linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: srirakr2@cisco.com
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org, mbumgard@cisco.com,
	ugm@cisco.com, nimm@cisco.com, xe-linux-external@cisco.com,
	kuba@kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6] hv_netvsc: add support for vlans in AF_PACKET mode
Date: Wed, 22 Jul 2020 17:58:30 -0700 (PDT)	[thread overview]
Message-ID: <20200722.175830.616952267325554952.davem@davemloft.net> (raw)
In-Reply-To: <20200722153845.79946-1-srirakr2@cisco.com>

From: Sriram Krishnan <srirakr2@cisco.com>
Date: Wed, 22 Jul 2020 21:08:44 +0530

> Vlan tagged packets are getting dropped when used with DPDK that uses
> the AF_PACKET interface on a hyperV guest.
> 
> The packet layer uses the tpacket interface to communicate the vlans
> information to the upper layers. On Rx path, these drivers can read the
> vlan info from the tpacket header but on the Tx path, this information
> is still within the packet frame and requires the paravirtual drivers to
> push this back into the NDIS header which is then used by the host OS to
> form the packet.
> 
> This transition from the packet frame to NDIS header is currently missing
> hence causing the host OS to drop the all vlan tagged packets sent by
> the drivers that use AF_PACKET (ETH_P_ALL) such as DPDK.
> 
> Here is an overview of the changes in the vlan header in the packet path:
> 
> The RX path (userspace handles everything):
>   1. RX VLAN packet is stripped by HOST OS and placed in NDIS header
>   2. Guest Kernel RX hv_netvsc packets and moves VLAN info from NDIS
>      header into kernel SKB
>   3. Kernel shares packets with user space application with PACKET_MMAP.
>      The SKB VLAN info is copied to tpacket layer and indication set
>      TP_STATUS_VLAN_VALID.
>   4. The user space application will re-insert the VLAN info into the frame
> 
> The TX path:
>   1. The user space application has the VLAN info in the frame.
>   2. Guest kernel gets packets from the application with PACKET_MMAP.
>   3. The kernel later sends the frame to the hv_netvsc driver. The only way
>      to send VLANs is when the SKB is setup & the VLAN is stripped from the
>      frame.
>   4. TX VLAN is re-inserted by HOST OS based on the NDIS header. If it sees
>      a VLAN in the frame the packet is dropped.
> 
> Cc: xe-linux-external@cisco.com
> Cc: Sriram Krishnan <srirakr2@cisco.com>
> Signed-off-by: Sriram Krishnan <srirakr2@cisco.com>

Applied to net-next, thank you.

      parent reply	other threads:[~2020-07-23  0:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 15:38 [PATCH v6] hv_netvsc: add support for vlans in AF_PACKET mode Sriram Krishnan
2020-07-22 21:06 ` Haiyang Zhang
2020-07-23  0:58 ` David Miller [this message]

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=20200722.175830.616952267325554952.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbumgard@cisco.com \
    --cc=netdev@vger.kernel.org \
    --cc=nimm@cisco.com \
    --cc=srirakr2@cisco.com \
    --cc=sthemmin@microsoft.com \
    --cc=ugm@cisco.com \
    --cc=wei.liu@kernel.org \
    --cc=xe-linux-external@cisco.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).