[dpdk-dev,v4,1/5] lib/ethdev: support for inline IPsec events

Message ID 1523428846-9774-2-git-send-email-anoob.joseph@caviumnetworks.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Anoob Joseph April 11, 2018, 6:40 a.m. UTC
  Adding support for IPsec events in rte_eth_event framework. In inline
IPsec offload, the per packet protocol defined variables, like ESN,
would be managed by PMD. In such cases, PMD would need IPsec events
to notify application about various conditions like, ESN overflow.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
---
v4:
* Added more details in documentation
* Renamed members of struct rte_eth_event_ipsec_desc for better readablity

v3:
* No change

v2:
* Added time expiry & byte expiry IPsec events in the enum

 lib/librte_ether/rte_ethdev.h | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
  

Comments

Anoob Joseph April 19, 2018, 9:15 a.m. UTC | #1
Hi Thomas,

Are these changes fine? Can you review the changes and let me know if 
you have more comments.

Thanks,

Anoob


On 11/04/18 12:10, Anoob Joseph wrote:
> Adding support for IPsec events in rte_eth_event framework. In inline
> IPsec offload, the per packet protocol defined variables, like ESN,
> would be managed by PMD. In such cases, PMD would need IPsec events
> to notify application about various conditions like, ESN overflow.
>
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
> v4:
> * Added more details in documentation
> * Renamed members of struct rte_eth_event_ipsec_desc for better readablity
>
> v3:
> * No change
>
> v2:
> * Added time expiry & byte expiry IPsec events in the enum
>
>   lib/librte_ether/rte_ethdev.h | 41 +++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 41 insertions(+)
>
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 5e13dca..2b36883 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -2436,6 +2436,46 @@ int
>   rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
>   
>   /**
> + * Subtypes for IPsec offload event(@ref RTE_ETH_EVENT_IPSEC) raised by
> + * eth device.
> + */
> +enum rte_eth_event_ipsec_subtype {
> +	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
> +			/**< Unknown event type */
> +	RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW,
> +			/**< Sequence number overflow */
> +	RTE_ETH_EVENT_IPSEC_SA_TIME_EXPIRY,
> +			/**< Soft time expiry of SA */
> +	RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY,
> +			/**< Soft byte expiry of SA */
> +	RTE_ETH_EVENT_IPSEC_MAX
> +			/**< Max value of this enum */
> +};
> +
> +/**
> + * Descriptor for @ref RTE_ETH_EVENT_IPSEC event. Used by eth dev to send extra
> + * information of the IPsec offload event.
> + */
> +struct rte_eth_event_ipsec_desc {
> +	enum rte_eth_event_ipsec_subtype subtype;
> +			/**< Type of RTE_ETH_EVENT_IPSEC_* event */
> +	uint64_t metadata;
> +			/**< Event specific metadata
> +			 *
> +			 * For the following events, *userdata* registered
> +			 * with the *rte_security_session* would be returned
> +			 * as metadata,
> +			 *
> +			 * - @ref RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW
> +			 * - @ref RTE_ETH_EVENT_IPSEC_SA_TIME_EXPIRY
> +			 * - @ref RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY
> +			 *
> +			 * @see struct rte_security_session_conf
> +			 *
> +			 */
> +};
> +
> +/**
>    * The eth device event type for interrupt, and maybe others in the future.
>    */
>   enum rte_eth_event_type {
> @@ -2446,6 +2486,7 @@ enum rte_eth_event_type {
>   	RTE_ETH_EVENT_INTR_RESET,
>   			/**< reset interrupt event, sent to VF on PF reset */
>   	RTE_ETH_EVENT_VF_MBOX,  /**< message from the VF received by PF */
> +	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
>   	RTE_ETH_EVENT_MACSEC,   /**< MACsec offload related event */
>   	RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
>   	RTE_ETH_EVENT_NEW,      /**< port is probed */
  
Thomas Monjalon April 19, 2018, 10:26 a.m. UTC | #2
11/04/2018 08:40, Anoob Joseph:
> Adding support for IPsec events in rte_eth_event framework. In inline
> IPsec offload, the per packet protocol defined variables, like ESN,
> would be managed by PMD. In such cases, PMD would need IPsec events
> to notify application about various conditions like, ESN overflow.
> 
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---
> v4:
> * Added more details in documentation
> * Renamed members of struct rte_eth_event_ipsec_desc for better readablity

Good, thank you.

Acked-by: Thomas Monjalon <thomas@monjalon.net>
  
Stephen Hemminger April 20, 2018, 3:14 p.m. UTC | #3
On Thu, 19 Apr 2018 14:45:01 +0530
Anoob Joseph <Anoob.Joseph@caviumnetworks.com> wrote:

> > +/**
> >    * The eth device event type for interrupt, and maybe others in the future.
> >    */
> >   enum rte_eth_event_type {
> > @@ -2446,6 +2486,7 @@ enum rte_eth_event_type {
> >   	RTE_ETH_EVENT_INTR_RESET,
> >   			/**< reset interrupt event, sent to VF on PF reset */
> >   	RTE_ETH_EVENT_VF_MBOX,  /**< message from the VF received by PF */
> > +	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
> >   	RTE_ETH_EVENT_MACSEC,   /**< MACsec offload related event */
> >   	RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
> >   	RTE_ETH_EVENT_NEW,      /**< port is probed */  


Putting new value in middle of enum risks breaking ABI compatiablity
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 5e13dca..2b36883 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2436,6 +2436,46 @@  int
 rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
 
 /**
+ * Subtypes for IPsec offload event(@ref RTE_ETH_EVENT_IPSEC) raised by
+ * eth device.
+ */
+enum rte_eth_event_ipsec_subtype {
+	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
+			/**< Unknown event type */
+	RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW,
+			/**< Sequence number overflow */
+	RTE_ETH_EVENT_IPSEC_SA_TIME_EXPIRY,
+			/**< Soft time expiry of SA */
+	RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY,
+			/**< Soft byte expiry of SA */
+	RTE_ETH_EVENT_IPSEC_MAX
+			/**< Max value of this enum */
+};
+
+/**
+ * Descriptor for @ref RTE_ETH_EVENT_IPSEC event. Used by eth dev to send extra
+ * information of the IPsec offload event.
+ */
+struct rte_eth_event_ipsec_desc {
+	enum rte_eth_event_ipsec_subtype subtype;
+			/**< Type of RTE_ETH_EVENT_IPSEC_* event */
+	uint64_t metadata;
+			/**< Event specific metadata
+			 *
+			 * For the following events, *userdata* registered
+			 * with the *rte_security_session* would be returned
+			 * as metadata,
+			 *
+			 * - @ref RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW
+			 * - @ref RTE_ETH_EVENT_IPSEC_SA_TIME_EXPIRY
+			 * - @ref RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY
+			 *
+			 * @see struct rte_security_session_conf
+			 *
+			 */
+};
+
+/**
  * The eth device event type for interrupt, and maybe others in the future.
  */
 enum rte_eth_event_type {
@@ -2446,6 +2486,7 @@  enum rte_eth_event_type {
 	RTE_ETH_EVENT_INTR_RESET,
 			/**< reset interrupt event, sent to VF on PF reset */
 	RTE_ETH_EVENT_VF_MBOX,  /**< message from the VF received by PF */
+	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
 	RTE_ETH_EVENT_MACSEC,   /**< MACsec offload related event */
 	RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
 	RTE_ETH_EVENT_NEW,      /**< port is probed */