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 <ying....@windriver.com> 
Sent: Friday, October 11, 2019 9:52 PM
To: Tuong Lien <tuong.t.l...@dektech.com.au>;
tipc-discussion@lists.sourceforge.net; jon.ma...@ericsson.com;
ma...@donjonn.com
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;






_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to