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: <063D6719AE5E284EB5DD2968C1650D6D1CA09D86@AcuExch.aculab.com>
Date:	Wed, 10 Dec 2014 09:50:38 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Alexander Duyck' <alexander.h.duyck@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	Florian Fainelli <f.fainelli@...il.com>,
	"eric.dumazet@...il.com" <eric.dumazet@...il.com>,
	Ariel Elior <ariel.elior@...gic.com>,
	"brouer@...hat.com" <brouer@...hat.com>,
	Gary Zambrano <zambrano@...adcom.com>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"ast@...mgrid.com" <ast@...mgrid.com>
Subject: RE: [net-next PATCH 6/6] ethernet/broadcom: Use napi_alloc_skb
 instead of netdev_alloc_skb_ip_align

From: Alexander Duyck
> This patch replaces the calls to netdev_alloc_skb_ip_align in the
> copybreak paths.

Why?

You still want the IP header to be aligned and you also want the
memcpy() to be copying aligned data.

I suspect this fails on both counts?

	David

> Cc: Gary Zambrano <zambrano@...adcom.com>
> Cc: Florian Fainelli <f.fainelli@...il.com>
> Cc: Ariel Elior <ariel.elior@...gic.com>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@...hat.com>
> ---
>  drivers/net/ethernet/broadcom/b44.c             |    2 +-
>  drivers/net/ethernet/broadcom/bcm63xx_enet.c    |    2 +-
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
> index ffeaf47..d86d6ba 100644
> --- a/drivers/net/ethernet/broadcom/b44.c
> +++ b/drivers/net/ethernet/broadcom/b44.c
> @@ -836,7 +836,7 @@ static int b44_rx(struct b44 *bp, int budget)
>  			struct sk_buff *copy_skb;
> 
>  			b44_recycle_rx(bp, cons, bp->rx_prod);
> -			copy_skb = netdev_alloc_skb_ip_align(bp->dev, len);
> +			copy_skb = napi_alloc_skb(&bp->napi, len);
>  			if (copy_skb == NULL)
>  				goto drop_it_no_recycle;
> 
> diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> index 3e8d1a8..21206d3 100644
> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> @@ -385,7 +385,7 @@ static int bcm_enet_receive_queue(struct net_device *dev, int budget)
>  		if (len < copybreak) {
>  			struct sk_buff *nskb;
> 
> -			nskb = netdev_alloc_skb_ip_align(dev, len);
> +			nskb = napi_alloc_skb(&priv->napi, len);
>  			if (!nskb) {
>  				/* forget packet, just rearm desc */
>  				dev->stats.rx_dropped++;
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> index b4d71fd..1d1147c 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> @@ -1015,7 +1015,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
>  		 */
>  		if ((bp->dev->mtu > ETH_MAX_PACKET_SIZE) &&
>  		    (len <= RX_COPY_THRESH)) {
> -			skb = netdev_alloc_skb_ip_align(bp->dev, len);
> +			skb = napi_alloc_skb(&fp->napi, len);
>  			if (skb == NULL) {
>  				DP(NETIF_MSG_RX_ERR | NETIF_MSG_RX_STATUS,
>  				   "ERROR  packet dropped because of alloc failure\n");
> 
> --
> 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