lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0d17b8bf-f8dc-4738-87bc-357d92768381@lunn.ch>
Date: Tue, 13 Jan 2026 23:01:18 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Yeounsu Moon <yyyynoom@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: dlink: count tx_dropped when dropping skb
 on link down

On Tue, Jan 13, 2026 at 08:30:45PM +0900, Yeounsu Moon wrote:
> On Tue Jan 6, 2026 at 10:44 PM KST, Andrew Lunn wrote:
> > On Tue, Jan 06, 2026 at 09:23:51PM +0900, Yeounsu Moon wrote:
> >> Increment tx_dropped when dropping the skb due to link down.
> >> 
> >> Tested-on: D-Link DGE-550T Rev-A3
> >> Signed-off-by: Yeounsu Moon <yyyynoom@...il.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 846d58c769ea..edc6cd64ac56 100644
> >> --- a/drivers/net/ethernet/dlink/dl2k.c
> >> +++ b/drivers/net/ethernet/dlink/dl2k.c
> >> @@ -733,6 +733,7 @@ start_xmit (struct sk_buff *skb, struct net_device *dev)
> >>  	u64 tfc_vlan_tag = 0;
> >>  
> >>  	if (np->link_status == 0) {	/* Link Down */
> >> +		dev->stats.tx_dropped++;
> >
> > Do you see this being hit very often? It should be that as soon as you
> > know the link is down, you tell the core, and it will stop calling
> > start_xmit. If you see this counter being incremented a lot, it
> > indicates there is a problem somewhere else.
> >
> > You might want to consider converting this driver to phylink.
> >
> > 	  Andrew
> 
> Sorry for the late reply. I recently started my first job and have been
> a bit busy settling in.
> 
> To answer your question: this path is hit extremely rarely. In practice,
> I only observed it in rather extreme cases, such as forcibly
> disconnecting the physical link (e.g. unplugging the Ethernet cable). I
> have not seen it occurring during normal operation.

In that case, i think this is fine. There is a race condition here
between indicating the carrier is down and the network stopping
passing packets, so this can happen, and incrementing the counter is
fine.

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