All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.duyck@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] vlan packet handling in ixgbevf driver when in promiscuous mode
Date: Mon, 01 Jun 2015 20:18:53 -0700	[thread overview]
Message-ID: <556D209D.9030001@gmail.com> (raw)
In-Reply-To: <7F861DC0615E0C47A872E6F3C5FCDDBD05EBFFBA@BPXM14GP.gisp.nec.co.jp>

On 06/01/2015 05:47 PM, Hiroshi Shimamoto wrote:
>> Subject: Re: [Intel-wired-lan] vlan packet handling in ixgbevf driver when in promiscuous mode
>>
>> Could you elaborate?
>>
>> The use-case here is for NFV/SDN type stuff, where we want to be able to run a
>> router or something similar in the guest--so it needs to be able to receive
>> packets from all VLANs.
>>
>>   From what I see if you enable promiscuous mode on the PF then the VFs get
>> packets from all VLANs.
> I'd like to have and am working to add a functionality to disable VLAN filter on PF
> to pass all VLANs to VFs in stock kernel ixgbe driver.
> How did you do that?
>
>> With the stock ixgbevf driver in the guest this doesn't work well because any
>> packets from VLANs that the guest hasn't registered for do not get the vlan tags
>> added back in to the packets (which makes it useless for routing).  With a minor
>> change to the ixgbevf driver to put the vlan tags back in for all packets it
>> seems to work okay.  Maybe this change would be a reasonable thing to do in the
>> stock ixgbevf driver when enabling promiscuous mode in the guest?
> I just have confirmed that behavior during my work, and thought something to do to
> fix this issue.
>
> Currently ixgbevf driver relies on VLAN filtering, that leads to this issue.
>
> Dropping unregistered VLAN packet is expected behavior, I think.
> I'm not sure whether we should implement to capture unknown VLAN packet in VF.
>
> What do you think?
>
> thanks,
> Hiroshi

Hiroshi,

What I would recommend doing is looking at something like 
fm10k_process_skb_fields and possibly working on updating ixgbevf to 
work similarly.  Basically you need to be able to determine when the VF 
has a port VLAN enabled, and when it does it needs to know what the port 
VLAN ID is so that you can correctly strip that tag on incoming frames.  
This is why I said your change would break legacy drivers by enabling 
VLAN promiscuous mode.

What you would probably need to do is setup a new API version and find a 
way of passing a notification that a port VLAN has been assigned.  Once 
you have that then you could look at rewriting the VLAN ID check so that 
you could pass all VLAN tagged frames that are not the port VLAN up to 
the stack as VLAN tagged.

- Alex

  reply	other threads:[~2015-06-02  3:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29 20:59 [Intel-wired-lan] vlan packet handling in ixgbevf driver when in promiscuous mode Chris Friesen
2015-06-01 16:48 ` Rose, Gregory V
2015-06-02  0:01   ` Chris Friesen
2015-06-02  0:47     ` Hiroshi Shimamoto
2015-06-02  3:18       ` Alexander Duyck [this message]
2015-06-04 15:54     ` Rose, Gregory V
2015-06-04 18:31       ` Chris Friesen
2015-06-04 20:34         ` Alexander Duyck
2015-06-04 20:45           ` Chris Friesen
2015-06-04 21:02             ` Alexander Duyck

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=556D209D.9030001@gmail.com \
    --to=alexander.duyck@gmail.com \
    --cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.