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  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 06:05:19 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	sonic zhang <sonic.adi@...il.com>
Cc:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	uclinux-dist-devel <uclinux-dist-devel@...ckfin.uclinux.org>
Subject: Re: [PATCH v2] netdev:bfin_mac: reclaim and free tx skb as soon as
 possible after transfer

Le jeudi 03 juin 2010 à 11:48 +0800, sonic zhang a écrit :

>  	bfin_tx_hwtstamp(dev, skb);
>  
>  	current_tx_ptr = current_tx_ptr->next;
>  	dev->stats.tx_packets++;
>  	dev->stats.tx_bytes += (skb->len);
> +
> +	tx_reclaim_skb(lp);
> +
>  	return NETDEV_TX_OK;
>  }
>  

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 >>

Doing these changes in a network driver dirties yet another cache line
in a hot path.

I suspect many drivers could be changed to avoid this double accounting.

A driver providing a ndo_get_stats() method can use the
dev_txq_stats_fold() helper.

driver not provinding a ndo_get_stats() method has nothing special to
do, dev_get_stats() automatically calls dev_txq_stats_fold() to update
dev->stats.{tx_packets|tx_bytes|tx_dropped} using txq stats.




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists