Skip to contentSkip to conversation

openvswitch: vlan fixes

PATCH In review Jiri Benc 4 participants 11 messages Oct 10, 2016 – Oct 13, 2016

Subsystems (3)
lore
Share & tools
lore

Jiri Benc

author
#0 lore raw

cover openvswitch: vlan fixes

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(-)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/3 openvswitch: vlan: remove wrong likely statement

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")
---
 net/openvswitch/flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/flow.c +1 -1
index c8c82e109c68..22087062bd10 100644
@@ -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 {
Signature · 1 line
1.8.3.1
Acked-by on v1 1/3
#2 lore raw

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

Quoted 5 lines · Jiri Benc

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")
author
#4 lore raw

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

In reply to Jiri Benc

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")
---
 net/openvswitch/vport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/openvswitch/vport.c +2 -1
index 8f198437c724..7387418ac514 100644
@@ -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
Signature · 1 line
1.8.3.1
Acked-by on v1 2/3
#5 lore raw

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

Quoted 5 lines · Jiri Benc

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")
Acked-by on v1 2/3
#6 lore raw

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

In reply to Jiri Benc
Quoted 5 lines · Jiri Benc

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")
author
#7 lore raw

PATCH 3/3 openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev

In reply to Jiri Benc

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

---
 net/openvswitch/vport-internal_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/vport-internal_dev.c +1 -1
index 95c36147a6e1..e7da29021b38 100644
@@ -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);
Signature · 1 line
1.8.3.1