* [PATCH net] bnxt_en: Fix compile error regression when CONFIG_BNXT_SRIOV is not set
@ 2021-11-16 19:26 Michael Chan
2021-11-17 3:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Michael Chan @ 2021-11-16 19:26 UTC (permalink / raw)
To: davem; +Cc: netdev, kuba, edwin.peer, gospo
[-- Attachment #1: Type: text/plain, Size: 1974 bytes --]
bp->sriov_cfg is not defined when CONFIG_BNXT_SRIOV is not set. Fix
it by adding a helper function bnxt_sriov_cfg() to handle the logic
with or without the config option.
Fixes: 46d08f55d24e ("bnxt_en: extend RTNL to VF check in devlink driver_reinit")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 10 ++++++++++
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index d0d5da9b78f8..4c9507d82fd0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2258,6 +2258,16 @@ static inline void bnxt_db_write(struct bnxt *bp, struct bnxt_db_info *db,
}
}
+/* Must hold rtnl_lock */
+static inline bool bnxt_sriov_cfg(struct bnxt *bp)
+{
+#if defined(CONFIG_BNXT_SRIOV)
+ return BNXT_PF(bp) && (bp->pf.active_vfs || bp->sriov_cfg);
+#else
+ return false;
+#endif
+}
+
extern const u16 bnxt_lhint_arr[];
int bnxt_alloc_rx_data(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 6fe9e9b59f83..951c4c569a9b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -442,7 +442,7 @@ static int bnxt_dl_reload_down(struct devlink *dl, bool netns_change,
switch (action) {
case DEVLINK_RELOAD_ACTION_DRIVER_REINIT: {
rtnl_lock();
- if (BNXT_PF(bp) && (bp->pf.active_vfs || bp->sriov_cfg)) {
+ if (bnxt_sriov_cfg(bp)) {
NL_SET_ERR_MSG_MOD(extack,
"reload is unsupported while VFs are allocated or being configured");
rtnl_unlock();
--
2.18.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] bnxt_en: Fix compile error regression when CONFIG_BNXT_SRIOV is not set
2021-11-16 19:26 [PATCH net] bnxt_en: Fix compile error regression when CONFIG_BNXT_SRIOV is not set Michael Chan
@ 2021-11-17 3:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-17 3:10 UTC (permalink / raw)
To: Michael Chan; +Cc: davem, netdev, kuba, edwin.peer, gospo
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 16 Nov 2021 14:26:10 -0500 you wrote:
> bp->sriov_cfg is not defined when CONFIG_BNXT_SRIOV is not set. Fix
> it by adding a helper function bnxt_sriov_cfg() to handle the logic
> with or without the config option.
>
> Fixes: 46d08f55d24e ("bnxt_en: extend RTNL to VF check in devlink driver_reinit")
> Reported-by: kernel test robot <lkp@intel.com>
> Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
> Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>
>
> [...]
Here is the summary with links:
- [net] bnxt_en: Fix compile error regression when CONFIG_BNXT_SRIOV is not set
https://git.kernel.org/netdev/net/c/9f5363916a50
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-17 3:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 19:26 [PATCH net] bnxt_en: Fix compile error regression when CONFIG_BNXT_SRIOV is not set Michael Chan
2021-11-17 3:10 ` patchwork-bot+netdevbpf
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).