Re: [PATCH net-next] net: dlink: count dropped packets on skb allocation failure
From: Simon Horman
Date: Thu Sep 11 2025 - 13:02:35 EST
On Wed, Sep 10, 2025 at 02:48:37PM +0900, Yeounsu Moon wrote:
> Track dropped packet statistics when skb allocation fails
> in the receive path.
>
> Tested-on: D-Link DGE-550T Rev-A3
> Signed-off-by: Yeounsu Moon <yyyynoom@xxxxxxxxx>
> ---
> drivers/net/ethernet/dlink/dl2k.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c
> index 6bbf6e5584e5..47d9eef2e725 100644
> --- a/drivers/net/ethernet/dlink/dl2k.c
> +++ b/drivers/net/ethernet/dlink/dl2k.c
> @@ -1009,6 +1009,7 @@ receive_packet (struct net_device *dev)
> skb = netdev_alloc_skb_ip_align(dev, np->rx_buf_sz);
> if (skb == NULL) {
> np->rx_ring[entry].fraginfo = 0;
> + dev->stats.rx_dropped++;
Although new users of dev->stats are discoraged (see ndetdevice.h).
That is not the case here, as the driver already uses dev-stats.
So I believe this is change is good.
> printk (KERN_INFO
> "%s: receive_packet: "
> "Unable to re-allocate Rx skbuff.#%d\n",
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>