DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1 1/1] ml/cnxk: fix fast-path synchronization
@ 2023-11-13  5:31 Srikanth Yalavarthi
  2023-11-13 15:56 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Srikanth Yalavarthi @ 2023-11-13  5:31 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara, jerinj, aprabhu

Segfaults are reported with TVM/LLVM models as NULL value
is read by dequeue thread for the op handle. This is due
synchronization issue between enqueue and dequeue threads.

This fix ensures the op handle written to internal request
structure is committed before the dequeue threads read the
handle value.

Fixes: 88001b4d88de ("ml/cnxk: update fast path functions")

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 drivers/ml/cnxk/cnxk_ml_ops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c
index 81866ceaa6..971362b242 100644
--- a/drivers/ml/cnxk/cnxk_ml_ops.c
+++ b/drivers/ml/cnxk/cnxk_ml_ops.c
@@ -1596,6 +1596,7 @@ cnxk_ml_enqueue_burst(struct rte_ml_dev *dev, uint16_t qp_id, struct rte_ml_op *
 jcmdq_full:
 	queue->head = head;
 	qp->stats.enqueued_count += count;
+	rte_wmb();
 
 	return count;
 }
-- 
2.42.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] ml/cnxk: fix fast-path synchronization
  2023-11-13  5:31 [PATCH v1 1/1] ml/cnxk: fix fast-path synchronization Srikanth Yalavarthi
@ 2023-11-13 15:56 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2023-11-13 15:56 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara, jerinj, aprabhu

On Mon, Nov 13, 2023 at 11:01 AM Srikanth Yalavarthi
<syalavarthi@marvell.com> wrote:
>
> Segfaults are reported with TVM/LLVM models as NULL value
> is read by dequeue thread for the op handle. This is due
> synchronization issue between enqueue and dequeue threads.
>
> This fix ensures the op handle written to internal request
> structure is committed before the dequeue threads read the
> handle value.
>
> Fixes: 88001b4d88de ("ml/cnxk: update fast path functions")
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>


Applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
>  drivers/ml/cnxk/cnxk_ml_ops.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c
> index 81866ceaa6..971362b242 100644
> --- a/drivers/ml/cnxk/cnxk_ml_ops.c
> +++ b/drivers/ml/cnxk/cnxk_ml_ops.c
> @@ -1596,6 +1596,7 @@ cnxk_ml_enqueue_burst(struct rte_ml_dev *dev, uint16_t qp_id, struct rte_ml_op *
>  jcmdq_full:
>         queue->head = head;
>         qp->stats.enqueued_count += count;
> +       rte_wmb();
>
>         return count;
>  }
> --
> 2.42.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-13 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-13  5:31 [PATCH v1 1/1] ml/cnxk: fix fast-path synchronization Srikanth Yalavarthi
2023-11-13 15:56 ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).