diff mbox series

[v4,03/10] net: add ESP trailer structure definition

Message ID 1544804589-10338-3-git-send-email-konstantin.ananyev@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series [v3,1/9] cryptodev: add opaque userdata pointer into crypto sym session | expand

Checks

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

Commit Message

Ananyev, Konstantin Dec. 14, 2018, 4:23 p.m. UTC
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
---
 lib/librte_net/rte_esp.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Akhil Goyal Dec. 19, 2018, 9:32 a.m. UTC | #1
On 12/14/2018 9:53 PM, Konstantin Ananyev wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
> Acked-by: Declan Doherty <declan.doherty@intel.com>
> ---
>   lib/librte_net/rte_esp.h | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_net/rte_esp.h b/lib/librte_net/rte_esp.h
> index f77ec2eb2..8e1b3d2dd 100644
> --- a/lib/librte_net/rte_esp.h
> +++ b/lib/librte_net/rte_esp.h
> @@ -11,7 +11,7 @@
>    * ESP-related defines
>    */
>   
> -#include <stdint.h>
> +#include <rte_byteorder.h>
>   
>   #ifdef __cplusplus
>   extern "C" {
> @@ -25,6 +25,14 @@ struct esp_hdr {
>   	rte_be32_t seq;  /**< packet sequence number */
>   } __attribute__((__packed__));
>   
> +/**
> + * ESP Trailer
> + */
> +struct esp_tail {
> +	uint8_t pad_len;     /**< number of pad bytes (0-255) */
> +	uint8_t next_proto;  /**< IPv4 or IPv6 or next layer header */
> +} __attribute__((__packed__));
> +
>   #ifdef __cplusplus
>   }
>   #endif
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Olivier Matz Dec. 27, 2018, 10:13 a.m. UTC | #2
Hi,

On Wed, Dec 19, 2018 at 09:32:09AM +0000, Akhil Goyal wrote:
> 
> 
> On 12/14/2018 9:53 PM, Konstantin Ananyev wrote:
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> > Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
> > Acked-by: Declan Doherty <declan.doherty@intel.com>
> > ---
> >   lib/librte_net/rte_esp.h | 10 +++++++++-
> >   1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_net/rte_esp.h b/lib/librte_net/rte_esp.h
> > index f77ec2eb2..8e1b3d2dd 100644
> > --- a/lib/librte_net/rte_esp.h
> > +++ b/lib/librte_net/rte_esp.h
> > @@ -11,7 +11,7 @@
> >    * ESP-related defines
> >    */
> >   
> > -#include <stdint.h>
> > +#include <rte_byteorder.h>
> >   
> >   #ifdef __cplusplus
> >   extern "C" {
> > @@ -25,6 +25,14 @@ struct esp_hdr {
> >   	rte_be32_t seq;  /**< packet sequence number */
> >   } __attribute__((__packed__));
> >   
> > +/**
> > + * ESP Trailer
> > + */
> > +struct esp_tail {
> > +	uint8_t pad_len;     /**< number of pad bytes (0-255) */
> > +	uint8_t next_proto;  /**< IPv4 or IPv6 or next layer header */
> > +} __attribute__((__packed__));
> > +
> >   #ifdef __cplusplus
> >   }
> >   #endif
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Is there a reason to pack the structure? I think it has no impact since
it is only composed of uint8_t, so it can be removed.

Thanks,
Olivier
diff mbox series

Patch

diff --git a/lib/librte_net/rte_esp.h b/lib/librte_net/rte_esp.h
index f77ec2eb2..8e1b3d2dd 100644
--- a/lib/librte_net/rte_esp.h
+++ b/lib/librte_net/rte_esp.h
@@ -11,7 +11,7 @@ 
  * ESP-related defines
  */
 
-#include <stdint.h>
+#include <rte_byteorder.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -25,6 +25,14 @@  struct esp_hdr {
 	rte_be32_t seq;  /**< packet sequence number */
 } __attribute__((__packed__));
 
+/**
+ * ESP Trailer
+ */
+struct esp_tail {
+	uint8_t pad_len;     /**< number of pad bytes (0-255) */
+	uint8_t next_proto;  /**< IPv4 or IPv6 or next layer header */
+} __attribute__((__packed__));
+
 #ifdef __cplusplus
 }
 #endif