From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id BD82C7CAB for ; Mon, 10 Jul 2017 09:35:23 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from borisp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 10 Jul 2017 10:35:19 +0300 Received: from gen-l-vrt-098.mtl.labs.mlnx (gen-l-vrt-098.mtl.labs.mlnx [10.137.170.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v6A7ZJVX030940; Mon, 10 Jul 2017 10:35:19 +0300 From: Boris Pismenny To: dev@dpdk.org Cc: aviadye@mellanox.com, borisp@mellanox.com Date: Mon, 10 Jul 2017 10:35:13 +0300 Message-Id: <1499672117-56728-4-git-send-email-borisp@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499672117-56728-1-git-send-email-borisp@mellanox.com> References: <1499672117-56728-1-git-send-email-borisp@mellanox.com> Subject: [dpdk-dev] [RFC 3/7] ethdev: add rte flow action for crypto X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jul 2017 07:35:24 -0000 The crypto action is specified by an application to request crypto offload for a flow. Signed-off-by: Boris Pismenny Signed-off-by: Aviad Yehezkel --- lib/Makefile | 1 + lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/lib/Makefile b/lib/Makefile index 07e1fd0..26c8c29 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -48,6 +48,7 @@ DEPDIRS-librte_cmdline := librte_eal DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DEPDIRS-librte_ether := librte_net librte_eal librte_mempool librte_ring DEPDIRS-librte_ether += librte_mbuf +DEPDIRS-librte_ether += librte_cryptodev DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += librte_cryptodev DEPDIRS-librte_cryptodev := librte_eal librte_mempool librte_ring librte_mbuf DEPDIRS-librte_cryptodev += librte_kvargs diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index 4b78b66..d3f75e7 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -51,6 +51,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -905,6 +906,14 @@ enum rte_flow_action_type { * See struct rte_flow_action_vf. */ RTE_FLOW_ACTION_TYPE_VF, + + /** + * Encrypts or decrypts packets matching this flow. Must be either egress + * or ingress, but not both. + * + * See struct rte_flow_action_crypto. + */ + RTE_FLOW_ACTION_TYPE_CRYPTO, }; /** @@ -998,6 +1007,23 @@ struct rte_flow_action_vf { }; /** + * RTE_FLOW_ACTION_TYPE_CRYPTO + * + * Encrypts or decrypts packets matching this flow. Must be either egress + * or ingress, but not both. + * + * Packets matched by IPsec SA lookup, which includes at least the following: + * Destination IP and ESP SPI, but it may include Source IP, UDP ports, etc. + * Packets are encrypted in the outgoing direction and decrypted in the incoming + * direction. + * + * Non-terminating by default. + */ +struct rte_flow_action_crypto { + struct rte_crypto_sym_xform xform; /* applied crypto transform */ +}; + +/** * Definition of a single action. * * A list of actions is terminated by a END action. -- 1.8.3.1