examples/ip_pipeline: support symmetric crypto action
authorFan Zhang <roy.fan.zhang@intel.com>
Fri, 28 Sep 2018 12:26:12 +0000 (13:26 +0100)
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>
Fri, 12 Oct 2018 17:33:15 +0000 (19:33 +0200)
This patch adds symmetric crypto action support to ip_pipeline
application.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
examples/ip_pipeline/action.c
examples/ip_pipeline/action.h
examples/ip_pipeline/pipeline.h
examples/ip_pipeline/thread.c

index 20497c3..a0f97be 100644 (file)
@@ -333,6 +333,17 @@ table_action_profile_create(const char *name,
                }
        }
 
+       if (params->action_mask & (1LLU << RTE_TABLE_ACTION_SYM_CRYPTO)) {
+               status = rte_table_action_profile_action_register(ap,
+                       RTE_TABLE_ACTION_SYM_CRYPTO,
+                       &params->sym_crypto);
+
+               if (status) {
+                       rte_table_action_profile_free(ap);
+                       return NULL;
+               }
+       }
+
        status = rte_table_action_profile_freeze(ap);
        if (status) {
                rte_table_action_profile_free(ap);
index 417200e..cde17e6 100644 (file)
@@ -53,6 +53,7 @@ struct table_action_profile_params {
        struct rte_table_action_nat_config nat;
        struct rte_table_action_ttl_config ttl;
        struct rte_table_action_stats_config stats;
+       struct rte_table_action_sym_crypto_config sym_crypto;
 };
 
 struct table_action_profile {
index fb283e5..b6b9dc0 100644 (file)
@@ -281,6 +281,7 @@ struct table_rule_action {
        struct rte_table_action_ttl_params ttl;
        struct rte_table_action_stats_params stats;
        struct rte_table_action_time_params time;
+       struct rte_table_action_sym_crypto_params sym_crypto;
 };
 
 int
index 7fc0333..ca74195 100644 (file)
@@ -2476,6 +2476,16 @@ action_convert(struct rte_table_action *a,
                        return status;
        }
 
+       if (action->action_mask & (1LLU << RTE_TABLE_ACTION_SYM_CRYPTO)) {
+               status = rte_table_action_apply(a,
+                       data,
+                       RTE_TABLE_ACTION_SYM_CRYPTO,
+                       &action->sym_crypto);
+
+               if (status)
+                       return status;
+       }
+
        return 0;
 }