From a907a89ff105272aaab6b184c08f91d4a5b67b91 Mon Sep 17 00:00:00 2001 From: Xuanqiang Luo Date: Wed, 16 Sep 2026 17:14:20 +0800 Subject: [PATCH] net: gro_cells: add drop reasons to gro_cells_receive() 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 Signed-off-by: Xuanqiang Luo Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20260916091420.138170-1-xuanqiang.luo@linux.dev Signed-off-by: Jakub Kicinski --- 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 d8c0a2867120..1d64207bf960 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; }