From patchwork Mon Sep 3 10:21:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 145774 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2313195ljw; Mon, 3 Sep 2018 03:23:11 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb+1rRVxhoDh54PHc7aEC7Lz91ZGRtTVwRFqIxN2CvrfSDWPHp3hgVwnq+rGMWRNtDRU2Gs X-Received: by 2002:a62:7590:: with SMTP id q138-v6mr21166395pfc.148.1535970191181; Mon, 03 Sep 2018 03:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535970191; cv=none; d=google.com; s=arc-20160816; b=frVkYLMt2nwVb6W91hv8Ih4E5DEl37+aAJwTBCkFTSqzY6EnK+MzPO2AM7ecI7Z+xK 7V4QqIn8d8P8tn2IAsSyH5Xm6umbHSUR5ZQ9rEQcmqPjCVpJk5CuRrzw66zyNP+Jj1CC mLCPljJ6dNh8kPsCuDVQAQMwzT0uSZ1895gSPhDi9am+kctLSFdtxXSYuyUKIPV2p03N JEazj6/Q0DTIgsCcEW/T2lPsTBJz5VU5z90jNboTr0azQIRN7sw1jzfdFbg+ImsODRQa trWhKJjHE/azMRIFux3XAzMydpXWi/XibVUvKDwtQFyY5clk8hxkCvF9hd2lyxgtYYy+ RrDw== 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 o20-v6si17486475pgb.608.2018.09.03.03.23.10; Mon, 03 Sep 2018 03:23:11 -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 S1727823AbeICOmj (ORCPT + 32 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 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(-) -- 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 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))