DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: Rakesh Kudurumalla <rkudurumalla@marvell.com>,
	Radu Nicolau <radu.nicolau@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
	Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
	Rakesh Kudurumalla <rkudurumalla@marvell.com>
Subject: RE: [PATCH 1/1] examples/ipsec-secgw: resolve segfault for IPsec packets
Date: Wed, 21 May 2025 14:13:14 +0000	[thread overview]
Message-ID: <CO6PR18MB4484F4DA8E9DA78C78157093D89EA@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20250407072155.1255817-1-rkudurumalla@marvell.com>


> Subject: [PATCH 1/1] examples/ipsec-secgw: resolve segfault for IPsec packets
> 
> launching ipsec-segw application in event vector mode
> after traffic has started results in segfault because
> we are receiving few IPSEC packet and application is trying
> to decrypt IPSEC packets using lookaside protocol.
> This contradicts inline event mode.This patch fixes the same
> by freeing IPSEC packets and processing only plain packets.

Please add a Fixme tag and cc stable@dpdk.org

> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
>  examples/ipsec-secgw/ipsec_worker.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-
> secgw/ipsec_worker.c
> index e0690fc8d9..04609964cd 100644
> --- a/examples/ipsec-secgw/ipsec_worker.c
> +++ b/examples/ipsec-secgw/ipsec_worker.c
> @@ -700,6 +700,9 @@ ipsec_ev_inbound_route_pkts(struct rte_event_vector
> *vec,
>  	struct rte_ipsec_session *sess;
>  	struct rte_mbuf *pkt;
>  	struct ipsec_sa *sa;
> +	uint8_t mask = (1UL << RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO)
> |
> +		       (1UL << RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL);
> +
> 
>  	j = ipsec_ev_route_ip_pkts(vec, rt, t);
> 
> @@ -707,7 +710,7 @@ ipsec_ev_inbound_route_pkts(struct rte_event_vector
> *vec,
>  	for (i = 0; i < t->ipsec.num; i++) {
>  		pkt = t->ipsec.pkts[i];
>  		sa = ipsec_mask_saptr(t->ipsec.saptr[i]);
> -		if (unlikely(sa == NULL)) {
> +		if (unlikely(sa == NULL) || ((1UL << sa->sessions[0].type) &
> mask)) {
>  			free_pkts(&pkt, 1);
>  			continue;
>  		}
> --
> 2.25.1


      reply	other threads:[~2025-05-21 14:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  7:21 Rakesh Kudurumalla
2025-05-21 14:13 ` Akhil Goyal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR18MB4484F4DA8E9DA78C78157093D89EA@CO6PR18MB4484.namprd18.prod.outlook.com \
    --to=gakhil@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=rkudurumalla@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).