[PATCH 0/3] common/sfc_efx/base: fix compiler warnings in X4 netport API

STALE364d

14 messages, 3 authors, 2025-08-02 · open the first message on its own page

[PATCH 0/3] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Ivan Malov <hidden>
Date: 2025-07-11 14:44:00

The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

Ivan Malov (3):
  common/sfc_efx/base: fix compiler warnings in statistic code
  common/sfc_efx/base: fix compiler warnings in PHY link setup
  common/sfc_efx/base: fix compiler warning in PHY link getter

 drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

-- 
2.39.5

[PATCH 1/3] common/sfc_efx/base: fix compiler warnings in statistic code

From: Ivan Malov <hidden>
Date: 2025-07-11 14:44:06

Fixes: f2f77453cb9f ("common/sfc_efx/base: fill in software LUT for MAC statistics")

Suggested-by: Andy Moreton <redacted>
Signed-off-by: Ivan Malov <redacted>
Reviewed-by: Andy Moreton <redacted>
---
 drivers/common/sfc_efx/base/efx_np.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index a19c986691..798fcce26c 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -750,7 +750,7 @@ efx_np_stat_describe(
 	return;
 
 found:
-	if (sw_id >= lut_nentries) {
+	if ((unsigned int)sw_id >= lut_nentries) {
 		/*
 		 * Static mapping size and the size of lookup
 		 * table are out-of-sync. Should never happen.
@@ -782,7 +782,6 @@ efx_np_stats_describe(
 	EFX_MCDI_DECLARE_BUF(payload,
 	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_IN_LEN,
 	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMAX_MCDI2);
-	efx_port_t *epp = &(enp->en_port);
 	uint32_t nprocessed;
 	efx_mcdi_req_t req;
 	uint8_t *entries;
-- 
2.39.5

Re: [PATCH 1/3] common/sfc_efx/base: fix compiler warnings in statistic code

From: Andrew Rybchenko <hidden>
Date: 2025-07-26 11:51:28

On 7/11/25 17:43, Ivan Malov wrote:
quoted hunk
Fixes: f2f77453cb9f ("common/sfc_efx/base: fill in software LUT for MAC statistics")

Suggested-by: Andy Moreton <redacted>
Signed-off-by: Ivan Malov <redacted>
Reviewed-by: Andy Moreton <redacted>
---
  drivers/common/sfc_efx/base/efx_np.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index a19c986691..798fcce26c 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -750,7 +750,7 @@ efx_np_stat_describe(
  	return;
  
  found:
-	if (sw_id >= lut_nentries) {
+	if ((unsigned int)sw_id >= lut_nentries) {
Unfortunately it is not trivial to understand what's happening here
without looking at code. I bit more verbose description would be
helpful.
quoted hunk
  		/*
  		 * Static mapping size and the size of lookup
  		 * table are out-of-sync. Should never happen.
@@ -782,7 +782,6 @@ efx_np_stats_describe(
  	EFX_MCDI_DECLARE_BUF(payload,
  	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_IN_LEN,
  	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMAX_MCDI2);
-	efx_port_t *epp = &(enp->en_port);
I guess the variable is simply unused.
  	uint32_t nprocessed;
  	efx_mcdi_req_t req;
  	uint8_t *entries;
IMHO it would be better to group similar fixes as unused variables into
single patch which clearly explains what's happening.
The goal is to "fix unused variable warnings".
The way is to "Remove unused variables."

[PATCH 2/3] common/sfc_efx/base: fix compiler warnings in PHY link setup

From: Ivan Malov <hidden>
Date: 2025-07-11 14:44:12

Fixes: 8e79cd30230d ("common/sfc_efx/base: implement PHY link control for Medford4")

Suggested-by: Andy Moreton <redacted>
Signed-off-by: Ivan Malov <redacted>
Reviewed-by: Andy Moreton <redacted>
---
 drivers/common/sfc_efx/base/efx_np.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index 798fcce26c..222d81c12e 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -1185,7 +1185,6 @@ efx_np_cap_sw_mask_to_hw_enum(
 	__out_opt			uint16_t *enum_hwp)
 {
 	unsigned int sw_nflags_req = 0;
-	unsigned int sw_nflags_sup = 0;
 	uint32_t sw_check_mask = 0;
 	unsigned int i;
 
@@ -1288,7 +1287,6 @@ efx_np_link_ctrl(
 	uint16_t cap_enum_hw;
 	boolean_t supported;
 	efx_mcdi_req_t req;
-	boolean_t phy_an;
 	efx_rc_t rc;
 	uint8_t fec;
 
@@ -1385,7 +1383,7 @@ efx_np_link_ctrl(
 	}
 
 	EFSYS_ASSERT(cap_enum_hw <= UINT8_MAX);
-	fec = cap_enum_hw;
+	fec = (uint8_t)cap_enum_hw;
 
 	MCDI_IN_SET_WORD(req, LINK_CTRL_IN_LINK_TECHNOLOGY, link_tech);
 	MCDI_IN_SET_DWORD(req, LINK_CTRL_IN_CONTROL_FLAGS, flags);
-- 
2.39.5

[PATCH 3/3] common/sfc_efx/base: fix compiler warning in PHY link getter

From: Ivan Malov <hidden>
Date: 2025-07-11 14:44:19

Fixes: 2a5cf77e6de8 ("common/sfc_efx/base: provide PHY link get method on Medford4")

Suggested-by: Andy Moreton <redacted>
Signed-off-by: Ivan Malov <redacted>
Reviewed-by: Andy Moreton <redacted>
---
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/common/sfc_efx/base/medford4_phy.c b/drivers/common/sfc_efx/base/medford4_phy.c
index 9ba6dfbc10..16e6dd2d84 100644
--- a/drivers/common/sfc_efx/base/medford4_phy.c
+++ b/drivers/common/sfc_efx/base/medford4_phy.c
@@ -34,7 +34,6 @@ medford4_phy_get_link(
 	efx_np_handle_t nph = enp->en_port.ep_np_handle;
 	efx_np_link_state_t ls;
 	efx_np_mac_state_t ms;
-	uint32_t fcntl;
 	efx_rc_t rc;
 
 	rc = efx_np_link_state(enp, nph, &ls);
-- 
2.39.5

Re: [PATCH 0/3] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2025-07-11 14:55:51

On Fri, 11 Jul 2025 18:43:46 +0400
Ivan Malov [off-list ref] wrote:
The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

Ivan Malov (3):
  common/sfc_efx/base: fix compiler warnings in statistic code
  common/sfc_efx/base: fix compiler warnings in PHY link setup
  common/sfc_efx/base: fix compiler warning in PHY link getter

 drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)
Have your tried enabling -Wshadow and -Wduplicated-branches and -Wduplicated-cond
Those flags are finding stuff in other places.

Re: [PATCH 0/3] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Ivan Malov <hidden>
Date: 2025-07-11 15:13:05

On Fri, 11 Jul 2025, Stephen Hemminger wrote:
On Fri, 11 Jul 2025 18:43:46 +0400
Ivan Malov [off-list ref] wrote:
quoted
The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

Ivan Malov (3):
  common/sfc_efx/base: fix compiler warnings in statistic code
  common/sfc_efx/base: fix compiler warnings in PHY link setup
  common/sfc_efx/base: fix compiler warning in PHY link getter

 drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)
Have your tried enabling -Wshadow and -Wduplicated-branches and -Wduplicated-cond
Those flags are finding stuff in other places.
Thanks Stephen. That is very useful. I tried adding these flags via meson.build
for common/sfc_efx, common/sfc_efx/base and for net/sfc trees and the only thing
I was able to find is as follows:

In file included from ../lib/eal/x86/include/rte_byteorder.h:9,
                  from ../drivers/net/sfc/sfc_ef10_essb_rx.c:14:
../drivers/net/sfc/sfc_ef10_essb_rx.c: In function ‘sfc_ef10_essb_rx_qsize_up_rings’:
../drivers/net/sfc/sfc_dp.h:27:27: warning: declaration of ‘_a’ shadows a previous local [-Wshadow]
    27 |                 typeof(a) _a = (a);     \
       |                           ^~
../lib/eal/include/rte_common.h:817:34: note: in definition of macro ‘RTE_MAX’
   817 |                 typeof (a) _a = (a); \
       |                                  ^
../drivers/net/sfc/sfc_ef10_essb_rx.c:535:33: note: in expansion of macro ‘SFC_DIV_ROUND_UP’
   535 |         nb_hw_rx_desc = RTE_MAX(SFC_DIV_ROUND_UP(nb_rx_desc,
       |                                 ^~~~~~~~~~~~~~~~
../lib/eal/include/rte_common.h:817:28: note: shadowed declaration is here
   817 |                 typeof (a) _a = (a); \
       |                            ^~
../drivers/net/sfc/sfc_ef10_essb_rx.c:535:25: note: in expansion of macro ‘RTE_MAX’
   535 |         nb_hw_rx_desc = RTE_MAX(SFC_DIV_ROUND_UP(nb_rx_desc,
       |

But no extra warnings in the base driver.

Thank you.

Re: [PATCH 0/3] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2025-07-11 16:31:30

On Fri, 11 Jul 2025 19:13:01 +0400 (+04)
Ivan Malov [off-list ref] wrote:
On Fri, 11 Jul 2025, Stephen Hemminger wrote:
quoted
On Fri, 11 Jul 2025 18:43:46 +0400
Ivan Malov [off-list ref] wrote:
 
quoted
The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

Ivan Malov (3):
  common/sfc_efx/base: fix compiler warnings in statistic code
  common/sfc_efx/base: fix compiler warnings in PHY link setup
  common/sfc_efx/base: fix compiler warning in PHY link getter

 drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)
 
Have your tried enabling -Wshadow and -Wduplicated-branches and -Wduplicated-cond
Those flags are finding stuff in other places.
 
Thanks Stephen. That is very useful. I tried adding these flags via meson.build
for common/sfc_efx, common/sfc_efx/base and for net/sfc trees and the only thing
I was able to find is as follows:

In file included from ../lib/eal/x86/include/rte_byteorder.h:9,
                  from ../drivers/net/sfc/sfc_ef10_essb_rx.c:14:
../drivers/net/sfc/sfc_ef10_essb_rx.c: In function ‘sfc_ef10_essb_rx_qsize_up_rings’:
../drivers/net/sfc/sfc_dp.h:27:27: warning: declaration of ‘_a’ shadows a previous local [-Wshadow]
    27 |                 typeof(a) _a = (a);     \
       |                           ^~
../lib/eal/include/rte_common.h:817:34: note: in definition of macro ‘RTE_MAX’
   817 |                 typeof (a) _a = (a); \
       |                                  ^
../drivers/net/sfc/sfc_ef10_essb_rx.c:535:33: note: in expansion of macro ‘SFC_DIV_ROUND_UP’
   535 |         nb_hw_rx_desc = RTE_MAX(SFC_DIV_ROUND_UP(nb_rx_desc,
       |                                 ^~~~~~~~~~~~~~~~
../lib/eal/include/rte_common.h:817:28: note: shadowed declaration is here
   817 |                 typeof (a) _a = (a); \
       |                            ^~
../drivers/net/sfc/sfc_ef10_essb_rx.c:535:25: note: in expansion of macro ‘RTE_MAX’
   535 |         nb_hw_rx_desc = RTE_MAX(SFC_DIV_ROUND_UP(nb_rx_desc,
       |

But no extra warnings in the base driver.

Thank you.
Good thanks, RTE_MIN/RTE_MAX has issues when nested. Not sure if there is an easy fix.

Re: [PATCH 0/3] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2025-07-22 03:51:02

On Fri, 11 Jul 2025 18:43:46 +0400
Ivan Malov [off-list ref] wrote:
The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

Ivan Malov (3):
  common/sfc_efx/base: fix compiler warnings in statistic code
  common/sfc_efx/base: fix compiler warnings in PHY link setup
  common/sfc_efx/base: fix compiler warning in PHY link getter

 drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

-- 
Queued to next-net for 25.11

[PATCH v2 0/2] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Ivan Malov <hidden>
Date: 2025-08-02 04:30:23

The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

v2:
- re-group the changes the way Andrew suggested
- include Cc to 'stable', to have this in 25.07

Ivan Malov (2):
  common/sfc_efx/base: resolve warnings about unused variables
  common/sfc_efx/base: clean up type-related compiler warnings

 drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

-- 
2.39.5

[PATCH v2 1/2] common/sfc_efx/base: resolve warnings about unused variables

From: Ivan Malov <hidden>
Date: 2025-08-02 04:30:30

Fixes: 2a5cf77e6de8 ("common/sfc_efx/base: provide PHY link get method on Medford4")
Fixes: 8e79cd30230d ("common/sfc_efx/base: implement PHY link control for Medford4")
Fixes: f2f77453cb9f ("common/sfc_efx/base: fill in software LUT for MAC statistics")
Cc: stable@dpdk.org

Suggested-by: Andy Moreton <redacted>
Signed-off-by: Ivan Malov <redacted>
---
 drivers/common/sfc_efx/base/efx_np.c       | 3 ---
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 4 deletions(-)
diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index a19c986691..d7692fdba7 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -782,7 +782,6 @@ efx_np_stats_describe(
 	EFX_MCDI_DECLARE_BUF(payload,
 	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_IN_LEN,
 	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMAX_MCDI2);
-	efx_port_t *epp = &(enp->en_port);
 	uint32_t nprocessed;
 	efx_mcdi_req_t req;
 	uint8_t *entries;
@@ -1186,7 +1185,6 @@ efx_np_cap_sw_mask_to_hw_enum(
 	__out_opt			uint16_t *enum_hwp)
 {
 	unsigned int sw_nflags_req = 0;
-	unsigned int sw_nflags_sup = 0;
 	uint32_t sw_check_mask = 0;
 	unsigned int i;
 
@@ -1289,7 +1287,6 @@ efx_np_link_ctrl(
 	uint16_t cap_enum_hw;
 	boolean_t supported;
 	efx_mcdi_req_t req;
-	boolean_t phy_an;
 	efx_rc_t rc;
 	uint8_t fec;
 
diff --git a/drivers/common/sfc_efx/base/medford4_phy.c b/drivers/common/sfc_efx/base/medford4_phy.c
index 9ba6dfbc10..16e6dd2d84 100644
--- a/drivers/common/sfc_efx/base/medford4_phy.c
+++ b/drivers/common/sfc_efx/base/medford4_phy.c
@@ -34,7 +34,6 @@ medford4_phy_get_link(
 	efx_np_handle_t nph = enp->en_port.ep_np_handle;
 	efx_np_link_state_t ls;
 	efx_np_mac_state_t ms;
-	uint32_t fcntl;
 	efx_rc_t rc;
 
 	rc = efx_np_link_state(enp, nph, &ls);
-- 
2.39.5

[PATCH v2 2/2] common/sfc_efx/base: clean up type-related compiler warnings

From: Ivan Malov <hidden>
Date: 2025-08-02 04:30:36

Fixes: 8e79cd30230d ("common/sfc_efx/base: implement PHY link control for Medford4")
Fixes: f2f77453cb9f ("common/sfc_efx/base: fill in software LUT for MAC statistics")
Cc: stable@dpdk.org

Suggested-by: Andy Moreton <redacted>
Signed-off-by: Ivan Malov <redacted>
---
 drivers/common/sfc_efx/base/efx_np.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index d7692fdba7..222d81c12e 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -750,7 +750,7 @@ efx_np_stat_describe(
 	return;
 
 found:
-	if (sw_id >= lut_nentries) {
+	if ((unsigned int)sw_id >= lut_nentries) {
 		/*
 		 * Static mapping size and the size of lookup
 		 * table are out-of-sync. Should never happen.
@@ -1383,7 +1383,7 @@ efx_np_link_ctrl(
 	}
 
 	EFSYS_ASSERT(cap_enum_hw <= UINT8_MAX);
-	fec = cap_enum_hw;
+	fec = (uint8_t)cap_enum_hw;
 
 	MCDI_IN_SET_WORD(req, LINK_CTRL_IN_LINK_TECHNOLOGY, link_tech);
 	MCDI_IN_SET_DWORD(req, LINK_CTRL_IN_CONTROL_FLAGS, flags);
-- 
2.39.5

Re: [PATCH v2 0/2] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Andrew Rybchenko <hidden>
Date: 2025-08-02 08:20:51

On 8/2/25 07:30, Ivan Malov wrote:
The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

v2:
- re-group the changes the way Andrew suggested
- include Cc to 'stable', to have this in 25.07

Ivan Malov (2):
   common/sfc_efx/base: resolve warnings about unused variables
   common/sfc_efx/base: clean up type-related compiler warnings

  drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
  drivers/common/sfc_efx/base/medford4_phy.c | 1 -
  2 files changed, 2 insertions(+), 6 deletions(-)
Series-acked-by: Andrew Rybchenko [off-list ref]

Re: [PATCH v2 0/2] common/sfc_efx/base: fix compiler warnings in X4 netport API

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2025-08-02 20:59:40

On Sat,  2 Aug 2025 08:30:08 +0400
Ivan Malov [off-list ref] wrote:
The 25.07 release has got support for AMD Solarflare X45xx adapters [1].
This series is a follow-up to [1] to fix compiler warnings in the base
driver that are seen in Windows driver build, also based on this driver.

[1] https://patches.dpdk.org/project/dpdk/list/?series=35095

v2:
- re-group the changes the way Andrew suggested
- include Cc to 'stable', to have this in 25.07

Ivan Malov (2):
  common/sfc_efx/base: resolve warnings about unused variables
  common/sfc_efx/base: clean up type-related compiler warnings

 drivers/common/sfc_efx/base/efx_np.c       | 7 ++-----
 drivers/common/sfc_efx/base/medford4_phy.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)
Queued to next-net for 25.11
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help