From: Andrew Rybchenko Date: Thu, 22 Oct 2020 12:24:05 +0000 (+0100) Subject: common/sfc_efx: introduce 128-bit unsigned integer compat X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d0714c393e13e843abac7b5d148dfe21de2626ee;p=dpdk.git common/sfc_efx: introduce 128-bit unsigned integer compat Intel SSE has __m128i, but ARMv8 has __uint128_t. So, add compat efsys_uint128_t to be used in driver source and have either __u128i or __uint128_t behind. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- diff --git a/drivers/common/sfc_efx/base/efx_types.h b/drivers/common/sfc_efx/base/efx_types.h index f7ec9a7378..d67d07ba3b 100644 --- a/drivers/common/sfc_efx/base/efx_types.h +++ b/drivers/common/sfc_efx/base/efx_types.h @@ -221,8 +221,8 @@ typedef union efx_oword_u { efx_word_t eo_word[8]; efx_dword_t eo_dword[4]; efx_qword_t eo_qword[2]; -#if EFSYS_HAS_SSE2_M128 - __m128i eo_u128[1]; +#if EFSYS_HAS_UINT128 + efsys_uint128_t eo_u128[1]; #endif #if EFSYS_HAS_UINT64 uint64_t eo_u64[2]; @@ -243,8 +243,8 @@ typedef union efx_xword_u { efx_dword_t ex_dword[8]; efx_qword_t ex_qword[4]; efx_oword_t ex_oword[2]; -#if EFSYS_HAS_SSE2_M128 - __m128i ex_u128[2]; +#if EFSYS_HAS_UINT128 + efsys_uint128_t ex_u128[2]; #endif #if EFSYS_HAS_UINT64 uint64_t ex_u64[4]; diff --git a/drivers/common/sfc_efx/efsys.h b/drivers/common/sfc_efx/efsys.h index bbe9f2ef12..139f4d81d8 100644 --- a/drivers/common/sfc_efx/efsys.h +++ b/drivers/common/sfc_efx/efsys.h @@ -39,7 +39,8 @@ extern "C" { #define EFSYS_HAS_UINT64 1 #define EFSYS_USE_UINT64 1 -#define EFSYS_HAS_SSE2_M128 1 +#define EFSYS_HAS_UINT128 1 +typedef __m128i efsys_uint128_t; #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN #define EFSYS_IS_BIG_ENDIAN 1 @@ -272,13 +273,13 @@ typedef struct efsys_mem_s { #define EFSYS_MEM_READO(_esmp, _offset, _eop) \ do { \ volatile uint8_t *_base = (_esmp)->esm_base; \ - volatile __m128i *_addr; \ + volatile efsys_uint128_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ sizeof(efx_oword_t))); \ \ - _addr = (volatile __m128i *)(_base + (_offset)); \ + _addr = (volatile efsys_uint128_t *)(_base + (_offset));\ (_eop)->eo_u128[0] = _addr[0]; \ \ EFSYS_PROBE5(mem_reado, unsigned int, (_offset), \ @@ -331,7 +332,7 @@ typedef struct efsys_mem_s { #define EFSYS_MEM_WRITEO(_esmp, _offset, _eop) \ do { \ volatile uint8_t *_base = (_esmp)->esm_base; \ - volatile __m128i *_addr; \ + volatile efsys_uint128_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ @@ -344,7 +345,7 @@ typedef struct efsys_mem_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ - _addr = (volatile __m128i *)(_base + (_offset)); \ + _addr = (volatile efsys_uint128_t *)(_base + (_offset));\ _addr[0] = (_eop)->eo_u128[0]; \ \ _NOTE(CONSTANTCONDITION); \ @@ -445,7 +446,7 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_READO(_esbp, _offset, _eop, _lock) \ do { \ volatile uint8_t *_base = (_esbp)->esb_base; \ - volatile __m128i *_addr; \ + volatile efsys_uint128_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ @@ -455,7 +456,7 @@ typedef struct efsys_bar_s { if (_lock) \ SFC_BAR_LOCK(_esbp); \ \ - _addr = (volatile __m128i *)(_base + (_offset)); \ + _addr = (volatile efsys_uint128_t *)(_base + (_offset));\ rte_rmb(); \ /* There is no rte_read128_relaxed() yet */ \ (_eop)->eo_u128[0] = _addr[0]; \ @@ -537,7 +538,7 @@ typedef struct efsys_bar_s { #define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ do { \ volatile uint8_t *_base = (_esbp)->esb_base; \ - volatile __m128i *_addr; \ + volatile efsys_uint128_t *_addr; \ \ _NOTE(CONSTANTCONDITION); \ SFC_EFX_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset, \ @@ -553,7 +554,7 @@ typedef struct efsys_bar_s { uint32_t, (_eop)->eo_u32[1], \ uint32_t, (_eop)->eo_u32[0]); \ \ - _addr = (volatile __m128i *)(_base + (_offset)); \ + _addr = (volatile efsys_uint128_t *)(_base + (_offset));\ /* There is no rte_write128_relaxed() yet */ \ _addr[0] = (_eop)->eo_u128[0]; \ rte_wmb(); \