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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 Oct 2013 12:11:31 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Tino Reichardt <milky-kernel@...ilk.de>
Cc:	netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
	Joe Perches <joe@...ches.com>, Jiri Pirko <jiri@...nulli.us>,
	Bill Pemberton <wfp5p@...ginia.edu>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 01/07] 8139too: Support for byte queue limits

On Mon, 2013-10-14 at 20:26 +0200, Tino Reichardt wrote:
> Changes to 8139too to use byte queue limits.
> 
> This patch was not tested on real hardware currently, but compiles fine and
> should work.
> 
> 
> Signed-off-by: Tino Reichardt <milky-kernel@...ilk.de>
> 
> ---
>  drivers/net/ethernet/realtek/8139too.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
> index 3ccedeb..992ac57 100644
> --- a/drivers/net/ethernet/realtek/8139too.c
> +++ b/drivers/net/ethernet/realtek/8139too.c
> @@ -1409,6 +1409,7 @@ static void rtl8139_hw_start (struct net_device *dev)
>  	}
>  
>  	netdev_dbg(dev, "init buffer addresses\n");
> +	netdev_reset_queue(dev);
>  
>  	/* Lock Config[01234] and BMCR register writes */
>  	RTL_W8 (Cfg9346, Cfg9346_Lock);
> @@ -1638,6 +1639,7 @@ static inline void rtl8139_tx_clear (struct rtl8139_private *tp)
>  {
>  	tp->cur_tx = 0;
>  	tp->dirty_tx = 0;
> +	netdev_reset_queue(tp->dev);
>  
>  	/* XXX account for unsent Tx packets in tp->stats.tx_dropped */
>  }
> @@ -1733,6 +1735,7 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb,
>  		   tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
>  
>  	tp->cur_tx++;
> +	netdev_sent_queue(dev, len);
>  

This looks wrong if len < ETH_ZLEN

>  	if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
>  		netif_stop_queue (dev);
> @@ -1750,6 +1753,7 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
>  				  void __iomem *ioaddr)
>  {
>  	unsigned long dirty_tx, tx_left;
> +	unsigned bytes_compl = 0, pkts_compl = 0;
>  
>  	assert (dev != NULL);
>  	assert (ioaddr != NULL);
> @@ -1792,6 +1796,8 @@ static void rtl8139_tx_interrupt (struct net_device *dev,
>  			u64_stats_update_begin(&tp->tx_stats.syncp);
>  			tp->tx_stats.packets++;
>  			tp->tx_stats.bytes += txstatus & 0x7ff;
> +			pkts_compl++;
> +			bytes_compl += txstatus & 0x7ff;

Because here len reported by NIC will be >= ETH_ZLEN


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