All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Yeounsu Moon <yyyynoom@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: dlink: count dropped packets on skb allocation failure
Date: Thu, 11 Sep 2025 18:02:32 +0100	[thread overview]
Message-ID: <20250911170232.GP30363@horms.kernel.org> (raw)
In-Reply-To: <20250910054836.6599-2-yyyynoom@gmail.com>

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@gmail.com>
> ---
>  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@kernel.org>


  reply	other threads:[~2025-09-11 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10  5:48 [PATCH net-next] net: dlink: count dropped packets on skb allocation failure Yeounsu Moon
2025-09-11 17:02 ` Simon Horman [this message]
2025-09-12  9:27   ` Yeounsu Moon
2025-09-12  0:08 ` Jakub Kicinski
2025-09-12 10:03   ` Yeounsu Moon
2025-09-12 14:35     ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250911170232.GP30363@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yyyynoom@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.