From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD25F41DEA; Sun, 5 Mar 2023 16:58:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70C6440EF0; Sun, 5 Mar 2023 16:58:03 +0100 (CET) Received: from forward501c.mail.yandex.net (forward501c.mail.yandex.net [178.154.239.209]) by mails.dpdk.org (Postfix) with ESMTP id 4266F40EE5 for ; Sun, 5 Mar 2023 16:58:02 +0100 (CET) Received: from sas8-e2d6e97d76c7.qloud-c.yandex.net (sas8-e2d6e97d76c7.qloud-c.yandex.net [IPv6:2a02:6b8:c1b:2904:0:640:e2d6:e97d]) by forward501c.mail.yandex.net (Yandex) with ESMTP id 8D8B95E9ED; Sun, 5 Mar 2023 18:58:01 +0300 (MSK) Received: by sas8-e2d6e97d76c7.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id wvbXKSSheCg1-QWtYrdNv; Sun, 05 Mar 2023 18:58:00 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1678031880; bh=S3IhEUbSL/7RTZl9teRg1QQo0uYymNZc2AQ3uJ2rAGk=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=g4coMPzWuP4G0w8h1iFduVcL9FhR5B9jAPgUBqXt2qfzNVnVQnn3d78YLdL1L9Kpp x2Os+tgFvPqtE5VFGOjZ4Qod3Faz8w3HyjvfNa43bPIi4kJhWBw2h9Cmg4/zsMrtDp NEt7F6L2q7CiglcZYcpRIy2p3p/9EKJFaKS1avgI= Authentication-Results: sas8-e2d6e97d76c7.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <1f0ccef2-7bd5-9e8b-a53c-a4d3997c2022@yandex.ru> Date: Sun, 5 Mar 2023 15:57:58 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 4/5] net/bnxt: use fp ops setup function Content-Language: en-US To: fengchengwen , Konstantin Ananyev , "thomas@monjalon.net" , "ferruh.yigit@amd.com" , Ajit Khaparde , Somnath Kotur Cc: "dev@dpdk.org" References: <20230301030610.49468-1-fengchengwen@huawei.com> <20230301030610.49468-5-fengchengwen@huawei.com> <22657fed-e920-5df9-8b9b-5bd1f986ff57@huawei.com> From: Konstantin Ananyev In-Reply-To: <22657fed-e920-5df9-8b9b-5bd1f986ff57@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 03/03/2023 01:38, fengchengwen пишет: > On 2023/3/2 20:30, Konstantin Ananyev wrote: >> >>> Use rte_eth_fp_ops_setup() instead of directly manipulating >>> rte_eth_fp_ops variable. >>> >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Chengwen Feng >>> --- >>> drivers/net/bnxt/bnxt_cpr.c | 5 +---- >>> drivers/net/bnxt/bnxt_ethdev.c | 5 +---- >>> 2 files changed, 2 insertions(+), 8 deletions(-) >>> >>> diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c >>> index 3950840600..a3f33c24c3 100644 >>> --- a/drivers/net/bnxt/bnxt_cpr.c >>> +++ b/drivers/net/bnxt/bnxt_cpr.c >>> @@ -416,10 +416,7 @@ void bnxt_stop_rxtx(struct rte_eth_dev *eth_dev) >>> eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy; >>> eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy; >> >> I am not that familiar with bnxt driver, but shouldn't we set here >> other optional fp_ops (descripto_status, etc.) to some dummy values OR to null values? > > I checked the bnxt PMD code, the other fp_ops (rx_queue_count/rx_descriptor_status/tx_descriptor_status) > both add following logic at the beginning of function: > > rc = is_bnxt_in_error(bp); > if (rc) > return rc; > > So I think it okey to keep it. I still think it is much safer/cleaner to update all fp_ops in one go (use fp_ops_reset()) here. But as you believe it would work either way, I'll leave it to bnxt maintainers to decide. > >> >>> >>> - rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = >>> - eth_dev->rx_pkt_burst; >>> - rte_eth_fp_ops[eth_dev->data->port_id].tx_pkt_burst = >>> - eth_dev->tx_pkt_burst; >>> + rte_eth_fp_ops_setup(eth_dev); >>> rte_mb(); >>> >>> /* Allow time for threads to exit the real burst functions. */ >>> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c >>> index 4083a69d02..d6064ceea4 100644 >>> --- a/drivers/net/bnxt/bnxt_ethdev.c >>> +++ b/drivers/net/bnxt/bnxt_ethdev.c >>> @@ -4374,10 +4374,7 @@ static void bnxt_dev_recover(void *arg) >>> if (rc) >>> goto err_start; >>> >>> - rte_eth_fp_ops[bp->eth_dev->data->port_id].rx_pkt_burst = >>> - bp->eth_dev->rx_pkt_burst; >>> - rte_eth_fp_ops[bp->eth_dev->data->port_id].tx_pkt_burst = >>> - bp->eth_dev->tx_pkt_burst; >>> + rte_eth_fp_ops_setup(bp->eth_dev); >>> rte_mb(); >>> >>> PMD_DRV_LOG(INFO, "Port: %u Recovered from FW reset\n", >>> -- >>> 2.17.1 >> >> . >>