Networking Forums

Networking Forums > Computer Networking > Linux Networking > When does skb fragmentation happen ?

Reply
Thread Tools Display Modes

When does skb fragmentation happen ?

 
 
frank_6014@yahoo.com
Guest
Posts: n/a

 
      06-14-2006, 03:28 PM

I'm writing a small kernel module that is similar to a Ethernet device
driver
and it receives skbs from the kernel. I'd like to generate some skbs
with
fragments (i.e. skb_shinfo(skb)->nr_frag > 0) to test my module, but I
don't
know how.

If you can help, I'd highly appreciate it. Basically, I'd like to know
under what
circumstances my driver can get fragmented skbs in its
hard_start_xmit()
function.

(I tried to send it large packet > than the Ethernet frame size, but
that didn't
seem to work.)

Please post or email, I'll summarize any responses received:

frank_6014 @ yahoo dot com.

Thanks!
-Frank H.

 
Reply With Quote
 
 
 
 
Spoon
Guest
Posts: n/a

 
      06-14-2006, 07:08 PM
frank wrote:

> I'm writing a small kernel module that is similar to a Ethernet
> device driver and it receives skbs from the kernel. I'd like to
> generate some skbs with fragments (i.e. skb_shinfo(skb)->nr_frag > 0)
> to test my module, but I don't know how.
>
> If you can help, I'd highly appreciate it. Basically, I'd like to
> know under what circumstances my driver can get fragmented skbs in
> its hard_start_xmit() function.


Linux Device Drivers, Third Edition
http://lwn.net/Kernel/LDD3/

Chapter 17 might provide some insight.

<quote>
NETIF_F_SG
NETIF_F_FRAGLIST

Both of these flags control the use of scatter/gather I/O. If your
interface can transmit a packet that has been split into several
distinct memory segments, you should set NETIF_F_SG. Of course, you have
to actually implement the scatter/gather I/O (we describe how that is
done in the section "Scatter/Gather I/O"). NETIF_F_FRAGLIST states that
your interface can cope with packets that have been fragmented; only the
loopback driver does this in 2.6.

[...]

The kernel does not pass scattered packets to your hard_start_xmit
method unless the NETIF_F_SG bit has been set in the features field of
your device structure. If you have set that flag, you need to look at a
special "shared info" field within the skb to see whether the packet is
made up of a single fragment or many and to find the scattered fragments
if need be.
</quote>

Regards.
 
Reply With Quote
 
frank_6014@yahoo.com
Guest
Posts: n/a

 
      06-20-2006, 02:45 PM

Spoon,

Thanks for your reply. My question probably wasn't clear in the
original post.

Basically, I've gotten past the setting of those flags and would like
to receive
some fragmented skbs from the kernel to test my code. (I wrote a
network
device driver and during tests, which composed mainly of running
several
network programs using my driver (e.g. Apache web server, telnet
server,
ssh servers, etc.), but I don't see fragmeted skbs going thru my
driver.)

How can I get some of those skbs coming fro mthe kernel?
(I'm using Linux kernel 2.6.13)

Thanks,
Ching

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What happen error VPN rasman.log Uyyy Windows Networking 0 11-25-2009 05:46 PM
what would happen if??? James Windows Networking 7 02-23-2009 06:27 PM
Why did this happen? (Belkin Router Q) Roger Network Routers 1 10-16-2006 09:27 PM
Linux and ML-520, can it happen? gprinaz Broadband Hardware 1 01-29-2004 12:16 AM
How did this happen? SteveE Windows Networking 0 08-05-2003 03:37 PM



1 2 3 4 5 6 7 8 9 10 11