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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 03 Jun 2010 11:19:09 +0200
From:	Eric Dumazet <>
To:	Junchang Wang <>
Cc:	sonic zhang <>,
	David Miller <>,
	netdev <>,
	uclinux-dist-devel <>
Subject: Re: [PATCH v2] netdev:bfin_mac: reclaim and free tx skb as soon as
  possible after transfer

Le jeudi 03 juin 2010 à 16:57 +0800, Junchang Wang a écrit :
> Hi Eric,
> On Thu, Jun 3, 2010 at 12:05 PM, Eric Dumazet <> wrote:
> > Not related to your patch, but reviewing it I see this driver still do
> > the "dev->stats.tx_packets++; dev->stats.tx_bytes += (skb->len);"
> >
> > This is not necessary and expensive, since we update txq stats in core
> > network stack.
> >
> >        rc = ops->ndo_start_xmit(skb, dev);
> >        if (rc == NETDEV_TX_OK)
> >                txq_trans_update(txq);  << here >>
> >
> Good suggestion for drivers. But I wonder whether there are stats for
> received packets in core network stack.

No its not there.

> I.e., can I replace "dev->stats.rx_packets++" and "dev->stats.rx_bytes
> += (skb->len);" with something already maintained by core stack? I
> failed to find them.

As I said, core network takes care of three counters only, because it
was 'free', as they share a cache line with a spinlock we must hold when
calling xmit function.

In receive path, we dont dirty a cache line in core network, so updating
counters would add a cost. (modern NICs handle stats in firmware)

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists