From: Fan Zhang Date: Fri, 28 Sep 2018 12:26:12 +0000 (+0100) Subject: examples/ip_pipeline: support symmetric crypto action X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d46fe9448caf68711e805b8fc2d05ef127fde8af;p=dpdk.git examples/ip_pipeline: support symmetric crypto action This patch adds symmetric crypto action support to ip_pipeline application. Signed-off-by: Fan Zhang Acked-by: Cristian Dumitrescu --- diff --git a/examples/ip_pipeline/action.c b/examples/ip_pipeline/action.c index 20497c3c71..a0f97bee7e 100644 --- a/examples/ip_pipeline/action.c +++ b/examples/ip_pipeline/action.c @@ -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, + ¶ms->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); diff --git a/examples/ip_pipeline/action.h b/examples/ip_pipeline/action.h index 417200e863..cde17e69a3 100644 --- a/examples/ip_pipeline/action.h +++ b/examples/ip_pipeline/action.h @@ -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 { diff --git a/examples/ip_pipeline/pipeline.h b/examples/ip_pipeline/pipeline.h index fb283e558e..b6b9dc06f0 100644 --- a/examples/ip_pipeline/pipeline.h +++ b/examples/ip_pipeline/pipeline.h @@ -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 diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c index 7fc03332ea..ca741952a5 100644 --- a/examples/ip_pipeline/thread.c +++ b/examples/ip_pipeline/thread.c @@ -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; }