[PATCH 0/3] common/sfc_efx/base: fix compiler warnings in X4 netport API
Stephen Hemminger
stephen at networkplumber.org
Fri Jul 11 18:31:24 CEST 2025
On Fri, 11 Jul 2025 19:13:01 +0400 (+04)
Ivan Malov <ivan.malov at arknetworks.am> wrote:
> On Fri, 11 Jul 2025, Stephen Hemminger wrote:
>
> > On Fri, 11 Jul 2025 18:43:46 +0400
> > Ivan Malov <ivan.malov at arknetworks.am> 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.
> >
> 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.
More information about the dev
mailing list