[PATCH net 0/3] openvswitch: vlan fixes

STALE3653d

Revision v1 of 2 in this series.

11 messages, 4 authors, 2016-10-13 · open the first message on its own page

[PATCH net 0/3] openvswitch: vlan fixes

From: Jiri Benc <hidden>
Date: 2016-10-10 15:03:03

Fix three issues introduced by the 802.1AD patchset.

Jiri Benc (3):
  openvswitch: vlan: remove wrong likely statement
  openvswitch: fix vlan subtraction from packet length
  openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev

 net/openvswitch/flow.c               | 2 +-
 net/openvswitch/vport-internal_dev.c | 2 +-
 net/openvswitch/vport.c              | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

-- 
1.8.3.1

[PATCH net 1/3] openvswitch: vlan: remove wrong likely statement

From: Jiri Benc <hidden>
Date: 2016-10-10 15:03:04

This code is called whenever flow key is being extracted from the packet.
The packet may be as likely vlan tagged as not.

Fixes: 018c1dda5ff1 ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: Jiri Benc <redacted>
---
 net/openvswitch/flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index c8c82e109c68..22087062bd10 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -343,7 +343,7 @@ static int parse_vlan(struct sk_buff *skb, struct sw_flow_key *key)
 	key->eth.cvlan.tci = 0;
 	key->eth.cvlan.tpid = 0;
 
-	if (likely(skb_vlan_tag_present(skb))) {
+	if (skb_vlan_tag_present(skb)) {
 		key->eth.vlan.tci = htons(skb->vlan_tci);
 		key->eth.vlan.tpid = skb->vlan_proto;
 	} else {
-- 
1.8.3.1

[PATCH net 2/3] openvswitch: fix vlan subtraction from packet length

From: Jiri Benc <hidden>
Date: 2016-10-10 15:03:05

When the packet has its vlan tag in skb->vlan_tci, the length of the VLAN
header is not counted in skb->len. It doesn't make sense to subtract it.

Fixes: 018c1dda5ff1 ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: Jiri Benc <redacted>
---
 net/openvswitch/vport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index 8f198437c724..7387418ac514 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -485,7 +485,8 @@ static unsigned int packet_length(const struct sk_buff *skb)
 {
 	unsigned int length = skb->len - ETH_HLEN;
 
-	if (skb_vlan_tagged(skb))
+	if (!skb_vlan_tag_present(skb) &&
+	    eth_type_vlan(skb->protocol))
 		length -= VLAN_HLEN;
 
 	/* Don't subtract for multiple VLAN tags. Most (all?) drivers allow
-- 
1.8.3.1

[PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev

From: Jiri Benc <hidden>
Date: 2016-10-10 15:03:07

The internal device does support 802.1AD offloading since 018c1dda5ff1
("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink
attributes").

Signed-off-by: Jiri Benc <redacted>
---
 net/openvswitch/vport-internal_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 95c36147a6e1..e7da29021b38 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -176,7 +176,7 @@ static void do_setup(struct net_device *netdev)
 
 	netdev->vlan_features = netdev->features;
 	netdev->hw_enc_features = netdev->features;
-	netdev->features |= NETIF_F_HW_VLAN_CTAG_TX;
+	netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
 	netdev->hw_features = netdev->features & ~NETIF_F_LLTX;
 
 	eth_hw_addr_random(netdev);
-- 
1.8.3.1

Re: [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement

From: Pravin Shelar <hidden>
Date: 2016-10-10 20:05:43

On Mon, Oct 10, 2016 at 8:02 AM, Jiri Benc [off-list ref] wrote:
This code is called whenever flow key is being extracted from the packet.
The packet may be as likely vlan tagged as not.

Fixes: 018c1dda5ff1 ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: Jiri Benc <redacted>
Acked-by: Pravin B Shelar <redacted>

Re: [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev

From: Pravin Shelar <hidden>
Date: 2016-10-10 20:05:51

On Mon, Oct 10, 2016 at 8:02 AM, Jiri Benc [off-list ref] wrote:
The internal device does support 802.1AD offloading since 018c1dda5ff1
("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink
attributes").

Signed-off-by: Jiri Benc <redacted>
Acked-by: Pravin B Shelar <redacted>

Re: [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length

From: Pravin Shelar <hidden>
Date: 2016-10-10 20:05:52

On Mon, Oct 10, 2016 at 8:02 AM, Jiri Benc [off-list ref] wrote:
When the packet has its vlan tag in skb->vlan_tci, the length of the VLAN
header is not counted in skb->len. It doesn't make sense to subtract it.

Fixes: 018c1dda5ff1 ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: Jiri Benc <redacted>
Acked-by: Pravin B Shelar <redacted>

Re: [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement

From: Eric Garver <hidden>
Date: 2016-10-11 17:39:01

On Mon, Oct 10, 2016 at 05:02:42PM +0200, Jiri Benc wrote:
This code is called whenever flow key is being extracted from the packet.
The packet may be as likely vlan tagged as not.

Fixes: 018c1dda5ff1 ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: Jiri Benc <redacted>
Acked-by: Eric Garver <redacted>

Re: [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length

From: Eric Garver <hidden>
Date: 2016-10-11 17:48:17

On Mon, Oct 10, 2016 at 05:02:43PM +0200, Jiri Benc wrote:
When the packet has its vlan tag in skb->vlan_tci, the length of the VLAN
header is not counted in skb->len. It doesn't make sense to subtract it.

Fixes: 018c1dda5ff1 ("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink attributes")
Signed-off-by: Jiri Benc <redacted>
Acked-by: Eric Garver <redacted>

Re: [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev

From: Eric Garver <hidden>
Date: 2016-10-11 18:06:35

On Mon, Oct 10, 2016 at 05:02:44PM +0200, Jiri Benc wrote:
The internal device does support 802.1AD offloading since 018c1dda5ff1
("openvswitch: 802.1AD Flow handling, actions, vlan parsing, netlink
attributes").

Signed-off-by: Jiri Benc <redacted>
Acked-by: Eric Garver <redacted>

Re: [PATCH net 0/3] openvswitch: vlan fixes

From: David Miller <davem@davemloft.net>
Date: 2016-10-13 14:05:33

From: Jiri Benc <redacted>
Date: Mon, 10 Oct 2016 17:02:41 +0200
Fix three issues introduced by the 802.1AD patchset.
Series applied, thanks Jiri.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help