patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 2/7] net/ixgbe/base: correct definition of macro
       [not found] <20250326155230.1315056-1-bruce.richardson@intel.com>
@ 2025-03-26 15:52 ` Bruce Richardson
  2025-03-26 15:52 ` [PATCH 3/7] net/ixgbe/base: fix compilation warnings Bruce Richardson
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 15:52 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable, Anatoly Burakov, Vladimir Medvedkin

The definition of IXGBE_LE32_TO_CPUS macro is meant to modify the value
in place - similar to the le32_to_cpus() macro in kernel. Fixing the
definition allows us to remove some warning flags, and removes the need
for the uintptr_t typecasts.

Fixes: aa4fc14d2cee ("ixgbe: update base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_common.c | 4 ++--
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h  | 2 +-
 drivers/net/intel/ixgbe/base/meson.build    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_common.c b/drivers/net/intel/ixgbe/base/ixgbe_common.c
index d6425c5b78..fbc9605e4d 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_common.c
@@ -4610,7 +4610,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* first pull in the header so we know the buffer length */
 	for (bi = 0; bi < dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 	/*
@@ -4646,7 +4646,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* Pull in the rest of the buffer (bi is where we left off) */
 	for (; bi <= dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 rel_out:
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index cffc6a4ce8..6e5f7b4ae8 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -83,7 +83,7 @@ enum {
 #define IXGBE_LE16_TO_CPU(_i)  rte_le_to_cpu_16(_i)
 #define IXGBE_LE32_TO_CPU(_i)  rte_le_to_cpu_32(_i)
 #define IXGBE_LE64_TO_CPU(_i)  rte_le_to_cpu_64(_i)
-#define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(_i)
+#define IXGBE_LE32_TO_CPUS(_i) do { *_i = rte_le_to_cpu_32(*_i); } while(0)
 #define IXGBE_CPU_TO_BE16(_i)  rte_cpu_to_be_16(_i)
 #define IXGBE_CPU_TO_BE32(_i)  rte_cpu_to_be_32(_i)
 #define IXGBE_BE32_TO_CPU(_i)  rte_be_to_cpu_32(_i)
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index 7e4fbdfa0f..f8b2ee6341 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,7 +19,7 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = ['-Wno-unused-value',
+error_cflags = [
         '-Wno-unused-but-set-variable',
         '-Wno-unused-parameter',
         ]
-- 
2.45.2


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

* [PATCH 3/7] net/ixgbe/base: fix compilation warnings
       [not found] <20250326155230.1315056-1-bruce.richardson@intel.com>
  2025-03-26 15:52 ` [PATCH 2/7] net/ixgbe/base: correct definition of macro Bruce Richardson
@ 2025-03-26 15:52 ` Bruce Richardson
  2025-03-26 15:52 ` [PATCH 4/7] net/i40e/base: fix unused value warnings Bruce Richardson
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 15:52 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Anatoly Burakov, Vladimir Medvedkin,
	Jedrzej Jagielski, Stefan Wegrzyn, Piotr Kwapulinski

We can remove almost all of the "unused parameter" and "unused variable"
warnings by just improving the macro definitions in the osdep.h header.
Remaining two instances can be fixed by just one-line additions to the
code, so add those to give us a clean build with the warnings enabled.

Fixes: af75078fece3 ("first public release")
Fixes: c6cb313da739 ("net/ixgbe/base: add link management for E610")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_e610.c  |  2 ++
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 19 +++++++++++--------
 drivers/net/intel/ixgbe/base/meson.build   | 11 -----------
 3 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.c b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
index 5474c3012a..7420c78d07 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
@@ -1054,6 +1054,7 @@ static void ixgbe_parse_vsi_func_caps(struct ixgbe_hw *hw,
 				      struct ixgbe_hw_func_caps *func_p,
 				      struct ixgbe_aci_cmd_list_caps_elem *cap)
 {
+	UNREFERENCED_PARAMETER(cap);
 	func_p->guar_num_vsi = ixgbe_get_num_per_func(hw, IXGBE_MAX_VSI);
 }
 
@@ -1770,6 +1771,7 @@ s32 ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
 	struct ixgbe_aci_cmd_set_event_mask *cmd;
 	struct ixgbe_aci_desc desc;
 
+	UNREFERENCED_PARAMETER(port_num);
 	cmd = &desc.params.set_event_mask;
 
 	ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_event_mask);
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 6e5f7b4ae8..398c38bffd 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -57,13 +57,16 @@
 
 /* Bunch of defines for shared code bogosity */
 #ifndef UNREFERENCED_PARAMETER
-#define UNREFERENCED_PARAMETER(_p)  
+#define UNREFERENCED_PARAMETER(_p) (void)(_p)
 #endif
-#define UNREFERENCED_1PARAMETER(_p) 
-#define UNREFERENCED_2PARAMETER(_p, _q)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) 
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) 
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) do { (void)(_p); (void)(_q); } while(0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while(0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while(0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while(0)
 
 /* Shared code error reporting */
 enum {
@@ -130,8 +133,8 @@ static inline uint32_t ixgbe_read_addr(volatile void* addr)
 	IXGBE_PCI_REG_ADDR((hw), (reg) + ((index) << 2))
 
 /* Not implemented !! */
-#define IXGBE_READ_PCIE_WORD(hw, reg) 0	
-#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { } while(0)
+#define IXGBE_READ_PCIE_WORD(hw, reg)  ((void)hw, (void)(reg), 0)
+#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { (void)hw; (void)reg; (void)value; } while(0)
 
 #define IXGBE_WRITE_FLUSH(a) IXGBE_READ_REG(a, IXGBE_STATUS)
 
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index f8b2ee6341..64e0bfd7be 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,17 +19,6 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
-        ]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('ixgbe_base', sources,
     dependencies: [static_rte_eal, static_rte_net],
     c_args: c_args)
-- 
2.45.2


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

* [PATCH 4/7] net/i40e/base: fix unused value warnings
       [not found] <20250326155230.1315056-1-bruce.richardson@intel.com>
  2025-03-26 15:52 ` [PATCH 2/7] net/ixgbe/base: correct definition of macro Bruce Richardson
  2025-03-26 15:52 ` [PATCH 3/7] net/ixgbe/base: fix compilation warnings Bruce Richardson
@ 2025-03-26 15:52 ` Bruce Richardson
  2025-03-26 15:52 ` [PATCH 5/7] net/i40e/base: fix compiler warnings Bruce Richardson
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 15:52 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Ian Stokes, Helin Zhang, Jijiang Liu,
	Jingjing Wu, Jing Chen, Heqing Zhu

Fix warnings about unused values - parameters, variables, etc., and
remove the warning disable flags for them. Although modifying the
base-code files is not ideal, the changes required are minor, and only
affect two files from the imported base code.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_nvm.c   |  2 +-
 drivers/net/intel/i40e/base/i40e_osdep.h |  4 ++--
 drivers/net/intel/i40e/base/i40e_type.h  | 14 +++++++++-----
 drivers/net/intel/i40e/base/meson.build  |  3 ---
 drivers/net/intel/i40e/i40e_ethdev.c     |  1 +
 5 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
index 3e16a0d997..56dc4d9279 100644
--- a/drivers/net/intel/i40e/base/i40e_nvm.c
+++ b/drivers/net/intel/i40e/base/i40e_nvm.c
@@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
  **/
 STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
 						    struct i40e_nvm_access *cmd,
-						    u8 *bytes, int *perrno)
+						    u8 *bytes, __rte_unused int *perrno)
 {
 	u32 aq_total_len;
 	u32 aq_desc_len;
diff --git a/drivers/net/intel/i40e/base/i40e_osdep.h b/drivers/net/intel/i40e/base/i40e_osdep.h
index c04f94732a..197f4678bf 100644
--- a/drivers/net/intel/i40e/base/i40e_osdep.h
+++ b/drivers/net/intel/i40e/base/i40e_osdep.h
@@ -184,8 +184,8 @@ struct __rte_packed_begin i40e_dma_mem {
 	const void *zone;
 } __rte_packed_end;
 
-#define i40e_allocate_dma_mem(h, m, unused, s, a) \
-			i40e_allocate_dma_mem_d(h, m, s, a)
+#define i40e_allocate_dma_mem(h, m, mt, s, a) \
+			i40e_allocate_dma_mem_d(h, m, mt, s, a)
 #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m)
 
 struct __rte_packed_begin i40e_virt_mem {
diff --git a/drivers/net/intel/i40e/base/i40e_type.h b/drivers/net/intel/i40e/base/i40e_type.h
index 7cc746f82f..968e1982a6 100644
--- a/drivers/net/intel/i40e/base/i40e_type.h
+++ b/drivers/net/intel/i40e/base/i40e_type.h
@@ -14,11 +14,15 @@
 #include "i40e_devids.h"
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p);
-#define UNREFERENCED_2PARAMETER(_p, _q) (_p); (_q);
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) (_p); (_q); (_r);
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) (_p); (_q); (_r); (_s);
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) (_p); (_q); (_r); (_s); (_t);
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) \
+	do { (void)(_p); (void)(_q); } while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while (0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while (0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while (0)
 
 #define BIT(a) (1UL << (a))
 #define BIT_ULL(a) (1ULL << (a))
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index a0912b1788..2648e5d0c4 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -13,10 +13,7 @@ sources = [
 
 error_cflags = [
         '-Wno-sign-compare',
-        '-Wno-unused-value',
         '-Wno-strict-aliasing',
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
 ]
 c_args = cflags
 foreach flag: error_cflags
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 1c5ab35a8b..90eba3419f 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -4694,6 +4694,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev,
 enum i40e_status_code
 i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw,
 			struct i40e_dma_mem *mem,
+			__rte_unused enum i40e_memory_type mtype,
 			u64 size,
 			u32 alignment)
 {
-- 
2.45.2


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

* [PATCH 5/7] net/i40e/base: fix compiler warnings
       [not found] <20250326155230.1315056-1-bruce.richardson@intel.com>
                   ` (2 preceding siblings ...)
  2025-03-26 15:52 ` [PATCH 4/7] net/i40e/base: fix unused value warnings Bruce Richardson
@ 2025-03-26 15:52 ` Bruce Richardson
       [not found] ` <20250326160539.1316499-1-bruce.richardson@intel.com>
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 15:52 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Ian Stokes, Jijiang Liu, Cunming Liang,
	Jing Chen, Jingjing Wu, Heqing Zhu

Add a single-line fix to the base code, and then the remaining two
compiler warning disable flags can be removed from the driver base code
build file.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_diag.c |  2 +-
 drivers/net/intel/i40e/base/meson.build | 13 +------------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_diag.c b/drivers/net/intel/i40e/base/i40e_diag.c
index 4ca102cdd5..71b2e53e85 100644
--- a/drivers/net/intel/i40e/base/i40e_diag.c
+++ b/drivers/net/intel/i40e/base/i40e_diag.c
@@ -34,7 +34,7 @@ static enum i40e_status_code i40e_diag_reg_pattern_test(struct i40e_hw *hw,
 {
 	const u32 patterns[] = {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
 	u32 pat, val, orig_val;
-	int i;
+	unsigned int i;
 
 	orig_val = rd32(hw, reg);
 	for (i = 0; i < ARRAY_SIZE(patterns); i++) {
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index 2648e5d0c4..766383101b 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -11,18 +11,7 @@ sources = [
         'i40e_nvm.c',
 ]
 
-error_cflags = [
-        '-Wno-sign-compare',
-        '-Wno-strict-aliasing',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('i40e_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


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

* [PATCH v2 1/8] net/fm10k/base: fix compilation warnings
       [not found] ` <20250326160539.1316499-1-bruce.richardson@intel.com>
@ 2025-03-26 16:05   ` Bruce Richardson
  2025-03-26 16:05   ` [PATCH v2 3/8] net/ixgbe/base: correct definition of macro Bruce Richardson
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 16:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable, Jing Chen

The fixes required to re-enable warnings in the fm10k base code are
trivial, so let's make the changes and get a clean compile without any
warning disable flags.

* provide definitions for the UNREFERENCED_PARAMETER macros
* fix the spelling of the work "fallthrough" in comments
* provide a definition of FM10K_READ_PCI_WORD in os_dep.h that marks the
  parameters as used.

Fixes: 7223d200c227 ("fm10k: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/fm10k/base/fm10k_mbx.c   |  2 +-
 drivers/net/intel/fm10k/base/fm10k_osdep.h |  2 +-
 drivers/net/intel/fm10k/base/fm10k_pf.c    |  8 ++++----
 drivers/net/intel/fm10k/base/fm10k_type.h  |  6 +++---
 drivers/net/intel/fm10k/base/meson.build   | 14 +-------------
 5 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/drivers/net/intel/fm10k/base/fm10k_mbx.c b/drivers/net/intel/fm10k/base/fm10k_mbx.c
index 2bb0d82efe..9028403757 100644
--- a/drivers/net/intel/fm10k/base/fm10k_mbx.c
+++ b/drivers/net/intel/fm10k/base/fm10k_mbx.c
@@ -1602,7 +1602,7 @@ s32 fm10k_pfvf_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,
 			mbx->mbmem_reg = FM10K_MBMEM_VF(id, 0);
 			break;
 		}
-		/* fallthough */
+		/* fallthrough */
 	default:
 		return FM10K_MBX_ERR_NO_MBX;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_osdep.h b/drivers/net/intel/fm10k/base/fm10k_osdep.h
index a727a57481..5f8ff10474 100644
--- a/drivers/net/intel/fm10k/base/fm10k_osdep.h
+++ b/drivers/net/intel/fm10k/base/fm10k_osdep.h
@@ -67,7 +67,7 @@ typedef uint64_t   u64;
 #define FM10K_PCI_REG_WRITE(reg, value) rte_write32((value), (reg))
 
 /* not implemented */
-#define FM10K_READ_PCI_WORD(hw, reg)     0
+#define FM10K_READ_PCI_WORD(hw, reg)     ((void)hw, (void)reg, 0)
 
 #define FM10K_WRITE_MBX(hw, reg, value) FM10K_WRITE_REG(hw, reg, value)
 #define FM10K_READ_MBX(hw, reg) FM10K_READ_REG(hw, reg)
diff --git a/drivers/net/intel/fm10k/base/fm10k_pf.c b/drivers/net/intel/fm10k/base/fm10k_pf.c
index 439dd224de..b54116a4b5 100644
--- a/drivers/net/intel/fm10k/base/fm10k_pf.c
+++ b/drivers/net/intel/fm10k/base/fm10k_pf.c
@@ -1362,19 +1362,19 @@ STATIC u8 fm10k_iov_supported_xcast_mode_pf(struct fm10k_vf_info *vf_info,
 	case FM10K_XCAST_MODE_PROMISC:
 		if (vf_flags & FM10K_VF_FLAG_PROMISC_CAPABLE)
 			return FM10K_XCAST_MODE_PROMISC;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_ALLMULTI:
 		if (vf_flags & FM10K_VF_FLAG_ALLMULTI_CAPABLE)
 			return FM10K_XCAST_MODE_ALLMULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_MULTI:
 		if (vf_flags & FM10K_VF_FLAG_MULTI_CAPABLE)
 			return FM10K_XCAST_MODE_MULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_NONE:
 		if (vf_flags & FM10K_VF_FLAG_NONE_CAPABLE)
 			return FM10K_XCAST_MODE_NONE;
-		/* fallthough */
+		/* fallthrough */
 	default:
 		break;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_type.h b/drivers/net/intel/fm10k/base/fm10k_type.h
index 84781ba9b2..437fb1c55e 100644
--- a/drivers/net/intel/fm10k/base/fm10k_type.h
+++ b/drivers/net/intel/fm10k/base/fm10k_type.h
@@ -83,9 +83,9 @@ struct fm10k_hw;
 #define FM10K_NOT_IMPLEMENTED			0x7FFFFFFF
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p)
-#define UNREFERENCED_2PARAMETER(_p, _q)	    do { (_p); (_q); } while (0)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { (_p); (_q); (_r); } while (0)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q)	    do { (void)(_p); (void)(_q); } while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { (void)(_p); (void)(_q); (void)(_r); } while (0)
 
 /* Start of PF registers */
 #define FM10K_CTRL		0x0000
diff --git a/drivers/net/intel/fm10k/base/meson.build b/drivers/net/intel/fm10k/base/meson.build
index f24e453fd0..a2640d1ee8 100644
--- a/drivers/net/intel/fm10k/base/meson.build
+++ b/drivers/net/intel/fm10k/base/meson.build
@@ -10,19 +10,7 @@ sources = [
         'fm10k_vf.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-parameter',
-        '-Wno-unused-value',
-        '-Wno-implicit-fallthrough',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('fm10k_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


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

* [PATCH v2 3/8] net/ixgbe/base: correct definition of macro
       [not found] ` <20250326160539.1316499-1-bruce.richardson@intel.com>
  2025-03-26 16:05   ` [PATCH v2 1/8] net/fm10k/base: fix compilation warnings Bruce Richardson
@ 2025-03-26 16:05   ` Bruce Richardson
  2025-03-26 16:05   ` [PATCH v2 4/8] net/ixgbe/base: fix compilation warnings Bruce Richardson
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 16:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable, Anatoly Burakov, Vladimir Medvedkin

The definition of IXGBE_LE32_TO_CPUS macro is meant to modify the value
in place - similar to the le32_to_cpus() macro in kernel. Fixing the
definition allows us to remove some warning flags, and removes the need
for the uintptr_t typecasts.

Fixes: aa4fc14d2cee ("ixgbe: update base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_common.c | 4 ++--
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h  | 2 +-
 drivers/net/intel/ixgbe/base/meson.build    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_common.c b/drivers/net/intel/ixgbe/base/ixgbe_common.c
index d6425c5b78..fbc9605e4d 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_common.c
@@ -4610,7 +4610,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* first pull in the header so we know the buffer length */
 	for (bi = 0; bi < dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 	/*
@@ -4646,7 +4646,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* Pull in the rest of the buffer (bi is where we left off) */
 	for (; bi <= dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 rel_out:
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index cffc6a4ce8..6e5f7b4ae8 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -83,7 +83,7 @@ enum {
 #define IXGBE_LE16_TO_CPU(_i)  rte_le_to_cpu_16(_i)
 #define IXGBE_LE32_TO_CPU(_i)  rte_le_to_cpu_32(_i)
 #define IXGBE_LE64_TO_CPU(_i)  rte_le_to_cpu_64(_i)
-#define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(_i)
+#define IXGBE_LE32_TO_CPUS(_i) do { *_i = rte_le_to_cpu_32(*_i); } while(0)
 #define IXGBE_CPU_TO_BE16(_i)  rte_cpu_to_be_16(_i)
 #define IXGBE_CPU_TO_BE32(_i)  rte_cpu_to_be_32(_i)
 #define IXGBE_BE32_TO_CPU(_i)  rte_be_to_cpu_32(_i)
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index 7e4fbdfa0f..f8b2ee6341 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,7 +19,7 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = ['-Wno-unused-value',
+error_cflags = [
         '-Wno-unused-but-set-variable',
         '-Wno-unused-parameter',
         ]
-- 
2.45.2


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

* [PATCH v2 4/8] net/ixgbe/base: fix compilation warnings
       [not found] ` <20250326160539.1316499-1-bruce.richardson@intel.com>
  2025-03-26 16:05   ` [PATCH v2 1/8] net/fm10k/base: fix compilation warnings Bruce Richardson
  2025-03-26 16:05   ` [PATCH v2 3/8] net/ixgbe/base: correct definition of macro Bruce Richardson
@ 2025-03-26 16:05   ` Bruce Richardson
  2025-03-26 16:05   ` [PATCH v2 5/8] net/i40e/base: fix unused value warnings Bruce Richardson
  2025-03-26 16:05   ` [PATCH v2 6/8] net/i40e/base: fix compiler warnings Bruce Richardson
  4 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 16:05 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Anatoly Burakov, Vladimir Medvedkin,
	Piotr Kwapulinski, Jedrzej Jagielski, Stefan Wegrzyn

We can remove almost all of the "unused parameter" and "unused variable"
warnings by just improving the macro definitions in the osdep.h header.
Remaining two instances can be fixed by just one-line additions to the
code, so add those to give us a clean build with the warnings enabled.

Fixes: af75078fece3 ("first public release")
Fixes: c6cb313da739 ("net/ixgbe/base: add link management for E610")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_e610.c  |  2 ++
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 19 +++++++++++--------
 drivers/net/intel/ixgbe/base/meson.build   | 11 -----------
 3 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.c b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
index 5474c3012a..7420c78d07 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
@@ -1054,6 +1054,7 @@ static void ixgbe_parse_vsi_func_caps(struct ixgbe_hw *hw,
 				      struct ixgbe_hw_func_caps *func_p,
 				      struct ixgbe_aci_cmd_list_caps_elem *cap)
 {
+	UNREFERENCED_PARAMETER(cap);
 	func_p->guar_num_vsi = ixgbe_get_num_per_func(hw, IXGBE_MAX_VSI);
 }
 
@@ -1770,6 +1771,7 @@ s32 ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
 	struct ixgbe_aci_cmd_set_event_mask *cmd;
 	struct ixgbe_aci_desc desc;
 
+	UNREFERENCED_PARAMETER(port_num);
 	cmd = &desc.params.set_event_mask;
 
 	ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_event_mask);
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 6e5f7b4ae8..398c38bffd 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -57,13 +57,16 @@
 
 /* Bunch of defines for shared code bogosity */
 #ifndef UNREFERENCED_PARAMETER
-#define UNREFERENCED_PARAMETER(_p)  
+#define UNREFERENCED_PARAMETER(_p) (void)(_p)
 #endif
-#define UNREFERENCED_1PARAMETER(_p) 
-#define UNREFERENCED_2PARAMETER(_p, _q)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) 
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) 
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) do { (void)(_p); (void)(_q); } while(0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while(0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while(0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while(0)
 
 /* Shared code error reporting */
 enum {
@@ -130,8 +133,8 @@ static inline uint32_t ixgbe_read_addr(volatile void* addr)
 	IXGBE_PCI_REG_ADDR((hw), (reg) + ((index) << 2))
 
 /* Not implemented !! */
-#define IXGBE_READ_PCIE_WORD(hw, reg) 0	
-#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { } while(0)
+#define IXGBE_READ_PCIE_WORD(hw, reg)  ((void)hw, (void)(reg), 0)
+#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { (void)hw; (void)reg; (void)value; } while(0)
 
 #define IXGBE_WRITE_FLUSH(a) IXGBE_READ_REG(a, IXGBE_STATUS)
 
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index f8b2ee6341..64e0bfd7be 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,17 +19,6 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
-        ]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('ixgbe_base', sources,
     dependencies: [static_rte_eal, static_rte_net],
     c_args: c_args)
-- 
2.45.2


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

* [PATCH v2 5/8] net/i40e/base: fix unused value warnings
       [not found] ` <20250326160539.1316499-1-bruce.richardson@intel.com>
                     ` (2 preceding siblings ...)
  2025-03-26 16:05   ` [PATCH v2 4/8] net/ixgbe/base: fix compilation warnings Bruce Richardson
@ 2025-03-26 16:05   ` Bruce Richardson
  2025-03-26 16:05   ` [PATCH v2 6/8] net/i40e/base: fix compiler warnings Bruce Richardson
  4 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 16:05 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Ian Stokes, Jijiang Liu, Cunming Liang,
	Heqing Zhu, Jing Chen, Jingjing Wu

Fix warnings about unused values - parameters, variables, etc., and
remove the warning disable flags for them. Although modifying the
base-code files is not ideal, the changes required are minor, and only
affect two files from the imported base code.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_nvm.c   |  2 +-
 drivers/net/intel/i40e/base/i40e_osdep.h |  4 ++--
 drivers/net/intel/i40e/base/i40e_type.h  | 14 +++++++++-----
 drivers/net/intel/i40e/base/meson.build  |  3 ---
 drivers/net/intel/i40e/i40e_ethdev.c     |  1 +
 5 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
index 3e16a0d997..56dc4d9279 100644
--- a/drivers/net/intel/i40e/base/i40e_nvm.c
+++ b/drivers/net/intel/i40e/base/i40e_nvm.c
@@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
  **/
 STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
 						    struct i40e_nvm_access *cmd,
-						    u8 *bytes, int *perrno)
+						    u8 *bytes, __rte_unused int *perrno)
 {
 	u32 aq_total_len;
 	u32 aq_desc_len;
diff --git a/drivers/net/intel/i40e/base/i40e_osdep.h b/drivers/net/intel/i40e/base/i40e_osdep.h
index c04f94732a..197f4678bf 100644
--- a/drivers/net/intel/i40e/base/i40e_osdep.h
+++ b/drivers/net/intel/i40e/base/i40e_osdep.h
@@ -184,8 +184,8 @@ struct __rte_packed_begin i40e_dma_mem {
 	const void *zone;
 } __rte_packed_end;
 
-#define i40e_allocate_dma_mem(h, m, unused, s, a) \
-			i40e_allocate_dma_mem_d(h, m, s, a)
+#define i40e_allocate_dma_mem(h, m, mt, s, a) \
+			i40e_allocate_dma_mem_d(h, m, mt, s, a)
 #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m)
 
 struct __rte_packed_begin i40e_virt_mem {
diff --git a/drivers/net/intel/i40e/base/i40e_type.h b/drivers/net/intel/i40e/base/i40e_type.h
index 7cc746f82f..968e1982a6 100644
--- a/drivers/net/intel/i40e/base/i40e_type.h
+++ b/drivers/net/intel/i40e/base/i40e_type.h
@@ -14,11 +14,15 @@
 #include "i40e_devids.h"
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p);
-#define UNREFERENCED_2PARAMETER(_p, _q) (_p); (_q);
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) (_p); (_q); (_r);
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) (_p); (_q); (_r); (_s);
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) (_p); (_q); (_r); (_s); (_t);
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) \
+	do { (void)(_p); (void)(_q); } while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while (0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while (0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while (0)
 
 #define BIT(a) (1UL << (a))
 #define BIT_ULL(a) (1ULL << (a))
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index a0912b1788..2648e5d0c4 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -13,10 +13,7 @@ sources = [
 
 error_cflags = [
         '-Wno-sign-compare',
-        '-Wno-unused-value',
         '-Wno-strict-aliasing',
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
 ]
 c_args = cflags
 foreach flag: error_cflags
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 1c5ab35a8b..90eba3419f 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -4694,6 +4694,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev,
 enum i40e_status_code
 i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw,
 			struct i40e_dma_mem *mem,
+			__rte_unused enum i40e_memory_type mtype,
 			u64 size,
 			u32 alignment)
 {
-- 
2.45.2


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

* [PATCH v2 6/8] net/i40e/base: fix compiler warnings
       [not found] ` <20250326160539.1316499-1-bruce.richardson@intel.com>
                     ` (3 preceding siblings ...)
  2025-03-26 16:05   ` [PATCH v2 5/8] net/i40e/base: fix unused value warnings Bruce Richardson
@ 2025-03-26 16:05   ` Bruce Richardson
  4 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-26 16:05 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Ian Stokes, Jingjing Wu, Heqing Zhu,
	Jijiang Liu, Jing Chen, Cunming Liang

Add a single-line fix to the base code, and then the remaining two
compiler warning disable flags can be removed from the driver base code
build file.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_diag.c |  2 +-
 drivers/net/intel/i40e/base/meson.build | 13 +------------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_diag.c b/drivers/net/intel/i40e/base/i40e_diag.c
index 4ca102cdd5..71b2e53e85 100644
--- a/drivers/net/intel/i40e/base/i40e_diag.c
+++ b/drivers/net/intel/i40e/base/i40e_diag.c
@@ -34,7 +34,7 @@ static enum i40e_status_code i40e_diag_reg_pattern_test(struct i40e_hw *hw,
 {
 	const u32 patterns[] = {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
 	u32 pat, val, orig_val;
-	int i;
+	unsigned int i;
 
 	orig_val = rd32(hw, reg);
 	for (i = 0; i < ARRAY_SIZE(patterns); i++) {
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index 2648e5d0c4..766383101b 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -11,18 +11,7 @@ sources = [
         'i40e_nvm.c',
 ]
 
-error_cflags = [
-        '-Wno-sign-compare',
-        '-Wno-strict-aliasing',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('i40e_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


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

* [PATCH v3 1/9] net/fm10k/base: fix compilation warnings
       [not found] ` <20250327145202.2220153-1-bruce.richardson@intel.com>
@ 2025-03-27 14:51   ` Bruce Richardson
  2025-03-27 14:51   ` [PATCH v3 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-27 14:51 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable, Jing Chen

The fixes required to re-enable warnings in the fm10k base code are
trivial, so let's make the changes and get a clean compile without any
warning disable flags.

* provide definitions for the UNREFERENCED_PARAMETER macros
* fix the spelling of the work "fallthrough" in comments
* provide a definition of FM10K_READ_PCI_WORD in os_dep.h that marks the
  parameters as used.

Fixes: 7223d200c227 ("fm10k: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/fm10k/base/fm10k_mbx.c   |  2 +-
 drivers/net/intel/fm10k/base/fm10k_osdep.h |  2 +-
 drivers/net/intel/fm10k/base/fm10k_pf.c    |  8 ++++----
 drivers/net/intel/fm10k/base/fm10k_type.h  |  6 +++---
 drivers/net/intel/fm10k/base/meson.build   | 14 +-------------
 5 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/drivers/net/intel/fm10k/base/fm10k_mbx.c b/drivers/net/intel/fm10k/base/fm10k_mbx.c
index 2bb0d82efe..9028403757 100644
--- a/drivers/net/intel/fm10k/base/fm10k_mbx.c
+++ b/drivers/net/intel/fm10k/base/fm10k_mbx.c
@@ -1602,7 +1602,7 @@ s32 fm10k_pfvf_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,
 			mbx->mbmem_reg = FM10K_MBMEM_VF(id, 0);
 			break;
 		}
-		/* fallthough */
+		/* fallthrough */
 	default:
 		return FM10K_MBX_ERR_NO_MBX;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_osdep.h b/drivers/net/intel/fm10k/base/fm10k_osdep.h
index a727a57481..5f8ff10474 100644
--- a/drivers/net/intel/fm10k/base/fm10k_osdep.h
+++ b/drivers/net/intel/fm10k/base/fm10k_osdep.h
@@ -67,7 +67,7 @@ typedef uint64_t   u64;
 #define FM10K_PCI_REG_WRITE(reg, value) rte_write32((value), (reg))
 
 /* not implemented */
-#define FM10K_READ_PCI_WORD(hw, reg)     0
+#define FM10K_READ_PCI_WORD(hw, reg)     ((void)hw, (void)reg, 0)
 
 #define FM10K_WRITE_MBX(hw, reg, value) FM10K_WRITE_REG(hw, reg, value)
 #define FM10K_READ_MBX(hw, reg) FM10K_READ_REG(hw, reg)
diff --git a/drivers/net/intel/fm10k/base/fm10k_pf.c b/drivers/net/intel/fm10k/base/fm10k_pf.c
index 439dd224de..b54116a4b5 100644
--- a/drivers/net/intel/fm10k/base/fm10k_pf.c
+++ b/drivers/net/intel/fm10k/base/fm10k_pf.c
@@ -1362,19 +1362,19 @@ STATIC u8 fm10k_iov_supported_xcast_mode_pf(struct fm10k_vf_info *vf_info,
 	case FM10K_XCAST_MODE_PROMISC:
 		if (vf_flags & FM10K_VF_FLAG_PROMISC_CAPABLE)
 			return FM10K_XCAST_MODE_PROMISC;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_ALLMULTI:
 		if (vf_flags & FM10K_VF_FLAG_ALLMULTI_CAPABLE)
 			return FM10K_XCAST_MODE_ALLMULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_MULTI:
 		if (vf_flags & FM10K_VF_FLAG_MULTI_CAPABLE)
 			return FM10K_XCAST_MODE_MULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_NONE:
 		if (vf_flags & FM10K_VF_FLAG_NONE_CAPABLE)
 			return FM10K_XCAST_MODE_NONE;
-		/* fallthough */
+		/* fallthrough */
 	default:
 		break;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_type.h b/drivers/net/intel/fm10k/base/fm10k_type.h
index 84781ba9b2..437fb1c55e 100644
--- a/drivers/net/intel/fm10k/base/fm10k_type.h
+++ b/drivers/net/intel/fm10k/base/fm10k_type.h
@@ -83,9 +83,9 @@ struct fm10k_hw;
 #define FM10K_NOT_IMPLEMENTED			0x7FFFFFFF
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p)
-#define UNREFERENCED_2PARAMETER(_p, _q)	    do { (_p); (_q); } while (0)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { (_p); (_q); (_r); } while (0)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q)	    do { (void)(_p); (void)(_q); } while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { (void)(_p); (void)(_q); (void)(_r); } while (0)
 
 /* Start of PF registers */
 #define FM10K_CTRL		0x0000
diff --git a/drivers/net/intel/fm10k/base/meson.build b/drivers/net/intel/fm10k/base/meson.build
index f24e453fd0..a2640d1ee8 100644
--- a/drivers/net/intel/fm10k/base/meson.build
+++ b/drivers/net/intel/fm10k/base/meson.build
@@ -10,19 +10,7 @@ sources = [
         'fm10k_vf.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-parameter',
-        '-Wno-unused-value',
-        '-Wno-implicit-fallthrough',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('fm10k_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


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

* [PATCH v3 3/9] net/ixgbe/base: correct definition of macro
       [not found] ` <20250327145202.2220153-1-bruce.richardson@intel.com>
  2025-03-27 14:51   ` [PATCH v3 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
@ 2025-03-27 14:51   ` Bruce Richardson
  2025-03-27 14:51   ` [PATCH v3 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-27 14:51 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable, Anatoly Burakov, Vladimir Medvedkin

The definition of IXGBE_LE32_TO_CPUS macro is meant to modify the value
in place - similar to the le32_to_cpus() macro in kernel. Fixing the
definition allows us to remove some warning flags, and removes the need
for the uintptr_t typecasts.

Fixes: aa4fc14d2cee ("ixgbe: update base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_common.c | 4 ++--
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h  | 2 +-
 drivers/net/intel/ixgbe/base/meson.build    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_common.c b/drivers/net/intel/ixgbe/base/ixgbe_common.c
index d6425c5b78..fbc9605e4d 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_common.c
@@ -4610,7 +4610,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* first pull in the header so we know the buffer length */
 	for (bi = 0; bi < dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 	/*
@@ -4646,7 +4646,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* Pull in the rest of the buffer (bi is where we left off) */
 	for (; bi <= dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 rel_out:
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index cffc6a4ce8..6e5f7b4ae8 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -83,7 +83,7 @@ enum {
 #define IXGBE_LE16_TO_CPU(_i)  rte_le_to_cpu_16(_i)
 #define IXGBE_LE32_TO_CPU(_i)  rte_le_to_cpu_32(_i)
 #define IXGBE_LE64_TO_CPU(_i)  rte_le_to_cpu_64(_i)
-#define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(_i)
+#define IXGBE_LE32_TO_CPUS(_i) do { *_i = rte_le_to_cpu_32(*_i); } while(0)
 #define IXGBE_CPU_TO_BE16(_i)  rte_cpu_to_be_16(_i)
 #define IXGBE_CPU_TO_BE32(_i)  rte_cpu_to_be_32(_i)
 #define IXGBE_BE32_TO_CPU(_i)  rte_be_to_cpu_32(_i)
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index 7e4fbdfa0f..f8b2ee6341 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,7 +19,7 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = ['-Wno-unused-value',
+error_cflags = [
         '-Wno-unused-but-set-variable',
         '-Wno-unused-parameter',
         ]
-- 
2.45.2


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

* [PATCH v3 4/9] net/ixgbe/base: fix compilation warnings
       [not found] ` <20250327145202.2220153-1-bruce.richardson@intel.com>
  2025-03-27 14:51   ` [PATCH v3 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
  2025-03-27 14:51   ` [PATCH v3 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
@ 2025-03-27 14:51   ` Bruce Richardson
  2025-03-27 14:51   ` [PATCH v3 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-27 14:51 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Anatoly Burakov, Vladimir Medvedkin,
	Piotr Kwapulinski, Jedrzej Jagielski, Stefan Wegrzyn

We can remove almost all of the "unused parameter" and "unused variable"
warnings by just improving the macro definitions in the osdep.h header.
Remaining two instances can be fixed by just one-line additions to the
code, so add those to give us a clean build with the warnings enabled.

Fixes: af75078fece3 ("first public release")
Fixes: c6cb313da739 ("net/ixgbe/base: add link management for E610")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_e610.c  |  2 ++
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 19 +++++++++++--------
 drivers/net/intel/ixgbe/base/meson.build   | 11 -----------
 3 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.c b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
index 5474c3012a..7420c78d07 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
@@ -1054,6 +1054,7 @@ static void ixgbe_parse_vsi_func_caps(struct ixgbe_hw *hw,
 				      struct ixgbe_hw_func_caps *func_p,
 				      struct ixgbe_aci_cmd_list_caps_elem *cap)
 {
+	UNREFERENCED_PARAMETER(cap);
 	func_p->guar_num_vsi = ixgbe_get_num_per_func(hw, IXGBE_MAX_VSI);
 }
 
@@ -1770,6 +1771,7 @@ s32 ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
 	struct ixgbe_aci_cmd_set_event_mask *cmd;
 	struct ixgbe_aci_desc desc;
 
+	UNREFERENCED_PARAMETER(port_num);
 	cmd = &desc.params.set_event_mask;
 
 	ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_event_mask);
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 6e5f7b4ae8..398c38bffd 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -57,13 +57,16 @@
 
 /* Bunch of defines for shared code bogosity */
 #ifndef UNREFERENCED_PARAMETER
-#define UNREFERENCED_PARAMETER(_p)  
+#define UNREFERENCED_PARAMETER(_p) (void)(_p)
 #endif
-#define UNREFERENCED_1PARAMETER(_p) 
-#define UNREFERENCED_2PARAMETER(_p, _q)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) 
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) 
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) do { (void)(_p); (void)(_q); } while(0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while(0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while(0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while(0)
 
 /* Shared code error reporting */
 enum {
@@ -130,8 +133,8 @@ static inline uint32_t ixgbe_read_addr(volatile void* addr)
 	IXGBE_PCI_REG_ADDR((hw), (reg) + ((index) << 2))
 
 /* Not implemented !! */
-#define IXGBE_READ_PCIE_WORD(hw, reg) 0	
-#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { } while(0)
+#define IXGBE_READ_PCIE_WORD(hw, reg)  ((void)hw, (void)(reg), 0)
+#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { (void)hw; (void)reg; (void)value; } while(0)
 
 #define IXGBE_WRITE_FLUSH(a) IXGBE_READ_REG(a, IXGBE_STATUS)
 
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index f8b2ee6341..64e0bfd7be 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,17 +19,6 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
-        ]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('ixgbe_base', sources,
     dependencies: [static_rte_eal, static_rte_net],
     c_args: c_args)
-- 
2.45.2


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

* [PATCH v3 5/9] net/ixgbe/base: fix lock checker errors
       [not found] ` <20250327145202.2220153-1-bruce.richardson@intel.com>
                     ` (2 preceding siblings ...)
  2025-03-27 14:51   ` [PATCH v3 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
@ 2025-03-27 14:51   ` Bruce Richardson
  2025-03-28  8:20     ` David Marchand
  2025-03-27 14:51   ` [PATCH v3 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
  2025-03-27 14:51   ` [PATCH v3 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
  5 siblings, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2025-03-27 14:51 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Anatoly Burakov, Vladimir Medvedkin,
	Jedrzej Jagielski, Stefan Wegrzyn, Piotr Kwapulinski

When building on FreeBSD, errors are reported in the base code by the
lock checker (-Wthread-safety). For example:

../drivers/net/intel/ixgbe/base/ixgbe_osdep.c:42:1: error: mutex 'lock->mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
   42 | }
      | ^

These errors are due to the checker not recognising the lock wrapper
functions. We can avoid these errors by converting these functions into
macros.

Fixes: 30b19d1b5c43 ("net/ixgbe/base: add definitions for E610")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_osdep.c | 20 --------------------
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h |  8 ++++----
 2 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.c b/drivers/net/intel/ixgbe/base/ixgbe_osdep.c
index d3d7e8e116..778f74e644 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.c
@@ -25,23 +25,3 @@ ixgbe_free(struct ixgbe_hw __rte_unused *hw, void *addr)
 {
 	free(addr);
 }
-
-void ixgbe_init_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_init(&lock->mutex, NULL);
-}
-
-void ixgbe_destroy_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_destroy(&lock->mutex);
-}
-
-void ixgbe_acquire_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_lock(&lock->mutex);
-}
-
-void ixgbe_release_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_unlock(&lock->mutex);
-}
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 398c38bffd..6e35991f49 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -167,9 +167,9 @@ void *ixgbe_calloc(struct ixgbe_hw *hw, size_t count, size_t size);
 void *ixgbe_malloc(struct ixgbe_hw *hw, size_t size);
 void ixgbe_free(struct ixgbe_hw *hw, void *addr);
 
-void ixgbe_init_lock(struct ixgbe_lock *lock);
-void ixgbe_destroy_lock(struct ixgbe_lock *lock);
-void ixgbe_acquire_lock(struct ixgbe_lock *lock);
-void ixgbe_release_lock(struct ixgbe_lock *lock);
+#define ixgbe_init_lock(lock) pthread_mutex_init(&(lock)->mutex, NULL)
+#define ixgbe_destroy_lock(lock) pthread_mutex_destroy(&(lock)->mutex)
+#define ixgbe_acquire_lock(lock) pthread_mutex_lock(&(lock)->mutex)
+#define ixgbe_release_lock(lock)	pthread_mutex_unlock(&(lock)->mutex)
 
 #endif /* _IXGBE_OS_H_ */
-- 
2.45.2


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

* [PATCH v3 6/9] net/i40e/base: fix unused value warnings
       [not found] ` <20250327145202.2220153-1-bruce.richardson@intel.com>
                     ` (3 preceding siblings ...)
  2025-03-27 14:51   ` [PATCH v3 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
@ 2025-03-27 14:51   ` Bruce Richardson
  2025-03-27 14:51   ` [PATCH v3 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
  5 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-27 14:51 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Ian Stokes, Heqing Zhu, Jijiang Liu,
	Helin Zhang, Jing Chen, Jingjing Wu

Fix warnings about unused values - parameters, variables, etc., and
remove the warning disable flags for them. Although modifying the
base-code files is not ideal, the changes required are minor, and only
affect two files from the imported base code.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_nvm.c   |  2 +-
 drivers/net/intel/i40e/base/i40e_osdep.h |  4 ++--
 drivers/net/intel/i40e/base/i40e_type.h  | 14 +++++++++-----
 drivers/net/intel/i40e/base/meson.build  |  3 ---
 drivers/net/intel/i40e/i40e_ethdev.c     |  1 +
 5 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
index 3e16a0d997..56dc4d9279 100644
--- a/drivers/net/intel/i40e/base/i40e_nvm.c
+++ b/drivers/net/intel/i40e/base/i40e_nvm.c
@@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
  **/
 STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
 						    struct i40e_nvm_access *cmd,
-						    u8 *bytes, int *perrno)
+						    u8 *bytes, __rte_unused int *perrno)
 {
 	u32 aq_total_len;
 	u32 aq_desc_len;
diff --git a/drivers/net/intel/i40e/base/i40e_osdep.h b/drivers/net/intel/i40e/base/i40e_osdep.h
index c04f94732a..197f4678bf 100644
--- a/drivers/net/intel/i40e/base/i40e_osdep.h
+++ b/drivers/net/intel/i40e/base/i40e_osdep.h
@@ -184,8 +184,8 @@ struct __rte_packed_begin i40e_dma_mem {
 	const void *zone;
 } __rte_packed_end;
 
-#define i40e_allocate_dma_mem(h, m, unused, s, a) \
-			i40e_allocate_dma_mem_d(h, m, s, a)
+#define i40e_allocate_dma_mem(h, m, mt, s, a) \
+			i40e_allocate_dma_mem_d(h, m, mt, s, a)
 #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m)
 
 struct __rte_packed_begin i40e_virt_mem {
diff --git a/drivers/net/intel/i40e/base/i40e_type.h b/drivers/net/intel/i40e/base/i40e_type.h
index 7cc746f82f..968e1982a6 100644
--- a/drivers/net/intel/i40e/base/i40e_type.h
+++ b/drivers/net/intel/i40e/base/i40e_type.h
@@ -14,11 +14,15 @@
 #include "i40e_devids.h"
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p);
-#define UNREFERENCED_2PARAMETER(_p, _q) (_p); (_q);
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) (_p); (_q); (_r);
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) (_p); (_q); (_r); (_s);
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) (_p); (_q); (_r); (_s); (_t);
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) \
+	do { (void)(_p); (void)(_q); } while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while (0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while (0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while (0)
 
 #define BIT(a) (1UL << (a))
 #define BIT_ULL(a) (1ULL << (a))
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index a0912b1788..2648e5d0c4 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -13,10 +13,7 @@ sources = [
 
 error_cflags = [
         '-Wno-sign-compare',
-        '-Wno-unused-value',
         '-Wno-strict-aliasing',
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
 ]
 c_args = cflags
 foreach flag: error_cflags
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 1c5ab35a8b..90eba3419f 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -4694,6 +4694,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev,
 enum i40e_status_code
 i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw,
 			struct i40e_dma_mem *mem,
+			__rte_unused enum i40e_memory_type mtype,
 			u64 size,
 			u32 alignment)
 {
-- 
2.45.2


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

* [PATCH v3 7/9] net/i40e/base: fix compiler warnings
       [not found] ` <20250327145202.2220153-1-bruce.richardson@intel.com>
                     ` (4 preceding siblings ...)
  2025-03-27 14:51   ` [PATCH v3 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
@ 2025-03-27 14:51   ` Bruce Richardson
  5 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-27 14:51 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, stable, Ian Stokes, Cunming Liang, Jing Chen,
	Heqing Zhu, Jijiang Liu, Jingjing Wu

Add a single-line fix to the base code, and then the remaining two
compiler warning disable flags can be removed from the driver base code
build file.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_diag.c |  2 +-
 drivers/net/intel/i40e/base/meson.build | 13 +------------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_diag.c b/drivers/net/intel/i40e/base/i40e_diag.c
index 4ca102cdd5..71b2e53e85 100644
--- a/drivers/net/intel/i40e/base/i40e_diag.c
+++ b/drivers/net/intel/i40e/base/i40e_diag.c
@@ -34,7 +34,7 @@ static enum i40e_status_code i40e_diag_reg_pattern_test(struct i40e_hw *hw,
 {
 	const u32 patterns[] = {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
 	u32 pat, val, orig_val;
-	int i;
+	unsigned int i;
 
 	orig_val = rd32(hw, reg);
 	for (i = 0; i < ARRAY_SIZE(patterns); i++) {
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index 2648e5d0c4..766383101b 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -11,18 +11,7 @@ sources = [
         'i40e_nvm.c',
 ]
 
-error_cflags = [
-        '-Wno-sign-compare',
-        '-Wno-strict-aliasing',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('i40e_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


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

* Re: [PATCH v3 5/9] net/ixgbe/base: fix lock checker errors
  2025-03-27 14:51   ` [PATCH v3 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
@ 2025-03-28  8:20     ` David Marchand
  0 siblings, 0 replies; 30+ messages in thread
From: David Marchand @ 2025-03-28  8:20 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, stable, Anatoly Burakov, Vladimir Medvedkin,
	Jedrzej Jagielski, Stefan Wegrzyn, Piotr Kwapulinski

On Thu, Mar 27, 2025 at 3:53 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> When building on FreeBSD, errors are reported in the base code by the
> lock checker (-Wthread-safety). For example:
>
> ../drivers/net/intel/ixgbe/base/ixgbe_osdep.c:42:1: error: mutex 'lock->mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
>    42 | }
>       | ^
>
> These errors are due to the checker not recognising the lock wrapper
> functions. We can avoid these errors by converting these functions into
> macros.
>
> Fixes: 30b19d1b5c43 ("net/ixgbe/base: add definitions for E610")
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

This is the best solution, given that FreeBSD pthread is instrumented
with clang thread safety annotations.

As a sidenote, I don't see much value with the remaining
malloc/calloc/free wrappers in this osdep.c file.
I suspect this makes some other annotations non working.


-- 
David Marchand


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

* [PATCH v4 1/9] net/fm10k/base: fix compilation warnings
       [not found] ` <20250328111621.2665257-1-bruce.richardson@intel.com>
@ 2025-03-28 11:16   ` Bruce Richardson
  2025-03-28 12:53     ` Burakov, Anatoly
  2025-03-28 11:16   ` [PATCH v4 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2025-03-28 11:16 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Anatoly Burakov, Vladimir Medvedkin,
	Bruce Richardson, stable

The fixes required to re-enable warnings in the fm10k base code are
trivial, so let's make the changes and get a clean compile without any
warning disable flags.

* provide definitions for the UNREFERENCED_PARAMETER macros
* fix the spelling of the work "fallthrough" in comments
* provide a definition of FM10K_READ_PCI_WORD in os_dep.h that marks the
  parameters as used.

Fixes: 7223d200c227 ("fm10k: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/fm10k/base/fm10k_mbx.c   |  2 +-
 drivers/net/intel/fm10k/base/fm10k_osdep.h |  2 +-
 drivers/net/intel/fm10k/base/fm10k_pf.c    |  8 ++++----
 drivers/net/intel/fm10k/base/fm10k_type.h  |  6 +++---
 drivers/net/intel/fm10k/base/meson.build   | 14 +-------------
 5 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/drivers/net/intel/fm10k/base/fm10k_mbx.c b/drivers/net/intel/fm10k/base/fm10k_mbx.c
index 2bb0d82efe..9028403757 100644
--- a/drivers/net/intel/fm10k/base/fm10k_mbx.c
+++ b/drivers/net/intel/fm10k/base/fm10k_mbx.c
@@ -1602,7 +1602,7 @@ s32 fm10k_pfvf_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,
 			mbx->mbmem_reg = FM10K_MBMEM_VF(id, 0);
 			break;
 		}
-		/* fallthough */
+		/* fallthrough */
 	default:
 		return FM10K_MBX_ERR_NO_MBX;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_osdep.h b/drivers/net/intel/fm10k/base/fm10k_osdep.h
index a727a57481..5f8ff10474 100644
--- a/drivers/net/intel/fm10k/base/fm10k_osdep.h
+++ b/drivers/net/intel/fm10k/base/fm10k_osdep.h
@@ -67,7 +67,7 @@ typedef uint64_t   u64;
 #define FM10K_PCI_REG_WRITE(reg, value) rte_write32((value), (reg))
 
 /* not implemented */
-#define FM10K_READ_PCI_WORD(hw, reg)     0
+#define FM10K_READ_PCI_WORD(hw, reg)     ((void)hw, (void)reg, 0)
 
 #define FM10K_WRITE_MBX(hw, reg, value) FM10K_WRITE_REG(hw, reg, value)
 #define FM10K_READ_MBX(hw, reg) FM10K_READ_REG(hw, reg)
diff --git a/drivers/net/intel/fm10k/base/fm10k_pf.c b/drivers/net/intel/fm10k/base/fm10k_pf.c
index 439dd224de..b54116a4b5 100644
--- a/drivers/net/intel/fm10k/base/fm10k_pf.c
+++ b/drivers/net/intel/fm10k/base/fm10k_pf.c
@@ -1362,19 +1362,19 @@ STATIC u8 fm10k_iov_supported_xcast_mode_pf(struct fm10k_vf_info *vf_info,
 	case FM10K_XCAST_MODE_PROMISC:
 		if (vf_flags & FM10K_VF_FLAG_PROMISC_CAPABLE)
 			return FM10K_XCAST_MODE_PROMISC;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_ALLMULTI:
 		if (vf_flags & FM10K_VF_FLAG_ALLMULTI_CAPABLE)
 			return FM10K_XCAST_MODE_ALLMULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_MULTI:
 		if (vf_flags & FM10K_VF_FLAG_MULTI_CAPABLE)
 			return FM10K_XCAST_MODE_MULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_NONE:
 		if (vf_flags & FM10K_VF_FLAG_NONE_CAPABLE)
 			return FM10K_XCAST_MODE_NONE;
-		/* fallthough */
+		/* fallthrough */
 	default:
 		break;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_type.h b/drivers/net/intel/fm10k/base/fm10k_type.h
index 84781ba9b2..437fb1c55e 100644
--- a/drivers/net/intel/fm10k/base/fm10k_type.h
+++ b/drivers/net/intel/fm10k/base/fm10k_type.h
@@ -83,9 +83,9 @@ struct fm10k_hw;
 #define FM10K_NOT_IMPLEMENTED			0x7FFFFFFF
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p)
-#define UNREFERENCED_2PARAMETER(_p, _q)	    do { (_p); (_q); } while (0)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { (_p); (_q); (_r); } while (0)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q)	    do { (void)(_p); (void)(_q); } while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { (void)(_p); (void)(_q); (void)(_r); } while (0)
 
 /* Start of PF registers */
 #define FM10K_CTRL		0x0000
diff --git a/drivers/net/intel/fm10k/base/meson.build b/drivers/net/intel/fm10k/base/meson.build
index f24e453fd0..a2640d1ee8 100644
--- a/drivers/net/intel/fm10k/base/meson.build
+++ b/drivers/net/intel/fm10k/base/meson.build
@@ -10,19 +10,7 @@ sources = [
         'fm10k_vf.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-parameter',
-        '-Wno-unused-value',
-        '-Wno-implicit-fallthrough',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('fm10k_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


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

* [PATCH v4 3/9] net/ixgbe/base: correct definition of macro
       [not found] ` <20250328111621.2665257-1-bruce.richardson@intel.com>
  2025-03-28 11:16   ` [PATCH v4 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
@ 2025-03-28 11:16   ` Bruce Richardson
  2025-03-28 13:01     ` Burakov, Anatoly
  2025-03-28 11:16   ` [PATCH v4 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2025-03-28 11:16 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Anatoly Burakov, Vladimir Medvedkin,
	Bruce Richardson, stable

The definition of IXGBE_LE32_TO_CPUS macro is meant to modify the value
in place - similar to the le32_to_cpus() macro in kernel. Fixing the
definition allows us to remove some warning flags, and removes the need
for the uintptr_t typecasts.

Fixes: aa4fc14d2cee ("ixgbe: update base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_common.c | 4 ++--
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h  | 2 +-
 drivers/net/intel/ixgbe/base/meson.build    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_common.c b/drivers/net/intel/ixgbe/base/ixgbe_common.c
index d6425c5b78..fbc9605e4d 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_common.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_common.c
@@ -4610,7 +4610,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* first pull in the header so we know the buffer length */
 	for (bi = 0; bi < dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 	/*
@@ -4646,7 +4646,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 	/* Pull in the rest of the buffer (bi is where we left off) */
 	for (; bi <= dword_len; bi++) {
 		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
-		IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+		IXGBE_LE32_TO_CPUS(&buffer[bi]);
 	}
 
 rel_out:
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index cffc6a4ce8..6e5f7b4ae8 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -83,7 +83,7 @@ enum {
 #define IXGBE_LE16_TO_CPU(_i)  rte_le_to_cpu_16(_i)
 #define IXGBE_LE32_TO_CPU(_i)  rte_le_to_cpu_32(_i)
 #define IXGBE_LE64_TO_CPU(_i)  rte_le_to_cpu_64(_i)
-#define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(_i)
+#define IXGBE_LE32_TO_CPUS(_i) do { *_i = rte_le_to_cpu_32(*_i); } while(0)
 #define IXGBE_CPU_TO_BE16(_i)  rte_cpu_to_be_16(_i)
 #define IXGBE_CPU_TO_BE32(_i)  rte_cpu_to_be_32(_i)
 #define IXGBE_BE32_TO_CPU(_i)  rte_be_to_cpu_32(_i)
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index 7e4fbdfa0f..f8b2ee6341 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,7 +19,7 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = ['-Wno-unused-value',
+error_cflags = [
         '-Wno-unused-but-set-variable',
         '-Wno-unused-parameter',
         ]
-- 
2.45.2


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

* [PATCH v4 4/9] net/ixgbe/base: fix compilation warnings
       [not found] ` <20250328111621.2665257-1-bruce.richardson@intel.com>
  2025-03-28 11:16   ` [PATCH v4 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
  2025-03-28 11:16   ` [PATCH v4 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
@ 2025-03-28 11:16   ` Bruce Richardson
  2025-03-28 13:02     ` Burakov, Anatoly
  2025-03-28 11:16   ` [PATCH v4 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2025-03-28 11:16 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Anatoly Burakov, Vladimir Medvedkin,
	Bruce Richardson, stable

We can remove almost all of the "unused parameter" and "unused variable"
warnings by just improving the macro definitions in the osdep.h header.
Remaining two instances can be fixed by just one-line additions to the
code, so add those to give us a clean build with the warnings enabled.

Fixes: af75078fece3 ("first public release")
Fixes: c6cb313da739 ("net/ixgbe/base: add link management for E610")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_e610.c  |  2 ++
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 19 +++++++++++--------
 drivers/net/intel/ixgbe/base/meson.build   | 11 -----------
 3 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.c b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
index 5474c3012a..7420c78d07 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
@@ -1054,6 +1054,7 @@ static void ixgbe_parse_vsi_func_caps(struct ixgbe_hw *hw,
 				      struct ixgbe_hw_func_caps *func_p,
 				      struct ixgbe_aci_cmd_list_caps_elem *cap)
 {
+	UNREFERENCED_PARAMETER(cap);
 	func_p->guar_num_vsi = ixgbe_get_num_per_func(hw, IXGBE_MAX_VSI);
 }
 
@@ -1770,6 +1771,7 @@ s32 ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
 	struct ixgbe_aci_cmd_set_event_mask *cmd;
 	struct ixgbe_aci_desc desc;
 
+	UNREFERENCED_PARAMETER(port_num);
 	cmd = &desc.params.set_event_mask;
 
 	ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_event_mask);
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 6e5f7b4ae8..398c38bffd 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -57,13 +57,16 @@
 
 /* Bunch of defines for shared code bogosity */
 #ifndef UNREFERENCED_PARAMETER
-#define UNREFERENCED_PARAMETER(_p)  
+#define UNREFERENCED_PARAMETER(_p) (void)(_p)
 #endif
-#define UNREFERENCED_1PARAMETER(_p) 
-#define UNREFERENCED_2PARAMETER(_p, _q)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) 
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) 
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) do { (void)(_p); (void)(_q); } while(0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while(0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while(0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while(0)
 
 /* Shared code error reporting */
 enum {
@@ -130,8 +133,8 @@ static inline uint32_t ixgbe_read_addr(volatile void* addr)
 	IXGBE_PCI_REG_ADDR((hw), (reg) + ((index) << 2))
 
 /* Not implemented !! */
-#define IXGBE_READ_PCIE_WORD(hw, reg) 0	
-#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { } while(0)
+#define IXGBE_READ_PCIE_WORD(hw, reg)  ((void)hw, (void)(reg), 0)
+#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { (void)hw; (void)reg; (void)value; } while(0)
 
 #define IXGBE_WRITE_FLUSH(a) IXGBE_READ_REG(a, IXGBE_STATUS)
 
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index f8b2ee6341..64e0bfd7be 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,17 +19,6 @@ sources = [
         'ixgbe_x550.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
-        ]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('ixgbe_base', sources,
     dependencies: [static_rte_eal, static_rte_net],
     c_args: c_args)
-- 
2.45.2


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

* [PATCH v4 5/9] net/ixgbe/base: fix lock checker errors
       [not found] ` <20250328111621.2665257-1-bruce.richardson@intel.com>
                     ` (2 preceding siblings ...)
  2025-03-28 11:16   ` [PATCH v4 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
@ 2025-03-28 11:16   ` Bruce Richardson
  2025-03-28 13:05     ` Burakov, Anatoly
  2025-03-28 11:16   ` [PATCH v4 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
  2025-03-28 11:16   ` [PATCH v4 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
  5 siblings, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2025-03-28 11:16 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Anatoly Burakov, Vladimir Medvedkin,
	Bruce Richardson, stable

When building on FreeBSD, errors are reported in the base code by the
lock checker (-Wthread-safety). For example:

../drivers/net/intel/ixgbe/base/ixgbe_osdep.c:42:1: error: mutex 'lock->mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
   42 | }
      | ^

These errors are due to the checker not recognising the lock wrapper
functions. We can avoid these errors by converting these functions into
macros. While converting the lock macros, we can also convert the memory
allocation functions too, which allows us to remove the osdep.c file
entirely from the build.

Fixes: 30b19d1b5c43 ("net/ixgbe/base: add definitions for E610")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/ixgbe/base/ixgbe_osdep.c | 47 ----------------------
 drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 18 +++++----
 drivers/net/intel/ixgbe/base/meson.build   |  1 -
 3 files changed, 10 insertions(+), 56 deletions(-)
 delete mode 100644 drivers/net/intel/ixgbe/base/ixgbe_osdep.c

diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.c b/drivers/net/intel/ixgbe/base/ixgbe_osdep.c
deleted file mode 100644
index d3d7e8e116..0000000000
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2024 Intel Corporation
- */
-
-#include <stdlib.h>
-
-#include <rte_common.h>
-
-#include "ixgbe_osdep.h"
-
-void *
-ixgbe_calloc(struct ixgbe_hw __rte_unused *hw, size_t count, size_t size)
-{
-	return malloc(count * size);
-}
-
-void *
-ixgbe_malloc(struct ixgbe_hw __rte_unused *hw, size_t size)
-{
-	return malloc(size);
-}
-
-void
-ixgbe_free(struct ixgbe_hw __rte_unused *hw, void *addr)
-{
-	free(addr);
-}
-
-void ixgbe_init_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_init(&lock->mutex, NULL);
-}
-
-void ixgbe_destroy_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_destroy(&lock->mutex);
-}
-
-void ixgbe_acquire_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_lock(&lock->mutex);
-}
-
-void ixgbe_release_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_unlock(&lock->mutex);
-}
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 398c38bffd..53d0422193 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -11,6 +11,8 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdbool.h>
+#include <malloc.h>
+
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_cycles.h>
@@ -50,7 +52,7 @@
 #define false               0
 #define true                1
 #ifndef RTE_EXEC_ENV_WINDOWS
-#define min(a,b)	RTE_MIN(a,b) 
+#define min(a,b)	RTE_MIN(a,b)
 #endif
 
 #define EWARN(hw, S, ...)         DEBUGOUT1(S, ##__VA_ARGS__)
@@ -163,13 +165,13 @@ struct ixgbe_lock {
 	pthread_mutex_t mutex;
 };
 
-void *ixgbe_calloc(struct ixgbe_hw *hw, size_t count, size_t size);
-void *ixgbe_malloc(struct ixgbe_hw *hw, size_t size);
-void ixgbe_free(struct ixgbe_hw *hw, void *addr);
+#define ixgbe_calloc(hw, c, s) ((void)hw, calloc(c, s))
+#define ixgbe_malloc(hw, s) ((void)hw, malloc(s))
+#define ixgbe_free(hw, a) ((void)hw, free(a))
 
-void ixgbe_init_lock(struct ixgbe_lock *lock);
-void ixgbe_destroy_lock(struct ixgbe_lock *lock);
-void ixgbe_acquire_lock(struct ixgbe_lock *lock);
-void ixgbe_release_lock(struct ixgbe_lock *lock);
+#define ixgbe_init_lock(lock) pthread_mutex_init(&(lock)->mutex, NULL)
+#define ixgbe_destroy_lock(lock) pthread_mutex_destroy(&(lock)->mutex)
+#define ixgbe_acquire_lock(lock) pthread_mutex_lock(&(lock)->mutex)
+#define ixgbe_release_lock(lock)	pthread_mutex_unlock(&(lock)->mutex)
 
 #endif /* _IXGBE_OS_H_ */
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index 64e0bfd7be..2af8a55e92 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -12,7 +12,6 @@ sources = [
         'ixgbe_e610.c',
         'ixgbe_hv_vf.c',
         'ixgbe_mbx.c',
-        'ixgbe_osdep.c',
         'ixgbe_phy.c',
         'ixgbe_vf.c',
         'ixgbe_x540.c',
-- 
2.45.2


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

* [PATCH v4 6/9] net/i40e/base: fix unused value warnings
       [not found] ` <20250328111621.2665257-1-bruce.richardson@intel.com>
                     ` (3 preceding siblings ...)
  2025-03-28 11:16   ` [PATCH v4 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
@ 2025-03-28 11:16   ` Bruce Richardson
  2025-03-28 13:07     ` Burakov, Anatoly
  2025-03-28 11:16   ` [PATCH v4 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
  5 siblings, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2025-03-28 11:16 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Anatoly Burakov, Vladimir Medvedkin,
	Bruce Richardson, stable

Fix warnings about unused values - parameters, variables, etc., and
remove the warning disable flags for them. Although modifying the
base-code files is not ideal, the changes required are minor, and only
affect two files from the imported base code.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_nvm.c   |  2 +-
 drivers/net/intel/i40e/base/i40e_osdep.h |  4 ++--
 drivers/net/intel/i40e/base/i40e_type.h  | 14 +++++++++-----
 drivers/net/intel/i40e/base/meson.build  |  3 ---
 drivers/net/intel/i40e/i40e_ethdev.c     |  1 +
 5 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
index 3e16a0d997..56dc4d9279 100644
--- a/drivers/net/intel/i40e/base/i40e_nvm.c
+++ b/drivers/net/intel/i40e/base/i40e_nvm.c
@@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
  **/
 STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
 						    struct i40e_nvm_access *cmd,
-						    u8 *bytes, int *perrno)
+						    u8 *bytes, __rte_unused int *perrno)
 {
 	u32 aq_total_len;
 	u32 aq_desc_len;
diff --git a/drivers/net/intel/i40e/base/i40e_osdep.h b/drivers/net/intel/i40e/base/i40e_osdep.h
index c04f94732a..197f4678bf 100644
--- a/drivers/net/intel/i40e/base/i40e_osdep.h
+++ b/drivers/net/intel/i40e/base/i40e_osdep.h
@@ -184,8 +184,8 @@ struct __rte_packed_begin i40e_dma_mem {
 	const void *zone;
 } __rte_packed_end;
 
-#define i40e_allocate_dma_mem(h, m, unused, s, a) \
-			i40e_allocate_dma_mem_d(h, m, s, a)
+#define i40e_allocate_dma_mem(h, m, mt, s, a) \
+			i40e_allocate_dma_mem_d(h, m, mt, s, a)
 #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m)
 
 struct __rte_packed_begin i40e_virt_mem {
diff --git a/drivers/net/intel/i40e/base/i40e_type.h b/drivers/net/intel/i40e/base/i40e_type.h
index 7cc746f82f..968e1982a6 100644
--- a/drivers/net/intel/i40e/base/i40e_type.h
+++ b/drivers/net/intel/i40e/base/i40e_type.h
@@ -14,11 +14,15 @@
 #include "i40e_devids.h"
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p);
-#define UNREFERENCED_2PARAMETER(_p, _q) (_p); (_q);
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) (_p); (_q); (_r);
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) (_p); (_q); (_r); (_s);
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) (_p); (_q); (_r); (_s); (_t);
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) \
+	do { (void)(_p); (void)(_q); } while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+	do { (void)(_p); (void)(_q); (void)(_r); } while (0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while (0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+	do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while (0)
 
 #define BIT(a) (1UL << (a))
 #define BIT_ULL(a) (1ULL << (a))
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index a0912b1788..2648e5d0c4 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -13,10 +13,7 @@ sources = [
 
 error_cflags = [
         '-Wno-sign-compare',
-        '-Wno-unused-value',
         '-Wno-strict-aliasing',
-        '-Wno-unused-but-set-variable',
-        '-Wno-unused-parameter',
 ]
 c_args = cflags
 foreach flag: error_cflags
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 1c5ab35a8b..90eba3419f 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -4694,6 +4694,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev,
 enum i40e_status_code
 i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw,
 			struct i40e_dma_mem *mem,
+			__rte_unused enum i40e_memory_type mtype,
 			u64 size,
 			u32 alignment)
 {
-- 
2.45.2


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

* [PATCH v4 7/9] net/i40e/base: fix compiler warnings
       [not found] ` <20250328111621.2665257-1-bruce.richardson@intel.com>
                     ` (4 preceding siblings ...)
  2025-03-28 11:16   ` [PATCH v4 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
@ 2025-03-28 11:16   ` Bruce Richardson
  2025-03-28 13:08     ` Burakov, Anatoly
  5 siblings, 1 reply; 30+ messages in thread
From: Bruce Richardson @ 2025-03-28 11:16 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Anatoly Burakov, Vladimir Medvedkin,
	Bruce Richardson, stable

Add a single-line fix to the base code, and then the remaining two
compiler warning disable flags can be removed from the driver base code
build file.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/i40e/base/i40e_diag.c |  2 +-
 drivers/net/intel/i40e/base/meson.build | 13 +------------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_diag.c b/drivers/net/intel/i40e/base/i40e_diag.c
index 4ca102cdd5..71b2e53e85 100644
--- a/drivers/net/intel/i40e/base/i40e_diag.c
+++ b/drivers/net/intel/i40e/base/i40e_diag.c
@@ -34,7 +34,7 @@ static enum i40e_status_code i40e_diag_reg_pattern_test(struct i40e_hw *hw,
 {
 	const u32 patterns[] = {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
 	u32 pat, val, orig_val;
-	int i;
+	unsigned int i;
 
 	orig_val = rd32(hw, reg);
 	for (i = 0; i < ARRAY_SIZE(patterns); i++) {
diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build
index 2648e5d0c4..766383101b 100644
--- a/drivers/net/intel/i40e/base/meson.build
+++ b/drivers/net/intel/i40e/base/meson.build
@@ -11,18 +11,7 @@ sources = [
         'i40e_nvm.c',
 ]
 
-error_cflags = [
-        '-Wno-sign-compare',
-        '-Wno-strict-aliasing',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('i40e_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


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

* Re: [PATCH v4 1/9] net/fm10k/base: fix compilation warnings
  2025-03-28 11:16   ` [PATCH v4 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
@ 2025-03-28 12:53     ` Burakov, Anatoly
  0 siblings, 0 replies; 30+ messages in thread
From: Burakov, Anatoly @ 2025-03-28 12:53 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: David Marchand, Vladimir Medvedkin, stable

On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> The fixes required to re-enable warnings in the fm10k base code are
> trivial, so let's make the changes and get a clean compile without any
> warning disable flags.
> 
> * provide definitions for the UNREFERENCED_PARAMETER macros
> * fix the spelling of the work "fallthrough" in comments
> * provide a definition of FM10K_READ_PCI_WORD in os_dep.h that marks the
>    parameters as used.
> 
> Fixes: 7223d200c227 ("fm10k: add base driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [PATCH v4 3/9] net/ixgbe/base: correct definition of macro
  2025-03-28 11:16   ` [PATCH v4 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
@ 2025-03-28 13:01     ` Burakov, Anatoly
  0 siblings, 0 replies; 30+ messages in thread
From: Burakov, Anatoly @ 2025-03-28 13:01 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: David Marchand, Vladimir Medvedkin, stable

On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> The definition of IXGBE_LE32_TO_CPUS macro is meant to modify the value
> in place - similar to the le32_to_cpus() macro in kernel. Fixing the
> definition allows us to remove some warning flags, and removes the need
> for the uintptr_t typecasts.
> 
> Fixes: aa4fc14d2cee ("ixgbe: update base driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [PATCH v4 4/9] net/ixgbe/base: fix compilation warnings
  2025-03-28 11:16   ` [PATCH v4 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
@ 2025-03-28 13:02     ` Burakov, Anatoly
  0 siblings, 0 replies; 30+ messages in thread
From: Burakov, Anatoly @ 2025-03-28 13:02 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: David Marchand, Vladimir Medvedkin, stable

On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> We can remove almost all of the "unused parameter" and "unused variable"
> warnings by just improving the macro definitions in the osdep.h header.
> Remaining two instances can be fixed by just one-line additions to the
> code, so add those to give us a clean build with the warnings enabled.
> 
> Fixes: af75078fece3 ("first public release")
> Fixes: c6cb313da739 ("net/ixgbe/base: add link management for E610")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [PATCH v4 5/9] net/ixgbe/base: fix lock checker errors
  2025-03-28 11:16   ` [PATCH v4 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
@ 2025-03-28 13:05     ` Burakov, Anatoly
  0 siblings, 0 replies; 30+ messages in thread
From: Burakov, Anatoly @ 2025-03-28 13:05 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: David Marchand, Vladimir Medvedkin, stable

On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> When building on FreeBSD, errors are reported in the base code by the
> lock checker (-Wthread-safety). For example:
> 
> ../drivers/net/intel/ixgbe/base/ixgbe_osdep.c:42:1: error: mutex 'lock->mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
>     42 | }
>        | ^
> 
> These errors are due to the checker not recognising the lock wrapper
> functions. We can avoid these errors by converting these functions into
> macros. While converting the lock macros, we can also convert the memory
> allocation functions too, which allows us to remove the osdep.c file
> entirely from the build.
> 
> Fixes: 30b19d1b5c43 ("net/ixgbe/base: add definitions for E610")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [PATCH v4 6/9] net/i40e/base: fix unused value warnings
  2025-03-28 11:16   ` [PATCH v4 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
@ 2025-03-28 13:07     ` Burakov, Anatoly
  2025-03-28 15:21       ` Andre Muezerie
  0 siblings, 1 reply; 30+ messages in thread
From: Burakov, Anatoly @ 2025-03-28 13:07 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: David Marchand, Vladimir Medvedkin, stable

On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> Fix warnings about unused values - parameters, variables, etc., and
> remove the warning disable flags for them. Although modifying the
> base-code files is not ideal, the changes required are minor, and only
> affect two files from the imported base code.
> 
> Fixes: 8db9e2a1b232 ("i40e: base driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   drivers/net/intel/i40e/base/i40e_nvm.c   |  2 +-
>   drivers/net/intel/i40e/base/i40e_osdep.h |  4 ++--
>   drivers/net/intel/i40e/base/i40e_type.h  | 14 +++++++++-----
>   drivers/net/intel/i40e/base/meson.build  |  3 ---
>   drivers/net/intel/i40e/i40e_ethdev.c     |  1 +
>   5 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
> index 3e16a0d997..56dc4d9279 100644
> --- a/drivers/net/intel/i40e/base/i40e_nvm.c
> +++ b/drivers/net/intel/i40e/base/i40e_nvm.c
> @@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
>    **/
>   STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
>   						    struct i40e_nvm_access *cmd,
> -						    u8 *bytes, int *perrno)
> +						    u8 *bytes, __rte_unused int *perrno)

I don't think we should be adding __rte_unused to base code, there's 
probably a macro for it in osdep? If not, maybe add 
UNREFERENCED_1PARAMETER in code?

For other parts,

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [PATCH v4 7/9] net/i40e/base: fix compiler warnings
  2025-03-28 11:16   ` [PATCH v4 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
@ 2025-03-28 13:08     ` Burakov, Anatoly
  0 siblings, 0 replies; 30+ messages in thread
From: Burakov, Anatoly @ 2025-03-28 13:08 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: David Marchand, Vladimir Medvedkin, stable

On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> Add a single-line fix to the base code, and then the remaining two
> compiler warning disable flags can be removed from the driver base code
> build file.
> 
> Fixes: 8db9e2a1b232 ("i40e: base driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [PATCH v4 6/9] net/i40e/base: fix unused value warnings
  2025-03-28 13:07     ` Burakov, Anatoly
@ 2025-03-28 15:21       ` Andre Muezerie
  2025-03-28 15:26         ` Bruce Richardson
  0 siblings, 1 reply; 30+ messages in thread
From: Andre Muezerie @ 2025-03-28 15:21 UTC (permalink / raw)
  To: Burakov, Anatoly
  Cc: Bruce Richardson, dev, David Marchand, Vladimir Medvedkin, stable

On Fri, Mar 28, 2025 at 02:07:23PM +0100, Burakov, Anatoly wrote:
> On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> >Fix warnings about unused values - parameters, variables, etc., and
> >remove the warning disable flags for them. Although modifying the
> >base-code files is not ideal, the changes required are minor, and only
> >affect two files from the imported base code.
> >
> >Fixes: 8db9e2a1b232 ("i40e: base driver")
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> >---
> >  drivers/net/intel/i40e/base/i40e_nvm.c   |  2 +-
> >  drivers/net/intel/i40e/base/i40e_osdep.h |  4 ++--
> >  drivers/net/intel/i40e/base/i40e_type.h  | 14 +++++++++-----
> >  drivers/net/intel/i40e/base/meson.build  |  3 ---
> >  drivers/net/intel/i40e/i40e_ethdev.c     |  1 +
> >  5 files changed, 13 insertions(+), 11 deletions(-)
> >
> >diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
> >index 3e16a0d997..56dc4d9279 100644
> >--- a/drivers/net/intel/i40e/base/i40e_nvm.c
> >+++ b/drivers/net/intel/i40e/base/i40e_nvm.c
> >@@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
> >   **/
> >  STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
> >  						    struct i40e_nvm_access *cmd,
> >-						    u8 *bytes, int *perrno)
> >+						    u8 *bytes, __rte_unused int *perrno)
> 
> I don't think we should be adding __rte_unused to base code, there's
> probably a macro for it in osdep? If not, maybe add
> UNREFERENCED_1PARAMETER in code?

+1 to this. MSVC does not have a direct equivalent to __attribute__((__unused__))
so it makes sense to not expand usage of __rte_unused.

> 
> For other parts,
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
> 
> -- 
> Thanks,
> Anatoly

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

* Re: [PATCH v4 6/9] net/i40e/base: fix unused value warnings
  2025-03-28 15:21       ` Andre Muezerie
@ 2025-03-28 15:26         ` Bruce Richardson
  0 siblings, 0 replies; 30+ messages in thread
From: Bruce Richardson @ 2025-03-28 15:26 UTC (permalink / raw)
  To: Andre Muezerie
  Cc: Burakov, Anatoly, dev, David Marchand, Vladimir Medvedkin, stable

On Fri, Mar 28, 2025 at 08:21:44AM -0700, Andre Muezerie wrote:
> On Fri, Mar 28, 2025 at 02:07:23PM +0100, Burakov, Anatoly wrote:
> > On 3/28/2025 12:16 PM, Bruce Richardson wrote:
> > >Fix warnings about unused values - parameters, variables, etc., and
> > >remove the warning disable flags for them. Although modifying the
> > >base-code files is not ideal, the changes required are minor, and only
> > >affect two files from the imported base code.
> > >
> > >Fixes: 8db9e2a1b232 ("i40e: base driver")
> > >Cc: stable@dpdk.org
> > >
> > >Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > >---
> > >  drivers/net/intel/i40e/base/i40e_nvm.c   |  2 +-
> > >  drivers/net/intel/i40e/base/i40e_osdep.h |  4 ++--
> > >  drivers/net/intel/i40e/base/i40e_type.h  | 14 +++++++++-----
> > >  drivers/net/intel/i40e/base/meson.build  |  3 ---
> > >  drivers/net/intel/i40e/i40e_ethdev.c     |  1 +
> > >  5 files changed, 13 insertions(+), 11 deletions(-)
> > >
> > >diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
> > >index 3e16a0d997..56dc4d9279 100644
> > >--- a/drivers/net/intel/i40e/base/i40e_nvm.c
> > >+++ b/drivers/net/intel/i40e/base/i40e_nvm.c
> > >@@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
> > >   **/
> > >  STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
> > >  						    struct i40e_nvm_access *cmd,
> > >-						    u8 *bytes, int *perrno)
> > >+						    u8 *bytes, __rte_unused int *perrno)
> > 
> > I don't think we should be adding __rte_unused to base code, there's
> > probably a macro for it in osdep? If not, maybe add
> > UNREFERENCED_1PARAMETER in code?
> 
> +1 to this. MSVC does not have a direct equivalent to __attribute__((__unused__))
> so it makes sense to not expand usage of __rte_unused.
> 

Ok. Will change on apply, rather that doing a respin for that one small
change.

/Bruce


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

end of thread, other threads:[~2025-03-28 15:26 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20250326155230.1315056-1-bruce.richardson@intel.com>
2025-03-26 15:52 ` [PATCH 2/7] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-26 15:52 ` [PATCH 3/7] net/ixgbe/base: fix compilation warnings Bruce Richardson
2025-03-26 15:52 ` [PATCH 4/7] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-26 15:52 ` [PATCH 5/7] net/i40e/base: fix compiler warnings Bruce Richardson
     [not found] ` <20250326160539.1316499-1-bruce.richardson@intel.com>
2025-03-26 16:05   ` [PATCH v2 1/8] net/fm10k/base: fix compilation warnings Bruce Richardson
2025-03-26 16:05   ` [PATCH v2 3/8] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-26 16:05   ` [PATCH v2 4/8] net/ixgbe/base: fix compilation warnings Bruce Richardson
2025-03-26 16:05   ` [PATCH v2 5/8] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-26 16:05   ` [PATCH v2 6/8] net/i40e/base: fix compiler warnings Bruce Richardson
     [not found] ` <20250327145202.2220153-1-bruce.richardson@intel.com>
2025-03-27 14:51   ` [PATCH v3 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
2025-03-27 14:51   ` [PATCH v3 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-27 14:51   ` [PATCH v3 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
2025-03-27 14:51   ` [PATCH v3 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
2025-03-28  8:20     ` David Marchand
2025-03-27 14:51   ` [PATCH v3 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-27 14:51   ` [PATCH v3 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
     [not found] ` <20250328111621.2665257-1-bruce.richardson@intel.com>
2025-03-28 11:16   ` [PATCH v4 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
2025-03-28 12:53     ` Burakov, Anatoly
2025-03-28 11:16   ` [PATCH v4 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-28 13:01     ` Burakov, Anatoly
2025-03-28 11:16   ` [PATCH v4 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
2025-03-28 13:02     ` Burakov, Anatoly
2025-03-28 11:16   ` [PATCH v4 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
2025-03-28 13:05     ` Burakov, Anatoly
2025-03-28 11:16   ` [PATCH v4 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-28 13:07     ` Burakov, Anatoly
2025-03-28 15:21       ` Andre Muezerie
2025-03-28 15:26         ` Bruce Richardson
2025-03-28 11:16   ` [PATCH v4 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
2025-03-28 13:08     ` Burakov, Anatoly

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).