net/bnxt: restore fast-path API pointers post recovery

Message ID 20211122045314.8860-1-somnath.kotur@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series net/bnxt: restore fast-path API pointers post recovery |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Somnath Kotur Nov. 22, 2021, 4:53 a.m. UTC
  In bnxt_dev_recover(), restore the newly introduced fast-path API pointers
(struct rte_eth_fp_ops)->rx_pkt_burst to the real burst routines instead of
the dummy ones, once error recovery has successfully completed.

Fixes: c87d435a4d79 ("ethdev: copy fast-path API into separate structure")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Ajit Khaparde Nov. 22, 2021, 5:19 a.m. UTC | #1
On Sun, Nov 21, 2021 at 8:59 PM Somnath Kotur
<somnath.kotur@broadcom.com> wrote:
>
> In bnxt_dev_recover(), restore the newly introduced fast-path API pointers
> (struct rte_eth_fp_ops)->rx_pkt_burst to the real burst routines instead of
> the dummy ones, once error recovery has successfully completed.
>
> Fixes: c87d435a4d79 ("ethdev: copy fast-path API into separate structure")
>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Squashed with previous commit [1].

[1] https://patchwork.dpdk.org/project/dpdk/patch/20211119035041.4493-1-somnath.kotur@broadcom.com/

> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index c1bdf9a921..f79f33ab4e 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -4345,6 +4345,12 @@ static void bnxt_dev_recover(void *arg)
>                 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_mb();
> +
>         rc = bnxt_restore_filters(bp);
>         if (rc)
>                 goto err_start;
> --
> 2.28.0.497.g54e85e7
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index c1bdf9a921..f79f33ab4e 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4345,6 +4345,12 @@  static void bnxt_dev_recover(void *arg)
 		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_mb();
+
 	rc = bnxt_restore_filters(bp);
 	if (rc)
 		goto err_start;