event/cnxk: wait for CPT fc on wqe path

Message ID 20221209134121.1757306-1-rbhansali@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers
Series event/cnxk: wait for CPT fc on wqe path |

Checks

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

Commit Message

Rahul Bhansali Dec. 9, 2022, 1:41 p.m. UTC
  Wait for CPT flow control on WQE path.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/event/cnxk/cn9k_worker.h |  1 +
 drivers/net/cnxk/cn9k_tx.h       | 10 ++++++++++
 2 files changed, 11 insertions(+)
  

Comments

Jerin Jacob Jan. 18, 2023, 3:06 p.m. UTC | #1
On Fri, Dec 9, 2022 at 7:11 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> Wait for CPT flow control on WQE path.

Please add Why? If it is bug add Fixes:

Also change the subject as event/cnxk: wait for CPT flow control on WQE path

>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
> ---
>  drivers/event/cnxk/cn9k_worker.h |  1 +
>  drivers/net/cnxk/cn9k_tx.h       | 10 ++++++++++
>  2 files changed, 11 insertions(+)
>
> diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h
> index 4c3932da47..d3c5180fbc 100644
> --- a/drivers/event/cnxk/cn9k_worker.h
> +++ b/drivers/event/cnxk/cn9k_worker.h
> @@ -730,6 +730,7 @@ cn9k_sso_hws_xmit_sec_one(const struct cn9k_eth_txq *txq, uint64_t base,
>
>         rte_io_wmb();
>         cn9k_sso_txq_fc_wait(txq);
> +       cn9k_nix_sec_fc_wait_one(txq);
>
>         /* Write CPT instruction to lmt line */
>         vst1q_u64(lmt_addr, cmd01);
> diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
> index 404edd6aed..7362025a34 100644
> --- a/drivers/net/cnxk/cn9k_tx.h
> +++ b/drivers/net/cnxk/cn9k_tx.h
> @@ -388,6 +388,16 @@ cn9k_nix_xmit_prep_lmt(uint64_t *cmd, void *lmt_addr, const uint32_t flags)
>         roc_lmt_mov(lmt_addr, cmd, cn9k_nix_tx_ext_subs(flags));
>  }
>
> +static __rte_always_inline void
> +cn9k_nix_sec_fc_wait_one(const struct cn9k_eth_txq *txq)
> +{
> +       uint64_t nb_desc = txq->cpt_desc;
> +       uint64_t *fc = txq->cpt_fc;
> +
> +       while (nb_desc <= __atomic_load_n(fc, __ATOMIC_RELAXED))
> +               ;
> +}
> +
>  static __rte_always_inline uint64_t
>  cn9k_nix_xmit_submit_lmt(const rte_iova_t io_addr)
>  {
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h
index 4c3932da47..d3c5180fbc 100644
--- a/drivers/event/cnxk/cn9k_worker.h
+++ b/drivers/event/cnxk/cn9k_worker.h
@@ -730,6 +730,7 @@  cn9k_sso_hws_xmit_sec_one(const struct cn9k_eth_txq *txq, uint64_t base,
 
 	rte_io_wmb();
 	cn9k_sso_txq_fc_wait(txq);
+	cn9k_nix_sec_fc_wait_one(txq);
 
 	/* Write CPT instruction to lmt line */
 	vst1q_u64(lmt_addr, cmd01);
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index 404edd6aed..7362025a34 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -388,6 +388,16 @@  cn9k_nix_xmit_prep_lmt(uint64_t *cmd, void *lmt_addr, const uint32_t flags)
 	roc_lmt_mov(lmt_addr, cmd, cn9k_nix_tx_ext_subs(flags));
 }
 
+static __rte_always_inline void
+cn9k_nix_sec_fc_wait_one(const struct cn9k_eth_txq *txq)
+{
+	uint64_t nb_desc = txq->cpt_desc;
+	uint64_t *fc = txq->cpt_fc;
+
+	while (nb_desc <= __atomic_load_n(fc, __ATOMIC_RELAXED))
+		;
+}
+
 static __rte_always_inline uint64_t
 cn9k_nix_xmit_submit_lmt(const rte_iova_t io_addr)
 {