Re: About structure sk_buff

Grant Grundler <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <CAP6odjjZSw0_fkFFeCgf1RzP6-K0g_W-ZCVRx5LW4pTQG3jZ8Q__3846.64641828767$1465254774$gmane$org@mail.gmail.com>
On Mon, Jun 6, 2016 at 3:10 AM, Corcodel Marian <[email protected]>
wrote:

>
>
> On 06.06.2016 12:59, Corcodel Marian wrote:
>
>> Hi
>> Why sk_buff  have memory allocated on hardware drivers on majority nic
>> drivers?
>>
>
This seems like an appropriate question for netdev mailing list:
     http://vger.kernel.org/vger-lists.html#netdev

(Tip: explain in more detail what you think is wrong with "rx mode" and
someone should be polite enough to point out why it works. Offhand, I don't
quite understand what you are trying to point out.)

cheers,
grant

 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
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.