lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net-next 4/4] net: hns3: delete unnecessary vf value judgement when get vport id
Date
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
\
 
 \ /
  Last update: 2022-09-27 13:16    [W:0.062 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site