From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4F611A034F for ; Tue, 1 Mar 2022 11:44:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4ABE4407FF; Tue, 1 Mar 2022 11:44:01 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 38FFE40DF6 for ; Tue, 1 Mar 2022 11:44:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RVyu7DN4UahErHo3c06Kz+IK/uOrfj4Ru62Ex0mxIyo=; b=P5uFSqCHY/PDyY7Ecx40UVvz0S6Lj0afFTsdCegMaRmoYevb+RtNtrQoPfFaWZANHNGEZv FNx7wSg31GvUeiMB43OuwHXLtycsGkus4eVXgIC87wHDhb2M8Xq1WnPgezSOpWBBko2dCB DdEsoFjVQCDf1lyPB7lXDaMEp6r4mzU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-fQmxhCbvMLCpXp3rNqUlsQ-1; Tue, 01 Mar 2022 05:43:56 -0500 X-MC-Unique: fQmxhCbvMLCpXp3rNqUlsQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11D9E1868335; Tue, 1 Mar 2022 10:43:55 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA6A7752D1; Tue, 1 Mar 2022 10:43:53 +0000 (UTC) From: Kevin Traynor To: Nithin Dabilpuram Cc: Akhil Goyal , dpdk stable Subject: patch 'examples/ipsec-secgw: fix buffer freeing in vector mode' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:41:43 +0000 Message-Id: <20220301104300.334382-27-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Acked-by: Akhil Goyal --- 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@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,