From patchwork Mon Aug 3 01:46:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivien Didelot X-Patchwork-Id: 502973 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 413B314007F for ; Mon, 3 Aug 2015 11:48:05 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009AbbHCBrk (ORCPT ); Sun, 2 Aug 2015 21:47:40 -0400 Received: from mail.savoirfairelinux.com ([209.172.62.77]:63507 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbbHCBrj (ORCPT ); Sun, 2 Aug 2015 21:47:39 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id C1D3A62022F; Sun, 2 Aug 2015 21:47:32 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id u2AYK0-ovcj5; Sun, 2 Aug 2015 21:47:31 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id BF56B6205BF; Sun, 2 Aug 2015 21:47:30 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qpsBfx-Ol5k9; Sun, 2 Aug 2015 21:47:30 -0400 (EDT) Received: from ketchup.mtl.sfl (unknown [96.127.211.123]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 99A9962022F; Sun, 2 Aug 2015 21:47:29 -0400 (EDT) From: Vivien Didelot To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Guenter Roeck , Andrew Lunn , Florian Fainelli , Vivien Didelot Subject: [PATCH] net: dsa: fix EDSA frame from hwaccel frame Date: Sun, 2 Aug 2015 21:46:02 -0400 Message-Id: <1438566362-28786-1-git-send-email-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.4.6 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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 +#include #include #include #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