DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeontx2: use fast udata and mdata flags
@ 2021-09-24 17:11 Tejasree Kondoj
  2021-09-27  4:42 ` Anoob Joseph
  0 siblings, 1 reply; 3+ messages in thread
From: Tejasree Kondoj @ 2021-09-24 17:11 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Tejasree Kondoj, Nithin Dabilpuram, Anoob Joseph, dev

Using fast metadata and userdata flags instead of
driver callbacks for set_pkt_metadata and
get_userdata in inline IPsec.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 drivers/net/octeontx2/otx2_ethdev_sec.c    | 25 ++--------------------
 drivers/net/octeontx2/otx2_ethdev_sec_tx.h |  2 +-
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/drivers/net/octeontx2/otx2_ethdev_sec.c b/drivers/net/octeontx2/otx2_ethdev_sec.c
index c2a36883cb..7bd1ed6da0 100644
--- a/drivers/net/octeontx2/otx2_ethdev_sec.c
+++ b/drivers/net/octeontx2/otx2_ethdev_sec.c
@@ -741,27 +741,6 @@ otx2_eth_sec_session_get_size(void *device __rte_unused)
 	return sizeof(struct otx2_sec_session);
 }
 
-static int
-otx2_eth_sec_set_pkt_mdata(void *device __rte_unused,
-			    struct rte_security_session *session,
-			    struct rte_mbuf *m, void *params __rte_unused)
-{
-	/* Set security session as the pkt metadata */
-	*rte_security_dynfield(m) = (rte_security_dynfield_t)session;
-
-	return 0;
-}
-
-static int
-otx2_eth_sec_get_userdata(void *device __rte_unused, uint64_t md,
-			   void **userdata)
-{
-	/* Retrieve userdata  */
-	*userdata = (void *)md;
-
-	return 0;
-}
-
 static const struct rte_security_capability *
 otx2_eth_sec_capabilities_get(void *device __rte_unused)
 {
@@ -772,8 +751,6 @@ static struct rte_security_ops otx2_eth_sec_ops = {
 	.session_create		= otx2_eth_sec_session_create,
 	.session_destroy	= otx2_eth_sec_session_destroy,
 	.session_get_size	= otx2_eth_sec_session_get_size,
-	.set_pkt_metadata	= otx2_eth_sec_set_pkt_mdata,
-	.get_userdata		= otx2_eth_sec_get_userdata,
 	.capabilities_get	= otx2_eth_sec_capabilities_get
 };
 
@@ -799,6 +776,8 @@ otx2_eth_sec_ctx_create(struct rte_eth_dev *eth_dev)
 	ctx->device = eth_dev;
 	ctx->ops = &otx2_eth_sec_ops;
 	ctx->sess_cnt = 0;
+	ctx->flags =
+		(RTE_SEC_CTX_F_FAST_SET_MDATA | RTE_SEC_CTX_F_FAST_GET_UDATA);
 
 	eth_dev->security_ctx = ctx;
 
diff --git a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h
index 623a2a841e..e59a869403 100644
--- a/drivers/net/octeontx2/otx2_ethdev_sec_tx.h
+++ b/drivers/net/octeontx2/otx2_ethdev_sec_tx.h
@@ -54,7 +54,7 @@ otx2_sec_event_tx(uint64_t base, struct rte_event *ev, struct rte_mbuf *m,
 		struct nix_iova_s nix_iova;
 	} *sd;
 
-	priv = get_sec_session_private_data((void *)(*rte_security_dynfield(m)));
+	priv = (struct otx2_sec_session *)(*rte_security_dynfield(m));
 	sess = &priv->ipsec.ip;
 	sa = &sess->out_sa;
 
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH] net/octeontx2: use fast udata and mdata flags
  2021-09-24 17:11 [dpdk-dev] [PATCH] net/octeontx2: use fast udata and mdata flags Tejasree Kondoj
@ 2021-09-27  4:42 ` Anoob Joseph
  2021-10-19 14:29   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Anoob Joseph @ 2021-09-27  4:42 UTC (permalink / raw)
  To: Tejasree Kondoj, Jerin Jacob Kollanukkaran, Akhil Goyal
  Cc: Tejasree Kondoj, Nithin Kumar Dabilpuram, dev

> 
> Using fast metadata and userdata flags instead of driver callbacks for
> set_pkt_metadata and get_userdata in inline IPsec.
> 
> Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>

Acked-by: Anoob Joseph <anoobj@marvell.com>

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

* Re: [dpdk-dev] [PATCH] net/octeontx2: use fast udata and mdata flags
  2021-09-27  4:42 ` Anoob Joseph
@ 2021-10-19 14:29   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2021-10-19 14:29 UTC (permalink / raw)
  To: Anoob Joseph, Ferruh Yigit
  Cc: Tejasree Kondoj, Jerin Jacob Kollanukkaran, Akhil Goyal,
	Nithin Kumar Dabilpuram, dev

On Mon, Sep 27, 2021 at 10:12 AM Anoob Joseph <anoobj@marvell.com> wrote:
>
> >
> > Using fast metadata and userdata flags instead of driver callbacks for
> > set_pkt_metadata and get_userdata in inline IPsec.
> >
> > Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
>
> Acked-by: Anoob Joseph <anoobj@marvell.com>

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

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

end of thread, other threads:[~2021-10-19 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 17:11 [dpdk-dev] [PATCH] net/octeontx2: use fast udata and mdata flags Tejasree Kondoj
2021-09-27  4:42 ` Anoob Joseph
2021-10-19 14:29   ` 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).