Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp499703pxb; Wed, 15 Sep 2021 06:58:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMC6nG8ZFqRBs3MOsTKnfngQAFR76cVPeZwzqLCPwG4nuhinizxxiDPEn7Xs7B+aE8glGG X-Received: by 2002:a05:6402:1ca4:: with SMTP id cz4mr127784edb.205.1631714288917; Wed, 15 Sep 2021 06:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631714288; cv=none; d=google.com; s=arc-20160816; b=ADtG+jOfAuqg5/JkL7KP/6N3ST4qEUpoqOmLOR79/YEoIeu7R0/U765hci1vTP+In8 s3KShypb0ZrAZOtli2138Cs58LIz1NHI/o8o2UX9o977AfVLc5+kbcYctCKPhRdwnv6h DSiTEyk1Me/aBdjw0+9vkhyoCGzdv/g0tO6wkFC19FSCLA/Dt7BfPxPnwbxIssmbnaD6 Ubm0MXcRVy/IUTLvtCJ1YLTX4pLf/d3rMpEftMVwi/JHung50GXC4+9VwyKeUp60tWwN R+Va2CexnjXnhDImnJ4rhHNYA9DJHbttS4p4P6VhU9rn/e18GlVe4Z5J6ZzxDrlNkCGp N64g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fPNLGXVdQVvzLEN0BwrpKtbhIYOdjmPk5ny6NciX9DI=; b=Zq9YX+6q2QQcqe+FhhDwpfepA2B2UgltYlSP848Vgap8Hwoe+IzirJraGZDZM0b8Hc g5CqvWcF6niNouX58h5tcsCvQmKv1D2GXu5dneliljj6TtDmHTfa7I7eW9zmUvS3XNEK AXNn8EDghUUalIhkCfGqmU/P5YtJ2xUgHF9xxTtId+ucmLU6Z0GE8llFKxwCGRsj8qsg sC3of6HqcUarOD5e3OdFWYscYGO6lh7CvCjNAfI/N8ETiqK88wXuki9yovoA5D6VvA2l xkm8xrMapoAwhMr/YoNOaNL4BU8JaCGlXeHQy7OZCPp9boG127qTp6Ht0yiaPITszRB+ 8UmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs6si109068ejc.12.2021.09.15.06.57.44; Wed, 15 Sep 2021 06:58:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237693AbhION5m (ORCPT + 99 others); Wed, 15 Sep 2021 09:57:42 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:16214 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234729AbhION5i (ORCPT ); Wed, 15 Sep 2021 09:57:38 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4H8hYZ3sDFz1DGv5; Wed, 15 Sep 2021 21:55:14 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 15 Sep 2021 21:56:15 +0800 Received: from localhost.localdomain (10.67.165.24) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 15 Sep 2021 21:56:14 +0800 From: Guangbin Huang To: , CC: , , , Subject: [PATCH net 2/6] net: hns3: fix inconsistent vf id print Date: Wed, 15 Sep 2021 21:52:07 +0800 Message-ID: <20210915135211.9129-3-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210915135211.9129-1-huangguangbin2@huawei.com> References: <20210915135211.9129-1-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen The vf id from ethtool is added 1 before configured to driver. So it's necessary to minus 1 when printing it, in order to keep consistent with user's configuration. Fixes: dd74f815dd41 ("net: hns3: Add support for rule add/delete for flow director") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 36c8741445e8..c0f25ea043b0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -6642,10 +6642,13 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie, u8 vf = ethtool_get_flow_spec_ring_vf(ring_cookie); u16 tqps; + /* To keep consistent with user's configuration, minus 1 when + * printing 'vf', because vf id from ethtool is added 1 for vf. + */ if (vf > hdev->num_req_vfs) { dev_err(&hdev->pdev->dev, - "Error: vf id (%u) > max vf num (%u)\n", - vf, hdev->num_req_vfs); + "Error: vf id (%u) should be less than %u\n", + vf - 1, hdev->num_req_vfs); return -EINVAL; } -- 2.33.0