From patchwork Tue Sep 19 16:17:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 113038 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5105557qgf; Tue, 19 Sep 2017 09:18:47 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAOwjvOogUUaYArh9VPnsxnXdHx+zOYSp0RsN5Ru+IEpFLfR7PtKJYymk2aV0/kHJa4GDz4 X-Received: by 10.84.235.203 with SMTP id m11mr1736313plt.28.1505837927903; Tue, 19 Sep 2017 09:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505837927; cv=none; d=google.com; s=arc-20160816; b=o0C+KPyLPyl9X+hL834bOLnaG9jv7uWshDlPL9OIC8pqoSBGwvO/r680XGA3xdFiMA bptxRRUDk0PpfSGiRuFKKMkurNF1jj4z6Y04UvUGPUwwZ+0zuS6TBW6qT5geH+nTa5VF XC0OwYmw61MgvODssEvCliiFFELMgpI7WS40X9cql1ETYsG7V7PoFBU/Rs9vDLgGVWMu HgVOj9r/3mDqAM2yJa2R1pMvzzV40HZwW0ycrMN+24Fb4nZrw4bSFIPFASCLb3DjaNg0 AYu2skqJop9cncpQzety49FeZN3Q9WTrIxSD6UA+PwdAxnJbLks+l8guOTcR+8UtDh/V QNPA== 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=y38JFdDYwI75XDPoEQkOAAohLivfBRc+pcCldok1Up8=; b=b69X2k48lOgrQoabMpttm+BjeXELXRYMBXp5kJZuLOZE5GpCE16wD45YMPOL1E7sZA SDSqabV94viYDm0xC5QYrOBOGt7y3AzzuInSp9FT9bfcPsA7KaCkx52pV2GDd8Ab2/uI kuPuWf1pMneGsys71zZXdCCHMmEhqlgb8Xn+zGOj6GsV0DWaQCDRGbzVL9+YrWFGzKN1 Nbz2tvOnjd+QGwUTEp+mLs6drU/zOQmldRZsCbTf7ABW4y9pRbhHu/H94kHiDxt/2ykc 71Zs6o+gKUn7dKbcYc5GNH4T5GSf5AFP6HwqmZp0hVtdYMgGCRjK+rRjW/Lev5Jpi3A8 sM0A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si1543288pfi.582.2017.09.19.09.18.47; Tue, 19 Sep 2017 09:18:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751966AbdISQSo (ORCPT + 26 others); Tue, 19 Sep 2017 12:18:44 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6498 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751669AbdISQSU (ORCPT ); Tue, 19 Sep 2017 12:18:20 -0400 Received: from 172.30.72.59 (EHLO DGGEMS414-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DHO40867; Wed, 20 Sep 2017 00:18:17 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.203.181.154) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.301.0; Wed, 20 Sep 2017 00:18:08 +0800 From: Salil Mehta To: CC: , , , , , , , , Mingguang Qu Subject: [PATCH V2 net 6/7] net: hns3: Fixes the default VLAN-id of PF Date: Tue, 19 Sep 2017 17:17:15 +0100 Message-ID: <20170919161716.92680-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20170919161716.92680-1-salil.mehta@huawei.com> References: <20170919161716.92680-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.203.181.154] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.59C1434A.0037, 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: 09cd0021600638663c90c5e7fde4c014 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Fixes: 6427264ef330 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") 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.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8e172af..74008ef 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)