From patchwork Wed Mar 6 09:20:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 138010 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 55DD243C58; Wed, 6 Mar 2024 10:25:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D49A40275; Wed, 6 Mar 2024 10:25:14 +0100 (CET) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 1E79440156 for ; Wed, 6 Mar 2024 10:25:11 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4TqRmR5Sv4z1h1JW; Wed, 6 Mar 2024 17:22:47 +0800 (CST) Received: from kwepemd100004.china.huawei.com (unknown [7.221.188.31]) by mail.maildlp.com (Postfix) with ESMTPS id A113D18002F; Wed, 6 Mar 2024 17:25:08 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Wed, 6 Mar 2024 17:25:07 +0800 From: Jie Hai To: , Yisen Zhuang , "Wei Hu (Xavier)" , Hao Chen , Ferruh Yigit , Chunsong Feng , "Min Hu (Connor)" CC: , , , Subject: [PATCH] net/hns3: fix user priority 4-7 didn't enable PFC Date: Wed, 6 Mar 2024 17:20:47 +0800 Message-ID: <20240306092047.492864-1-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd100004.china.huawei.com (7.221.188.31) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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);