examples/ipsec-secgw: add egress flow actions
authorNélio Laranjeiro <nelio.laranjeiro@6wind.com>
Mon, 18 Dec 2017 10:24:37 +0000 (11:24 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Sat, 20 Jan 2018 15:10:52 +0000 (16:10 +0100)
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>
examples/ipsec-secgw/ipsec.c

index 4337e66..05e89a1 100644 (file)
@@ -226,6 +226,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,