[v2,1/2] mbuf: fix big endian build

Message ID 20190409200636.2193-2-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series fix big endian build |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Thomas Monjalon April 9, 2019, 8:06 p.m. UTC
  Compilation was failing when using a big endian toolchain:

rte_mbuf.h:504:2: error: expected ',' or '}' before 'RTE_MBUF_L3_LEN_OFS'

Fixes: 8d9c2c3a1f01 ("mbuf: add function to generate raw Tx offload value")
Cc: konstantin.ananyev@intel.com

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_mbuf/rte_mbuf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ananyev, Konstantin April 9, 2019, 10:55 p.m. UTC | #1
> 
> Compilation was failing when using a big endian toolchain:
> 
> rte_mbuf.h:504:2: error: expected ',' or '}' before 'RTE_MBUF_L3_LEN_OFS'
> 
> Fixes: 8d9c2c3a1f01 ("mbuf: add function to generate raw Tx offload value")
> Cc: konstantin.ananyev@intel.com
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  lib/librte_mbuf/rte_mbuf.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index f7886dcb3..7dd2e7fb3 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -500,7 +500,7 @@ enum {
>  		RTE_MBUF_OUTL2_LEN_BITS,
>  #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
>  	RTE_MBUF_L2_LEN_OFS =
> -		sizeof(uint64_t) * CHAR_BIT - RTE_MBUF_L2_LEN_BITS
> +		sizeof(uint64_t) * CHAR_BIT - RTE_MBUF_L2_LEN_BITS,
>  	RTE_MBUF_L3_LEN_OFS = RTE_MBUF_L2_LEN_OFS - RTE_MBUF_L3_LEN_BITS,
>  	RTE_MBUF_L4_LEN_OFS = RTE_MBUF_L3_LEN_OFS - RTE_MBUF_L4_LEN_BITS,
>  	RTE_MBUF_TSO_SEGSZ_OFS = RTE_MBUF_L4_LEN_OFS - RTE_MBUF_TSO_SEGSZ_BITS,
> --

Thanks for fixing
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.21.0
  
Thomas Monjalon April 22, 2019, 1:28 p.m. UTC | #2
> > Compilation was failing when using a big endian toolchain:
> > 
> > rte_mbuf.h:504:2: error: expected ',' or '}' before 'RTE_MBUF_L3_LEN_OFS'
> > 
> > Fixes: 8d9c2c3a1f01 ("mbuf: add function to generate raw Tx offload value")
> > Cc: konstantin.ananyev@intel.com
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Thanks for fixing
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied alone because patch 2 has been integrated in another patchset.
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index f7886dcb3..7dd2e7fb3 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -500,7 +500,7 @@  enum {
 		RTE_MBUF_OUTL2_LEN_BITS,
 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 	RTE_MBUF_L2_LEN_OFS =
-		sizeof(uint64_t) * CHAR_BIT - RTE_MBUF_L2_LEN_BITS
+		sizeof(uint64_t) * CHAR_BIT - RTE_MBUF_L2_LEN_BITS,
 	RTE_MBUF_L3_LEN_OFS = RTE_MBUF_L2_LEN_OFS - RTE_MBUF_L3_LEN_BITS,
 	RTE_MBUF_L4_LEN_OFS = RTE_MBUF_L3_LEN_OFS - RTE_MBUF_L4_LEN_BITS,
 	RTE_MBUF_TSO_SEGSZ_OFS = RTE_MBUF_L4_LEN_OFS - RTE_MBUF_TSO_SEGSZ_BITS,