Subject: Re: [PATCH 06/13] sis190: use netdev_alloc_skb

From: Stephen Hemminger <[email-masked]>
Date: Wed, 16 Apr 2008 19:59:01 -0700

On Thu, 17 Apr 2008 10:16:26 +0800
Wang Chen <[email-masked]> wrote:

> Stephen Hemminger said the following on 2008-4-17 7:37:
> > +static int sis190_try_rx_copy(struct net_device *dev,
> > +			      struct sk_buff **sk_buff, int pkt_size,
> > +			      struct RxDesc *desc, int rx_buf_sz)
> >  {
> > -	int ret = -1;
> > +	int ret = 01;
> >

Sorry, that was a typo.  meant to leave original -1

> why not : ret = 1
>   
> >  	if (pkt_size < rx_copybreak) {
> >  		struct sk_buff *skb;
> >  
> > -		skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
> > +		skb = netdev_alloc_skb(dev, pkt_size + 2);
> >  		if (skb) {
> > -			skb_reserve(skb, NET_IP_ALIGN);
> > +			skb_reserve(skb, 2);
> 
> why?
> [PATCH 02/13] atl1: use netdev_alloc_skb
> using NET_IP_ALIGN, not 2.

NET_IP_ALIGN is defined as 0 on some platforms where cost of unaligned
DMA is greater than the cost of unaligned access. But in this case, the
driver is copying into the buffer, so the cost of unaligned DMA is not involved
so just align the data.