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]
Message-ID: <1416957251.29427.39.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Tue, 25 Nov 2014 15:14:11 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Alexander Duyck <alexander.h.duyck@...hat.com>
Cc:	netdev@...r.kernel.org, Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
	davem@...emloft.net
Subject: Re: [net-next PATCH 2/5] ethernet/intel: Use eth_skb_pad helper

On Tue, 2014-11-25 at 14:44 -0800, Alexander Duyck wrote:
> Update the Intel Ethernet drivers to use eth_skb_pad() instead of doing
> their own implementations of the function.
> 
> Also this cleans up two other spots where skb_pad was called but the length
> and tail pointers were being manipulated directly instead of just having
> the padding length added via __skb_put.
> 
> Cc: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@...hat.com>
> ---
>  drivers/net/ethernet/intel/e1000/e1000_main.c     |    8 ++------
>  drivers/net/ethernet/intel/fm10k/fm10k_main.c     |   11 +++--------
>  drivers/net/ethernet/intel/igb/igb_main.c         |   11 +++--------
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     |   11 +++--------
>  drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   11 +++--------
>  5 files changed, 14 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index 24f3986..862d198 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -3136,12 +3136,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
>  	 * packets may get corrupted during padding by HW.
>  	 * To WA this issue, pad all small packets manually.
>  	 */
> -	if (skb->len < ETH_ZLEN) {
> -		if (skb_pad(skb, ETH_ZLEN - skb->len))
> -			return NETDEV_TX_OK;
> -		skb->len = ETH_ZLEN;
> -		skb_set_tail_pointer(skb, ETH_ZLEN);
> -	}
> +	if (eth_skb_pad(skb))
> +		return NETDEV_TX_OK;
>  

Its a bit sad almost no driver increments some drop counter.

This probably could be generically done in eth_skb_pad()

atomic_long_inc(&skb->dev->tx_dropped)



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