Skip to content

Commit

Permalink
udp: properly flush normal packet at GRO time
Browse files Browse the repository at this point in the history
If an UDP packet enters the GRO engine but is not eligible
for aggregation and is not targeting an UDP tunnel,
udp_gro_receive() will not set the flush bit, and packet
could delayed till the next napi flush.

Fix the issue ensuring non GROed packets traverse
skb_gro_flush_final().

Reported-and-tested-by: Matthias Treydte <[email protected]>
Fixes: 18f25dc ("udp: skip L4 aggregation for UDP tunnel packets")
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Paolo Abeni authored and davem330 committed Jul 2, 2021
1 parent b225802 commit b43c890
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/ipv4/udp_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,10 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb,

if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) ||
(sk && udp_sk(sk)->gro_enabled) || NAPI_GRO_CB(skb)->is_flist)
pp = call_gro_receive(udp_gro_receive_segment, head, skb);
return pp;
return call_gro_receive(udp_gro_receive_segment, head, skb);

/* no GRO, be sure flush the current packet */
goto out;
}

if (NAPI_GRO_CB(skb)->encap_mark ||
Expand Down

0 comments on commit b43c890

Please sign in to comment.