Re: [PATCH] netdev/ethernet: dev_alloc_skb to netdev_alloc_skb

From: Pradeep A. Dalvi
Date: Mon Jan 23 2012 - 05:37:36 EST


On Mon, Jan 23, 2012 at 3:15 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> Le dimanche 22 janvier 2012 à 02:27 +0530, Pradeep A. Dalvi a écrit :
>> Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
>>
>
> ...
>
>
>> diff --git a/drivers/net/ethernet/3com/3c515.c b/drivers/net/ethernet/3com/3c515.c
>> index f67a5d3..68fd765 100644
>> --- a/drivers/net/ethernet/3com/3c515.c
>> +++ b/drivers/net/ethernet/3com/3c515.c
>> @@ -826,7 +826,7 @@ static int corkscrew_open(struct net_device *dev)
>>                               vp->rx_ring[i].next = 0;
>>                       vp->rx_ring[i].status = 0;      /* Clear complete bit. */
>>                       vp->rx_ring[i].length = PKT_BUF_SZ | 0x80000000;
>> -                     skb = dev_alloc_skb(PKT_BUF_SZ);
>> +                     skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
>>                       vp->rx_skbuff[i] = skb;
>>                       if (skb == NULL)
>>                               break;  /* Bad news!  */
>
>
> One of the difference between netdev_alloc_skb() and dev_alloc_skb() is
> the former initializes skb->dev.
>
> So you should remove the extra "skb->dev = dev;" lines that sometimes
> are after the dev_alloc_skb() calls.
>
> [ They were redundant anyway because eth_type_trans() also sets skb->dev
> ]

Thanks! Shall take extra skb->dev = dev into consideration.

Eric, is this ok to assume that the memory address given to
dma_map_single & received from dma_unmap_single would remain same
across all platforms? Thanks in advance!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/