<div><br></div><div class="gmail_quote">On Wed, Mar 30, 2011 at 10:42 PM, sk.syed2 <span dir="ltr"><<a href="mailto:sk.syed2@gmail.com">sk.syed2@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> struct page *page = virt_to_page(skb->data);<br>
> int offset = (unsigned long) skb->data - (unsigned long) page_address(page);<br>
> skb_add_rx_frag(master_skb, skb_shinfo(master_skb)->nr_frags, page, offset,<br>
> skb->len)<br>
> .<br>
> .<br>
> is this the right way to do ?<br>
</div>This will work if skb->len < PAGE_SIZE, otherwise it means it spans<br>
more than a page and you need to do skb_add_rx_frag for each PAGE_SIZE<br>
data present. Refer to Understanding Linux network internals By<br>
Christian Benvenuti p 488/489.<br></blockquote><div><br></div><div>Thanks Syed, skb->len is always smaller then PAGE_SIZE because i have set the mtu size as 1500 from my network driver.</div><div>But am facing kernel panic, if i just the moment the driver call dev_queue_xmit, so i guess this may not be right way to get</div>
<div>the page.</div><div><br></div><div>Anyways thanks for the support.</div></div><br>