net/*: replace intrinsic header include with rte_vect

Message ID 20240620123218.1936250-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/*: replace intrinsic header include with rte_vect |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Bruce Richardson June 20, 2024, 12:32 p.m. UTC
Rather than having the SSE code in each driver include tmmintrin.h,
which often does not contain all needed intrinsics, e.g.
_mm_cvtsi128_si64() for 32-bit x86 builds, we can just replace the
include of ?mmintrin.h with rte_vect.h for all network drivers.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/fm10k/fm10k_rxtx_vec.c          | 2 +-
 drivers/net/i40e/i40e_rxtx_vec_sse.c        | 2 +-
 drivers/net/iavf/iavf_rxtx_vec_sse.c        | 2 +-
 drivers/net/ice/ice_rxtx_vec_sse.c          | 2 +-
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c      | 2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h        | 2 +-
 drivers/net/ngbe/ngbe_rxtx_vec_sse.c        | 2 +-
 drivers/net/txgbe/txgbe_rxtx_vec_sse.c      | 2 +-
 drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)
  

Comments

Stephen Hemminger June 20, 2024, 2:46 p.m. UTC | #1
On Thu, 20 Jun 2024 13:32:18 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> Rather than having the SSE code in each driver include tmmintrin.h,
> which often does not contain all needed intrinsics, e.g.
> _mm_cvtsi128_si64() for 32-bit x86 builds, we can just replace the
> include of ?mmintrin.h with rte_vect.h for all network drivers.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Konstantin Ananyev June 20, 2024, 3:21 p.m. UTC | #2
> Rather than having the SSE code in each driver include tmmintrin.h,
> which often does not contain all needed intrinsics, e.g.
> _mm_cvtsi128_si64() for 32-bit x86 builds, we can just replace the
> include of ?mmintrin.h with rte_vect.h for all network drivers.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  drivers/net/fm10k/fm10k_rxtx_vec.c          | 2 +-
>  drivers/net/i40e/i40e_rxtx_vec_sse.c        | 2 +-
>  drivers/net/iavf/iavf_rxtx_vec_sse.c        | 2 +-
>  drivers/net/ice/ice_rxtx_vec_sse.c          | 2 +-
>  drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c      | 2 +-
>  drivers/net/mlx5/mlx5_rxtx_vec_sse.h        | 2 +-
>  drivers/net/ngbe/ngbe_rxtx_vec_sse.c        | 2 +-
>  drivers/net/txgbe/txgbe_rxtx_vec_sse.c      | 2 +-
>  drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
>  9 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
> index 62119de373..9a84775cb1 100644
> --- a/drivers/net/fm10k/fm10k_rxtx_vec.c
> +++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
> @@ -10,7 +10,7 @@
>  #include "fm10k.h"
>  #include "base/fm10k_type.h"
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  #ifndef __INTEL_COMPILER
>  #pragma GCC diagnostic ignored "-Wcast-qual"
> diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
> index 2d4480a765..ad560d2b6b 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
> +++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
> @@ -12,7 +12,7 @@
>  #include "i40e_rxtx.h"
>  #include "i40e_rxtx_vec_common.h"
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  #ifndef __INTEL_COMPILER
>  #pragma GCC diagnostic ignored "-Wcast-qual"
> diff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c b/drivers/net/iavf/iavf_rxtx_vec_sse.c
> index 96f187f511..0db6fa8bd4 100644
> --- a/drivers/net/iavf/iavf_rxtx_vec_sse.c
> +++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c
> @@ -10,7 +10,7 @@
>  #include "iavf_rxtx.h"
>  #include "iavf_rxtx_vec_common.h"
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  #ifndef __INTEL_COMPILER
>  #pragma GCC diagnostic ignored "-Wcast-qual"
> diff --git a/drivers/net/ice/ice_rxtx_vec_sse.c b/drivers/net/ice/ice_rxtx_vec_sse.c
> index 9a1b7e3e51..c01d8ede29 100644
> --- a/drivers/net/ice/ice_rxtx_vec_sse.c
> +++ b/drivers/net/ice/ice_rxtx_vec_sse.c
> @@ -4,7 +4,7 @@
> 
>  #include "ice_rxtx_vec_common.h"
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  #ifndef __INTEL_COMPILER
>  #pragma GCC diagnostic ignored "-Wcast-qual"
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> index f60808d576..a77370cdb7 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
> @@ -10,7 +10,7 @@
>  #include "ixgbe_rxtx.h"
>  #include "ixgbe_rxtx_vec_common.h"
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  #ifndef __INTEL_COMPILER
>  #pragma GCC diagnostic ignored "-Wcast-qual"
> diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
> index 2bdd1f676d..93d6d1b5f0 100644
> --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
> +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
> @@ -9,7 +9,7 @@
>  #include <stdint.h>
>  #include <string.h>
>  #include <stdlib.h>
> -#include <smmintrin.h>
> +#include <rte_vect.h>
> 
>  #include <rte_mbuf.h>
>  #include <rte_mempool.h>
> diff --git a/drivers/net/ngbe/ngbe_rxtx_vec_sse.c b/drivers/net/ngbe/ngbe_rxtx_vec_sse.c
> index f703d0ea15..b128bd3a67 100644
> --- a/drivers/net/ngbe/ngbe_rxtx_vec_sse.c
> +++ b/drivers/net/ngbe/ngbe_rxtx_vec_sse.c
> @@ -11,7 +11,7 @@
>  #include "ngbe_rxtx.h"
>  #include "ngbe_rxtx_vec_common.h"
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  static inline void
>  ngbe_rxq_rearm(struct ngbe_rx_queue *rxq)
> diff --git a/drivers/net/txgbe/txgbe_rxtx_vec_sse.c b/drivers/net/txgbe/txgbe_rxtx_vec_sse.c
> index 12eb4aeef5..1a3f2ce3cd 100644
> --- a/drivers/net/txgbe/txgbe_rxtx_vec_sse.c
> +++ b/drivers/net/txgbe/txgbe_rxtx_vec_sse.c
> @@ -10,7 +10,7 @@
>  #include "txgbe_rxtx.h"
>  #include "txgbe_rxtx_vec_common.h"
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  static inline void
>  txgbe_rxq_rearm(struct txgbe_rx_queue *rxq)
> diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
> index 6a18741b6d..d53acc4fd6 100644
> --- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
> +++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
> @@ -8,7 +8,7 @@
>  #include <string.h>
>  #include <errno.h>
> 
> -#include <tmmintrin.h>
> +#include <rte_vect.h>
> 
>  #include <rte_byteorder.h>
>  #include <rte_branch_prediction.h>
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>

> 2.43.0
  
Tyler Retzlaff June 21, 2024, 9:06 p.m. UTC | #3
On Thu, Jun 20, 2024 at 01:32:18PM +0100, Bruce Richardson wrote:
> Rather than having the SSE code in each driver include tmmintrin.h,
> which often does not contain all needed intrinsics, e.g.
> _mm_cvtsi128_si64() for 32-bit x86 builds, we can just replace the
> include of ?mmintrin.h with rte_vect.h for all network drivers.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  
Ferruh Yigit July 6, 2024, 6:50 p.m. UTC | #4
On 6/21/2024 10:06 PM, Tyler Retzlaff wrote:
> On Thu, Jun 20, 2024 at 01:32:18PM +0100, Bruce Richardson wrote:
>> Rather than having the SSE code in each driver include tmmintrin.h,
>> which often does not contain all needed intrinsics, e.g.
>> _mm_cvtsi128_si64() for 32-bit x86 builds, we can just replace the
>> include of ?mmintrin.h with rte_vect.h for all network drivers.
>>
>> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>> ---
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> 

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 62119de373..9a84775cb1 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -10,7 +10,7 @@ 
 #include "fm10k.h"
 #include "base/fm10k_type.h"
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 2d4480a765..ad560d2b6b 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -12,7 +12,7 @@ 
 #include "i40e_rxtx.h"
 #include "i40e_rxtx_vec_common.h"
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
diff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c b/drivers/net/iavf/iavf_rxtx_vec_sse.c
index 96f187f511..0db6fa8bd4 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_sse.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c
@@ -10,7 +10,7 @@ 
 #include "iavf_rxtx.h"
 #include "iavf_rxtx_vec_common.h"
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
diff --git a/drivers/net/ice/ice_rxtx_vec_sse.c b/drivers/net/ice/ice_rxtx_vec_sse.c
index 9a1b7e3e51..c01d8ede29 100644
--- a/drivers/net/ice/ice_rxtx_vec_sse.c
+++ b/drivers/net/ice/ice_rxtx_vec_sse.c
@@ -4,7 +4,7 @@ 
 
 #include "ice_rxtx_vec_common.h"
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index f60808d576..a77370cdb7 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -10,7 +10,7 @@ 
 #include "ixgbe_rxtx.h"
 #include "ixgbe_rxtx_vec_common.h"
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wcast-qual"
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index 2bdd1f676d..93d6d1b5f0 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -9,7 +9,7 @@ 
 #include <stdint.h>
 #include <string.h>
 #include <stdlib.h>
-#include <smmintrin.h>
+#include <rte_vect.h>
 
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
diff --git a/drivers/net/ngbe/ngbe_rxtx_vec_sse.c b/drivers/net/ngbe/ngbe_rxtx_vec_sse.c
index f703d0ea15..b128bd3a67 100644
--- a/drivers/net/ngbe/ngbe_rxtx_vec_sse.c
+++ b/drivers/net/ngbe/ngbe_rxtx_vec_sse.c
@@ -11,7 +11,7 @@ 
 #include "ngbe_rxtx.h"
 #include "ngbe_rxtx_vec_common.h"
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 static inline void
 ngbe_rxq_rearm(struct ngbe_rx_queue *rxq)
diff --git a/drivers/net/txgbe/txgbe_rxtx_vec_sse.c b/drivers/net/txgbe/txgbe_rxtx_vec_sse.c
index 12eb4aeef5..1a3f2ce3cd 100644
--- a/drivers/net/txgbe/txgbe_rxtx_vec_sse.c
+++ b/drivers/net/txgbe/txgbe_rxtx_vec_sse.c
@@ -10,7 +10,7 @@ 
 #include "txgbe_rxtx.h"
 #include "txgbe_rxtx_vec_common.h"
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 static inline void
 txgbe_rxq_rearm(struct txgbe_rx_queue *rxq)
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
index 6a18741b6d..d53acc4fd6 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
@@ -8,7 +8,7 @@ 
 #include <string.h>
 #include <errno.h>
 
-#include <tmmintrin.h>
+#include <rte_vect.h>
 
 #include <rte_byteorder.h>
 #include <rte_branch_prediction.h>