openvswitch: vlan fixes
Subsystems (3)
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
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.
--- net/openvswitch/flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/flow.c +1 -1
@@ -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
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")Signed-off-by Jiri Benc <[email protected]>
Re: [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement
In reply to Jiri BencQuoted 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")Signed-off-by Jiri Benc <[email protected]>
PATCH 2/3 openvswitch: fix vlan subtraction from packet length
In reply to Jiri BencWhen 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.
--- net/openvswitch/vport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/openvswitch/vport.c +2 -1
@@ -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
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 inskb->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 <[email protected]>
Re: [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length
In reply to Jiri BencQuoted 5 lines · Jiri Benc
When the packet has its vlan tag in
skb->vlan_tci, the length of the VLAN header is not counted inskb->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 <[email protected]>
PATCH 3/3 openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev
In reply to Jiri BencThe 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
@@ -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
Re: [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev
Quoted 5 lines · Jiri Benc
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 <[email protected]>
Re: [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev
In reply to Jiri BencQuoted 5 lines · Jiri Benc
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 <[email protected]>
David Miller
maintainerFrom: Jiri Benc <[email protected]>
Date: Mon, 10 Oct 2016 17:02:41 +0200
Quoted 1 line
Fix three issues introduced by the 802.1AD patchset.
Series applied, thanks Jiri.