From: Guangbin Huang <huangguangbin2@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>
Cc: <edumazet@google.com>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<huangguangbin2@huawei.com>, <shenjian15@huawei.com>,
<lanhao@huawei.com>
Subject: [PATCH net-next 4/4] net: hns3: delete unnecessary vf value judgement when get vport id
Date: Tue, 27 Sep 2022 19:12:05 +0800 [thread overview]
Message-ID: <20220927111205.18060-5-huangguangbin2@huawei.com> (raw)
In-Reply-To: <20220927111205.18060-1-huangguangbin2@huawei.com>
The hdev->vport->vport_id is equal to hdev->vport[0].vport_id, so
delete unnecessary vf value judgement.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 6962a9d69cf8..b566c0d782ad 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -6487,8 +6487,6 @@ static bool hclge_is_cls_flower_active(struct hnae3_handle *handle)
static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
u16 *vport_id, u8 *action, u16 *queue_id)
{
- struct hclge_vport *vport = hdev->vport;
-
if (ring_cookie == RX_CLS_FLOW_DISC) {
*action = HCLGE_FD_ACTION_DROP_PACKET;
} else {
@@ -6506,7 +6504,7 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
return -EINVAL;
}
- *vport_id = vf ? hdev->vport[vf].vport_id : vport->vport_id;
+ *vport_id = hdev->vport[vf].vport_id;
tqps = hdev->vport[vf].nic.kinfo.num_tqps;
if (ring >= tqps) {
--
2.33.0
prev parent reply other threads:[~2022-09-27 11:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 11:12 [PATCH net-next 0/4] net: hns3: cleanup and optimization Guangbin Huang
2022-09-27 11:12 ` [PATCH net-next 1/4] net: hns3: refine the tcam key convert handle Guangbin Huang
2022-09-28 10:28 ` Leon Romanovsky
2022-11-15 14:12 ` Hao Lan
2022-09-27 11:12 ` [PATCH net-next 2/4] net: hns3: fix hns3 driver header file not self-contained issue Guangbin Huang
2022-09-27 11:12 ` [PATCH net-next 3/4] net: hns3: replace magic numbers with macro for IPv4/v6 Guangbin Huang
2022-09-28 10:34 ` Leon Romanovsky
2022-09-27 11:12 ` Guangbin Huang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220927111205.18060-5-huangguangbin2@huawei.com \
--to=huangguangbin2@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lanhao@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenjian15@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).