patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v2 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap
       [not found] <20230425104010.339177-1-rbhansali@marvell.com>
@ 2023-05-18 15:48 ` Rahul Bhansali
  2023-05-18 15:49   ` [PATCH v2 3/5] event/cnxk: fix Tx adapter data pointer Rahul Bhansali
  2023-05-18 15:49   ` [PATCH v2 4/5] event/cnxk: fix mempool cookies check Rahul Bhansali
  0 siblings, 2 replies; 3+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:48 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Akhil Goyal, Srujana Challa, Tejasree Kondoj
  Cc: jerinj, Rahul Bhansali, stable

Fix the IPsec IPv6 tunnel address bytes swap during SA
configurations in session create/update.

Fixes: 78d03027f2cc ("common/cnxk: add IPsec common code")
Cc: stable@dpdk.org

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: update in commit message for fixes and cc tag

 drivers/common/cnxk/cnxk_security.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
index 79427d48fe..13ca2c7791 100644
--- a/drivers/common/cnxk/cnxk_security.c
+++ b/drivers/common/cnxk/cnxk_security.c
@@ -274,6 +274,14 @@ ot_ipsec_inb_ctx_size(struct roc_ot_ipsec_inb_sa *sa)
 	return size;
 }

+static void
+ot_ipsec_update_ipv6_addr_endianness(uint64_t *addr)
+{
+	*addr = rte_be_to_cpu_64(*addr);
+	addr++;
+	*addr = rte_be_to_cpu_64(*addr);
+}
+
 static int
 ot_ipsec_inb_tunnel_hdr_fill(struct roc_ot_ipsec_inb_sa *sa,
 			     struct rte_security_ipsec_xform *ipsec_xfrm)
@@ -310,6 +318,10 @@ ot_ipsec_inb_tunnel_hdr_fill(struct roc_ot_ipsec_inb_sa *sa,
 		memcpy(&sa->outer_hdr.ipv6.dst_addr, &tunnel->ipv6.dst_addr,
 		       sizeof(struct in6_addr));

+		/* IP Source and Dest are in LE/CPU endian */
+		ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.src_addr);
+		ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.dst_addr);
+
 		break;
 	default:
 		return -EINVAL;
@@ -499,6 +511,10 @@ cnxk_ot_ipsec_outb_sa_fill(struct roc_ot_ipsec_outb_sa *sa,
 		memcpy(&sa->outer_hdr.ipv6.dst_addr, &tunnel->ipv6.dst_addr,
 		       sizeof(struct in6_addr));

+		/* IP Source and Dest are in LE/CPU endian */
+		ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.src_addr);
+		ot_ipsec_update_ipv6_addr_endianness((uint64_t *)&sa->outer_hdr.ipv6.dst_addr);
+
 		/* Outer header flow label source */
 		if (!ipsec_xfrm->options.copy_flabel) {
 			sa->w2.s.ipv4_df_src_or_ipv6_flw_lbl_src =
--
2.25.1


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

* [PATCH v2 3/5] event/cnxk: fix Tx adapter data pointer
  2023-05-18 15:48 ` [PATCH v2 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
@ 2023-05-18 15:49   ` Rahul Bhansali
  2023-05-18 15:49   ` [PATCH v2 4/5] event/cnxk: fix mempool cookies check Rahul Bhansali
  1 sibling, 0 replies; 3+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:49 UTC (permalink / raw)
  To: dev, Pavan Nikhilesh, Shijith Thotton, Volodymyr Fialko
  Cc: jerinj, Rahul Bhansali, stable

Dpdk test application crashes when event inline IPsec test ran for
second time onwards.
In case of event device cleanup, Tx adapter data pointer is free
but not set back to NULL, which causes incomplete
initialization on next run.

Fixes: 6a24c7c4bcd1 ("event/cnxk: add Tx adapter freeing")
Cc: stable@dpdk.org

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: update in commit message for fixes and cc tag

 drivers/event/cnxk/cnxk_eventdev_adptr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c
index 6d975362e8..9a02026ea6 100644
--- a/drivers/event/cnxk/cnxk_eventdev_adptr.c
+++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c
@@ -635,6 +635,7 @@ cnxk_sso_tx_adapter_free(uint8_t id __rte_unused,
 	if (dev->tx_adptr_data_sz && dev->tx_adptr_active_mask == 0) {
 		dev->tx_adptr_data_sz = 0;
 		free(dev->tx_adptr_data);
+		dev->tx_adptr_data = NULL;
 	}

 	return 0;
--
2.25.1


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

* [PATCH v2 4/5] event/cnxk: fix mempool cookies check
  2023-05-18 15:48 ` [PATCH v2 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
  2023-05-18 15:49   ` [PATCH v2 3/5] event/cnxk: fix Tx adapter data pointer Rahul Bhansali
@ 2023-05-18 15:49   ` Rahul Bhansali
  1 sibling, 0 replies; 3+ messages in thread
From: Rahul Bhansali @ 2023-05-18 15:49 UTC (permalink / raw)
  To: dev, Pavan Nikhilesh, Shijith Thotton, Jerin Jacob, Nithin Dabilpuram
  Cc: Rahul Bhansali, stable

Fix for mempool cookies get mark to be done before
meta to mbuf processing.

Fixes: 7a709964d9bb ("net/cnxk: use NPA batch burst free for meta buffers")
Cc: stable@dpdk.org

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: update in commit message for fixes and cc tag

 drivers/event/cnxk/cn10k_worker.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h
index 06c71c6092..1e519d8156 100644
--- a/drivers/event/cnxk/cn10k_worker.h
+++ b/drivers/event/cnxk/cn10k_worker.h
@@ -22,9 +22,6 @@ cn10k_wqe_to_mbuf(uint64_t wqe, const uint64_t __mbuf, uint8_t port_id,
 				   (flags & NIX_RX_OFFLOAD_TSTAMP_F ? 8 : 0);
 	struct rte_mbuf *mbuf = (struct rte_mbuf *)__mbuf;

-	/* Mark mempool obj as "get" as it is alloc'ed by NIX */
-	RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
-
 	cn10k_nix_cqe_to_mbuf((struct nix_cqe_hdr_s *)wqe, tag,
 			      (struct rte_mbuf *)mbuf, lookup_mem,
 			      mbuf_init | ((uint64_t)port_id) << 48, flags);
@@ -166,6 +163,10 @@ cn10k_sso_hws_post_process(struct cn10k_sso_hws *ws, uint64_t *u64,

 		mbuf = u64[1] - sizeof(struct rte_mbuf);
 		rte_prefetch0((void *)mbuf);
+
+		/* Mark mempool obj as "get" as it is alloc'ed by NIX */
+		RTE_MEMPOOL_CHECK_COOKIES(((struct rte_mbuf *)mbuf)->pool, (void **)&mbuf, 1, 1);
+
 		if (flags & NIX_RX_OFFLOAD_SECURITY_F) {
 			const uint64_t mbuf_init =
 				0x100010000ULL | RTE_PKTMBUF_HEADROOM |
--
2.25.1


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

end of thread, other threads:[~2023-05-18 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230425104010.339177-1-rbhansali@marvell.com>
2023-05-18 15:48 ` [PATCH v2 1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap Rahul Bhansali
2023-05-18 15:49   ` [PATCH v2 3/5] event/cnxk: fix Tx adapter data pointer Rahul Bhansali
2023-05-18 15:49   ` [PATCH v2 4/5] event/cnxk: fix mempool cookies check Rahul Bhansali

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).