DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] examples/ipsec-secgw: free the actual mbuf pointer
@ 2024-08-16  7:22 Vidya Sagar Velumuri
  2024-08-22  4:03 ` Anoob Joseph
  0 siblings, 1 reply; 2+ messages in thread
From: Vidya Sagar Velumuri @ 2024-08-16  7:22 UTC (permalink / raw)
  To: Radu Nicolau, Akhil Goyal
  Cc: jerinj, anoobj, vvelumuri, asasidharan, ktejasree, gmuthukrishn, dev

In case of crypto event vector, the vector points to crypto op structure
in priv area and not actual mbuf.
Extract the mbuf pointer and pass these to rte_mbuf_free to free the
mbufs.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>

diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c
index c9c43ebd2b..dd14226e81 100644
--- a/examples/ipsec-secgw/ipsec_worker.c
+++ b/examples/ipsec-secgw/ipsec_worker.c
@@ -960,7 +960,18 @@ static void
 ipsec_event_vector_free(struct rte_event *ev)
 {
 	struct rte_event_vector *vec = ev->vec;
-	rte_pktmbuf_free_bulk(vec->mbufs + vec->elem_offset, vec->nb_elem);
+
+	if (ev->event_type == RTE_EVENT_TYPE_CRYPTODEV_VECTOR) {
+		struct rte_crypto_op *cop;
+		int i;
+
+		for (i = 0; i < vec->nb_elem; i++) {
+			cop = vec->ptrs[i];
+			rte_pktmbuf_free(cop->sym->m_src);
+		}
+	} else {
+		rte_pktmbuf_free_bulk(vec->mbufs + vec->elem_offset, vec->nb_elem);
+	}
 	rte_mempool_put(rte_mempool_from_obj(vec), vec);
 }
 
-- 
2.25.1


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

end of thread, other threads:[~2024-08-22  4:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-16  7:22 [PATCH v1] examples/ipsec-secgw: free the actual mbuf pointer Vidya Sagar Velumuri
2024-08-22  4:03 ` Anoob Joseph

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