Skip to content

Commit db8caf3

Browse files
edumazetdavem330
authored andcommitted
gro: should aggregate frames without DF
GRO on IPv4 doesn't aggregate frames if they don't have DF bit set. Some servers use IP_MTU_DISCOVER/IP_PMTUDISC_PROBE, so linux receivers are unable to aggregate this kind of traffic. The right thing to do is to allow aggregation as long as the DF bit has same value on all segments. bnx2x LRO does this correctly. Signed-off-by: Eric Dumazet <[email protected]> Cc: Jerry Chu <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Ben Hutchings <[email protected]> Reviewed-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c3f1dba commit db8caf3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/af_inet.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
13851385
goto out_unlock;
13861386

13871387
id = ntohl(*(__be32 *)&iph->id);
1388-
flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id ^ IP_DF));
1388+
flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id & ~IP_DF));
13891389
id >>= 16;
13901390

13911391
for (p = *head; p; p = p->next) {
@@ -1407,6 +1407,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
14071407
NAPI_GRO_CB(p)->flush |=
14081408
(iph->ttl ^ iph2->ttl) |
14091409
(iph->tos ^ iph2->tos) |
1410+
((iph->frag_off ^ iph2->frag_off) & htons(IP_DF)) |
14101411
((u16)(ntohs(iph2->id) + NAPI_GRO_CB(p)->count) ^ id);
14111412

14121413
NAPI_GRO_CB(p)->flush |= flush;

0 commit comments

Comments
 (0)