Received: by 10.213.65.68 with SMTP id h4csp2118407imn; Sun, 8 Apr 2018 20:09:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/U7YZNzCptnaZkCoDgcM5uPd6PhHIIy8/BUxSBmOd3eJzsUt+QQEpNjrAoxUJk12K1bFpj X-Received: by 2002:a17:902:5305:: with SMTP id b5-v6mr31803130pli.326.1523243384534; Sun, 08 Apr 2018 20:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243384; cv=none; d=google.com; s=arc-20160816; b=FASxqx8gn1pWL+WECUBpvFeLbx2gQud14tKylta1ElVQ0mwTTgAY5+KxkOaC6ZxrSJ MBf/zE0moWLT2qRH4XEF6f3+z/rd3ymxQcjd/Ob8Yu4BL4VwyLSypAr3kUJFCrILTije jdzuiCbSOOSAOSz/cxHzpJJfUoNEbLi7eSE7t1+/rBAtLn0ABsqG9AQZZqRYFb0O+r0W JNFjzX+ebfhGNXTypbBHJqL9WlIBgOrGa0bxs/e/AB3YezJzeRjvipIgA6l2tq/B1mD1 Zu629h8b1wfDi+cX2v7f0jT5/kEK2XWgOy1OrCqshwbFGOvBHIvIw3/JrqFLY4DLRyFL g/Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Hv4+o+vExGaFWJJ4Vogmgnd2dljGcS6Yf/1S31uUtRo=; b=IU/3kbr2cr2qNkSStFMrSotkEDa2EtYU3+shOlKSY2qAZZKMadBwRloX+7psW9Egup z8rCE3K0IwNoaI3N+B58ETaI127MlmLOvk7D7QR0BkscHpKzZQBzFrClbHgdcqgVch34 5NzyIAEOWGAEbgCGXK+k7T2lNB193SXICnyo9GJ5n2aw9eBPIs/Z38XToHDABDTo6PCS LYXKWuBnd64LME+6WAvi/MEVmnp7KNzXcwxaaKXN6vcppyHZPJ5wW3x/XvBhr4sKDiI2 zYICCHN/NcTTT/W5fxcI4gaoyIjDPNozlMf+VZaBwm4H68w+hMk3lRSZKTwj6OgBHJn/ ZRXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TcmiPoSD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7si9888406pfh.395.2018.04.08.20.09.07; Sun, 08 Apr 2018 20:09:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TcmiPoSD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756292AbeDICmV (ORCPT + 99 others); Sun, 8 Apr 2018 22:42:21 -0400 Received: from mail-by2nam03on0133.outbound.protection.outlook.com ([104.47.42.133]:46250 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755468AbeDIA0y (ORCPT ); Sun, 8 Apr 2018 20:26:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Hv4+o+vExGaFWJJ4Vogmgnd2dljGcS6Yf/1S31uUtRo=; b=TcmiPoSDxTJHfE8zaXStM8DXVx6dq7eb7+UJVNXkGh6DRJor2NdPAZnfHWlMZfAV7SesEEHXGOdG8yV1afXwXAQ+QVXImwEf/j6/HgmP/r02q4wCYHbC6ujC5HKLX/QxnAgUy/Sa2P8R1yXlb5q64bEybfE5R4wEuMytS9wliuA= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0885.namprd21.prod.outlook.com (52.132.132.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:26:45 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:26:45 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "Mintz, Yuval" , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 027/293] bnx2x: Allow vfs to disable txvlan offload Thread-Topic: [PATCH AUTOSEL for 4.9 027/293] bnx2x: Allow vfs to disable txvlan offload Thread-Index: AQHTz5jxO6acy8tZGUC6rGSOC9/Y1A== Date: Mon, 9 Apr 2018 00:23:11 +0000 Message-ID: <20180409002239.163177-27-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0885;7:S0Q+47YzOdjQjgeyixRLdjVq2rwlUKEMoH527WsvWI1Fed0q6xgSbA84RPn3xNJ53AC1vSUlxmRjvg9iHU0zkR7veDjnlf6yRRwF9qO11sjO4upamM/7D0odD8jtAdU6MkXwiDVXgZh4pxF91j6iH46JkWPhWQx+UkcTfqRzB+QIPqWWlzda+1C9BJWwHFJJ/A+iP/gWDypJgrIb5X/1CG/G+jZJ+c/mhv1ANmPOGZI9sSU6j4yaaUzP0U68FwJs;20:c6fUZWUVoFfFJAzLYaL436GcJhlItFgIAUSrvA2kfDmmzhBXgwXo6fDN2EgRPqx/Iaj0msCypwHI/REcscBBoCqmcWUWrDtxFblqdS/x56KM8bEa2X0OnnW+a4Ch4SL3qMFvDx7VL37LlT6LL+9AwrJcyDwWGGmvfhN0RqVpI9w= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: b0917c89-d123-496b-5454-08d59db09376 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0885; x-ms-traffictypediagnostic: DM5PR2101MB0885: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0885;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0885; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(396003)(39380400002)(189003)(199004)(2906002)(68736007)(22452003)(316002)(6512007)(5660300001)(6666003)(54906003)(110136005)(486006)(6486002)(102836004)(36756003)(14454004)(99286004)(86612001)(105586002)(72206003)(106356001)(2900100001)(1076002)(97736004)(10090500001)(3280700002)(5250100002)(6436002)(3660700001)(6116002)(3846002)(305945005)(86362001)(59450400001)(66066001)(10290500003)(186003)(81166006)(8936002)(478600001)(476003)(25786009)(81156014)(8676002)(4326008)(7736002)(2501003)(107886003)(6506007)(2616005)(26005)(76176011)(446003)(53936002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0885;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 38kHq/9bKy8We4TtL8UcwvoYrtYVarm7sly9L5LxNQIl5IU8kFS1pUfUt4MpRFQIeSMdixKXFS/i3SH42qAHDNuWPFUqNnUf2rl25Zu1W+cLch3md04BguUi/MekYmeCQnjx3sfHwH+3voFM201jFo13P7WYSOhcYKMRso6r13bxZM5ndfZBxb0x8D7wHXU1hgsnKGq57Ace3nAu8K0+ihQxKDNIbOZtimVeB8/6gAwg2CQwvI+T1B8d3VqlIaMBb4gQx3SpF1Ss3apBzlhX5a/Wbzw5gmJxlgonoD3k1WDWWyoUdPpbrwqIhpVzxf9oFzjdZiJ3VsNbUcTtNtJrbhANCee2di9+dRa772jSiux7nxFye36Qe77IsJ1Gqtquby7dfJY5t6x9wc0daVen8aJqUb7eNwvR/OKbd3Tk/08= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0917c89-d123-496b-5454-08d59db09376 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:11.1592 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0885 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Mintz, Yuval" [ Upstream commit 92f85f05caa51d844af6ea14ffbc7a786446a644 ] VF clients are configured as enforced, meaning firmware is validating the correctness of their ethertype/vid during transmission. Once txvlan is disabled, VF would start getting SKBs for transmission here vlan is on the payload - but it'll pass the packet's ethertype instead of the vid, leading to firmware declaring it as malicious. Signed-off-by: Yuval Mintz Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/= ethernet/broadcom/bnx2x/bnx2x_cmn.c index ca6c4718000f..31287cec6e3a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -3887,15 +3887,26 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, s= truct net_device *dev) /* when transmitting in a vf, start bd must hold the ethertype * for fw to enforce it */ + u16 vlan_tci =3D 0; #ifndef BNX2X_STOP_ON_ERROR - if (IS_VF(bp)) + if (IS_VF(bp)) { #endif - tx_start_bd->vlan_or_ethertype =3D - cpu_to_le16(ntohs(eth->h_proto)); + /* Still need to consider inband vlan for enforced */ + if (__vlan_get_tag(skb, &vlan_tci)) { + tx_start_bd->vlan_or_ethertype =3D + cpu_to_le16(ntohs(eth->h_proto)); + } else { + tx_start_bd->bd_flags.as_bitfield |=3D + (X_ETH_INBAND_VLAN << + ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT); + tx_start_bd->vlan_or_ethertype =3D + cpu_to_le16(vlan_tci); + } #ifndef BNX2X_STOP_ON_ERROR - else + } else { /* used by FW for packet accounting */ tx_start_bd->vlan_or_ethertype =3D cpu_to_le16(pkt_prod); + } #endif } =20 --=20 2.15.1