patch 'examples/ipsec-secgw: fix buffer freeing in vector mode' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Tue Mar 1 11:41:43 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/06/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/ad76dc4e91a5efa1cb6583e5ec1f3fc7b471fa29

Thanks.

Kevin

---
>From ad76dc4e91a5efa1cb6583e5ec1f3fc7b471fa29 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram at marvell.com>
Date: Wed, 23 Feb 2022 15:23:52 +0530
Subject: [PATCH] examples/ipsec-secgw: fix buffer freeing in vector mode

[ upstream commit 5fb245ba6d8234f10a785d00f63434545a1ddc48 ]

Fix packet processing to skip after mbuf is freed instead of
touching and Tx'ing it.

Also free vector event buffer in event worker when after processing
there is no pkt to be enqueued to Tx adapter.

Fixes: 86738ebe1e3d ("examples/ipsec-secgw: support event vector")

Signed-off-by: Nithin Dabilpuram <ndabilpuram at marvell.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 examples/ipsec-secgw/ipsec_worker.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c
index 7419e85db2..5fe91b62e4 100644
--- a/examples/ipsec-secgw/ipsec_worker.c
+++ b/examples/ipsec-secgw/ipsec_worker.c
@@ -206,10 +206,14 @@ check_sp_sa_bulk(struct sp_ctx *sp, struct sa_ctx *sa_ctx,
 		else {
 			sa = *(struct ipsec_sa **)rte_security_dynfield(m);
-			if (sa == NULL)
+			if (sa == NULL) {
 				free_pkts(&m, 1);
+				continue;
+			}
 
 			/* SPI on the packet should match with the one in SA */
-			if (unlikely(sa->spi != sa_ctx->sa[res - 1].spi))
+			if (unlikely(sa->spi != sa_ctx->sa[res - 1].spi)) {
 				free_pkts(&m, 1);
+				continue;
+			}
 
 			ip->pkts[j++] = m;
@@ -536,4 +540,5 @@ ipsec_ev_route_pkts(struct rte_event_vector *vec, struct route_table *rt,
 				RTE_LOG(ERR, IPSEC, "SA type not supported\n");
 				free_pkts(&pkt, 1);
+				continue;
 			}
 			rte_security_set_pkt_metadata(sess->security.ctx,
@@ -694,9 +699,11 @@ ipsec_ev_vector_process(struct lcore_conf_ev_tx_int_port_wrkr *lconf,
 						       &lconf->rt, vec);
 
-	if (ret > 0) {
+	if (likely(ret > 0)) {
 		vec->nb_elem = ret;
 		rte_event_eth_tx_adapter_enqueue(links[0].eventdev_id,
 						 links[0].event_port_id,
 						 ev, 1, 0);
+	} else {
+		rte_mempool_put(rte_mempool_from_obj(vec), vec);
 	}
 }
@@ -719,4 +726,6 @@ ipsec_ev_vector_drv_mode_process(struct eh_event_link_info *links,
 						 links[0].event_port_id,
 						 ev, 1, 0);
+	else
+		rte_mempool_put(rte_mempool_from_obj(vec), vec);
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-01 10:41:02.098834028 +0000
+++ 0027-examples-ipsec-secgw-fix-buffer-freeing-in-vector-mo.patch	2022-03-01 10:41:01.278244093 +0000
@@ -1 +1 @@
-From 5fb245ba6d8234f10a785d00f63434545a1ddc48 Mon Sep 17 00:00:00 2001
+From ad76dc4e91a5efa1cb6583e5ec1f3fc7b471fa29 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5fb245ba6d8234f10a785d00f63434545a1ddc48 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index e9493c56ae..8639426c5c 100644
+index 7419e85db2..5fe91b62e4 100644
@@ -42 +43 @@
-@@ -537,4 +541,5 @@ ipsec_ev_route_pkts(struct rte_event_vector *vec, struct route_table *rt,
+@@ -536,4 +540,5 @@ ipsec_ev_route_pkts(struct rte_event_vector *vec, struct route_table *rt,
@@ -48 +49 @@
-@@ -696,9 +701,11 @@ ipsec_ev_vector_process(struct lcore_conf_ev_tx_int_port_wrkr *lconf,
+@@ -694,9 +699,11 @@ ipsec_ev_vector_process(struct lcore_conf_ev_tx_int_port_wrkr *lconf,
@@ -61 +62 @@
-@@ -721,4 +728,6 @@ ipsec_ev_vector_drv_mode_process(struct eh_event_link_info *links,
+@@ -719,4 +726,6 @@ ipsec_ev_vector_drv_mode_process(struct eh_event_link_info *links,



More information about the stable mailing list