diff mbox series

[2/2] examples/ipsec-secgw: add UDP encapsulation for inline protocol

Message ID 20210713074219.6804-2-schalla@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series [1/2] common/cnxk: add support for UDP encapsulation | expand

Checks

Context Check Description
ci/iol-intel-Performance fail Performance Testing issues
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-abi-testing warning Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot success github build: passed
ci/checkpatch success coding style OK

Commit Message

Srujana Challa July 13, 2021, 7:42 a.m. UTC
Adds support to allow udp-encap option for
RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL mode also.

Signed-off-by: Srujana Challa <schalla@marvell.com>
---
 examples/ipsec-secgw/sa.c | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

Comments

Akhil Goyal July 18, 2021, 10:33 a.m. UTC | #1
> Subject: [PATCH 2/2] examples/ipsec-secgw: add UDP encapsulation for
> inline protocol
> 
> Adds support to allow udp-encap option for
> RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL mode also.
> 
> Signed-off-by: Srujana Challa <schalla@marvell.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>

@Konstantin Ananyev: Any comments on this patch?
Ananyev, Konstantin July 19, 2021, 9:32 a.m. UTC | #2
> 
> > Subject: [PATCH 2/2] examples/ipsec-secgw: add UDP encapsulation for
> > inline protocol
> >
> > Adds support to allow udp-encap option for
> > RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL mode also.
> >
> > Signed-off-by: Srujana Challa <schalla@marvell.com>
> > ---
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> 
> @Konstantin Ananyev: Any comments on this patch?

No I don't have any, looks ok to me.
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Akhil Goyal July 19, 2021, 7:30 p.m. UTC | #3
> >
> > > Subject: [PATCH 2/2] examples/ipsec-secgw: add UDP encapsulation for
> > > inline protocol
> > >
> > > Adds support to allow udp-encap option for
> > > RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL mode also.
> > >
> > > Signed-off-by: Srujana Challa <schalla@marvell.com>
> > > ---
> > Acked-by: Akhil Goyal <gakhil@marvell.com>
> >
> > @Konstantin Ananyev: Any comments on this patch?
> 
> No I don't have any, looks ok to me.
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Series Applied to dpdk-next-crypto

Thanks.
diff mbox series

Patch

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 7bb9ef36c2..17a28556c9 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -759,20 +759,25 @@  parse_sa_tokens(char **tokens, uint32_t n_tokens,
 			continue;
 		}
 		if (strcmp(tokens[ti], "udp-encap") == 0) {
-			APP_CHECK(ips->type ==
-				RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
-				status, "UDP encapsulation is allowed if the "
-				"session is of type lookaside-protocol-offload "
-				"only.");
-			if (status->status < 0)
-				return;
-			APP_CHECK_PRESENCE(udp_encap_p, tokens[ti], status);
-			if (status->status < 0)
-				return;
+			switch (ips->type) {
+			case RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL:
+			case RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL:
+				APP_CHECK_PRESENCE(udp_encap_p, tokens[ti],
+						   status);
+				if (status->status < 0)
+					return;
 
-			rule->udp_encap = 1;
-			app_sa_prm.udp_encap = 1;
-			udp_encap_p = 1;
+				rule->udp_encap = 1;
+				app_sa_prm.udp_encap = 1;
+				udp_encap_p = 1;
+				break;
+			default:
+				APP_CHECK(0, status,
+					"UDP encapsulation not supported for "
+					"security session type %d",
+					ips->type);
+				return;
+			}
 			continue;
 		}