net: gro_cells: add drop reasons to gro_cells_receive()
Subsystems (2)
PATCH 1/1 net: gro_cells: add drop reasons to gro_cells_receive()
From: Xuanqiang Luo <[email protected]>
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.
---
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/
net/core/gro_cells.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/core/gro_cells.c +4 -1
@@ -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
Signature · 1 line
2.43.0
Quoted 11 lines · Xuanqiang Luo
From: Xuanqiang Luo <[email protected]>
gro_cells_receive()reportsSKB_DROP_REASON_NOT_SPECIFIEDwhen the device is down or the GRO cell queue length exceedsmax_backlog.Pass
SKB_DROP_REASON_DEV_READYandSKB_DROP_REASON_CPU_BACKLOGtokfree_skb_reason()for these two cases, respectively.Suggested-by Eric Dumazet <[email protected]>Signed-off-by Xuanqiang Luo <[email protected]>
Thanks!
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 16 Sep 2026 17:14:20 +0800 you wrote:
From: Xuanqiang Luo <[email protected]>
gro_cells_receive()reportsSKB_DROP_REASON_NOT_SPECIFIEDwhen the device is down or the GRO cell queue length exceedsmax_backlog.Pass
SKB_DROP_REASON_DEV_READYandSKB_DROP_REASON_CPU_BACKLOGtokfree_skb_reason()for these two cases, respectively.[...]
Here is the summary with links:
- [net-next,v1] net: gro_cells: add drop reasons to gro_cells_receive()
https://git.kernel.org/netdev/net-next/c/a907a89ff105
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html