patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v3 2/6] net: fix L2TPv2 common header
       [not found] <20220129062434.2455711-1-jie1x.wang@intel.com>
@ 2022-01-29  6:24 ` Jie Wang
  2022-01-30  9:17   ` Ori Kam
       [not found] ` <20220208083849.510136-1-jie1x.wang@intel.com>
  1 sibling, 1 reply; 5+ messages in thread
From: Jie Wang @ 2022-01-29  6:24 UTC (permalink / raw)
  To: dev
  Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
	andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
	olivier.matz, Jie Wang, stable

The fields of L2TPv2 common header were reversed in big endian and
little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
Cc: stable@dpdk.org

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
---
 lib/net/rte_l2tpv2.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 938a993b48..1f3ad3f03c 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
 		__extension__
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint16_t ver:4;		/**< protocol version */
 			uint16_t res3:4;	/**< reserved */
 			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
 			uint16_t res1:2;	/**< reserved */
 			uint16_t l:1;		/**< length option bit */
 			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
+			uint16_t ver:4;		/**< protocol version */
 #endif
 		};
 	};
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v3 2/6] net: fix L2TPv2 common header
  2022-01-29  6:24 ` [PATCH v3 2/6] net: fix L2TPv2 common header Jie Wang
@ 2022-01-30  9:17   ` Ori Kam
  2022-02-01 12:20     ` Ferruh Yigit
  0 siblings, 1 reply; 5+ messages in thread
From: Ori Kam @ 2022-01-30  9:17 UTC (permalink / raw)
  To: 20220126063016.2384393-1-jie1x.wang, dev
  Cc: stevex.yang, aman.deep.singh, ferruh.yigit,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
	olivier.matz, stable



