Thread (5 messages) 5 messages, 3 authors, 2021-01-17

Re: [PATCHv3 net-next 1/2] net: move the hsize check to the else block in skb_segment

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-01-17 03:14:01
Also in: linux-sctp

On Fri, 15 Jan 2021 17:39:02 -0800 Alexander Duyck wrote:
On Fri, Jan 15, 2021 at 1:36 AM Xin Long [off-list ref] wrote:
quoted
After commit 89319d3801d1 ("net: Add frag_list support to skb_segment"),
it goes to process frag_list when !hsize in skb_segment(). However, when
using skb frag_list, sg normally should not be set. In this case, hsize
will be set with len right before !hsize check, then it won't go to
frag_list processing code.

So the right thing to do is move the hsize check to the else block, so
that it won't affect the !hsize check for frag_list processing.

v1->v2:
  - change to do "hsize <= 0" check instead of "!hsize", and also move
    "hsize < 0" into else block, to save some cycles, as Alex suggested.

Signed-off-by: Xin Long <lucien.xin@gmail.com>  
Looks good to me.

Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Applied, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help