From: Jakub Kicinski Date: Thu, 2 Feb 2023 22:49:55 +0000 (-0800) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=82b4a9412b4de2f68679f1403f1d229390ace27e;p=linux.git Merge git://git./linux/kernel/git/netdev/net net/core/gro.c 7d2c89b32587 ("skb: Do mix page pool and page referenced frags in GRO") b1a78b9b9886 ("net: add support for ipv4 big tcp") https://lore.kernel.org/all/20230203094454.5766f160@canb.auug.org.au/ Signed-off-by: Jakub Kicinski --- 82b4a9412b4de2f68679f1403f1d229390ace27e diff --cc net/core/gro.c index b15f85546bdda,4bac7ea6e0256..a606705a08595 --- a/net/core/gro.c +++ b/net/core/gro.c @@@ -162,10 -162,17 +162,19 @@@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *lp; int segs; + /* Do not splice page pool based packets w/ non-page pool + * packets. This can result in reference count issues as page + * pool pages will not decrement the reference count and will + * instead be immediately returned to the pool or have frag + * count decremented. + */ + if (p->pp_recycle != skb->pp_recycle) + return -ETOOMANYREFS; + - /* pairs with WRITE_ONCE() in netif_set_gro_max_size() */ - gro_max_size = READ_ONCE(p->dev->gro_max_size); + /* pairs with WRITE_ONCE() in netif_set_gro(_ipv4)_max_size() */ + gro_max_size = p->protocol == htons(ETH_P_IPV6) ? + READ_ONCE(p->dev->gro_max_size) : - READ_ONCE(p->dev->gro_ipv4_max_size); ++ READ_ONCE(p->dev->gro_ipv4_max_size); if (unlikely(p->len + len >= gro_max_size || NAPI_GRO_CB(skb)->flush)) return -E2BIG;