> -----Original Message-----
> From: Jie Wang <jie1x.wang@intel.com>
> Sent: Saturday, January 29, 2022 8:25 AM
> To: dev@dpdk.org
> Cc: stevex.yang@intel.com; Ori Kam <orika@nvidia.com>; aman.deep.singh@intel.com;
> ferruh.yigit@intel.com; NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> andrew.rybchenko@oktetlabs.ru; jingjing.wu@intel.com; beilei.xing@intel.com;
> qi.z.zhang@intel.com; olivier.matz@6wind.com; Jie Wang <jie1x.wang@intel.com>; stable@dpdk.org
> Subject: [PATCH v3 2/6] net: fix L2TPv2 common header
> 
> The fields of L2TPv2 common header were reversed in big endian and
> little endian.
> 
> This patch fixes this error to ensure L2TPv2 can be parsed correctly.
> 
> Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
> ---
>  lib/net/rte_l2tpv2.h | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
> index 938a993b48..1f3ad3f03c 100644
> --- a/lib/net/rte_l2tpv2.h
> +++ b/lib/net/rte_l2tpv2.h
> @@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
>  		__extension__
>  		struct {
>  #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
> -			uint16_t t:1;		/**< message Type */
> -			uint16_t l:1;		/**< length option bit */
> -			uint16_t res1:2;	/**< reserved */
> -			uint16_t s:1;		/**< ns/nr option bit */
> -			uint16_t res2:1;	/**< reserved */
> -			uint16_t o:1;		/**< offset option bit */
> -			uint16_t p:1;		/**< priority option bit */
> -			uint16_t res3:4;	/**< reserved */
> -			uint16_t ver:4;		/**< protocol version */
> -#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
>  			uint16_t ver:4;		/**< protocol version */
>  			uint16_t res3:4;	/**< reserved */
>  			uint16_t p:1;		/**< priority option bit */
> @@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
>  			uint16_t res1:2;	/**< reserved */
>  			uint16_t l:1;		/**< length option bit */
>  			uint16_t t:1;		/**< message Type */
> +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
> +			uint16_t t:1;		/**< message Type */
> +			uint16_t l:1;		/**< length option bit */
> +			uint16_t res1:2;	/**< reserved */
> +			uint16_t s:1;		/**< ns/nr option bit */
> +			uint16_t res2:1;	/**< reserved */
> +			uint16_t o:1;		/**< offset option bit */
> +			uint16_t p:1;		/**< priority option bit */
> +			uint16_t res3:4;	/**< reserved */
> +			uint16_t ver:4;		/**< protocol version */
>  #endif
>  		};
>  	};
> --
> 2.25.1

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/6] net: fix L2TPv2 common header
  2022-01-30  9:17   ` Ori Kam
@ 2022-02-01 12:20     ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2022-02-01 12:20 UTC (permalink / raw)
  To: Ori Kam, 20220126063016.2384393-1-jie1x.wang, dev
  Cc: stevex.yang, aman.deep.singh,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
	olivier.matz, stable

On 1/30/2022 9:17 AM, Ori Kam wrote:
> 
> 
>> -----Original Message-----
>> From: Jie Wang <jie1x.wang@intel.com>
>> Sent: Saturday, January 29, 2022 8:25 AM
>> To: dev@dpdk.org
>> Cc: stevex.yang@intel.com; Ori Kam <orika@nvidia.com>; aman.deep.singh@intel.com;
>> ferruh.yigit@intel.com; NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
>> andrew.rybchenko@oktetlabs.ru; jingjing.wu@intel.com; beilei.xing@intel.com;
>> qi.z.zhang@intel.com; olivier.matz@6wind.com; Jie Wang <jie1x.wang@intel.com>; stable@dpdk.org
>> Subject: [PATCH v3 2/6] net: fix L2TPv2 common header
>>
>> The fields of L2TPv2 common header were reversed in big endian and
>> little endian.
>>
>> This patch fixes this error to ensure L2TPv2 can be parsed correctly.
>>
>> Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Jie Wang <jie1x.wang@intel.com>
>> ---
>>   lib/net/rte_l2tpv2.h | 20 ++++++++++----------
>>   1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
>> index 938a993b48..1f3ad3f03c 100644
>> --- a/lib/net/rte_l2tpv2.h
>> +++ b/lib/net/rte_l2tpv2.h
>> @@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
>>   		__extension__
>>   		struct {
>>   #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
>> -			uint16_t t:1;		/**< message Type */
>> -			uint16_t l:1;		/**< length option bit */
>> -			uint16_t res1:2;	/**< reserved */
>> -			uint16_t s:1;		/**< ns/nr option bit */
>> -			uint16_t res2:1;	/**< reserved */
>> -			uint16_t o:1;		/**< offset option bit */
>> -			uint16_t p:1;		/**< priority option bit */
>> -			uint16_t res3:4;	/**< reserved */
>> -			uint16_t ver:4;		/**< protocol version */
>> -#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
>>   			uint16_t ver:4;		/**< protocol version */
>>   			uint16_t res3:4;	/**< reserved */
>>   			uint16_t p:1;		/**< priority option bit */
>> @@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
>>   			uint16_t res1:2;	/**< reserved */
>>   			uint16_t l:1;		/**< length option bit */
>>   			uint16_t t:1;		/**< message Type */
>> +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
>> +			uint16_t t:1;		/**< message Type */
>> +			uint16_t l:1;		/**< length option bit */
>> +			uint16_t res1:2;	/**< reserved */
>> +			uint16_t s:1;		/**< ns/nr option bit */
>> +			uint16_t res2:1;	/**< reserved */
>> +			uint16_t o:1;		/**< offset option bit */
>> +			uint16_t p:1;		/**< priority option bit */
>> +			uint16_t res3:4;	/**< reserved */
>> +			uint16_t ver:4;		/**< protocol version */
>>   #endif
>>   		};
>>   	};
>> --
>> 2.25.1
> 
> Acked-by: Ori Kam <orika@nvidia.com>
> 

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

What do you think putting the link of the related RFC in the commit log
for reference: https://datatracker.ietf.org/doc/html/rfc2661#section-3.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v4 2/6] net: fix L2TPv2 common header
       [not found] ` <20220208083849.510136-1-jie1x.wang@intel.com>
