netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] openvswitch: vlan fixes
@ 2016-10-10 15:02 Jiri Benc
  2016-10-10 15:02 ` [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement Jiri Benc
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jiri Benc @ 2016-10-10 15:02 UTC (permalink / raw)
  To: netdev; +Cc: pravin shelar, Eric Garver

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement
  2016-10-10 15:02 [PATCH net 0/3] openvswitch: vlan fixes Jiri Benc
@ 2016-10-10 15:02 ` Jiri Benc
  2016-10-10 20:05   ` Pravin Shelar
  2016-10-11 17:38   ` Eric Garver
  2016-10-10 15:02 ` [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length Jiri Benc
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Jiri Benc @ 2016-10-10 15:02 UTC (permalink / raw)
  To: netdev; +Cc: pravin shelar, Eric Garver

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 <jbenc@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length
  2016-10-10 15:02 [PATCH net 0/3] openvswitch: vlan fixes Jiri Benc
  2016-10-10 15:02 ` [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement Jiri Benc
@ 2016-10-10 15:02 ` Jiri Benc
  2016-10-10 20:05   ` Pravin Shelar
  2016-10-11 17:41   ` Eric Garver
  2016-10-10 15:02 ` [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev Jiri Benc
  2016-10-13 14:03 ` [PATCH net 0/3] openvswitch: vlan fixes David Miller
  3 siblings, 2 replies; 11+ messages in thread
From: Jiri Benc @ 2016-10-10 15:02 UTC (permalink / raw)
  To: netdev; +Cc: pravin shelar, Eric Garver

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 <jbenc@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev
  2016-10-10 15:02 [PATCH net 0/3] openvswitch: vlan fixes Jiri Benc
  2016-10-10 15:02 ` [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement Jiri Benc
  2016-10-10 15:02 ` [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length Jiri Benc
@ 2016-10-10 15:02 ` Jiri Benc
  2016-10-10 20:05   ` Pravin Shelar
  2016-10-11 17:41   ` Eric Garver
  2016-10-13 14:03 ` [PATCH net 0/3] openvswitch: vlan fixes David Miller
  3 siblings, 2 replies; 11+ messages in thread
From: Jiri Benc @ 2016-10-10 15:02 UTC (permalink / raw)
  To: netdev; +Cc: pravin shelar, Eric Garver

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 <jbenc@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement
  2016-10-10 15:02 ` [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement Jiri Benc
@ 2016-10-10 20:05   ` Pravin Shelar
  2016-10-11 17:38   ` Eric Garver
  1 sibling, 0 replies; 11+ messages in thread
From: Pravin Shelar @ 2016-10-10 20:05 UTC (permalink / raw)
  To: Jiri Benc; +Cc: Linux Kernel Network Developers, Eric Garver

On Mon, Oct 10, 2016 at 8:02 AM, Jiri Benc <jbenc@redhat.com> 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 <jbenc@redhat.com>

Acked-by: Pravin B Shelar <pshelar@ovn.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length
  2016-10-10 15:02 ` [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length Jiri Benc
@ 2016-10-10 20:05   ` Pravin Shelar
  2016-10-11 17:41   ` Eric Garver
  1 sibling, 0 replies; 11+ messages in thread
From: Pravin Shelar @ 2016-10-10 20:05 UTC (permalink / raw)
  To: Jiri Benc; +Cc: Linux Kernel Network Developers, Eric Garver

On Mon, Oct 10, 2016 at 8:02 AM, Jiri Benc <jbenc@redhat.com> 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 <jbenc@redhat.com>

Acked-by: Pravin B Shelar <pshelar@ovn.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev
  2016-10-10 15:02 ` [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev Jiri Benc
@ 2016-10-10 20:05   ` Pravin Shelar
  2016-10-11 17:41   ` Eric Garver
  1 sibling, 0 replies; 11+ messages in thread
From: Pravin Shelar @ 2016-10-10 20:05 UTC (permalink / raw)
  To: Jiri Benc; +Cc: Linux Kernel Network Developers, Eric Garver

On Mon, Oct 10, 2016 at 8:02 AM, Jiri Benc <jbenc@redhat.com> 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 <jbenc@redhat.com>

Acked-by: Pravin B Shelar <pshelar@ovn.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement
  2016-10-10 15:02 ` [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement Jiri Benc
  2016-10-10 20:05   ` Pravin Shelar
@ 2016-10-11 17:38   ` Eric Garver
  1 sibling, 0 replies; 11+ messages in thread
From: Eric Garver @ 2016-10-11 17:38 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, pravin shelar

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 <jbenc@redhat.com>

Acked-by: Eric Garver <e@erig.me>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length
  2016-10-10 15:02 ` [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length Jiri Benc
  2016-10-10 20:05   ` Pravin Shelar
@ 2016-10-11 17:41   ` Eric Garver
  1 sibling, 0 replies; 11+ messages in thread
From: Eric Garver @ 2016-10-11 17:41 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, pravin shelar

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 <jbenc@redhat.com>

Acked-by: Eric Garver <e@erig.me>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev
  2016-10-10 15:02 ` [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev Jiri Benc
  2016-10-10 20:05   ` Pravin Shelar
@ 2016-10-11 17:41   ` Eric Garver
  1 sibling, 0 replies; 11+ messages in thread
From: Eric Garver @ 2016-10-11 17:41 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, pravin shelar

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 <jbenc@redhat.com>

Acked-by: Eric Garver <e@erig.me>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH net 0/3] openvswitch: vlan fixes
  2016-10-10 15:02 [PATCH net 0/3] openvswitch: vlan fixes Jiri Benc
                   ` (2 preceding siblings ...)
  2016-10-10 15:02 ` [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev Jiri Benc
@ 2016-10-13 14:03 ` David Miller
  3 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2016-10-13 14:03 UTC (permalink / raw)
  To: jbenc; +Cc: netdev, pshelar, e

From: Jiri Benc <jbenc@redhat.com>
Date: Mon, 10 Oct 2016 17:02:41 +0200

> Fix three issues introduced by the 802.1AD patchset.

Series applied, thanks Jiri.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-10-13 14:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-10 15:02 [PATCH net 0/3] openvswitch: vlan fixes Jiri Benc
2016-10-10 15:02 ` [PATCH net 1/3] openvswitch: vlan: remove wrong likely statement Jiri Benc
2016-10-10 20:05   ` Pravin Shelar
2016-10-11 17:38   ` Eric Garver
2016-10-10 15:02 ` [PATCH net 2/3] openvswitch: fix vlan subtraction from packet length Jiri Benc
2016-10-10 20:05   ` Pravin Shelar
2016-10-11 17:41   ` Eric Garver
2016-10-10 15:02 ` [PATCH net 3/3] openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev Jiri Benc
2016-10-10 20:05   ` Pravin Shelar
2016-10-11 17:41   ` Eric Garver
2016-10-13 14:03 ` [PATCH net 0/3] openvswitch: vlan fixes David Miller

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).