[v1] examples/ipsec-secgw: free the actual mbuf pointer
Checks
Commit Message
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>
Comments
> Subject: [PATCH v1] examples/ipsec-secgw: free the actual mbuf pointer
>
> 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>
Acked-by: Anoob Joseph <anoobj@marvell.com>
> Subject: [PATCH v1] examples/ipsec-secgw: free the actual mbuf pointer
>
> 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>
Applied to dpdk-next-crypto
Thanks.
@@ -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);
}