@ 2022-02-08  8:38   ` Jie Wang
       [not found]   ` <20220209093857.79364-1-jie1x.wang@intel.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Jie Wang @ 2022-02-08  8:38 UTC (permalink / raw)
  To: dev
  Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
	andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
	olivier.matz, Jie Wang, stable

The fields of L2TPv2 common header were reversed in big endian and
little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

For L2TP reference:
https://datatracker.ietf.org/doc/html/rfc2661#section-3.1

Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
Cc: stable@dpdk.org

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/net/rte_l2tpv2.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 938a993b48..1f3ad3f03c 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
 		__extension__
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint16_t ver:4;		/**< protocol version */
 			uint16_t res3:4;	/**< reserved */
 			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
 			uint16_t res1:2;	/**< reserved */
 			uint16_t l:1;		/**< length option bit */
 			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
+			uint16_t ver:4;		/**< protocol version */
 #endif
 		};
 	};
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v5 2/6] net: fix L2TPv2 common header
       [not found]   ` <20220209093857.79364-1-jie1x.wang@intel.com>
@ 2022-02-09  9:38     ` Jie Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jie Wang @ 2022-02-09  9:38 UTC (permalink / raw)
  To: dev
  Cc: stevex.yang, orika, aman.deep.singh, ferruh.yigit, thomas,
	andrew.rybchenko, jingjing.wu, beilei.xing, qi.z.zhang,
	olivier.matz, Jie Wang, stable

The fields of L2TPv2 common header were reversed in big endian and
little endian.

This patch fixes this error to ensure L2TPv2 can be parsed correctly.

For L2TP reference:
https://datatracker.ietf.org/doc/html/rfc2661#section-3.1

Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")
Cc: stable@dpdk.org

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/net/rte_l2tpv2.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h
index 938a993b48..1f3ad3f03c 100644
--- a/lib/net/rte_l2tpv2.h
+++ b/lib/net/rte_l2tpv2.h
@@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr {
 		__extension__
 		struct {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
-			uint16_t t:1;		/**< message Type */
-			uint16_t l:1;		/**< length option bit */
-			uint16_t res1:2;	/**< reserved */
-			uint16_t s:1;		/**< ns/nr option bit */
-			uint16_t res2:1;	/**< reserved */
-			uint16_t o:1;		/**< offset option bit */
-			uint16_t p:1;		/**< priority option bit */
-			uint16_t res3:4;	/**< reserved */
-			uint16_t ver:4;		/**< protocol version */
-#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 			uint16_t ver:4;		/**< protocol version */
 			uint16_t res3:4;	/**< reserved */
 			uint16_t p:1;		/**< priority option bit */
@@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr {
 			uint16_t res1:2;	/**< reserved */
 			uint16_t l:1;		/**< length option bit */
 			uint16_t t:1;		/**< message Type */
+#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
+			uint16_t t:1;		/**< message Type */
+			uint16_t l:1;		/**< length option bit */
+			uint16_t res1:2;	/**< reserved */
+			uint16_t s:1;		/**< ns/nr option bit */
+			uint16_t res2:1;	/**< reserved */
+			uint16_t o:1;		/**< offset option bit */
+			uint16_t p:1;		/**< priority option bit */
+			uint16_t res3:4;	/**< reserved */
+			uint16_t ver:4;		/**< protocol version */
 #endif
 		};
 	};
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-09  9:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220129062434.2455711-1-jie1x.wang@intel.com>
2022-01-29  6:24 ` [PATCH v3 2/6] net: fix L2TPv2 common header Jie Wang
2022-01-30  9:17   ` Ori Kam
2022-02-01 12:20     ` Ferruh Yigit
     [not found] ` <20220208083849.510136-1-jie1x.wang@intel.com>
2022-02-08  8:38   ` [PATCH v4 " Jie Wang
     [not found]   ` <20220209093857.79364-1-jie1x.wang@intel.com>
2022-02-09  9:38     ` [PATCH v5 " Jie Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).