From: Tuong L. T. <tuo...@de...> - 2019-10-15 04:49:55
|
Hi Ying, Agree, it's hard to trace... I've changed the way we approach, will post it as a new patch, please take a look from there! Thanks a lot! BR/Tuong -----Original Message----- From: Xue, Ying <Yin...@wi...> Sent: Friday, October 11, 2019 9:52 PM To: Tuong Lien <tuo...@de...>; tip...@li...; jon...@er...; ma...@do... Subject: RE: [PATCH RFC 2/2] tipc: improve message bundling algorithm I can recognize this is a good improvement except that the following switch cases of return values of tipc_msg_try_bundle() are not very friendly for code reader. Although I do understand their real meanings, I have to spend time checking its context back and forth. At least we should the meaningless hard code case numbers or we try to change return value numbers of tipc_msg_try_bundle(). + n = tipc_msg_try_bundle(&l->backlog[imp].target_bskb, skb, + mtu - INT_H_SIZE, + l->addr); + switch (n) { + case 0: + break; + case 1: + __skb_queue_tail(backlogq, skb); l->backlog[imp].len++; - l->stats.sent_bundled++; + continue; + case 2: l->stats.sent_bundles++; + l->stats.sent_bundled++; + default: + kfree_skb(skb); + l->stats.sent_bundled++; continue; |