From: David Miller <davem@davemloft.net>
To: mst@redhat.com
Cc: vyasevic@redhat.com, netdev@vger.kernel.org
Subject: Re: [RFC net-next PATCH] macvtap: Add packet capture support
Date: Wed, 20 Nov 2013 14:52:33 -0500 (EST) [thread overview]
Message-ID: <20131120.145233.1158930529349207237.davem@davemloft.net> (raw)
In-Reply-To: <20131120181949.GB25569@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Wed, 20 Nov 2013 20:19:49 +0200
> On Wed, Nov 20, 2013 at 01:04:09PM -0500, Vlad Yasevich wrote:
>> Currently it is impossible to capture traffic when using a macvtap
>> device. The reason is that all capture handling is done either in
>> dev_hard_start_xmit() or in __netif_receive_skb_core(). Macvtap
>> currenlty doesn't use dev_hard_start_xmit(), and at the time the
>> packet traverses __netif_receive_skb_core, the skb->dev is set to
>> the lower-level device that doesn't end up matching macvtap.
>>
>> To solve the issue, use dev_hard_start_xmit() on the output path.
>> On the input path, it is toughter to solve since macvtap ends up
>> consuming the skb so there is nothing more left for
>> __netif_receive_skb_core() to do. A simple solution is to
>> pull the code that delivers things to the taps/captures into
>> its own function and allow macvtap to call it from its receive
>> routine.
>>
>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>> ---
>> This is only an RFC. I'd like to solicit comments on this simple
>> approach.
>
> I'm kind of worried about this. What worries me is that normally
> if you have a packet socket bound to all interfaces, what it shows is
> traffic to/from the box.
>
> This might be a bug for someone, but I suspect at this point this
> is part of the ABI.
Tunnel decapsulations on input are shown for other types of devices,
such as IP tunnels. It is because they feed packets back into the
stack via netif_receive_skb() upon decapsulation.
Then we have all of this sideways code for VLANs and "rx_handler"s
in order to perform decapsulation via direct iteration instead of
recursion inside of __netif_receive_skb_core().
I suspect that Vlad's suggested rx_handler alternative approach is
going to be much better.
next prev parent reply other threads:[~2013-11-20 19:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 18:04 [RFC net-next PATCH] macvtap: Add packet capture support Vlad Yasevich
2013-11-20 18:19 ` Michael S. Tsirkin
2013-11-20 19:36 ` Vlad Yasevich
2013-11-20 20:06 ` Michael S. Tsirkin
2013-11-20 20:19 ` Vlad Yasevich
2013-11-20 20:30 ` Michael S. Tsirkin
2013-11-20 20:35 ` Vlad Yasevich
2013-11-20 21:12 ` Michael S. Tsirkin
2013-11-20 22:01 ` Vlad Yasevich
2013-11-20 19:52 ` David Miller [this message]
2013-11-20 20:10 ` Vlad Yasevich
2013-11-20 20:20 ` David Miller
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=20131120.145233.1158930529349207237.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevic@redhat.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;
as well as URLs for NNTP newsgroup(s).