Skip to content

Commit 7871f54

Browse files
edumazetdavem330
authored andcommitted
gro: take care of DODGY packets
Jaroslav reported a recent throughput regression with virtio_net caused by blamed commit. It is unclear if DODGY GSO packets coming from user space can be accepted by GRO engine in the future with minimal changes, and if there is any expected gain from it. In the meantime, make sure to detect and flush DODGY packets. Fixes: 5eddb24 ("gro: add support of (hw)gro packets to gro stack") Signed-off-by: Eric Dumazet <[email protected]> Reported-and-bisected-by: Jaroslav Pulchart <[email protected]> Cc: Coco Li <[email protected]> Cc: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9dab880 commit 7871f54

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/core/gro.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,9 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
505505
NAPI_GRO_CB(skb)->count = 1;
506506
if (unlikely(skb_is_gso(skb))) {
507507
NAPI_GRO_CB(skb)->count = skb_shinfo(skb)->gso_segs;
508-
/* Only support TCP at the moment. */
509-
if (!skb_is_gso_tcp(skb))
508+
/* Only support TCP and non DODGY users. */
509+
if (!skb_is_gso_tcp(skb) ||
510+
(skb_shinfo(skb)->gso_type & SKB_GSO_DODGY))
510511
NAPI_GRO_CB(skb)->flush = 1;
511512
}
512513

0 commit comments

Comments
 (0)