Are "skb->data" physically continuous?

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

 



Hi,

I'm not sure if this is the correct list to post this; sory if it
isn't.

 I'm writting a network driver for a DMA-enabled Fast Ethernet card,
for linux 2.4. If I'm not mistaken the kernel, whenever it wants to
transmit a packet, calls the driver's "hard_start_xmit()" function,
passing it a pointer to the "skb" holding the packet.

My question is: is there any guarantee that the packet's data at
"skb->data" are stored in physically-continuous memory locations? 

If it is so, then I can pass the "skb->data" pointer directly to the
card and let it do all the work (using of-course "pci_map_single()" or
similar means, in order to synchronize it, and get its physical
address). If not then I have to copy the packet to a
known-to-be-continuous area (e.g. a kmalloc-allocated one); this
caries a certain performance penalty.

Existing drivers I've studied (namely: "eepro100.c") seem to make this
assumption, but I have also heard that "zero-copy" networking was
added to the kernel at some point. Zero-copy indicates that data come
directly for user-space and, hence, they might be non-continuous.

Thanks in advance
/npat

-- 
What strange patches have you been smoking?
  -- Linus Torvalds
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux