From: Srujana Challa <schalla@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>,
Radu Nicolau <radu.nicolau@intel.com>,
Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: Srujana Challa <schalla@marvell.com>,
Anoob Joseph <anoobj@marvell.com>,
Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
Tejasree Kondoj <ktejasree@marvell.com>, <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: add UDP encapsulation for inline protocol
Date: Tue, 13 Jul 2021 13:12:18 +0530 [thread overview]
Message-ID: <20210713074219.6804-2-schalla@marvell.com> (raw)
In-Reply-To: <20210713074219.6804-1-schalla@marvell.com>
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(-)
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;
}
--
2.29.0
next prev parent reply other threads:[~2021-07-13 7:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 7:42 [dpdk-dev] [PATCH 1/2] common/cnxk: add support for UDP encapsulation Srujana Challa
2021-07-13 7:42 ` Srujana Challa [this message]
2021-07-18 10:33 ` [dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: add UDP encapsulation for inline protocol Akhil Goyal
2021-07-19 9:32 ` Ananyev, Konstantin
2021-07-19 19:30 ` Akhil Goyal
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=20210713074219.6804-2-schalla@marvell.com \
--to=schalla@marvell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=konstantin.ananyev@intel.com \
--cc=ktejasree@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=radu.nicolau@intel.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).