netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* TX pre-headers...
@ 2009-02-06  9:41 David Miller
  2009-02-06 10:46 ` Steve.Glendinning
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: David Miller @ 2009-02-06  9:41 UTC (permalink / raw)
  To: netdev


Some NIC hardware wants a pre-header pushed in front of the packet
data on transmit.

When routing or bridging this will cause a reallocation of skb->data
on every packet forwarded because there will only be NET_IP_ALIGN
space reserved at the head by the device receive path.

NIU is one such NIC and I only noticed this because of some things I
saw in some of Robert Olsson's routing stress test oprofile dumps.

Putting a hack into NIU is the wrong way to do this and would only fix
cases where NIU is the receiver and transmitting device. e1000 to
NIU would still be broken, for example.

I think the way to solve this is to have each device indicate how
much TX slack space it neads for it's preheaders.  On device
registration we have some global "netdev_max_tx_hdr_space" that
records the maximum value seen.

We could decrease it on unregister (by walking the device list)
but I don't think that is worth it.

We also round netdev_max_tx_hdr_space up to be a multiple of 4
or something reasonable like that.

Then we get drivers to use a new interface:

	struct sk_buff *netdev_alloc_rx_skb(struct net_device *dev, int size);

which is nearly identical to netdev_alloc_skb() except that it does:

	size += NET_IP_ALIGN + netdev_max_tx_hdr_space;
	skb = netdev_alloc_skb(dev, size);
	if (skb)
		skb_reserve(skb, NET_IP_ALIGN + netdev_max_tx_hdr_space);
	return skb;

Seems reasonable?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-02-10  8:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06  9:41 TX pre-headers David Miller
2009-02-06 10:46 ` Steve.Glendinning
2009-02-06 11:11   ` David Miller
2009-02-06 18:53   ` Inaky Perez-Gonzalez
2009-02-06 12:02 ` Frank Blaschka
2009-02-07  8:10   ` David Miller
2009-02-09  3:34     ` David Miller
2009-02-09 10:07 ` Herbert Xu
2009-02-09 10:14   ` David Miller
2009-02-09 10:19     ` Herbert Xu
2009-02-09 15:39       ` Krzysztof Halasa
2009-02-10  8:15         ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).