From patchwork Fri Jun 24 08:59:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 113424 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 CC646A0032; Fri, 24 Jun 2022 11:00:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F150F4280E; Fri, 24 Jun 2022 11:00:26 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 84FF240E2D; Fri, 24 Jun 2022 11:00:25 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LTrbF1zKZzSgw3; Fri, 24 Jun 2022 16:56:57 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 24 Jun 2022 17:00:22 +0800 From: Dongdong Liu To: , , , CC: , Huisong Li , Dongdong Liu , Yisen Zhuang Subject: [PATCH 1/6] net/hns3: cancel heartbeat alarm when VF reset Date: Fri, 24 Jun 2022 16:59:46 +0800 Message-ID: <20220624085951.3177-2-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220624085951.3177-1-liudongdong3@huawei.com> References: <20220624085951.3177-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected 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 From: Huisong Li The purpose of the heartbeat alarm is to keep alive for VF. The mailbox channel is disabled when VF is reset, and the heartbeat mailbox message will fail to send. If the reset is not complete, the error information about the heartbeat sending failure will be printed continuously. In fact, VF does set alive when VF restore its configuration. So the heartbeat alarm can be canceled to prepare to start reset and start the alarm when start service. Signed-off-by: Huisong Li --- drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 6c8940fde5..2ac712ec77 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1977,6 +1977,8 @@ hns3vf_stop_service(struct hns3_adapter *hns) } else hw->reset.mbuf_deferred_free = false; + rte_eal_alarm_cancel(hns3vf_keep_alive_handler, eth_dev); + /* * It is cumbersome for hardware to pick-and-choose entries for deletion * from table space. Hence, for function reset software intervention is @@ -1998,6 +2000,10 @@ hns3vf_start_service(struct hns3_adapter *hns) eth_dev = &rte_eth_devices[hw->data->port_id]; hns3_set_rxtx_function(eth_dev); hns3_mp_req_start_rxtx(eth_dev); + + rte_eal_alarm_set(HNS3VF_KEEP_ALIVE_INTERVAL, hns3vf_keep_alive_handler, + eth_dev); + if (hw->adapter_state == HNS3_NIC_STARTED) { hns3vf_start_poll_job(eth_dev); From patchwork Fri Jun 24 08:59:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 113425 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 873BEA0032; Fri, 24 Jun 2022 11:00:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32EC142847; Fri, 24 Jun 2022 11:00:28 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 9F1F940E2D; Fri, 24 Jun 2022 11:00:26 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LTrbH2lXyzSgxB; Fri, 24 Jun 2022 16:56:59 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 24 Jun 2022 17:00:24 +0800 From: Dongdong Liu To: , , , CC: , Huisong Li , Dongdong Liu , Yisen Zhuang , "Min Hu (Connor)" Subject: [PATCH 2/6] net/hns3: fix received unknown event print when PTP enable Date: Fri, 24 Jun 2022 16:59:47 +0800 Message-ID: <20220624085951.3177-3-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220624085951.3177-1-liudongdong3@huawei.com> References: <20220624085951.3177-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected 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 From: Huisong Li PMD driver will receive a PTP interrupt when receive a PTP packet. But driver doesn't distinguish it. As a result, many unknown events are printed when many PTP packets are received on the link. The PTP interrupt is normal, so this patch doesn't log and ignores it. Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 4f507efa35..96fde7550f 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -317,7 +317,7 @@ hns3_interrupt_handler(void *param) hns3_schedule_reset(hns); } else if (event_cause == HNS3_VECTOR0_EVENT_MBX) { hns3_dev_handle_mbx_msg(hw); - } else { + } else if (event_cause != HNS3_VECTOR0_EVENT_PTP) { hns3_warn(hw, "received unknown event: vector0_int_stat:0x%x " "ras_int_stat:0x%x cmdq_int_stat:0x%x", vector0_int, ras_int, cmdq_int); From patchwork Fri Jun 24 08:59:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 113426 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 A5B77A0032; Fri, 24 Jun 2022 11:00:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 431F042823; Fri, 24 Jun 2022 11:00:31 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 27A1542820; Fri, 24 Jun 2022 11:00:29 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LTrfc1GhdzDsTX; Fri, 24 Jun 2022 16:59:52 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 24 Jun 2022 17:00:27 +0800 From: Dongdong Liu To: , , , CC: , Huisong Li , Dongdong Liu , Yisen Zhuang Subject: [PATCH 3/6] net/hns3: fix statistic lock Date: Fri, 24 Jun 2022 16:59:48 +0800 Message-ID: <20220624085951.3177-4-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220624085951.3177-1-liudongdong3@huawei.com> References: <20220624085951.3177-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected 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 From: Huisong Li The stats_lock is used to protect statistics update in stats APIs and periodic task, but current code only protect queue related statistics. Fixes: 1bb6e9073b82 ("net/hns3: fix MAC and queues hw statistics reversion") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_stats.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 07fad03485..1b0464f3f7 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -629,6 +629,7 @@ hns3_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *rte_stats) uint16_t i; int ret; + rte_spinlock_lock(&hw->stats_lock); /* Update imissed stats */ ret = hns3_update_imissed_stats(hw, false); if (ret) { @@ -644,10 +645,7 @@ hns3_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *rte_stats) if (rxq == NULL) continue; - rte_spinlock_lock(&hw->stats_lock); hns3_rcb_rx_ring_stats_get(rxq, stats); - rte_spinlock_unlock(&hw->stats_lock); - rte_stats->ierrors += rxq->err_stats.l2_errors + rxq->err_stats.pkt_len_errors; rte_stats->ibytes += rxq->basic_stats.bytes; @@ -659,9 +657,7 @@ hns3_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *rte_stats) if (txq == NULL) continue; - rte_spinlock_lock(&hw->stats_lock); hns3_rcb_tx_ring_stats_get(txq, stats); - rte_spinlock_unlock(&hw->stats_lock); rte_stats->obytes += txq->basic_stats.bytes; } @@ -683,7 +679,10 @@ hns3_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *rte_stats) rte_stats->opackets = stats->rcb_tx_ring_pktnum_rcd - rte_stats->oerrors; rte_stats->rx_nombuf = eth_dev->data->rx_mbuf_alloc_failed; + out: + rte_spinlock_unlock(&hw->stats_lock); + return ret; } @@ -697,6 +696,7 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) uint16_t i; int ret; + rte_spinlock_lock(&hw->stats_lock); /* * Note: Reading hardware statistics of imissed registers will * clear them. @@ -732,7 +732,6 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) if (rxq == NULL) continue; - rte_spinlock_lock(&hw->stats_lock); memset(&rxq->basic_stats, 0, sizeof(struct hns3_rx_basic_stats)); @@ -740,7 +739,6 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) (void)hns3_read_dev(rxq, HNS3_RING_RX_PKTNUM_RECORD_REG); rxq->err_stats.pkt_len_errors = 0; rxq->err_stats.l2_errors = 0; - rte_spinlock_unlock(&hw->stats_lock); } /* Clear all the stats of a txq in a loop to keep them synchronized */ @@ -749,19 +747,18 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) if (txq == NULL) continue; - rte_spinlock_lock(&hw->stats_lock); memset(&txq->basic_stats, 0, sizeof(struct hns3_tx_basic_stats)); /* This register is read-clear */ (void)hns3_read_dev(txq, HNS3_RING_TX_PKTNUM_RECORD_REG); - rte_spinlock_unlock(&hw->stats_lock); } - rte_spinlock_lock(&hw->stats_lock); hns3_tqp_stats_clear(hw); - rte_spinlock_unlock(&hw->stats_lock); + out: + rte_spinlock_unlock(&hw->stats_lock); + return ret; } @@ -1082,11 +1079,11 @@ hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, count++; } } - rte_spinlock_unlock(&hw->stats_lock); ret = hns3_update_imissed_stats(hw, false); if (ret) { hns3_err(hw, "update imissed stats failed, ret = %d", ret); + rte_spinlock_unlock(&hw->stats_lock); return ret; } @@ -1115,7 +1112,6 @@ hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, } } - rte_spinlock_lock(&hw->stats_lock); hns3_tqp_dfx_stats_get(dev, xstats, &count); hns3_queue_stats_get(dev, xstats, &count); rte_spinlock_unlock(&hw->stats_lock); From patchwork Fri Jun 24 08:59:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 113427 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 35B3DA0093; Fri, 24 Jun 2022 11:00:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94E72427F1; Fri, 24 Jun 2022 11:00:33 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 17CE940A89; Fri, 24 Jun 2022 11:00:31 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LTrff2WVPzDsTR; Fri, 24 Jun 2022 16:59:54 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 24 Jun 2022 17:00:29 +0800 From: Dongdong Liu To: , , , CC: , Chengwen Feng , Dongdong Liu , Yisen Zhuang , Chengchang Tang , "Wei Hu (Xavier)" Subject: [PATCH 4/6] net/hns3: fix nb-desc not verified when using SVE Date: Fri, 24 Jun 2022 16:59:49 +0800 Message-ID: <20220624085951.3177-5-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220624085951.3177-1-liudongdong3@huawei.com> References: <20220624085951.3177-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected 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 From: Chengwen Feng The SVE algorithm and NEON algorithm have the same requirements for nb-desc, but the nb-desc is verified only when using NEON. This patch fixes it. Fixes: fa29fe45a7b4 ("net/hns3: support queue start and stop") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 0c91e4721e..b48da82b64 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1754,7 +1754,8 @@ hns3_rxq_conf_runtime_check(struct hns3_hw *hw, uint16_t buf_size, return -EINVAL; } - if (pkt_burst == hns3_recv_pkts_vec) { + if (pkt_burst == hns3_recv_pkts_vec || + pkt_burst == hns3_recv_pkts_vec_sve) { min_vec_bds = HNS3_DEFAULT_RXQ_REARM_THRESH + HNS3_DEFAULT_RX_BURST; if (nb_desc < min_vec_bds || From patchwork Fri Jun 24 08:59:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 113428 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 C332AA0032; Fri, 24 Jun 2022 11:00:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD27F42B75; Fri, 24 Jun 2022 11:00:39 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 6798D40A89; Fri, 24 Jun 2022 11:00:38 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LTrfn4rdtzDsTR; Fri, 24 Jun 2022 17:00:01 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 24 Jun 2022 17:00:36 +0800 From: Dongdong Liu To: , , , CC: , Dongdong Liu , Yisen Zhuang Subject: [PATCH 5/6] net/hns3: make code more clean Date: Fri, 24 Jun 2022 16:59:50 +0800 Message-ID: <20220624085951.3177-6-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220624085951.3177-1-liudongdong3@huawei.com> References: <20220624085951.3177-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected 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 Delete unnecessary code and adjust code to make code more clean. Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_rxtx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index b48da82b64..4ae07fd91d 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1904,8 +1904,6 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc, rxq->pvid_sw_discard_en = false; rxq->ptype_en = hns3_dev_get_support(hw, RXD_ADV_LAYOUT) ? true : false; rxq->configured = true; - rxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET + - idx * HNS3_TQP_REG_SIZE); rxq->io_base = (void *)((char *)hw->io_base + hns3_get_tqp_reg_offset(idx)); rxq->io_head_reg = (volatile void *)((char *)rxq->io_base + @@ -2437,10 +2435,8 @@ hns3_recv_pkts_simple(void *rx_queue, nmb = hns3_rx_alloc_buffer(rxq); if (unlikely(nmb == NULL)) { - uint16_t port_id; - - port_id = rxq->port_id; - rte_eth_devices[port_id].data->rx_mbuf_alloc_failed++; + rte_eth_devices[rxq->port_id].data-> + rx_mbuf_alloc_failed++; break; } @@ -3865,7 +3861,7 @@ hns3_prep_pkt_proc(struct hns3_tx_queue *tx_queue, struct rte_mbuf *m) #endif if (hns3_pkt_is_tso(m)) { if (hns3_pkt_need_linearized(m, m->nb_segs, - tx_queue->max_non_tso_bd_num) || + tx_queue->max_non_tso_bd_num) || hns3_check_tso_pkt_valid(m)) { rte_errno = EINVAL; return -EINVAL; From patchwork Fri Jun 24 08:59:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 113429 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru 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 4737BA0032; Fri, 24 Jun 2022 11:01:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1C4F40A89; Fri, 24 Jun 2022 11:00:41 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 9119240A89; Fri, 24 Jun 2022 11:00:40 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LTrd13pCNz1KCDN; Fri, 24 Jun 2022 16:58:29 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 24 Jun 2022 17:00:38 +0800 From: Dongdong Liu To: , , , CC: , Dongdong Liu , Yisen Zhuang , Huisong Li , "Min Hu (Connor)" Subject: [PATCH 6/6] net/hns3: delete the unused code Date: Fri, 24 Jun 2022 16:59:51 +0800 Message-ID: <20220624085951.3177-7-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220624085951.3177-1-liudongdong3@huawei.com> References: <20220624085951.3177-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected 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 The RTE_HNS3_ONLY_1630_FPGA macro is not in use, so delete the code. Fixes: 2192c428f9a6 ("net/hns3: fix firmware compatibility configuration") Fixes: bdaf190f8235 ("net/hns3: support link speed autoneg for PF") Cc: stable@dpdk.org Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_cmd.c | 33 --------------------------------- drivers/net/hns3/hns3_ethdev.c | 11 ++--------- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index 5dc874fd7a..0883df1b62 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -631,39 +631,6 @@ hns3_firmware_compat_config(struct hns3_hw *hw, bool is_init) struct hns3_cmd_desc desc; uint32_t compat = 0; -#if defined(RTE_HNS3_ONLY_1630_FPGA) - /* If resv reg enabled phy driver of imp is not configured, driver - * will use temporary phy driver. - */ - struct rte_pci_device *pci_dev; - struct rte_eth_dev *eth_dev; - uint8_t revision; - int ret; - - eth_dev = &rte_eth_devices[hw->data->port_id]; - pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* Get PCI revision id */ - ret = rte_pci_read_config(pci_dev, &revision, HNS3_PCI_REVISION_ID_LEN, - HNS3_PCI_REVISION_ID); - if (ret != HNS3_PCI_REVISION_ID_LEN) { - PMD_INIT_LOG(ERR, "failed to read pci revision id, ret = %d", - ret); - return -EIO; - } - if (revision == PCI_REVISION_ID_HIP09_A) { - struct hns3_pf *pf = HNS3_DEV_HW_TO_PF(hw); - if (hns3_dev_get_support(hw, COPPER) == 0 || pf->is_tmp_phy) { - PMD_INIT_LOG(ERR, "***use temp phy driver in dpdk***"); - pf->is_tmp_phy = true; - hns3_set_bit(hw->capability, - HNS3_DEV_SUPPORT_COPPER_B, 1); - return 0; - } - - PMD_INIT_LOG(ERR, "***use phy driver in imp***"); - } -#endif - hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_FIRMWARE_COMPAT_CFG, false); req = (struct hns3_firmware_compat_cmd *)desc.data; diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 96fde7550f..5822d4fa71 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -4970,17 +4970,10 @@ hns3_set_port_link_speed(struct hns3_hw *hw, { int ret; - if (hw->mac.media_type == HNS3_MEDIA_TYPE_COPPER) { -#if defined(RTE_HNS3_ONLY_1630_FPGA) - struct hns3_pf *pf = HNS3_DEV_HW_TO_PF(hw); - if (pf->is_tmp_phy) - return 0; -#endif - + if (hw->mac.media_type == HNS3_MEDIA_TYPE_COPPER) ret = hns3_set_copper_port_link_speed(hw, cfg); - } else { + else ret = hns3_set_fiber_port_link_speed(hw, cfg); - } if (ret) { hns3_err(hw, "failed to set %s port link speed, ret = %d.",