From patchwork Wed Jan 6 03:46:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 86009 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 (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6DEB5A09FF; Wed, 6 Jan 2021 04:47:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02CA81608BF; Wed, 6 Jan 2021 04:46:59 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id 95471160887 for ; Wed, 6 Jan 2021 04:46:52 +0100 (CET) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4D9Zyr0zcMz7QyS for ; Wed, 6 Jan 2021 11:45:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 6 Jan 2021 11:46:44 +0800 From: Lijun Ou To: CC: Date: Wed, 6 Jan 2021 11:46:27 +0800 Message-ID: <1609904792-63280-2-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609904792-63280-1-git-send-email-oulijun@huawei.com> References: <1607846585-2381-1-git-send-email-oulijun@huawei.com> <1609904792-63280-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 1/6] net/hns3: fix incorrect interception with filter director 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" The rte_fdir_conf structure has deprecated and users need to use the specified rule parameters of rte_flow structure when configure a flow rule. As a result, it is incorrectly used in the rte_flow API. Fixes: fcba820d9b9e ("net/hns3: support flow director") Cc: stable@dpdk.org Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_flow.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index ee6ec15..f303df4 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1208,11 +1208,6 @@ hns3_parse_fdir_filter(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "Fdir not supported in VF"); - if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_PERFECT) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_HANDLE, NULL, - "fdir_conf.mode isn't perfect"); - step_mngr.items = first_items; step_mngr.count = ARRAY_SIZE(first_items); for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { From patchwork Wed Jan 6 03:46:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 86005 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 (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 309DDA09FF; Wed, 6 Jan 2021 04:46:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9102C16088D; Wed, 6 Jan 2021 04:46:53 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id E44B4160887 for ; Wed, 6 Jan 2021 04:46:51 +0100 (CET) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4D9Zyr0XQzz7QyK for ; Wed, 6 Jan 2021 11:45:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 6 Jan 2021 11:46:45 +0800 From: Lijun Ou To: CC: Date: Wed, 6 Jan 2021 11:46:28 +0800 Message-ID: <1609904792-63280-3-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609904792-63280-1-git-send-email-oulijun@huawei.com> References: <1607846585-2381-1-git-send-email-oulijun@huawei.com> <1609904792-63280-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 2/6] net/hns3: fix xstats statistics with id and names 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: Huisong Li Currently, validity check for ids and values in the hns3_dev_xstats_get_by_id API is incorrect, which will cause a problem. Namely, if the ID range of the xstats stats item does not include the basic stats item, the app can not obtain the corresponding xstats statistics in hns3_dev_xstats_get_by_id. Similarly, the hns3_dev_xstats_get_names_by_id interface also has a problem. Although the input parameter verification code cannot be executed due to the implementation of the ethdev framework interface, the driver needs to ensure the correctness of the input parameters. Fixes: 8839c5e202f3 ("net/hns3: support device stats") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- V1->V2: -fix ids and values check -add hns3_dev_xstats_get_names_by_id check --- drivers/net/hns3/hns3_stats.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 91168ac..1597af3 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -933,9 +933,13 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, uint32_t i; int ret; - if (ids == NULL || size < cnt_stats) + if (ids == NULL && values == NULL) return cnt_stats; + if (ids == NULL) + if (size < cnt_stats) + return cnt_stats; + /* Update tqp stats by read register */ ret = hns3_update_tqp_stats(hw); if (ret) { @@ -957,6 +961,15 @@ hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, return -EINVAL; } + if (ids == NULL && values != NULL) { + for (i = 0; i < cnt_stats; i++) + memcpy(&values[i], &values_copy[i].value, + sizeof(values[i])); + + rte_free(values_copy); + return cnt_stats; + } + for (i = 0; i < size; i++) { if (ids[i] >= cnt_stats) { hns3_err(hw, "ids[%u] (%" PRIx64 ") is invalid, " @@ -1005,9 +1018,16 @@ hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, uint64_t len; uint32_t i; - if (ids == NULL || xstats_names == NULL) + if (xstats_names == NULL) return cnt_stats; + if (ids == NULL) { + if (size < cnt_stats) + return cnt_stats; + + return hns3_dev_xstats_get_names(dev, xstats_names, cnt_stats); + } + len = cnt_stats * sizeof(struct rte_eth_xstat_name); names_copy = rte_zmalloc("hns3_xstats_names", len, 0); if (names_copy == NULL) { From patchwork Wed Jan 6 03:46:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 86007 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 (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F0BEA09FF; Wed, 6 Jan 2021 04:47:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20AD216089E; Wed, 6 Jan 2021 04:46:56 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id EF8B616088D for ; Wed, 6 Jan 2021 04:46:51 +0100 (CET) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4D9Zyr0j7kz7QyP for ; Wed, 6 Jan 2021 11:45:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 6 Jan 2021 11:46:45 +0800 From: Lijun Ou To: CC: Date: Wed, 6 Jan 2021 11:46:29 +0800 Message-ID: <1609904792-63280-4-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609904792-63280-1-git-send-email-oulijun@huawei.com> References: <1607846585-2381-1-git-send-email-oulijun@huawei.com> <1609904792-63280-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 3/6] net/hns3: fix abnormal return value in xstats 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: Huisong Li The ethdev API has processed the failure to obtain xstats statistics. Therefore, driver should return an error code instead of 0 in 'hns3_dev_xstats_get' API. Fixes: 8839c5e202f3 ("net/hns3: support device stats") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 1597af3..42ec9b8 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -739,9 +739,9 @@ hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, if (!hns->is_vf) { /* Update Mac stats */ ret = hns3_query_update_mac_stats(dev); - if (ret) { + if (ret < 0) { hns3_err(hw, "Update Mac stats fail : %d", ret); - return 0; + return ret; } /* Get MAC stats from hw->hw_xstats.mac_stats struct */ From patchwork Wed Jan 6 03:46:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 86008 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 (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 75540A09FF; Wed, 6 Jan 2021 04:47:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A7A11608AA; Wed, 6 Jan 2021 04:46:57 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id F3C2216088E for ; Wed, 6 Jan 2021 04:46:51 +0100 (CET) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4D9Zyr0F3Sz7Qp5 for ; Wed, 6 Jan 2021 11:45:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 6 Jan 2021 11:46:46 +0800 From: Lijun Ou To: CC: Date: Wed, 6 Jan 2021 11:46:30 +0800 Message-ID: <1609904792-63280-5-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609904792-63280-1-git-send-email-oulijun@huawei.com> References: <1607846585-2381-1-git-send-email-oulijun@huawei.com> <1609904792-63280-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 4/6] net/hns3: fix Rx/Tx abnormal errors stats 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: Huisong Li Abnormal errors stats in Rx/Tx datapath are statistics items in driver, and displayed in xstats. They should be cleared by the rte_eth_xstats_reset api, instead of the rte_eth_stats_reset. Fixes: c4b7d6761d01 ("net/hns3: get Tx abnormal errors in xstats") Fixes: 521ab3e93361 ("net/hns3: add simple Rx path") Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_stats.c | 59 ++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 42ec9b8..62a712b 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -551,7 +551,6 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) struct hns3_hw *hw = &hns->hw; struct hns3_cmd_desc desc_reset; struct hns3_rx_queue *rxq; - struct hns3_tx_queue *txq; uint16_t i; int ret; @@ -581,29 +580,15 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) } } - /* Clear the Rx BD errors stats */ - for (i = 0; i != eth_dev->data->nb_rx_queues; ++i) { + /* + * Clear soft stats of rx error packet which will be dropped + * in driver. + */ + for (i = 0; i < eth_dev->data->nb_rx_queues; ++i) { rxq = eth_dev->data->rx_queues[i]; if (rxq) { rxq->pkt_len_errors = 0; rxq->l2_errors = 0; - rxq->l3_csum_errors = 0; - rxq->l4_csum_errors = 0; - rxq->ol3_csum_errors = 0; - rxq->ol4_csum_errors = 0; - } - } - - /* Clear the Tx errors stats */ - for (i = 0; i != eth_dev->data->nb_tx_queues; ++i) { - txq = eth_dev->data->tx_queues[i]; - if (txq) { - txq->over_length_pkt_cnt = 0; - txq->exceed_limit_bd_pkt_cnt = 0; - txq->exceed_limit_bd_reassem_fail = 0; - txq->unsupported_tunnel_pkt_cnt = 0; - txq->queue_full_cnt = 0; - txq->pkt_padding_fail_cnt = 0; } } @@ -1053,6 +1038,38 @@ hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, return size; } +static void +hns3_tqp_dfx_stats_clear(struct rte_eth_dev *dev) +{ + struct hns3_rx_queue *rxq; + struct hns3_tx_queue *txq; + int i; + + /* Clear Rx dfx stats */ + for (i = 0; i < dev->data->nb_rx_queues; ++i) { + rxq = dev->data->rx_queues[i]; + if (rxq) { + rxq->l3_csum_errors = 0; + rxq->l4_csum_errors = 0; + rxq->ol3_csum_errors = 0; + rxq->ol4_csum_errors = 0; + } + } + + /* Clear Tx dfx stats */ + for (i = 0; i < dev->data->nb_tx_queues; ++i) { + txq = dev->data->tx_queues[i]; + if (txq) { + txq->over_length_pkt_cnt = 0; + txq->exceed_limit_bd_pkt_cnt = 0; + txq->exceed_limit_bd_reassem_fail = 0; + txq->unsupported_tunnel_pkt_cnt = 0; + txq->queue_full_cnt = 0; + txq->pkt_padding_fail_cnt = 0; + } + } +} + int hns3_dev_xstats_reset(struct rte_eth_dev *dev) { @@ -1068,6 +1085,8 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev) /* Clear reset stats */ memset(&hns->hw.reset.stats, 0, sizeof(struct hns3_reset_stats)); + hns3_tqp_dfx_stats_clear(dev); + if (hns->is_vf) return 0; From patchwork Wed Jan 6 03:46:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 86010 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 (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CCAD2A09FF; Wed, 6 Jan 2021 04:47:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 335B61608C5; Wed, 6 Jan 2021 04:47:00 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id 06B32160887 for ; Wed, 6 Jan 2021 04:46:53 +0100 (CET) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4D9Zyr17jkz7QyV for ; Wed, 6 Jan 2021 11:45:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 6 Jan 2021 11:46:46 +0800 From: Lijun Ou To: CC: Date: Wed, 6 Jan 2021 11:46:31 +0800 Message-ID: <1609904792-63280-6-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609904792-63280-1-git-send-email-oulijun@huawei.com> References: <1607846585-2381-1-git-send-email-oulijun@huawei.com> <1609904792-63280-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 5/6] net/hns3: fix crash with multi-process 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: "Min Hu (Connor)" In current version, procedure of saving eth_dev in hns3 PMD init will be called more than twice, one for primary, the other for secondary. That will cause segmentation fault in Multi-process as eth_dev will be changed in secondary process, which is different from one in primary process. The initial problem was access to 'rte_eth_devices' global variable, which is wrong. But current approach can cause problem for the secondaries, moving 'eth_dev' to process private can work but before making things more complex. This patch deserted the procedure of saving eth_dev in hns3 PMD init. Instead, it creates an internal function that gets "struct hns3_hw" as parameter and it can be called internally without knowing 'eth_dev'and the .dev_ops can be wrapper to this. Fixes: 5e8d3de4ca36 ("net/hns3: fix FEC state query") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_ethdev.c | 16 ++++++++++------ drivers/net/hns3/hns3_ethdev.h | 2 -- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 7c34e38..90544fe 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5821,10 +5821,9 @@ get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state) } static int -hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa) +hns3_fec_get_internal(struct hns3_hw *hw, uint32_t *fec_capa) { #define QUERY_ACTIVE_SPEED 1 - struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct hns3_sfp_speed_cmd *resp; uint32_t tmp_fec_capa; uint8_t auto_state; @@ -5885,6 +5884,14 @@ hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa) } static int +hns3_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa) +{ + struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + return hns3_fec_get_internal(hw, fec_capa); +} + +static int hns3_set_fec_hw(struct hns3_hw *hw, uint32_t mode) { struct hns3_config_fec_cmd *req; @@ -6017,10 +6024,9 @@ hns3_query_dev_fec_info(struct hns3_hw *hw) { struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(hns); - struct rte_eth_dev *eth_dev = hns->eth_dev; int ret; - ret = hns3_fec_get(eth_dev, &pf->fec_mode); + ret = hns3_fec_get_internal(hw, &pf->fec_mode); if (ret) hns3_err(hw, "query device FEC info failed, ret = %d", ret); @@ -6106,8 +6112,6 @@ hns3_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); - hns->eth_dev = eth_dev; - eth_dev->process_private = (struct hns3_process_private *) rte_zmalloc_socket("hns3_filter_list", sizeof(struct hns3_process_private), diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index 8d6b8cd..31f78a1 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -743,8 +743,6 @@ struct hns3_adapter { struct hns3_vf vf; }; - struct rte_eth_dev *eth_dev; - bool rx_simple_allowed; bool rx_vec_allowed; bool tx_simple_allowed; From patchwork Wed Jan 6 03:46:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 86006 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 (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43B4FA09FF; Wed, 6 Jan 2021 04:47:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1C05160895; Wed, 6 Jan 2021 04:46:54 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id EB4C416088A for ; Wed, 6 Jan 2021 04:46:51 +0100 (CET) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4D9Zyr05NJz78pn for ; Wed, 6 Jan 2021 11:45:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 6 Jan 2021 11:46:46 +0800 From: Lijun Ou To: CC: Date: Wed, 6 Jan 2021 11:46:32 +0800 Message-ID: <1609904792-63280-7-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1609904792-63280-1-git-send-email-oulijun@huawei.com> References: <1607846585-2381-1-git-send-email-oulijun@huawei.com> <1609904792-63280-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 6/6] net/hns3: remove unnecessary memset 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" The hns3_cmd_desc has memset when setup and the memset for req is unnecessary. Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_rss.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index e2f0468..b5df374 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -633,16 +633,11 @@ hns3_set_rss_tc_mode(struct hns3_hw *hw) static void hns3_rss_tuple_uninit(struct hns3_hw *hw) { - struct hns3_rss_input_tuple_cmd *req; struct hns3_cmd_desc desc; int ret; hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INPUT_TUPLE, false); - req = (struct hns3_rss_input_tuple_cmd *)desc.data; - - memset(req, 0, sizeof(struct hns3_rss_tuple_cfg)); - ret = hns3_cmd_send(hw, &desc, 1); if (ret) { hns3_err(hw, "RSS uninit tuple failed %d", ret);