diff mbox series

bnxt: fix building without CONFIG_RFS_ACCEL

Message ID 20240103102332.3642417-1-arnd@kernel.org (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series bnxt: fix building without CONFIG_RFS_ACCEL | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1113 this patch: 1113
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1140 this patch: 1140
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Arnd Bergmann Jan. 3, 2024, 10:23 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

A recent patch series generalized the filter logic in bnxt to no
longer just be used for RFS, but it now fails to build when RFS_ACCEL
is disabled:

drivers/net/ethernet/broadcom/bnxt/bnxt.c: In function 'bnxt_cfg_ntp_filters':
drivers/net/ethernet/broadcom/bnxt/bnxt.c:14077:37: error: implicit declaration of function 'rps_may_expire_flow' [-Werror=implicit-function-declaration]
14077 |                                 if (rps_may_expire_flow(bp->dev, fltr->base.rxq,
      |                                     ^~~~~~~~~~~~~~~~~~~

Add back one #ifdef check around a call to the missing rps_may_expire_flow()
function.

Fixes: 59cde76f33fa ("bnxt_en: Refactor filter insertion logic in bnxt_rx_flow_steer().")
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I don't know if this is a correct fix, only checked that it is plausible
and that it does address the build failure. If a different fix is needed,
please just treat this as a bug report.
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Gospodarek Jan. 3, 2024, 3:46 p.m. UTC | #1
On Wed, Jan 03, 2024 at 11:23:11AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A recent patch series generalized the filter logic in bnxt to no
> longer just be used for RFS, but it now fails to build when RFS_ACCEL
> is disabled:
> 
> drivers/net/ethernet/broadcom/bnxt/bnxt.c: In function 'bnxt_cfg_ntp_filters':
> drivers/net/ethernet/broadcom/bnxt/bnxt.c:14077:37: error: implicit declaration of function 'rps_may_expire_flow' [-Werror=implicit-function-declaration]
> 14077 |                                 if (rps_may_expire_flow(bp->dev, fltr->base.rxq,
>       |                                     ^~~~~~~~~~~~~~~~~~~
> 
> Add back one #ifdef check around a call to the missing rps_may_expire_flow()
> function.
> 
> Fixes: 59cde76f33fa ("bnxt_en: Refactor filter insertion logic in bnxt_rx_flow_steer().")
> Cc: Michael Chan <michael.chan@broadcom.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I don't know if this is a correct fix, only checked that it is plausible
> and that it does address the build failure. If a different fix is needed,
> please just treat this as a bug report.

Are you using a kernel config with CONFIG_SMP=n ?  That was how I was
able to reproduce this.

There is a good oppportunity to clean this up a little better.  When
CONFIG_RFS_ACCEL is not set there is no reason to even have
bnxt_cfg_ntp_filters included in the driver build.

I'll talk to Michael and we will post a fix for this.

> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 827821e89c40..83a97c65b728 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -14074,6 +14074,7 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)
>  			if (test_bit(BNXT_FLTR_VALID, &fltr->base.state)) {
>  				if (fltr->base.flags & BNXT_ACT_NO_AGING)
>  					continue;
> +#if IS_ENABLED(CONFIG_RFS_ACCEL)
>  				if (rps_may_expire_flow(bp->dev, fltr->base.rxq,
>  							fltr->flow_id,
>  							fltr->base.sw_id)) {
> @@ -14081,6 +14082,7 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)
>  									 fltr);
>  					del = true;
>  				}
> +#endif
>  			} else {
>  				rc = bnxt_hwrm_cfa_ntuple_filter_alloc(bp,
>  								       fltr);
> -- 
> 2.39.2
>
Arnd Bergmann Jan. 3, 2024, 4:01 p.m. UTC | #2
On Wed, Jan 3, 2024, at 16:46, Andy Gospodarek wrote:
> On Wed, Jan 03, 2024 at 11:23:11AM +0100, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>> 
>> A recent patch series generalized the filter logic in bnxt to no
>> longer just be used for RFS, but it now fails to build when RFS_ACCEL
>> is disabled:
>> 
>> drivers/net/ethernet/broadcom/bnxt/bnxt.c: In function 'bnxt_cfg_ntp_filters':
>> drivers/net/ethernet/broadcom/bnxt/bnxt.c:14077:37: error: implicit declaration of function 'rps_may_expire_flow' [-Werror=implicit-function-declaration]
>> 14077 |                                 if (rps_may_expire_flow(bp->dev, fltr->base.rxq,
>>       |                                     ^~~~~~~~~~~~~~~~~~~
>> 
>> Add back one #ifdef check around a call to the missing rps_may_expire_flow()
>> function.
>> 
>> Fixes: 59cde76f33fa ("bnxt_en: Refactor filter insertion logic in bnxt_rx_flow_steer().")
>> Cc: Michael Chan <michael.chan@broadcom.com>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>> I don't know if this is a correct fix, only checked that it is plausible
>> and that it does address the build failure. If a different fix is needed,
>> please just treat this as a bug report.
>
> Are you using a kernel config with CONFIG_SMP=n ?  That was how I was
> able to reproduce this.

I saw this in two randconfig test builds on 32-bit arm, both with
SMP disabled, though I did not expect that to make a difference.

In case it helps, this is one of the two config files:
https://pastebin.com/raw/uxHEXzG2

> There is a good oppportunity to clean this up a little better.  When
> CONFIG_RFS_ACCEL is not set there is no reason to even have
> bnxt_cfg_ntp_filters included in the driver build.
>
> I'll talk to Michael and we will post a fix for this.

Ok, thanks!

     Arnd
Michael Chan Jan. 3, 2024, 4:56 p.m. UTC | #3
On Wed, Jan 3, 2024 at 8:01 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wed, Jan 3, 2024, at 16:46, Andy Gospodarek wrote:
> > There is a good oppportunity to clean this up a little better.  When
> > CONFIG_RFS_ACCEL is not set there is no reason to even have
> > bnxt_cfg_ntp_filters included in the driver build.
> >
> > I'll talk to Michael and we will post a fix for this.
>
> Ok, thanks!

Yes, we can clean this up better.  User configured ntuple filters are
directly added and don't go through bnxt_cfg_ntp_filters() by way of
the workqueue.  I'll post the fix later today.  Thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 827821e89c40..83a97c65b728 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -14074,6 +14074,7 @@  static void bnxt_cfg_ntp_filters(struct bnxt *bp)
 			if (test_bit(BNXT_FLTR_VALID, &fltr->base.state)) {
 				if (fltr->base.flags & BNXT_ACT_NO_AGING)
 					continue;
+#if IS_ENABLED(CONFIG_RFS_ACCEL)
 				if (rps_may_expire_flow(bp->dev, fltr->base.rxq,
 							fltr->flow_id,
 							fltr->base.sw_id)) {
@@ -14081,6 +14082,7 @@  static void bnxt_cfg_ntp_filters(struct bnxt *bp)
 									 fltr);
 					del = true;
 				}
+#endif
 			} else {
 				rc = bnxt_hwrm_cfa_ntuple_filter_alloc(bp,
 								       fltr);