DPDK patches and discussions
 help / color / mirror / Atom feed
From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <jerinj@marvell.com>,
	<aprabhu@marvell.com>
Subject: [PATCH v1 1/1] ml/cnxk: fix fast-path synchronization
Date: Sun, 12 Nov 2023 21:31:15 -0800	[thread overview]
Message-ID: <20231113053115.15142-1-syalavarthi@marvell.com> (raw)

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


             reply	other threads:[~2023-11-13  5:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13  5:31 Srikanth Yalavarthi [this message]
2023-11-13 15:56 ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231113053115.15142-1-syalavarthi@marvell.com \
    --to=syalavarthi@marvell.com \
    --cc=aprabhu@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=sshankarnara@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).