Re: mapping address pointer to page structure

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

 



> struct page *page = virt_to_page(skb->data);
> int offset = (unsigned long) skb->data - (unsigned long) page_address(page);
> skb_add_rx_frag(master_skb, skb_shinfo(master_skb)->nr_frags, page, offset,
> skb->len)
> .
> .
> is this the right way to do ?
This will work if skb->len < PAGE_SIZE, otherwise it means it spans
more than a page and you need to do skb_add_rx_frag for each PAGE_SIZE
data present. Refer to Understanding Linux network internals By
Christian Benvenuti p 488/489.

-syed

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux