[v4,4/7] net/bnxt: use fp ops setup function

Message ID 20240905092504.10725-5-fengchengwen@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Ferruh Yigit
Headers
Series fix race-condition of proactive error handling mode |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

fengchengwen Sept. 5, 2024, 9:25 a.m. UTC
Use rte_eth_fp_ops_setup() instead of directly manipulating
rte_eth_fp_ops variable.

Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/net/bnxt/bnxt_cpr.c    | 5 +----
 drivers/net/bnxt/bnxt_ethdev.c | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index 1da0fc62f4..dab8a5a158 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -440,10 +440,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;
 
-	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 2813ce5035..e1507474e5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4550,10 +4550,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",