From patchwork Tue Sep 19 01:06:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 112958 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4321281qgf; Mon, 18 Sep 2017 18:07:47 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAqF/0PravSMf1ou3FFy+IuG84+Ggq3gE3qr3TJa8HLmw3wuTZYY1mI48+uyRGWH1npmsNN X-Received: by 10.99.114.19 with SMTP id n19mr406312pgc.174.1505783267063; Mon, 18 Sep 2017 18:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505783267; cv=none; d=google.com; s=arc-20160816; b=ZfbXCnlrJ6OfTRA9x30sg3vjBFaqgVjyzaf0XcMuxOSt4PUd+gmtUkpC67WO7VQ4sU Iz4UpCvzvpmwjAMg9QZQJIldnOijz4a3S0Kia+nwqILdEZWnSfo0QFAprHB//o7uaqn5 8tqk0wnfh3GwDM/DtHSJjTfYmv+YMsGj4EeqS47Ajoc1QFcNVMx71r0ls8x5q6p0zEqy 9ok4YwEJPNhcXODnkRrT4eQ8qhriVl08GI0KB0ENPVdE3BPh64IgBv2gn+RnF8zftVSI mtJnV/TUcqAb5wQrqyFL8bhtFbHBAD7sPWonyE7Q41QCcBYRyHQlVyKEVnZgTZMq1CL9 m3YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=X3wuXvrXRfzW4ek7m/9PCvIVHP1tZrg/kXHlAUeGWCQ=; b=DDbtP6luu4xmf5C+ckNYprNpAqjEMb1aO6DdUDYjv+xapp5557D8Z7BC8BNcgS8dzT sQTsv0vF1UJpns0dY6Gw31T8cUCEwjopNSSYplriUhE7bHxmHSeUhUrz08PFuAMchtwo t/KAm6Z4zsXdWxi8R0+ABoFE5v3Mnv1C+hD954AZG+fLPmRZeJVHWcYCG4A5PtbwDpLy OJFIn5SplNPilXujboEYn3VZyJ3m3oYb0v1mbwWRp7rzs8kWI/VA46xfBkEyis8BSTRr mAl+hCEVMU27hoXxC5XkMtJsuTGrhbK+GjEIujDqHP6R39cXi3odeOaKsC97WJ+9rtkU P5wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si5672403pla.144.2017.09.18.18.07.46; Mon, 18 Sep 2017 18:07:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584AbdISBHo (ORCPT + 8 others); Mon, 18 Sep 2017 21:07:44 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6071 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbdISBHi (ORCPT ); Mon, 18 Sep 2017 21:07:38 -0400 Received: from 172.30.72.59 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.59]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DHO21298; Tue, 19 Sep 2017 09:07:36 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.47.92.71) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.301.0; Tue, 19 Sep 2017 09:07:27 +0800 From: Salil Mehta To: CC: , , , , , , , , Mingguang Qu Subject: [PATCH net 6/7] net: hns3: set default vlan id to PF Date: Tue, 19 Sep 2017 02:06:27 +0100 Message-ID: <20170919010628.175732-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20170919010628.175732-1-salil.mehta@huawei.com> References: <20170919010628.175732-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.92.71] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.59C06DD8.0117, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 20da39b55f16caee2e1880ebc66f7b0c Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Lipeng When there is no vlan id in the packets, hardware will treat the vlan id as 0 and look for the mac_vlan table. This patch set the default vlan id of PF as 0. Without this config, it will fail when look for mac_vlan table, and hardware will drop packets. Signed-off-by: Mingguang Qu Signed-off-by: Lipeng Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8e172afd4876..74008ef23169 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3673,6 +3673,7 @@ static int hclge_init_vlan_config(struct hclge_dev *hdev) { #define HCLGE_VLAN_TYPE_VF_TABLE 0 #define HCLGE_VLAN_TYPE_PORT_TABLE 1 + struct hnae3_handle *handle; int ret; ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_VLAN_TYPE_VF_TABLE, @@ -3682,8 +3683,11 @@ static int hclge_init_vlan_config(struct hclge_dev *hdev) ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_VLAN_TYPE_PORT_TABLE, true); + if (ret) + return ret; - return ret; + handle = &hdev->vport[0].nic; + return hclge_set_port_vlan_filter(handle, htons(ETH_P_8021Q), 0, false); } static int hclge_set_mtu(struct hnae3_handle *handle, int new_mtu)