All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Guenter Roeck <linux@roeck-us.net>, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net] net: dsa: fix EDSA frame from hwaccel frame
Date: Tue, 25 Aug 2015 18:28:34 -0700	[thread overview]
Message-ID: <55DD1642.2020301@gmail.com> (raw)
In-Reply-To: <1438670111-31051-1-git-send-email-vivien.didelot@savoirfairelinux.com>

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

  parent reply	other threads:[~2015-08-26  1:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-08-26  1:37   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DD1642.2020301@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.