[PATCH net-next v1] net: gro_cells: add drop reasons to gro_cells_receive()
From: Xuanqiang Luo
Date: Wed Sep 16 2026 - 05:22:42 EST
From: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
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@xxxxxxxxxx>
Signed-off-by: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
---
This patch is based entirely on Eric Dumazet's suggestion in the
discussion below:
https://lore.kernel.org/all/CANn89i+d4ny7K0QV-v+ZY6Kj735tPVrrzd0AzwRqe4vvu5r=aw@xxxxxxxxxxxxxx/
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