From: Jie Hai <haijie1@huawei.com>
To: <dev@dpdk.org>, Yisen Zhuang <yisen.zhuang@huawei.com>,
"Wei Hu (Xavier)" <xavier.huwei@huawei.com>,
Hao Chen <chenh@yusur.tech>,
Ferruh Yigit <ferruh.yigit@intel.com>,
Chunsong Feng <fengchunsong@huawei.com>,
"Min Hu (Connor)" <humin29@huawei.com>
Cc: <lihuisong@huawei.com>, <fengchengwen@huawei.com>,
<liudongdong3@huawei.com>, <haijie1@huawei.com>
Subject: [PATCH] net/hns3: fix user priority 4-7 didn't enable PFC
Date: Wed, 6 Mar 2024 17:20:47 +0800 [thread overview]
Message-ID: <20240306092047.492864-1-haijie1@huawei.com> (raw)
Currently, hns3 driver only enable user priority 0-3 when the
user set TC number to 4 and enable PFC and ETS by dev_configure.
In this moment, the packet with user priority 4-7 cannot trigger
PFC frame. By the way, the nb_tcs from user can never be 0 because
of the ahead check in driver. So remove this redundant code.
Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
drivers/net/hns3/hns3_dcb.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c
index 2831d3dc6205..915e4eb76817 100644
--- a/drivers/net/hns3/hns3_dcb.c
+++ b/drivers/net/hns3/hns3_dcb.c
@@ -1499,7 +1499,6 @@ hns3_dcb_info_update(struct hns3_adapter *hns, uint8_t num_tc)
static int
hns3_dcb_hw_configure(struct hns3_adapter *hns)
{
- struct rte_eth_dcb_rx_conf *dcb_rx_conf;
struct hns3_pf *pf = &hns->pf;
struct hns3_hw *hw = &hns->hw;
enum hns3_fc_status fc_status = hw->current_fc_status;
@@ -1519,12 +1518,8 @@ hns3_dcb_hw_configure(struct hns3_adapter *hns)
}
if (hw->data->dev_conf.dcb_capability_en & RTE_ETH_DCB_PFC_SUPPORT) {
- dcb_rx_conf = &hw->data->dev_conf.rx_adv_conf.dcb_rx_conf;
- if (dcb_rx_conf->nb_tcs == 0)
- hw->dcb_info.pfc_en = 1; /* tc0 only */
- else
- hw->dcb_info.pfc_en =
- RTE_LEN2MASK((uint8_t)dcb_rx_conf->nb_tcs, uint8_t);
+ hw->dcb_info.pfc_en =
+ RTE_LEN2MASK((uint8_t)HNS3_MAX_USER_PRIO, uint8_t);
hw->dcb_info.hw_pfc_map =
hns3_dcb_undrop_tc_map(hw, hw->dcb_info.pfc_en);
--
2.30.0
next reply other threads:[~2024-03-06 9:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 9:20 Jie Hai [this message]
2024-03-08 20:31 ` Ferruh Yigit
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=20240306092047.492864-1-haijie1@huawei.com \
--to=haijie1@huawei.com \
--cc=chenh@yusur.tech \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=fengchunsong@huawei.com \
--cc=ferruh.yigit@intel.com \
--cc=humin29@huawei.com \
--cc=lihuisong@huawei.com \
--cc=liudongdong3@huawei.com \
--cc=xavier.huwei@huawei.com \
--cc=yisen.zhuang@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).