netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: netdev@vger.kernel.org
Cc: pravin shelar <pshelar@ovn.org>, Eric Garver <e@erig.me>
Subject: [PATCH net-next v3 4/6] openvswitch: keep vlan tag accelerated on internal device
Date: Fri,  7 Oct 2016 18:07:39 +0200	[thread overview]
Message-ID: <e10f83e6907169d243ab0e6475ce61f0ef621d68.1475855896.git.jbenc@redhat.com> (raw)
In-Reply-To: <cover.1475855896.git.jbenc@redhat.com>

Disallow turning off of vlan acceleration on internal ports. We need the
vlan tag to be in skb->vlan_tci; otherwise, we would pull it back in
ovs_flow_key_extract, defeating the purpose of setting the vlan acceleration
off in the first place.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
v3: new in v3
---
 net/openvswitch/vport-internal_dev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index e7da29021b38..0531d48eb960 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -143,6 +143,12 @@ static void internal_set_rx_headroom(struct net_device *dev, int new_hr)
 	dev->needed_headroom = new_hr < 0 ? 0 : new_hr;
 }
 
+static netdev_features_t internal_fix_features(struct net_device *dev,
+					       netdev_features_t features)
+{
+	return features | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
+}
+
 static const struct net_device_ops internal_dev_netdev_ops = {
 	.ndo_open = internal_dev_open,
 	.ndo_stop = internal_dev_stop,
@@ -151,6 +157,7 @@ static const struct net_device_ops internal_dev_netdev_ops = {
 	.ndo_change_mtu = internal_dev_change_mtu,
 	.ndo_get_stats64 = internal_get_stats,
 	.ndo_set_rx_headroom = internal_set_rx_headroom,
+	.ndo_fix_features = internal_fix_features,
 };
 
 static struct rtnl_link_ops internal_dev_link_ops __read_mostly = {
-- 
1.8.3.1

  parent reply	other threads:[~2016-10-07 16:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 16:07 [PATCH net-next v3 0/6] openvswitch: make vlan handling consistent Jiri Benc
2016-10-07 16:07 ` [PATCH net-next v3 1/6] openvswitch: make skb modifiable in ovs_flow_key_extract* Jiri Benc
2016-10-07 16:07 ` [PATCH net-next v3 2/6] openvswitch: normalize vlan rx path Jiri Benc
2016-10-07 16:07 ` [PATCH net-next v3 3/6] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev Jiri Benc
2016-10-07 16:07 ` Jiri Benc [this message]
2016-10-07 16:07 ` [PATCH net-next v3 5/6] openvswitch: remove unreachable code in vlan parsing Jiri Benc
2016-10-07 16:07 ` [PATCH net-next v3 6/6] openvswitch: fix vlan subtraction from packet length Jiri Benc
2016-10-07 19:59 ` [PATCH net-next v3 0/6] openvswitch: make vlan handling consistent Pravin Shelar
2016-10-10 12:46   ` Jiri Benc

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=e10f83e6907169d243ab0e6475ce61f0ef621d68.1475855896.git.jbenc@redhat.com \
    --to=jbenc@redhat.com \
    --cc=e@erig.me \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.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).