[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: About structure sk_buff





On 06.06.2016 12:59, Corcodel Marian wrote:
Hi
Why sk_buff have memory allocated on hardware drivers on majority nic drivers?
 This is wrong on rx mode look like:

    struct sk_buff *skb;
    struct device *d = &tp->pci_dev->dev;

    data = rtl8169_align(data);
    dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
    prefetch(data);
    skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
    if (skb)
        memcpy(skb->data, data, pkt_size);
    dma_sync_single_for_device(d, addr, pkt_size, DMA_FROM_DEVICE);

sk_buff is allocated on place tx mode
and on start_xmit no need to keep sk_buff on hardware structure because any info is extracted from
 next level of driver.


--
Visit my project https://sourceforge.net/projects/network-card-driver/?source=navbar


Reply to: