Netdev List
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: fix EDSA frame from hwaccel frame
@ 2015-08-04  6:35 Vivien Didelot
  2015-08-26  0:11 ` Vivien Didelot
  2015-08-26  1:28 ` Florian Fainelli
  0 siblings, 2 replies; 4+ messages in thread
From: Vivien Didelot @ 2015-08-04  6:35 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Guenter Roeck, Andrew Lunn,
	Florian Fainelli, Vivien Didelot

If the underlying network device features NETIF_F_HW_VLAN_CTAG_TX,
an EDSA frame is prepended with a 802.1q header once queued.

To fix this, push the VLAN tag to the payload if present, before
checking the frame protocol.

[note: we may prefer to access directly VLAN TCI from hwaccel frames,
but this approach is simpler.]

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/dsa/tag_edsa.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index 2288c80..3ada4eb 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/etherdevice.h>
+#include <linux/if_vlan.h>
 #include <linux/list.h>
 #include <linux/slab.h>
 #include "dsa_priv.h"
@@ -21,6 +22,10 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct dsa_slave_priv *p = netdev_priv(dev);
 	u8 *edsa_header;
 
+	skb = vlan_hwaccel_push_inside(skb);
+	if (unlikely(!skb))
+		return NULL;
+
 	/*
 	 * Convert the outermost 802.1q tag to a DSA tag and prepend
 	 * a DSA ethertype field is the packet is tagged, or insert
-- 
2.4.6

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

* Re: [PATCH net] net: dsa: fix EDSA frame from hwaccel frame
  2015-08-04  6:35 [PATCH net] net: dsa: fix EDSA frame from hwaccel frame Vivien Didelot
@ 2015-08-26  0:11 ` Vivien Didelot
  2015-08-26  1:28 ` Florian Fainelli
  1 sibling, 0 replies; 4+ messages in thread
From: Vivien Didelot @ 2015-08-26  0:11 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Guenter Roeck, Andrew Lunn,
	Florian Fainelli

Hi All,

On Aug. Tuesday 04 (32) 02:35 AM, Vivien Didelot wrote:
> If the underlying network device features NETIF_F_HW_VLAN_CTAG_TX,
> an EDSA frame is prepended with a 802.1q header once queued.
> 
> To fix this, push the VLAN tag to the payload if present, before
> checking the frame protocol.
> 
> [note: we may prefer to access directly VLAN TCI from hwaccel frames,
> but this approach is simpler.]
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
>  net/dsa/tag_edsa.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
> index 2288c80..3ada4eb 100644
> --- a/net/dsa/tag_edsa.c
> +++ b/net/dsa/tag_edsa.c
> @@ -9,6 +9,7 @@
>   */
>  
>  #include <linux/etherdevice.h>
> +#include <linux/if_vlan.h>
>  #include <linux/list.h>
>  #include <linux/slab.h>
>  #include "dsa_priv.h"
> @@ -21,6 +22,10 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev)
>  	struct dsa_slave_priv *p = netdev_priv(dev);
>  	u8 *edsa_header;
>  
> +	skb = vlan_hwaccel_push_inside(skb);
> +	if (unlikely(!skb))
> +		return NULL;
> +
>  	/*
>  	 * Convert the outermost 802.1q tag to a DSA tag and prepend
>  	 * a DSA ethertype field is the packet is tagged, or insert
> -- 
> 2.4.6
> 

Did someone have a chance to give this a look?

Thanks,
-v

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

* Re: [PATCH net] net: dsa: fix EDSA frame from hwaccel frame
  2015-08-04  6:35 [PATCH net] net: dsa: fix EDSA frame from hwaccel frame Vivien Didelot
  2015-08-26  0:11 ` Vivien Didelot
@ 2015-08-26  1:28 ` Florian Fainelli
  2015-08-26  1:37   ` Guenter Roeck
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2015-08-26  1:28 UTC (permalink / raw)
  To: Vivien Didelot, netdev
  Cc: linux-kernel, kernel, David S. Miller, Guenter Roeck, Andrew Lunn

Le 08/03/15 23:35, Vivien Didelot a écrit :
> If the underlying network device features NETIF_F_HW_VLAN_CTAG_TX,
> an EDSA frame is prepended with a 802.1q header once queued.
> 
> To fix this, push the VLAN tag to the payload if present, before
> checking the frame protocol.

Makes sense, but you would want Andrew or Guenter to ack this patch.

Thanks!

> 
> [note: we may prefer to access directly VLAN TCI from hwaccel frames,
> but this approach is simpler.]
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> ---
>  net/dsa/tag_edsa.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
> index 2288c80..3ada4eb 100644
> --- a/net/dsa/tag_edsa.c
> +++ b/net/dsa/tag_edsa.c
> @@ -9,6 +9,7 @@
>   */
>  
>  #include <linux/etherdevice.h>
> +#include <linux/if_vlan.h>
>  #include <linux/list.h>
>  #include <linux/slab.h>
>  #include "dsa_priv.h"
> @@ -21,6 +22,10 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev)
>  	struct dsa_slave_priv *p = netdev_priv(dev);
>  	u8 *edsa_header;
>  
> +	skb = vlan_hwaccel_push_inside(skb);
> +	if (unlikely(!skb))
> +		return NULL;
> +
>  	/*
>  	 * Convert the outermost 802.1q tag to a DSA tag and prepend
>  	 * a DSA ethertype field is the packet is tagged, or insert
> 


-- 
Florian

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

* Re: [PATCH net] net: dsa: fix EDSA frame from hwaccel frame
  2015-08-26  1:28 ` Florian Fainelli
@ 2015-08-26  1:37   ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2015-08-26  1:37 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Vivien Didelot, netdev, linux-kernel, kernel, David S. Miller,
	Andrew Lunn

On Tue, Aug 25, 2015 at 06:28:34PM -0700, Florian Fainelli wrote:
> Le 08/03/15 23:35, Vivien Didelot a écrit :
> > If the underlying network device features NETIF_F_HW_VLAN_CTAG_TX,
> > an EDSA frame is prepended with a 802.1q header once queued.
> > 
> > To fix this, push the VLAN tag to the payload if present, before
> > checking the frame protocol.
> 
> Makes sense, but you would want Andrew or Guenter to ack this patch.
> 
I'll have to carve out some time soon to see if the current dsa code
still works for me. Just don't know when and how to do that :-(

Guenter

> Thanks!
> 
> > 
> > [note: we may prefer to access directly VLAN TCI from hwaccel frames,
> > but this approach is simpler.]
> > 
> > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> > ---
> >  net/dsa/tag_edsa.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
> > index 2288c80..3ada4eb 100644
> > --- a/net/dsa/tag_edsa.c
> > +++ b/net/dsa/tag_edsa.c
> > @@ -9,6 +9,7 @@
> >   */
> >  
> >  #include <linux/etherdevice.h>
> > +#include <linux/if_vlan.h>
> >  #include <linux/list.h>
> >  #include <linux/slab.h>
> >  #include "dsa_priv.h"
> > @@ -21,6 +22,10 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev)
> >  	struct dsa_slave_priv *p = netdev_priv(dev);
> >  	u8 *edsa_header;
> >  
> > +	skb = vlan_hwaccel_push_inside(skb);
> > +	if (unlikely(!skb))
> > +		return NULL;
> > +
> >  	/*
> >  	 * Convert the outermost 802.1q tag to a DSA tag and prepend
> >  	 * a DSA ethertype field is the packet is tagged, or insert
> > 
> 
> 
> -- 
> Florian

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

end of thread, other threads:[~2015-08-26  1:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-04  6:35 [PATCH net] net: dsa: fix EDSA frame from hwaccel frame Vivien Didelot
2015-08-26  0:11 ` Vivien Didelot
2015-08-26  1:28 ` Florian Fainelli
2015-08-26  1:37   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox