net/mlx5: fix build failure on Windows

Message ID 20230217143717.203737-1-maxime.coquelin@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix build failure on Windows |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional fail Functional Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS

Commit Message

Maxime Coquelin Feb. 17, 2023, 2:37 p.m. UTC
  __always_inline is not supported on Windows, let's use
__rte_always_inline instead.

..\drivers\net\mlx5/mlx5_hws_cnt.h:162:8: error: unknown type name '__always_inline'

static __always_inline struct mlx5_hws_cnt_pool *

       ^

..\drivers\net\mlx5/mlx5_hws_cnt.h:165:9: error: incompatible pointer types returning 'struct mlx5_hws_cnt_pool *' from a function with result type 'int *' [-Werror,-Wincompatible-pointer-types]

        return cpool->cfg.host_cpool ? cpool->cfg.host_cpool : cpool;

Fixes: 13ea6bdcc7ee ("net/mlx5: support counters in cross port shared mode")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/mlx5/mlx5_hws_cnt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Feb. 17, 2023, 4:56 p.m. UTC | #1
17/02/2023 15:37, Maxime Coquelin:
> __always_inline is not supported on Windows, let's use
> __rte_always_inline instead.
> 
> ..\drivers\net\mlx5/mlx5_hws_cnt.h:162:8: error: unknown type name '__always_inline'
> 
> static __always_inline struct mlx5_hws_cnt_pool *
> 
>        ^
> 
> ..\drivers\net\mlx5/mlx5_hws_cnt.h:165:9: error: incompatible pointer types returning 'struct mlx5_hws_cnt_pool *' from a function with result type 'int *' [-Werror,-Wincompatible-pointer-types]
> 
>         return cpool->cfg.host_cpool ? cpool->cfg.host_cpool : cpool;
> 
> Fixes: 13ea6bdcc7ee ("net/mlx5: support counters in cross port shared mode")
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Applied, thanks.
  
Slava Ovsiienko Feb. 18, 2023, 8:56 p.m. UTC | #2
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Friday, February 17, 2023 4:37 PM
> To: dev@dpdk.org; Slava Ovsiienko <viacheslavo@nvidia.com>; NBU-Contact-
> Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [PATCH] net/mlx5: fix build failure on Windows
> 
> __always_inline is not supported on Windows, let's use __rte_always_inline
> instead.
> 
> ..\drivers\net\mlx5/mlx5_hws_cnt.h:162:8: error: unknown type name
> '__always_inline'
> 
> static __always_inline struct mlx5_hws_cnt_pool *
> 
>        ^
> 
> ..\drivers\net\mlx5/mlx5_hws_cnt.h:165:9: error: incompatible pointer types
> returning 'struct mlx5_hws_cnt_pool *' from a function with result type 'int *' [-
> Werror,-Wincompatible-pointer-types]
> 
>         return cpool->cfg.host_cpool ? cpool->cfg.host_cpool : cpool;
> 
> Fixes: 13ea6bdcc7ee ("net/mlx5: support counters in cross port shared mode")
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Thank you for the fix,
With best regards,
Slava
  

Patch

diff --git a/drivers/net/mlx5/mlx5_hws_cnt.h b/drivers/net/mlx5/mlx5_hws_cnt.h
index d35d083eeb..b4f3db0533 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.h
+++ b/drivers/net/mlx5/mlx5_hws_cnt.h
@@ -159,7 +159,7 @@  struct mlx5_hws_age_param {
  * @return
  *   Internal index
  */
-static __always_inline struct mlx5_hws_cnt_pool *
+static __rte_always_inline struct mlx5_hws_cnt_pool *
 mlx5_hws_cnt_host_pool(struct mlx5_hws_cnt_pool *cpool)
 {
 	return cpool->cfg.host_cpool ? cpool->cfg.host_cpool : cpool;