From: Johannes Berg <johannes@sipsolutions.net>
To: David Miller <davem@davemloft.net>
Cc: tomasw@gmail.com, linville@tuxdriver.com, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org
Subject: Re: [RFC v2] mac80211: assign needed_headroom/tailroom for netdevs
Date: Tue, 06 May 2008 01:17:14 +0200 [thread overview]
Message-ID: <1210029435.8012.25.camel@johannes.berg> (raw)
In-Reply-To: <20080505.160328.203996832.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 2315 bytes --]
> First, the skb_header_cloned() patch I posted in another reply will
> get rid of copying due to clones. I've included it below for
> completeness.
>
> The next problem is to make sure there is enough space available. And
> all that's needed is some help from the bridging layer and some hooks
> into netdev_alloc_skb().
>
> On bridge transmit, it knows the input and output devices, and the
> requirements of LL header space on the transmit side.
>
> If the transmit requirements are not met for the received packet, we
> can tag the difference into the input netdev.
>
> Using that information we can allocate extra space in
> netdev_alloc_skb(), and do an skb_reserve().
>
> The only requirement is that the ethernet driver serving input packets
> uses netdev_alloc_skb(). The most important drivers already do, and
> those which do not are trivially converted.
>
> The following along with Johannes's needed_header et al. patch should
> take care of the overhead.
>
> If this proves to be a working solution, we can do something similar
> for IPv4 and IPv6 forwarding. At that point, we should make this
> "adjust input device extra space" a helper function that all of
> these spots can call.
This looks feasible, thanks for looking into it. But isn't, when the
bridge gives us a cloned skb, the complete header the complete data
since it won't be a fraglist skb? And then we copy it all anyway? That's
just for group addressed frames, of course, so still a lot better I
guess. The main point is getting enough headroom.
Also, should there be some sort of timer that resets the rx_alloc_extra
again so that when you bridge it once with p54 (needs heaps of headroom)
you don't suffer forever?
> @@ -255,11 +255,12 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> unsigned int length, gfp_t gfp_mask)
> {
> int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
> + unsigned int extra = dev->rx_alloc_extra + NET_SKB_PAD;
> struct sk_buff *skb;
>
> - skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask, 0, node);
> + skb = __alloc_skb(length + extra, gfp_mask, 0, node);
> if (likely(skb)) {
> - skb_reserve(skb, NET_SKB_PAD);
> + skb_reserve(skb, extra);
Doesn't that break alignment though?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2008-05-05 23:17 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-04 21:24 [RFC] mac80211: assign needed_headroom/tailroom for netdevs Johannes Berg
2008-05-04 21:31 ` Johannes Berg
2008-05-04 21:32 ` [RFC v2] " Johannes Berg
2008-05-05 0:30 ` David Miller
2008-05-05 7:22 ` Johannes Berg
2008-05-05 14:27 ` Tomas Winkler
2008-05-05 15:22 ` Johannes Berg
2008-05-05 17:15 ` Tomas Winkler
2008-05-05 17:57 ` Johannes Berg
2008-05-05 18:58 ` David Miller
2008-05-05 19:05 ` Johannes Berg
2008-05-05 19:50 ` David Miller
2008-05-05 19:57 ` Johannes Berg
2008-05-05 20:02 ` David Miller
2008-05-05 20:10 ` Johannes Berg
2008-05-05 20:44 ` David Miller
2008-05-05 20:57 ` Johannes Berg
2008-05-05 21:01 ` David Miller
2008-05-05 22:37 ` David Miller
2008-05-05 22:44 ` Johannes Berg
2008-05-05 23:14 ` David Miller
2008-05-05 23:23 ` Johannes Berg
2008-05-05 23:39 ` David Miller
2008-05-06 0:01 ` Johannes Berg
2008-05-06 0:08 ` David Miller
2008-05-06 11:13 ` Johannes Berg
2008-05-06 1:32 ` Herbert Xu
2008-05-13 5:01 ` David Miller
2008-05-05 23:03 ` David Miller
2008-05-05 23:17 ` Johannes Berg [this message]
2008-05-05 23:24 ` David Miller
2008-05-05 23:30 ` Johannes Berg
2008-05-05 23:36 ` Johannes Berg
2008-05-05 23:40 ` David Miller
2008-05-13 3:52 ` David Miller
2008-05-13 9:01 ` Johannes Berg
2008-05-13 9:45 ` David Miller
2008-05-13 10:07 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1210029435.8012.25.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=tomasw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox