From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Pavan Nikhilesh <pbhagavatula@marvell.com>,
Shijith Thotton <sthotton@marvell.com>,
Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: <dev@dpdk.org>, <aprabhu@marvell.com>, <sshankarnara@marvell.com>,
<ptakkar@marvell.com>, <jerinj@marvell.com>
Subject: [PATCH 4/4] ml/cnxk: add adapter dequeue function
Date: Sun, 7 Jan 2024 07:40:13 -0800 [thread overview]
Message-ID: <20240107154013.4676-5-syalavarthi@marvell.com> (raw)
In-Reply-To: <20240107154013.4676-1-syalavarthi@marvell.com>
Implemented ML adapter dequeue function.
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
drivers/event/cnxk/cn10k_worker.h | 3 +++
drivers/ml/cnxk/cn10k_ml_event_dp.h | 2 ++
drivers/ml/cnxk/cn10k_ml_ops.c | 17 +++++++++++++++++
drivers/ml/cnxk/version.map | 1 +
4 files changed, 23 insertions(+)
diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
index 8aa916fa129..1a0ca7f9493 100644
--- a/drivers/event/cnxk/cn10k_worker.h
+++ b/drivers/event/cnxk/cn10k_worker.h
@@ -7,6 +7,7 @@
#include <rte_eventdev.h>
#include "cn10k_cryptodev_event_dp.h"
+#include "cn10k_ml_event_dp.h"
#include "cn10k_rx.h"
#include "cnxk_worker.h"
#include "cn10k_eventdev.h"
@@ -236,6 +237,8 @@ cn10k_sso_hws_post_process(struct cn10k_sso_hws *ws, uint64_t *u64,
/* Mark vector mempool object as get */
RTE_MEMPOOL_CHECK_COOKIES(rte_mempool_from_obj((void *)u64[1]),
(void **)&u64[1], 1, 1);
+ } else if (CNXK_EVENT_TYPE_FROM_TAG(u64[0]) == RTE_EVENT_TYPE_MLDEV) {
+ u64[1] = cn10k_ml_adapter_dequeue(u64[1]);
}
}
diff --git a/drivers/ml/cnxk/cn10k_ml_event_dp.h b/drivers/ml/cnxk/cn10k_ml_event_dp.h
index bf7fc57bceb..0ff92091296 100644
--- a/drivers/ml/cnxk/cn10k_ml_event_dp.h
+++ b/drivers/ml/cnxk/cn10k_ml_event_dp.h
@@ -12,5 +12,7 @@
__rte_internal
__rte_hot uint16_t cn10k_ml_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_events);
+__rte_internal
+__rte_hot uintptr_t cn10k_ml_adapter_dequeue(uintptr_t get_work1);
#endif /* _CN10K_ML_EVENT_DP_H_ */
diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
index 4bc17eaa8c4..c33a7a85987 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -1660,3 +1660,20 @@ cn10k_ml_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_events)
return count;
}
+
+__rte_hot uintptr_t
+cn10k_ml_adapter_dequeue(uintptr_t get_work1)
+{
+ struct cnxk_ml_dev *cnxk_mldev;
+ struct cnxk_ml_req *req;
+ struct cnxk_ml_qp *qp;
+
+ req = (struct cnxk_ml_req *)(get_work1);
+ cnxk_mldev = req->cnxk_mldev;
+ qp = cnxk_mldev->mldev->data->queue_pairs[req->qp_id];
+
+ cn10k_ml_result_update(cnxk_mldev, req->qp_id, req);
+ rte_mempool_put(qp->mla.req_mp, req);
+
+ return (uintptr_t)req->op;
+}
diff --git a/drivers/ml/cnxk/version.map b/drivers/ml/cnxk/version.map
index c2cacaf8c65..97c2c149998 100644
--- a/drivers/ml/cnxk/version.map
+++ b/drivers/ml/cnxk/version.map
@@ -2,6 +2,7 @@ INTERNAL {
global:
cn10k_ml_adapter_enqueue;
+ cn10k_ml_adapter_dequeue;
local: *;
};
--
2.42.0
next prev parent reply other threads:[~2024-01-07 15:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-07 15:40 [PATCH 0/4] Implementation of CNXK ML event adapter driver Srikanth Yalavarthi
2024-01-07 15:40 ` [PATCH 1/4] event/cnxk: add ML adapter capabilities get Srikanth Yalavarthi
2024-01-07 15:40 ` [PATCH 2/4] event/cnxk: implement queue pair add and delete Srikanth Yalavarthi
2024-01-07 15:40 ` [PATCH 3/4] ml/cnxk: add adapter enqueue function Srikanth Yalavarthi
2024-01-07 15:40 ` Srikanth Yalavarthi [this message]
2024-02-02 9:00 ` [PATCH 4/4] ml/cnxk: add adapter dequeue function 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=20240107154013.4676-5-syalavarthi@marvell.com \
--to=syalavarthi@marvell.com \
--cc=aprabhu@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=ptakkar@marvell.com \
--cc=sshankarnara@marvell.com \
--cc=sthotton@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).