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

Message ID 1521630685-5179-2-git-send-email-anoob.joseph@caviumnetworks.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Anoob Joseph March 21, 2018, 11:11 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>
---
v3:
* No change

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

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

Comments

Akhil Goyal March 21, 2018, 11:42 a.m. UTC | #1
On 3/21/2018 4:41 PM, 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>
> ---
> v3:
> * No change
> 
> v2:
> * Added time expiry & byte expiry IPsec events in the enum
> 
>   lib/librte_ether/rte_ethdev.h | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
Series Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  
Anoob Joseph April 3, 2018, 2:27 p.m. UTC | #2
Adding maintainers of testpmd & lib/ethdev

Thanks,
Anoob
On 21/03/18 16:41, 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>
> ---
> v3:
> * No change
>
> v2:
> * Added time expiry & byte expiry IPsec events in the enum
>
>   lib/librte_ether/rte_ethdev.h | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
>
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 0361533..96b2aa0 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -2438,6 +2438,33 @@ int
>   rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
>   
>   /**
> + * Subtypes for IPsec offload events 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 in security offload */
> +	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 IPsec event. Used by eth dev to send extra information of the
> + * event.
> + */
> +struct rte_eth_event_ipsec_desc {
> +	enum rte_eth_event_ipsec_subtype stype;
> +			/** Type of IPsec event */
> +	uint64_t md;
> +			/** Event specific metadata */
> +};
> +
> +/**
>    * The eth device event type for interrupt, and maybe others in the future.
>    */
>   enum rte_eth_event_type {
> @@ -2448,6 +2475,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 */
  
Anoob Joseph April 10, 2018, 5:10 a.m. UTC | #3
Hi Thomas,

Can you review the patch and let me know if you have any comments.

Thanks,
Anoob

On 03/04/18 19:57, Anoob Joseph wrote:
> Adding maintainers of testpmd & lib/ethdev
>
> Thanks,
> Anoob
> On 21/03/18 16:41, 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>
>> ---
>> v3:
>> * No change
>>
>> v2:
>> * Added time expiry & byte expiry IPsec events in the enum
>>
>>   lib/librte_ether/rte_ethdev.h | 28 ++++++++++++++++++++++++++++
>>   1 file changed, 28 insertions(+)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.h 
>> b/lib/librte_ether/rte_ethdev.h
>> index 0361533..96b2aa0 100644
>> --- a/lib/librte_ether/rte_ethdev.h
>> +++ b/lib/librte_ether/rte_ethdev.h
>> @@ -2438,6 +2438,33 @@ int
>>   rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, 
>> uint32_t free_cnt);
>>     /**
>> + * Subtypes for IPsec offload events 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 in security offload */
>> +    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 IPsec event. Used by eth dev to send extra 
>> information of the
>> + * event.
>> + */
>> +struct rte_eth_event_ipsec_desc {
>> +    enum rte_eth_event_ipsec_subtype stype;
>> +            /** Type of IPsec event */
>> +    uint64_t md;
>> +            /** Event specific metadata */
>> +};
>> +
>> +/**
>>    * The eth device event type for interrupt, and maybe others in the 
>> future.
>>    */
>>   enum rte_eth_event_type {
>> @@ -2448,6 +2475,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 10, 2018, 9:11 a.m. UTC | #4
Hi,

21/03/2018 12:11, 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>

No comment about IPsec handling.

The documentation could try to better link things together, see below:

>  /**
> + * Subtypes for IPsec offload events 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 in security offload */
> +	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 IPsec event. Used by eth dev to send extra information of the
> + * event.
> + */

You could link it to the event type RTE_ETH_EVENT_IPSEC in this doxygen comment.

> +struct rte_eth_event_ipsec_desc {
> +	enum rte_eth_event_ipsec_subtype stype;

stype is not easy to read & understand. What about subtype?

> +			/** Type of IPsec event */

You could add the prefix of the events in this comment: RTE_ETH_EVENT_IPSEC_*

> +	uint64_t md;

What about metadata?

> +			/** Event specific metadata */

Could you describe what is the metadata, depending on each sub-type?

> +};
> +
> +/**
>   * The eth device event type for interrupt, and maybe others in the future.
>   */
>  enum rte_eth_event_type {
> @@ -2448,6 +2475,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 */
  
Anoob Joseph April 11, 2018, 3:20 a.m. UTC | #5
Hi Thomas,

Thanks for the comments. Will send a revised patch with your suggestions.

Anoob

On 10/04/18 14:41, Thomas Monjalon wrote:
> Hi,
>
> 21/03/2018 12:11, 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>
> No comment about IPsec handling.
>
> The documentation could try to better link things together, see below:
>
>>   /**
>> + * Subtypes for IPsec offload events 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 in security offload */
>> +	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 IPsec event. Used by eth dev to send extra information of the
>> + * event.
>> + */
> You could link it to the event type RTE_ETH_EVENT_IPSEC in this doxygen comment.
>
>> +struct rte_eth_event_ipsec_desc {
>> +	enum rte_eth_event_ipsec_subtype stype;
> stype is not easy to read & understand. What about subtype?
>
>> +			/** Type of IPsec event */
> You could add the prefix of the events in this comment: RTE_ETH_EVENT_IPSEC_*
>
>> +	uint64_t md;
> What about metadata?
>
>> +			/** Event specific metadata */
> Could you describe what is the metadata, depending on each sub-type?
>
>> +};
>> +
>> +/**
>>    * The eth device event type for interrupt, and maybe others in the future.
>>    */
>>   enum rte_eth_event_type {
>> @@ -2448,6 +2475,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 */
>
>
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0361533..96b2aa0 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2438,6 +2438,33 @@  int
 rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
 
 /**
+ * Subtypes for IPsec offload events 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 in security offload */
+	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 IPsec event. Used by eth dev to send extra information of the
+ * event.
+ */
+struct rte_eth_event_ipsec_desc {
+	enum rte_eth_event_ipsec_subtype stype;
+			/** Type of IPsec event */
+	uint64_t md;
+			/** Event specific metadata */
+};
+
+/**
  * The eth device event type for interrupt, and maybe others in the future.
  */
 enum rte_eth_event_type {
@@ -2448,6 +2475,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 */