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: <20110709222833.GA5710@electric-eye.fr.zoreil.com>
Date:	Sun, 10 Jul 2011 00:28:33 +0200
From:	Francois Romieu <romieu@...zoreil.com>
To:	Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc:	netdev@...r.kernel.org, Don Fry <pcnet32@...ntier.com>
Subject: Re: [PATCH 09/21] net: pcnet32: use common rx_copybreak handling [strict refill!]

Michał Mirosław <mirq-linux@...e.qmqm.pl> :
[...]
> diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
> index 8b3090d..baae404 100644
> --- a/drivers/net/pcnet32.c
> +++ b/drivers/net/pcnet32.c
> @@ -1147,51 +1146,18 @@ static void pcnet32_rx_entry(struct net_device *dev,
>  		return;
>  	}
>  
> -	if (pkt_len > rx_copybreak) {
> -		struct sk_buff *newskb;
> -
> -		newskb = dev_alloc_skb(PKT_BUF_SKB);
> -		if (newskb) {
> -			skb_reserve(newskb, NET_IP_ALIGN);
> -			skb = lp->rx_skbuff[entry];
> -			pci_unmap_single(lp->pci_dev,
> -					 lp->rx_dma_addr[entry],
> -					 PKT_BUF_SIZE,
> -					 PCI_DMA_FROMDEVICE);
> -			skb_put(skb, pkt_len);
> -			lp->rx_skbuff[entry] = newskb;
> -			lp->rx_dma_addr[entry] =
> -					    pci_map_single(lp->pci_dev,
> -							   newskb->data,
> -							   PKT_BUF_SIZE,
> -							   PCI_DMA_FROMDEVICE);
> -			rxp->base = cpu_to_le32(lp->rx_dma_addr[entry]);
> -			rx_in_place = 1;
> -		} else
> -			skb = NULL;
> -	} else
> -		skb = dev_alloc_skb(pkt_len + NET_IP_ALIGN);
> +	skb = dev_skb_finish_rx_dma_refill(&lp->rx_skbuff[entry],
> +		pkt_len, rx_copybreak, NET_IP_ALIGN, 0,
> +		&lp->pci_dev->dev, &lp->rx_dma_addr[entry],
> +		PKT_BUF_SIZE);
> +	rxp->base = cpu_to_le32(lp->rx_dma_addr[entry]);
>  
>  	if (skb == NULL) {

s/skb/lp->rx_skbuff[entry]/

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