Thread (3 messages) flat view 3 messages, 3 authors, 7d ago
COOLING7d

[PATCH net-next v1] net: gro_cells: add drop reasons to gro_cells_receive()

From: Xuanqiang Luo <hidden>
Date: 2026-09-16 09:14:56
Also in: lkml
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Xuanqiang Luo <redacted>

gro_cells_receive() reports SKB_DROP_REASON_NOT_SPECIFIED when the device
is down or the GRO cell queue length exceeds max_backlog.

Pass SKB_DROP_REASON_DEV_READY and SKB_DROP_REASON_CPU_BACKLOG to
kfree_skb_reason() for these two cases, respectively.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Xuanqiang Luo <redacted>
---
This patch is based entirely on Eric Dumazet's suggestion in the
discussion below:
https://lore.kernel.org/all/CANn89i+d4ny7K0QV-v+ZY6Kj735tPVrrzd0AzwRqe4vvu5r=aw@mail.gmail.com/ (local)

 net/core/gro_cells.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/core/gro_cells.c b/net/core/gro_cells.c
index d8c0a28671201..1d64207bf960f 100644
--- a/net/core/gro_cells.c
+++ b/net/core/gro_cells.c
@@ -14,11 +14,13 @@ struct gro_cell {
 int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
 {
 	struct net_device *dev = skb->dev;
+	enum skb_drop_reason reason;
 	bool have_bh_lock = false;
 	struct gro_cell *cell;
 	int res;
 
 	rcu_read_lock();
+	reason = SKB_DROP_REASON_DEV_READY;
 	if (unlikely(!(dev->flags & IFF_UP)))
 		goto drop;
 
@@ -34,9 +36,10 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
 	cell = this_cpu_ptr(gcells->cells);
 
 	if (skb_queue_len(&cell->napi_skbs) > READ_ONCE(net_hotdata.max_backlog)) {
+		reason = SKB_DROP_REASON_CPU_BACKLOG;
 drop:
 		dev_core_stats_rx_dropped_inc(dev);
-		kfree_skb(skb);
+		kfree_skb_reason(skb, reason);
 		res = NET_RX_DROP;
 		goto unlock;
 	}
base-commit: 87b80c2f6b05cad9f0ff9136709c62a0f59923e3
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help