[dpdk-dev,v5,3/3] examples/ipsec-secgw: add Egress flow actions

Message ID 18c01491a351b4c6c2fd77177f19da1f065ec3dc.1513592582.git.nelio.laranjeiro@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Nélio Laranjeiro Dec. 18, 2017, 10:24 a.m. UTC
  Add Egress flow create for devices supporting
RTE_SECURITY_TX_HW_TRAILER_OFFLOAD.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

--

Changes in v5:

 * removed default second end actions wrongly added in this patch.
---
 examples/ipsec-secgw/ipsec.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

De Lara Guarch, Pablo Jan. 8, 2018, 4:13 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro
> Sent: Monday, December 18, 2017 10:25 AM
> To: Gonzalez Monroy, Sergio <sergio.gonzalez.monroy@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>; Anoob Joseph
> <anoob.joseph@caviumnetworks.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v5 3/3] examples/ipsec-secgw: add Egress flow
> actions
> 
> Add Egress flow create for devices supporting
> RTE_SECURITY_TX_HW_TRAILER_OFFLOAD.
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Akhil, Radu, could you review this patch?

Thanks,
Pablo
  
Radu Nicolau Jan. 16, 2018, 4:12 p.m. UTC | #2
> -----Original Message-----
> From: Nelio Laranjeiro [mailto:nelio.laranjeiro@6wind.com]
> Sent: Monday, December 18, 2017 10:25 AM
> To: Gonzalez Monroy, Sergio <sergio.gonzalez.monroy@intel.com>; Nicolau,
> Radu <radu.nicolau@intel.com>; Anoob Joseph
> <anoob.joseph@caviumnetworks.com>
> Cc: dev@dpdk.org
> Subject: [PATCH v5 3/3] examples/ipsec-secgw: add Egress flow actions
> 
> Add Egress flow create for devices supporting
> RTE_SECURITY_TX_HW_TRAILER_OFFLOAD.
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> 
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
  

Patch

diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index 37a6416ed..580e09a3a 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -255,6 +255,13 @@  create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa)
 							&err);
 				if (ret)
 					goto flow_create_failure;
+			} else if (sa->attr.egress &&
+				   (sa->ol_flags &
+				    RTE_SECURITY_TX_HW_TRAILER_OFFLOAD)) {
+					sa->action[1].type =
+						RTE_FLOW_ACTION_TYPE_PASSTHRU;
+					sa->action[2].type =
+						RTE_FLOW_ACTION_TYPE_END;
 			}
 flow_create:
 			sa->flow = rte_flow_create(sa->portid,