DPDK patches and discussions
 help / color / mirror / Atom feed
From: Robert Shearman <robertshearman@gmail.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	Robert Shearman <robert.shearman@att.com>
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: Strip SR-IOV transparent VLANs in VF
Date: Tue, 4 Sep 2018 10:57:39 +0100	[thread overview]
Message-ID: <e389dc71-6c90-44cb-5815-5827ac19a54b@gmail.com> (raw)
In-Reply-To: <039ED4275CED7440929022BC67E706115327F96F@SHSMSX103.ccr.corp.intel.com>

Hi Qi,

On 04/09/2018 03:16, Zhang, Qi Z wrote:
>> -----Original Message-----
>> From: Robert Shearman [mailto:robertshearman@gmail.com]
>> Sent: Monday, September 3, 2018 9:14 PM
>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org
>> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
>> <konstantin.ananyev@intel.com>; Robert Shearman
>> <robert.shearman@att.com>
>> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: Strip SR-IOV transparent VLANs in
>> VF
>>
>> Hi Qi,
>>
>> On 03/09/2018 12:45, Zhang, Qi Z wrote:
>>> Hi Robert:
>>>
>>>> -----Original Message-----
>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of
>>>> robertshearman@gmail.com
>>>> Sent: Saturday, August 25, 2018 12:35 AM
>>>> To: dev@dpdk.org
>>>> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
>>>> <konstantin.ananyev@intel.com>; Robert Shearman
>>>> <robert.shearman@att.com>
>>>> Subject: [dpdk-dev] [PATCH] net/ixgbe: Strip SR-IOV transparent VLANs
>>>> in VF
>>>>
>>>> From: Robert Shearman <robert.shearman@att.com>
>>>>
>>>> SR-IOV VFs support "transparent" VLANs. Traffic from/to a VM
>>>> associated with a VF has a VLAN tag inserted/stripped in a manner
>>>> intended to be totally transparent to the VM.  On a Linux hypervisor
>>>> the vlan can be specified by "ip link set <device> vf <n> vlan <v>".
>>>> The VM VF driver is not configured to use any VLAN and the VM should
>>>> never see the transparent VLAN for that reason.  However, in practice
>>>> these VLAN headers are being received by the VM which discards the
>>>> packets as that VLAN is unknown to it.  The Linux kernel ixbge driver
>>>> explicitly removes the VLAN in this case (presumably due to the
>>>> hardware not being able to do this) but the DPDK driver does not.
>>>
>>> I'm not quite understand this part.
>>> What does explicitly remove the VLAN means?, DPDK also discard
>>> unmatched VLAN and strip vlan if vlan_strip is enabled what is the gap?
>>> It will be better if you can give same examples
>>
>> Sure. Typical use case for this is a hypervisor where it is necessary to provide
>> L2 access into the guests, but there are insufficient, and so the hypervisor is
>> using the PF and VFs are assigned to guests. In order to avoid having to
>> configure each guest to use the VLAN and to not send any untagged traffic it is
>> desirable to use transparent VLANs. For example:
>> Guest 1 = VLAN 10
>> Guest 2 = VLAN 20
>>
>> ip link set eth0 vf 1 vlan 10
>> ip link set eth0 vf 2 vlan 20
>>
>> Now this means that packets arriving tagged on the physical port should be
>> delivered to the guest and arrive in the guest untagged. Similarly, packets
>> transmitted untagged by the guest should gain a tag before they go out of the
>> physical port. What you get when using the Linux VF ixgbe driver inside the
>> VMs is exactly this since the driver knows that for this hardware the
>> transparent stripping isn't done in hardware and is done inside the driver.
>> What you get currently when using the DPDK VF ixgbe driver inside the VMs is
>> that packets arrive tagged (e.g. with VLAN tag 10) and these are then dropped
>> because the VM doesn't know about VLAN 10.
>>
>> Transparent VLAN insertion works currently with both Linux and DPDK VF
>> drivers.
> 
> What do you mean "stripping isn't done in hardware" and "packets arrived tagged"?
> Let me explain how PMD driver works. (or it is expected)
> if we enable vlan_strip, the VLAN header is expected to be stripped from packet data by hardware.
> And in rx descriptor, it still keep the stripped vlan information, so driver will set mbuf->ol_flags with PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED and also set stripped vlan tag to mbuf->vlan_tci
> So in my review, it is "stripping is done and packets arrived with untagged", and application also know what exactly happened and make decision based on the requirement
> 
> So do you mean ixgbevf does not support vlan_strip as a hardware offload?, and it should be done with software?
> But in your code, I didn't see the part that vlan header is stripped from the packet data. ( set mbuf->ol_flag and mbuf->vlan_tci does not mean the vlan is stripped)

I understand how the VLAN stripping hardware offload is supposed to 
work, but this use case is distinct from VLAN stripping and it was my 
mistake to use that loaded term in my explanation of the use case.

The expectation in this case is that the packet arrive completely 
untagged, i.e. whether the VLAN has been stripped and placed in metadata 
or not. The application running inside the VM expects the packet to 
arrive is if the VLAN tag was never there.

The application cannot do the removal of the VLAN tag itself because in 
this use case it is implicit that it shouldn't know about the tag and 
the presence of the tag is driver/hardware specific.

Thanks for highlighting the PKT_RX_VLAN_STRIPPED flag - I should remove 
that as well when the transparent VLAN filter triggers.

Thanks,
Rob

  reply	other threads:[~2018-09-04  9:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 16:35 robertshearman
2018-08-28 23:58 ` Chas Williams
2018-09-03 11:45 ` Zhang, Qi Z
2018-09-03 13:14   ` Robert Shearman
2018-09-04  2:16     ` Zhang, Qi Z
2018-09-04  9:57       ` Robert Shearman [this message]
2018-09-12 14:59 ` Ananyev, Konstantin

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=e389dc71-6c90-44cb-5815-5827ac19a54b@gmail.com \
    --to=robertshearman@gmail.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=robert.shearman@att.com \
    --cc=wenzhuo.lu@intel.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).