Skip to content

Commit d61d072

Browse files
Eric Dumazetdavem330
authored andcommitted
net-gro: avoid reorders
Receiving a GSO packet in dev_gro_receive() is not uncommon in stacked devices, or devices partially implementing LRO/GRO like bnx2x. GRO is implementing the aggregation the device was not able to do itself. Current code causes reorders, like in following case : For a given flow where sender sent 3 packets P1,P2,P3,P4 Receiver might receive P1 as a single packet, stored in GRO engine. Then P2-P4 are received as a single GSO packet, immediately given to upper stack, while P1 is held in GRO engine. This patch will make sure P1 is given to upper stack, then P2-P4 immediately after. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8e6e596 commit d61d072

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/core/dev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4482,7 +4482,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
44824482
if (!(skb->dev->features & NETIF_F_GRO))
44834483
goto normal;
44844484

4485-
if (skb_is_gso(skb) || skb_has_frag_list(skb) || skb->csum_bad)
4485+
if (skb->csum_bad)
44864486
goto normal;
44874487

44884488
gro_list_prepare(napi, skb);
@@ -4495,7 +4495,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
44954495
skb_set_network_header(skb, skb_gro_offset(skb));
44964496
skb_reset_mac_len(skb);
44974497
NAPI_GRO_CB(skb)->same_flow = 0;
4498-
NAPI_GRO_CB(skb)->flush = 0;
4498+
NAPI_GRO_CB(skb)->flush = skb_is_gso(skb) || skb_has_frag_list(skb);
44994499
NAPI_GRO_CB(skb)->free = 0;
45004500
NAPI_GRO_CB(skb)->encap_mark = 0;
45014501
NAPI_GRO_CB(skb)->recursion_counter = 0;

0 commit comments

Comments
 (0)