]> git.droids-corp.org - dpdk.git/commitdiff
net/softnic: add symmetric crypto action
authorFan Zhang <roy.fan.zhang@intel.com>
Wed, 24 Oct 2018 12:49:03 +0000 (13:49 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 26 Oct 2018 12:13:45 +0000 (14:13 +0200)
This patch adds symmetric crypto action support to softnic.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
drivers/net/softnic/rte_eth_softnic_action.c
drivers/net/softnic/rte_eth_softnic_internals.h
drivers/net/softnic/rte_eth_softnic_thread.c

index 2b74848c31ad37f66e5003b216054e78e36ef31c..92c744dc9a8580412ac9796441d4b56f7b4a0e35 100644 (file)
@@ -386,6 +386,17 @@ softnic_table_action_profile_create(struct pmd_internals *p,
                }
        }
 
+       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 6322b32062a145340cfe6a723ab0ff67acfeaa7d..e12b8ae4ca7d4c052b352a6b644af7eaa48776ee 100644 (file)
@@ -328,6 +328,7 @@ struct softnic_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 softnic_table_action_profile {
@@ -950,6 +951,7 @@ struct softnic_table_rule_action {
        struct rte_table_action_time_params time;
        struct rte_table_action_tag_params tag;
        struct rte_table_action_decap_params decap;
+       struct rte_table_action_sym_crypto_params sym_crypto;
 };
 
 struct rte_flow {
index c8a8d230b6e7b92d64a8dd01ca07e8b861451134..4572adfa6a100cd9d1721936bf85dbda8f9456ed 100644 (file)
@@ -2498,6 +2498,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;
 }