On Thu, Mar 03, 2016 at 05:19:42PM +0000, Xie, Huawei wrote: > On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > > [...] > CCed changchun, the author for the chained handling of desc and mbuf. > The change makes the code more readable, but i think the following > commit message is simple and enough.
Hmm.., my commit log tells a full story: - What is the issue? (messy/logic twisted code) - What the code does? (And what are the challenges: few tricky places) - What's the proposed solution to fix it. (the below pseudo code) And you suggest me to get rid of the first 2 items and leave 3rd item (a solution) only? --yliu > > > > while (this_desc_is_not_drained_totally || has_next_desc) { > > if (this_desc_has_drained_totally) { > > this_desc = next_desc(); > > } > > > > if (mbuf_has_no_room) { > > mbuf = allocate_a_new_mbuf(); > > } > > > > COPY(mbuf, desc); > > } > > > > [...] > > > > This refactor makes the code much more readable (IMO), yet it reduces > > binary code size (nearly 2K). > I guess the reduced binary code size comes from reduced inline calls to > mbuf allocation. >