[v1,1/4] lib: add optional fields in GRE header

Message ID 20220126084404.40178-2-xiazhang@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series Add support for GRE optional fields matching |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Sean Zhang Jan. 26, 2022, 8:44 a.m. UTC
  There are optional fields in GRE header(checksum/key/sequence), this
patch adds definition of structures of the optional fields.

Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
---
 lib/net/rte_gre.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
  

Comments

Ori Kam Feb. 1, 2022, 12:47 p.m. UTC | #1
Hi Sean,

> -----Original Message-----
> From: Sean Zhang <xiazhang@nvidia.com>
> Subject: [v1 1/4] lib: add optional fields in GRE header
> 
> There are optional fields in GRE header(checksum/key/sequence), this
> patch adds definition of structures of the optional fields.
> 
> Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
> ---
>  lib/net/rte_gre.h | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/lib/net/rte_gre.h b/lib/net/rte_gre.h
> index 5897756..5113e79 100644
> --- a/lib/net/rte_gre.h
> +++ b/lib/net/rte_gre.h
> @@ -48,6 +48,27 @@ struct rte_gre_hdr {
>  	uint16_t proto;  /**< Protocol Type */
>  } __rte_packed;
> 
> +/**
> + * Optional field checksum in GRE header
> + */
> +struct rte_gre_hdr_opt_checksum {
> +	rte_be16_t checksum;
> +} __rte_packed;
> +
> +/**
> + * Optional field key in GRE header
> + */
> +struct rte_gre_hdr_opt_key {
> +	rte_be32_t key;
> +} __rte_packed;
> +
> +/**
> + * Optional field sequence in GRE header
> + */
> +struct rte_gre_hdr_opt_sequence {
> +	rte_be32_t sequence;
> +} __rte_packed;
> +
>  #ifdef __cplusplus
>  }
>  #endif
> --
> 1.8.3.1

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
  

Patch

diff --git a/lib/net/rte_gre.h b/lib/net/rte_gre.h
index 5897756..5113e79 100644
--- a/lib/net/rte_gre.h
+++ b/lib/net/rte_gre.h
@@ -48,6 +48,27 @@  struct rte_gre_hdr {
 	uint16_t proto;  /**< Protocol Type */
 } __rte_packed;
 
+/**
+ * Optional field checksum in GRE header
+ */
+struct rte_gre_hdr_opt_checksum {
+	rte_be16_t checksum;
+} __rte_packed;
+
+/**
+ * Optional field key in GRE header
+ */
+struct rte_gre_hdr_opt_key {
+	rte_be32_t key;
+} __rte_packed;
+
+/**
+ * Optional field sequence in GRE header
+ */
+struct rte_gre_hdr_opt_sequence {
+	rte_be32_t sequence;
+} __rte_packed;
+
 #ifdef __cplusplus
 }
 #endif