[4/5] net/bnxt: use fp ops setup function

Message ID 20230301030610.49468-5-fengchengwen@huawei.com (mailing list archive)
State Changes Requested, archived
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 March 1, 2023, 3:06 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>
---
 drivers/net/bnxt/bnxt_cpr.c    | 5 +----
 drivers/net/bnxt/bnxt_ethdev.c | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)
  

Comments

Konstantin Ananyev March 2, 2023, 12:30 p.m. UTC | #1
> 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>
> ---
>  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?
 
> 
> -	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
  
Konstantin Ananyev March 3, 2023, 12:01 a.m. UTC | #2
02/03/2023 12:30, Konstantin Ananyev пишет:
> 
>> 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>
>> ---
>>   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?

After another thought - wouldn't it be better just to call 
fp_ops_reset() here?

>   
>>
>> -	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
>
  
Ajit Khaparde March 3, 2023, 1:17 a.m. UTC | #3
On Thu, Mar 2, 2023 at 4:01 PM Konstantin Ananyev
<konstantin.v.ananyev@yandex.ru> wrote:
>
> 02/03/2023 12:30, Konstantin Ananyev пишет:
> >
> >> 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>
> >> ---
> >>   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?
>
> After another thought - wouldn't it be better just to call
> fp_ops_reset() here?
Yes. I was actually thinking the same.
A reset equivalent of the setup.

>
> >
> >>
> >> -    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
> >
>
  
fengchengwen March 3, 2023, 1:38 a.m. UTC | #4
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 <fengchengwen@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 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.

>  
>>
>> -	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
> 
> .
>
  
fengchengwen March 3, 2023, 2:02 a.m. UTC | #5
On 2023/3/3 8:01, Konstantin Ananyev wrote:
> 02/03/2023 12:30, Konstantin Ananyev пишет:
>>
>>> 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>
>>> ---
>>>   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?
> 
> After another thought - wouldn't it be better just to call fp_ops_reset() here?

The fp_ops_reset was targeting who violate invocation, so it contain an error log and stack-dump.

It's not suitable for this error recovering scenario.

I've also considered expansion (e.g. add extra parameter for fp_ops_reset), but there are also
other callbacks (e.g. rx_queue_count) should adjust, and make all not simple but complicated.

> 
>>  
>>>
>>> -    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
>>
> 
> .
  
Konstantin Ananyev March 5, 2023, 3:57 p.m. UTC | #6
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 <fengchengwen@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 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
>>
>> .
>>
  
Ajit Khaparde March 6, 2023, 2:47 a.m. UTC | #7
On Sun, Mar 5, 2023 at 7:58 AM Konstantin Ananyev
<konstantin.v.ananyev@yandex.ru> wrote:
>
> 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 <fengchengwen@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 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.

We have been operating without the application being aware of the
underlying functionality for some time now.
Each step here is an improvement.
I think it is okay to keep it simple and update them separately.

Thanks
Ajit

>
>
> >
> >>
> >>>
> >>> -   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
> >>
> >> .
> >>
>
  

Patch

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;
 
-	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",