public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: linville@tuxdriver.com, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org
Subject: Re: [RFC v2] mac80211: assign needed_headroom/tailroom for netdevs
Date: Sun, 04 May 2008 17:30:51 -0700 (PDT)	[thread overview]
Message-ID: <20080504.173051.133197507.davem@davemloft.net> (raw)
In-Reply-To: <1209936745.7304.16.camel@johannes.berg>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Sun, 04 May 2008 23:32:25 +0200

> --- everything.orig/net/mac80211/iface.c	2008-05-04 23:24:17.000000000 +0200
> +++ everything/net/mac80211/iface.c	2008-05-04 23:31:46.000000000 +0200
> @@ -53,6 +53,15 @@ int ieee80211_if_add(struct net_device *
>  	if (!ndev)
>  		return -ENOMEM;
>  
> +	ndev->needed_headroom = local->tx_headroom +
> +				4*6 /* four MAC addresses */
> +				+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
> +				+ 6 /* mesh */
> +				+ 8 /* rfc1042/bridge tunnel */
> +				- ETH_HLEN /* ethernet hard_header_len */
> +				+ IEEE80211_ENCRYPT_HEADROOM;
> +	ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
> +
>  	ret = dev_alloc_name(ndev, ndev->name);
>  	if (ret < 0)
>  		goto fail;

Where is the patch that adds these new members to struct netdevice,
and where is the code that uses these new values?

I even searched the netdev archives and couldn't find it.

Anyways I see your basic idea and this may be the best way to handle
the problem.  The invariants would be:

1) LL_MAX_HEADER has to include all of these bits.

2) LL_RESERVED_SPACE*() has to take the new needed_headroom
   into account.

Your patch which I can't find, which adds netdev->needed_*, probably
does all of that.  But I'm just making sure :-)

Note that what would be really nice is if we could assert, in
dev_queue_xmit, that the SKB has all of the necessary headroom, and
give a WARN_ON_ONCE() backtrace if not.

If we can ensure that, things like mac80211 and others will not need
to skb_realloc_headroom() or anything like that unless they need to
modify packet contents after skb->data and the packet is shared
(ie. the pskb_expand_headroom(skb, 0, 0, GFP_*) case the TSO drivers
use).

  reply	other threads:[~2008-05-05  0:30 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 [this message]
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
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=20080504.173051.133197507.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /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