+1 use new api to modify rte_eth_fp_ops[]
Acked-by: Huisong Li <lihuis...@huawei.com>
在 2023/10/20 18:07, Chengwen Feng 写道:
Use rte_eth_fp_ops_setup() instead of directly manipulating
rte_eth_fp_ops variable.
Cc: sta...@dpdk.org
Signed-off-by: Chengwen Feng <fengcheng...@huawei.com>
---
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 d8947d5b5f..3a08028331 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;
- 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 003a6eec11..9d9b9ae8cf 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4428,10 +4428,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",