linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Green <andy@warmcat.com>
To: Michael Wu <flamingice@sourmilk.net>
Cc: linux-wireless@vger.kernel.org, Jiri Benc <jbenc@suse.cz>
Subject: Re: [PATCH 2/2] mac80211: Monitor mode radiotap-based packet injection
Date: Sun, 18 Mar 2007 09:00:21 +0000	[thread overview]
Message-ID: <45FCFFA5.5070801@warmcat.com> (raw)
In-Reply-To: <45FC7924.8050501@warmcat.com>

Andy Green wrote:
> Michael Wu wrote:
>> On Saturday 17 March 2007 18:09, Andy Green wrote:
>>> Yeah naturally it was my first move to use what was there, but the
>>> result was a panic that went away when I moved the skb to belong to the
>>> "master" interface's index and separately persistently tagged the packet
>>> as being injected.
>>>
>> I don't see anything that would prevent this from working.. if you 
>> have a patch which does this and crashes, I'll take a look at it.
> 
> Okay I will try to regenerate this situation tomorrow afternoon, which 
> will be my next chance.

Well the panic did not return, I guess whatever I was doing that 
provoked it I am not doing any more.  So I changed it back to the 
sdata->dev->ifindex that the normal code path uses and confirmed that 
continued to worked okay.

However when I went on to look at leveraging that to find out if the 
originating interface was in Monitor mode, it seems that it might be a 
little bit more expensive to do that -- and it would have to be done for 
every tx packet in order to find out if it was injected.  By contrast 
with the currently proposed staged system at each level the information 
is always available without processing, and the overhead for the common 
case where the packet was not injected is just testing if the if type 
was monitor, and then later testing a bit in flags that are already 
available.

 From looking around the existing code, it seems something like this is 
called for to use the ifindex instead:

__ieee80211_tx_prepare(...)
{
	struct ieee80211_tx_packet_data *pkt_data;

	/* skb->cb is still valid by this time? */

	pkt_data = (struct ieee80211_tx_packet_data *)skb->cb;

	/* dev_get_by_index holds a read lock and iterates
	 * a hlist, done for every tx packet */

	originating_dev = dev_get_by_index(pkt_data->ifindex);
	if(!originating_dev) goto skipped;
	if (unlikely(!is_ieee80211_device(originating_dev, dev))) {
		goto give_up_dev;
	}

	originating__sdata = IEEE80211_DEV_TO_SUB_IF(dev);
	if(!originating__sdata) goto give_up_dev;

	if (unlikely(originating__sdata->type==IEEE80211_IF_TYPE_MNTR)){
...
	}
	give_up_dev:
	dev_put(originating_dev);
	skipped:
...
}

Given this, if it is actually the leanest implementation of using 
ifindex, is it still preferred?

-Andy

  reply	other threads:[~2007-03-18  9:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-17 10:58 [PATCH 0/2] Radiotap on Monitor Mode interfaces for rx and tx andy
2007-03-17 10:58 ` [PATCH 1/2] mac80211: Add radiotap support andy
2007-03-17 10:58 ` [PATCH 2/2] mac80211: Monitor mode radiotap-based packet injection andy
2007-03-17 13:59   ` Michael Buesch
2007-03-17 14:58     ` Andy Green
2007-03-17 15:06       ` Michael Buesch
2007-03-17 15:35         ` Andy Green
2007-03-17 21:30   ` Michael Wu
2007-03-17 21:51     ` Michael Wu
2007-03-17 22:09       ` Andy Green
2007-03-17 23:20         ` Michael Wu
2007-03-17 23:26           ` Andy Green
2007-03-18  9:00             ` Andy Green [this message]
2007-03-18 10:12               ` Andy Green
2007-03-17 22:05     ` Andy Green
  -- strict thread matches above, loose matches on Subject: below --
2007-03-18 10:15 [PATCH 0/2] Try #3 Radiotap on Monitor Mode interfaces for rx and tx andy
2007-03-18 10:15 ` [PATCH 2/2] mac80211: Monitor mode radiotap-based packet injection andy
2007-03-19  5:55   ` Michael Wu
2007-03-19 10:54     ` Andy Green
2007-03-19 16:50       ` Michael Wu
2007-03-21  4:12         ` Joerg Mayer

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=45FCFFA5.5070801@warmcat.com \
    --to=andy@warmcat.com \
    --cc=flamingice@sourmilk.net \
    --cc=jbenc@suse.cz \
    --cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).