From patchwork Fri Apr 30 09:04:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 92472 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 E6E69A0546; Fri, 30 Apr 2021 11:04:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9765C4113B; Fri, 30 Apr 2021 11:04:07 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 838644013F for ; Fri, 30 Apr 2021 11:04:02 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FWmZL1Hk3z19MKH for ; Fri, 30 Apr 2021 17:01:30 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Fri, 30 Apr 2021 17:03:56 +0800 From: "Min Hu (Connor)" To: CC: Date: Fri, 30 Apr 2021 17:04:02 +0800 Message-ID: <1619773444-10074-2-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619773444-10074-1-git-send-email-humin29@huawei.com> References: <1619773444-10074-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 1/3] net/hns3: remove read when enabling TM QCN error event 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 Sender: "dev" From: Chengwen Feng According to the HW manual, the read operation is unnecessary when enabling TM QCN error event, so remove it. Fixes: f53a793bb7c2 ("net/hns3: add more hardware error types") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_intr.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c index b743b41..62e89a9 100644 --- a/drivers/net/hns3/hns3_intr.c +++ b/drivers/net/hns3/hns3_intr.c @@ -1782,14 +1782,7 @@ enable_tm_err_intr(struct hns3_adapter *hns, bool en) } /* configure TM QCN hw errors */ - hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_TM_QCN_MEM_INT_CFG, true); - ret = hns3_cmd_send(hw, &desc, 1); - if (ret) { - hns3_err(hw, "fail to read TM QCN CFG status, ret = %d\n", ret); - return ret; - } - - hns3_cmd_reuse_desc(&desc, false); + hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_TM_QCN_MEM_INT_CFG, false); if (en) desc.data[1] = rte_cpu_to_le_32(HNS3_TM_QCN_MEM_ERR_INT_EN); From patchwork Fri Apr 30 09:04:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 92469 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 B5EEFA0546; Fri, 30 Apr 2021 11:04:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C97340693; Fri, 30 Apr 2021 11:04:02 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id A68AA4014F for ; Fri, 30 Apr 2021 11:04:01 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FWmZL0zCsz19MBq for ; Fri, 30 Apr 2021 17:01:30 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Fri, 30 Apr 2021 17:03:57 +0800 From: "Min Hu (Connor)" To: CC: Date: Fri, 30 Apr 2021 17:04:03 +0800 Message-ID: <1619773444-10074-3-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619773444-10074-1-git-send-email-humin29@huawei.com> References: <1619773444-10074-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 2/3] net/hns3: remove unused code of VMDq 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 Sender: "dev" From: Chengwen Feng VMDq is not supported yet, so remove the unused code. Fixes: d51867db65c1 ("net/hns3: add initialization") Fixes: 1265b5372d9d ("net/hns3: add some definitions for data structure and macro") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_cmd.h | 2 -- drivers/net/hns3/hns3_ethdev.c | 4 ---- drivers/net/hns3/hns3_ethdev.h | 1 - drivers/net/hns3/hns3_ethdev_vf.c | 2 -- 4 files changed, 9 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h index 944e3d6..eafa365 100644 --- a/drivers/net/hns3/hns3_cmd.h +++ b/drivers/net/hns3/hns3_cmd.h @@ -457,8 +457,6 @@ struct hns3_umv_spc_alc_cmd { #define HNS3_CFG_RD_LEN_BYTES 16 #define HNS3_CFG_RD_LEN_UNIT 4 -#define HNS3_CFG_VMDQ_S 0 -#define HNS3_CFG_VMDQ_M GENMASK(7, 0) #define HNS3_CFG_TC_NUM_S 8 #define HNS3_CFG_TC_NUM_M GENMASK(15, 8) #define HNS3_CFG_TQP_DESC_N_S 16 diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index b665554..b74f068 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2791,8 +2791,6 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info) .offloads = 0, }; - info->vmdq_queue_num = 0; - info->reta_size = hw->rss_ind_tbl_size; info->hash_key_size = HNS3_RSS_KEY_SIZE; info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT; @@ -3075,8 +3073,6 @@ hns3_parse_cfg(struct hns3_cfg *cfg, struct hns3_cmd_desc *desc) req = (struct hns3_cfg_param_cmd *)desc[0].data; /* get the configuration */ - cfg->vmdq_vport_num = hns3_get_field(rte_le_to_cpu_32(req->param[0]), - HNS3_CFG_VMDQ_M, HNS3_CFG_VMDQ_S); cfg->tc_num = hns3_get_field(rte_le_to_cpu_32(req->param[0]), HNS3_CFG_TC_NUM_M, HNS3_CFG_TC_NUM_S); cfg->tqp_desc_num = hns3_get_field(rte_le_to_cpu_32(req->param[0]), diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index 133b484..1714eba 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -155,7 +155,6 @@ struct hns3_tc_queue_info { }; struct hns3_cfg { - uint8_t vmdq_vport_num; uint8_t tc_num; uint16_t tqp_desc_num; uint16_t rx_buf_len; diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 9a85e97..6aa8a9b 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1022,8 +1022,6 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info) .offloads = 0, }; - info->vmdq_queue_num = 0; - info->reta_size = hw->rss_ind_tbl_size; info->hash_key_size = HNS3_RSS_KEY_SIZE; info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT; From patchwork Fri Apr 30 09:04:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 92471 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 89979A0546; Fri, 30 Apr 2021 11:04:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A58B41129; Fri, 30 Apr 2021 11:04:06 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id A42334013F for ; Fri, 30 Apr 2021 11:04:01 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FWmZL0n11z19M1r for ; Fri, 30 Apr 2021 17:01:30 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Fri, 30 Apr 2021 17:03:57 +0800 From: "Min Hu (Connor)" To: CC: Date: Fri, 30 Apr 2021 17:04:04 +0800 Message-ID: <1619773444-10074-4-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619773444-10074-1-git-send-email-humin29@huawei.com> References: <1619773444-10074-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 3/3] net/hns3: fix format u64 variable readability 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 Sender: "dev" From: Chengwen Feng Some logs format u64 variables, mostly using hexadecimal which was not readable. This patch formats most u64 variables in decimal, and add '0x' prefix to the ones that are not adjusted. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Fixes: 2790c6464725 ("net/hns3: support device reset") Fixes: 8839c5e202f3 ("net/hns3: support device stats") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_flow.c | 2 +- drivers/net/hns3/hns3_intr.c | 20 ++++++++++---------- drivers/net/hns3/hns3_stats.c | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 49d6568..65c7f6e 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1556,7 +1556,7 @@ hns3_config_rss_filter(struct rte_eth_dev *dev, hw->rss_info.conf.types; if (flow_types != rss_flow_conf.types) hns3_warn(hw, "modified RSS types based on hardware support, " - "requested:%" PRIx64 " configured:%" PRIx64, + "requested:0x%" PRIx64 " configured:0x%" PRIx64, rss_flow_conf.types, flow_types); /* Update the useful flow types */ rss_flow_conf.types = flow_types; diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c index 62e89a9..905c6d9 100644 --- a/drivers/net/hns3/hns3_intr.c +++ b/drivers/net/hns3/hns3_intr.c @@ -2570,7 +2570,7 @@ hns3_clear_reset_level(struct hns3_hw *hw, uint64_t *levels) if (merge_cnt != hw->reset.stats.merge_cnt) hns3_warn(hw, "No need to do low-level reset after %s reset. " - "merge cnt: %" PRIx64 " total merge cnt: %" PRIx64, + "merge cnt: %" PRIu64 " total merge cnt: %" PRIu64, reset_string[hw->reset.level], hw->reset.stats.merge_cnt - merge_cnt, hw->reset.stats.merge_cnt); @@ -2590,7 +2590,7 @@ hns3_reset_err_handle(struct hns3_adapter *hns) hw->reset.attempts = 0; hw->reset.stats.fail_cnt++; hns3_warn(hw, "%s reset fail because new Reset is pending " - "attempts:%" PRIx64, + "attempts:%" PRIu64, reset_string[hw->reset.level], hw->reset.stats.fail_cnt); hw->reset.level = HNS3_NONE_RESET; @@ -2617,10 +2617,10 @@ hns3_reset_err_handle(struct hns3_adapter *hns) reset_fail: hw->reset.attempts = 0; hw->reset.stats.fail_cnt++; - hns3_warn(hw, "%s reset fail fail_cnt:%" PRIx64 " success_cnt:%" PRIx64 - " global_cnt:%" PRIx64 " imp_cnt:%" PRIx64 - " request_cnt:%" PRIx64 " exec_cnt:%" PRIx64 - " merge_cnt:%" PRIx64 "adapter_state:%d", + hns3_warn(hw, "%s reset fail fail_cnt:%" PRIu64 " success_cnt:%" PRIu64 + " global_cnt:%" PRIu64 " imp_cnt:%" PRIu64 + " request_cnt:%" PRIu64 " exec_cnt:%" PRIu64 + " merge_cnt:%" PRIu64 "adapter_state:%d", reset_string[hw->reset.level], hw->reset.stats.fail_cnt, hw->reset.stats.success_cnt, hw->reset.stats.global_cnt, hw->reset.stats.imp_cnt, hw->reset.stats.request_cnt, @@ -2736,10 +2736,10 @@ hns3_reset_post(struct hns3_adapter *hns) rte_spinlock_unlock(&hw->lock); hns3_clock_gettime(&tv); timersub(&tv, &hw->reset.start_time, &tv_delta); - hns3_warn(hw, "%s reset done fail_cnt:%" PRIx64 - " success_cnt:%" PRIx64 " global_cnt:%" PRIx64 - " imp_cnt:%" PRIx64 " request_cnt:%" PRIx64 - " exec_cnt:%" PRIx64 " merge_cnt:%" PRIx64, + hns3_warn(hw, "%s reset done fail_cnt:%" PRIu64 + " success_cnt:%" PRIu64 " global_cnt:%" PRIu64 + " imp_cnt:%" PRIu64 " request_cnt:%" PRIu64 + " exec_cnt:%" PRIu64 " merge_cnt:%" PRIu64, reset_string[hw->reset.level], hw->reset.stats.fail_cnt, hw->reset.stats.success_cnt, hw->reset.stats.global_cnt, hw->reset.stats.imp_cnt, diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 3afef4a..e09dc0d 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -1325,7 +1325,7 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, len = cnt_stats * sizeof(struct rte_eth_xstat); values_copy = rte_zmalloc("hns3_xstats_values", len, 0); if (values_copy == NULL) { - hns3_err(hw, "Failed to allocate %" PRIx64 " bytes needed " + hns3_err(hw, "Failed to allocate 0x%" PRIx64 " bytes needed " "to store statistics values", len); return -ENOMEM; } @@ -1347,7 +1347,7 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, for (i = 0; i < size; i++) { if (ids[i] >= cnt_stats) { - hns3_err(hw, "ids[%u] (%" PRIx64 ") is invalid, " + hns3_err(hw, "ids[%u] (%" PRIu64 ") is invalid, " "should < %u", i, ids[i], cnt_stats); rte_free(values_copy); return -EINVAL; @@ -1406,7 +1406,7 @@ hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, len = cnt_stats * sizeof(struct rte_eth_xstat_name); names_copy = rte_zmalloc("hns3_xstats_names", len, 0); if (names_copy == NULL) { - hns3_err(hw, "Failed to allocate %" PRIx64 " bytes needed " + hns3_err(hw, "Failed to allocate 0x%" PRIx64 " bytes needed " "to store statistics names", len); return -ENOMEM; } @@ -1415,7 +1415,7 @@ hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, for (i = 0; i < size; i++) { if (ids[i] >= cnt_stats) { - hns3_err(hw, "ids[%u] (%" PRIx64 ") is invalid, " + hns3_err(hw, "ids[%u] (%" PRIu64 ") is invalid, " "should < %u", i, ids[i], cnt_stats); rte_free(names_copy); return -EINVAL;