Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1547412imm; Mon, 3 Sep 2018 03:24:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdagQzCGHrgqyWfZexmVyaEd5phshpsQaZZxsI4hDJlc/1CWogxksDtkAer5eGVCipG8hJHN X-Received: by 2002:a17:902:7402:: with SMTP id g2-v6mr6258014pll.321.1535970274122; Mon, 03 Sep 2018 03:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535970274; cv=none; d=google.com; s=arc-20160816; b=oOqYHcVZjzH2QtDHtnfNVPoBiNjeklKWQaOn/H7KmoMVuh4mEc35328ydMsgudGJm8 QEjSHxqgJ3UtV9TNAKk5u8QndAkuVh9ArR5MT98xgp/89p4PTE63hHtCq/lL/aAAJVGD p19IoYms4T8PmDxsHZAwzU/JfAexGokPfOAR0DdqJRuXaOmaCB8AAfKlVKSdIM8+ykod 5tx92QjoT3+TwfHVT6ox5OpvDiQHCZTzoTu+xgUuFx26DxMO3iGRF0/7FpVX2paHBZmn Ols31ObvQuGlQbfdr0nG6B2wNeDbA4RtFyj4eo2bJGdk8rPrAWCSof+FLcA0t6hhEFBN PtJw== 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=QURNkdS4bZT7qfBib0V2Twshc+CJsCrPF9wWB3Sr13c=; b=cv8TmNXUd2kmzkM/RrBWQsGal+j4aukwL/rgWYoVOxHpzyo/dOhKtUXkSYkPlIQGGy 1zxCh36DTjwQ3557RmsjfIO8aPus7S5emtJsPBVaxye6z/zsAUePcRVSE4awfjoGdxm/ 0req05/j/gMxn4YEGZFuD/LHsP8vPsZkcEGd4guF+oBGH85Gw6SQsjG1fdxGKah5CM2/ uOwt+ipzBHBon9MQBM5V807ocnjK2GwV45LhWYR05ehynv/QBs4Bc9bnZIga7e1YvcEq LtkIRGfce8wVdjiIh6HMb2s5ORZ54cipvKe4DjfaFbCZc8LoKfSzHqIALc0UrIDyPzGs O9fw== 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 7-v6si16981914pgw.207.2018.09.03.03.24.19; Mon, 03 Sep 2018 03:24:34 -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 S1727818AbeICOmj (ORCPT + 99 others); Mon, 3 Sep 2018 10:42:39 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:51520 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727284AbeICOmi (ORCPT ); Mon, 3 Sep 2018 10:42:38 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A88945D1119B7; Mon, 3 Sep 2018 18:23:04 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Mon, 3 Sep 2018 18:22:57 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 03/11] net: hns3: Fix error of checking used vlan id Date: Mon, 3 Sep 2018 11:21:48 +0100 Message-ID: <20180903102156.18676-4-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180903102156.18676-1-salil.mehta@huawei.com> References: <20180903102156.18676-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen PF uses hdev->vlan_table to manage the port vlan table. In function hclge_set_vlan_filter_hw(), it checks whether a vlan id has been used, by foreach all the vport bits. It should use macro HCLGE_VPORT_NUM, not VLAN_N_VID as the foreach condition. Fixes: 6c251711b37f ("net: hns3: Disable vf vlan filter when vf vlan table is full") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8f1339a..3cf8b80 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4769,7 +4769,7 @@ static int hclge_set_vlan_filter_hw(struct hclge_dev *hdev, __be16 proto, return -EINVAL; } - for_each_set_bit(vport_idx, hdev->vlan_table[vlan_id], VLAN_N_VID) + for_each_set_bit(vport_idx, hdev->vlan_table[vlan_id], HCLGE_VPORT_NUM) vport_num++; if ((is_kill && vport_num == 0) || (!is_kill && vport_num == 1)) -- 2.7.4