netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Subject: Transmit VLAN with AF_PACKET
Date: Wed, 12 Jun 2019 08:10:07 -0700	[thread overview]
Message-ID: <20190612081007.32dcb7ec@hermes.lan> (raw)

Sending VLAN packets through AF_PACKET over Hyper-V netvsc driver doesn't work now.
The question is what is best option for fixing it?

AF_PACKET handles VLAN stripping on receive, but there currently is no mechanism
for VLAN offload on transmit. Instead an application may form a raw packet with
a VLAN header and inject it into the kernel. This works fine for most drivers.

The problem is that in order to send a VLAN packet through Hyper-V, the VLAN
tag must be stripped and placed in the NDIS meta data. If the VLAN header is
inline in the packet it gets dropped by the vswitch rules as an invalid packet.

There a several options for fixing this and would like some consensus.

Option #1: Add code in netvsc transmit to look at packet and do a
VLAN pop if necessary before doing the normal VLAN tag handling on
transmit.

Option #2: Do a generic solution in AF_PACKET so that if application
sends a packet with VLAN header, it gets popped and inserted into skb.

Option #3: Add new tpacket header on transmit to match the Rx VLAN
tag strip on receive.

                 reply	other threads:[~2019-06-12 15:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190612081007.32dcb7ec@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=netdev@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).