* [PATCH net 1/6] bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg()
2023-06-07 7:54 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
@ 2023-06-07 7:54 ` Michael Chan
2023-06-07 7:54 ` [PATCH net 2/6] bnxt_en: Don't issue AP reset during ethtool's reset operation Michael Chan
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Michael Chan @ 2023-06-07 7:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, kuba, pabeni, gospo, Pavan Chebbi,
Kalesh Anakkur Purayil, Somnath Kotur
[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]
From: Pavan Chebbi <pavan.chebbi@broadcom.com>
We must specify the vnic id of the vnic in the input structure of this
firmware message. Otherwise we will get an error from the firmware.
Fixes: 98a4322b70e8 ("bnxt_en: update RSS config using difference algorithm")
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index dcd9367f05af..4aa490cb2fe0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -5350,6 +5350,7 @@ static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp)
if (hwrm_req_init(bp, req, HWRM_VNIC_RSS_QCFG))
return;
+ req->vnic_id = cpu_to_le16(vnic->fw_vnic_id);
/* all contexts configured to same hash_type, zero always exists */
req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]);
resp = hwrm_req_hold(bp, req);
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 2/6] bnxt_en: Don't issue AP reset during ethtool's reset operation
2023-06-07 7:54 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
2023-06-07 7:54 ` [PATCH net 1/6] bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg() Michael Chan
@ 2023-06-07 7:54 ` Michael Chan
2023-06-07 7:54 ` [PATCH net 3/6] bnxt_en: Query default VLAN before VNIC setup on a VF Michael Chan
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Michael Chan @ 2023-06-07 7:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, kuba, pabeni, gospo, Sreekanth Reddy, Pavan Chebbi
[-- Attachment #1: Type: text/plain, Size: 1425 bytes --]
From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Only older NIC controller's firmware uses the PROC AP reset type.
Firmware on 5731X/5741X and newer chips does not support this reset
type. When bnxt_reset() issues a series of resets, this PROC AP
reset may actually fail on these newer chips because the firmware
is not ready to accept this unsupported command yet. Avoid this
unnecessary error by skipping this reset type on chips that don't
support it.
Fixes: 7a13240e3718 ("bnxt_en: fix ethtool_reset_flags ABI violations")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 2dd8ee4a6f75..8fd5071d8b09 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -3831,7 +3831,7 @@ static int bnxt_reset(struct net_device *dev, u32 *flags)
}
}
- if (req & BNXT_FW_RESET_AP) {
+ if (!BNXT_CHIP_P4_PLUS(bp) && (req & BNXT_FW_RESET_AP)) {
/* This feature is not supported in older firmware versions */
if (bp->hwrm_spec_code >= 0x10803) {
if (!bnxt_firmware_reset_ap(dev)) {
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 3/6] bnxt_en: Query default VLAN before VNIC setup on a VF
2023-06-07 7:54 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
2023-06-07 7:54 ` [PATCH net 1/6] bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg() Michael Chan
2023-06-07 7:54 ` [PATCH net 2/6] bnxt_en: Don't issue AP reset during ethtool's reset operation Michael Chan
@ 2023-06-07 7:54 ` Michael Chan
2023-06-07 7:54 ` [PATCH net 4/6] bnxt_en: Skip firmware fatal error recovery if chip is not accessible Michael Chan
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Michael Chan @ 2023-06-07 7:54 UTC (permalink / raw)
To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Somnath Kotur, Pavan Chebbi
[-- Attachment #1: Type: text/plain, Size: 1655 bytes --]
From: Somnath Kotur <somnath.kotur@broadcom.com>
We need to call bnxt_hwrm_func_qcfg() on a VF to query the default
VLAN that may be setup by the PF. If a default VLAN is enabled,
the VF cannot support VLAN acceleration on the receive side and
the VNIC must be setup to strip out the default VLAN tag. If a
default VLAN is not enabled, the VF can support VLAN acceleration
on the receive side. The VNIC should be set up to strip or not
strip the VLAN based on the RX VLAN acceleration setting.
Without this call to determine the default VLAN before calling
bnxt_setup_vnic(), the VNIC may not be set up correctly. For
example, bnxt_setup_vnic() may set up to strip the VLAN tag based
on stale default VLAN information. If RX VLAN acceleration is
not enabled, the VLAN tag will be incorrectly stripped and the
RX data path will not work correctly.
Fixes: cf6645f8ebc6 ("bnxt_en: Add function for VF driver to query default VLAN.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 4aa490cb2fe0..2d39b43ee7cd 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8813,6 +8813,9 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init)
goto err_out;
}
+ if (BNXT_VF(bp))
+ bnxt_hwrm_func_qcfg(bp);
+
rc = bnxt_setup_vnic(bp, 0);
if (rc)
goto err_out;
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 4/6] bnxt_en: Skip firmware fatal error recovery if chip is not accessible
2023-06-07 7:54 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
` (2 preceding siblings ...)
2023-06-07 7:54 ` [PATCH net 3/6] bnxt_en: Query default VLAN before VNIC setup on a VF Michael Chan
@ 2023-06-07 7:54 ` Michael Chan
2023-06-07 7:54 ` [PATCH net 5/6] bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event Michael Chan
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Michael Chan @ 2023-06-07 7:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, kuba, pabeni, gospo, Vikas Gupta,
Somnath Kotur, Pavan Chebbi
[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]
From: Vikas Gupta <vikas.gupta@broadcom.com>
Driver starts firmware fatal error recovery by detecting
heartbeat failure or fw reset count register changing. But
these checks are not reliable if the device is not accessible.
This can happen while DPC (Downstream Port containment) is in
progress. Skip firmware fatal recovery if pci_device_is_present()
returns false.
Fixes: acfb50e4e773 ("bnxt_en: Add FW fatal devlink_health_reporter.")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2d39b43ee7cd..5c8d409d7af8 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11602,6 +11602,7 @@ static void bnxt_tx_timeout(struct net_device *dev, unsigned int txqueue)
static void bnxt_fw_health_check(struct bnxt *bp)
{
struct bnxt_fw_health *fw_health = bp->fw_health;
+ struct pci_dev *pdev = bp->pdev;
u32 val;
if (!fw_health->enabled || test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
@@ -11615,7 +11616,7 @@ static void bnxt_fw_health_check(struct bnxt *bp)
}
val = bnxt_fw_health_readl(bp, BNXT_FW_HEARTBEAT_REG);
- if (val == fw_health->last_fw_heartbeat) {
+ if (val == fw_health->last_fw_heartbeat && pci_device_is_present(pdev)) {
fw_health->arrests++;
goto fw_reset;
}
@@ -11623,7 +11624,7 @@ static void bnxt_fw_health_check(struct bnxt *bp)
fw_health->last_fw_heartbeat = val;
val = bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG);
- if (val != fw_health->last_fw_reset_cnt) {
+ if (val != fw_health->last_fw_reset_cnt && pci_device_is_present(pdev)) {
fw_health->discoveries++;
goto fw_reset;
}
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 5/6] bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event
2023-06-07 7:54 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
` (3 preceding siblings ...)
2023-06-07 7:54 ` [PATCH net 4/6] bnxt_en: Skip firmware fatal error recovery if chip is not accessible Michael Chan
@ 2023-06-07 7:54 ` Michael Chan
2023-06-07 7:54 ` [PATCH net 6/6] bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks Michael Chan
2023-06-08 9:20 ` [PATCH net 0/6] bnxt_en: Bug fixes patchwork-bot+netdevbpf
6 siblings, 0 replies; 8+ messages in thread
From: Michael Chan @ 2023-06-07 7:54 UTC (permalink / raw)
To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Pavan Chebbi
[-- Attachment #1: Type: text/plain, Size: 2253 bytes --]
From: Pavan Chebbi <pavan.chebbi@broadcom.com>
The firmware can send PHC_RTC_UPDATE async event on a PF that may not
have PTP registered. In such a case, there will be a null pointer
deference for bp->ptp_cfg when we try to handle the event.
Fix it by not registering for this event with the firmware if !bp->ptp_cfg.
Also, check that bp->ptp_cfg is valid before proceeding when we receive
the event.
Fixes: 8bcf6f04d4a5 ("bnxt_en: Handle async event when the PHC is updated in RTC mode")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++++++
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 1 +
2 files changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 5c8d409d7af8..c0b0423de338 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -2365,6 +2365,9 @@ static int bnxt_async_event_process(struct bnxt *bp,
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
u64 ns;
+ if (!ptp)
+ goto async_event_process_exit;
+
spin_lock_bh(&ptp->ptp_lock);
bnxt_ptp_update_current_time(bp);
ns = (((u64)BNXT_EVENT_PHC_RTC_UPDATE(data1) <<
@@ -4763,6 +4766,9 @@ int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap, int bmap_size,
if (event_id == ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY &&
!(bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY))
continue;
+ if (event_id == ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE &&
+ !bp->ptp_cfg)
+ continue;
__set_bit(bnxt_async_events_arr[i], async_events_bmap);
}
if (bmap && bmap_size) {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
index e46689128e32..f3886710e778 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
@@ -952,6 +952,7 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
bnxt_ptp_timecounter_init(bp, true);
bnxt_ptp_adjfine_rtc(bp, 0);
}
+ bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, true);
ptp->ptp_info = bnxt_ptp_caps;
if ((bp->fw_cap & BNXT_FW_CAP_PTP_PPS)) {
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net 6/6] bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
2023-06-07 7:54 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
` (4 preceding siblings ...)
2023-06-07 7:54 ` [PATCH net 5/6] bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event Michael Chan
@ 2023-06-07 7:54 ` Michael Chan
2023-06-08 9:20 ` [PATCH net 0/6] bnxt_en: Bug fixes patchwork-bot+netdevbpf
6 siblings, 0 replies; 8+ messages in thread
From: Michael Chan @ 2023-06-07 7:54 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, kuba, pabeni, gospo, Somnath Kotur,
Kalesh Anakkur Purayil
[-- Attachment #1: Type: text/plain, Size: 2707 bytes --]
From: Somnath Kotur <somnath.kotur@broadcom.com>
As per the new udp tunnel framework, drivers which need to know the
details of a port entry (i.e. port type) when it gets deleted should
use the .set_port / .unset_port callbacks.
Implementing the current .udp_tunnel_sync callback would mean that the
deleted tunnel port entry would be all zeros. This used to work on
older firmware because it would not check the input when deleting a
tunnel port. With newer firmware, the delete will now fail and
subsequent tunnel port allocation will fail as a result.
Fixes: 442a35a5a7aa ("bnxt: convert to new udp_tunnel_nic infra")
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 25 ++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index c0b0423de338..d5dc5ee70a48 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -13036,26 +13036,37 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)
#endif /* CONFIG_RFS_ACCEL */
-static int bnxt_udp_tunnel_sync(struct net_device *netdev, unsigned int table)
+static int bnxt_udp_tunnel_set_port(struct net_device *netdev, unsigned int table,
+ unsigned int entry, struct udp_tunnel_info *ti)
{
struct bnxt *bp = netdev_priv(netdev);
- struct udp_tunnel_info ti;
unsigned int cmd;
- udp_tunnel_nic_get_port(netdev, table, 0, &ti);
- if (ti.type == UDP_TUNNEL_TYPE_VXLAN)
+ if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
else
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
- if (ti.port)
- return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti.port, cmd);
+ return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti->port, cmd);
+}
+
+static int bnxt_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table,
+ unsigned int entry, struct udp_tunnel_info *ti)
+{
+ struct bnxt *bp = netdev_priv(netdev);
+ unsigned int cmd;
+
+ if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
+ cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
+ else
+ cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
return bnxt_hwrm_tunnel_dst_port_free(bp, cmd);
}
static const struct udp_tunnel_nic_info bnxt_udp_tunnels = {
- .sync_table = bnxt_udp_tunnel_sync,
+ .set_port = bnxt_udp_tunnel_set_port,
+ .unset_port = bnxt_udp_tunnel_unset_port,
.flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP |
UDP_TUNNEL_NIC_INFO_OPEN_ONLY,
.tables = {
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net 0/6] bnxt_en: Bug fixes
2023-06-07 7:54 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
` (5 preceding siblings ...)
2023-06-07 7:54 ` [PATCH net 6/6] bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks Michael Chan
@ 2023-06-08 9:20 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-06-08 9:20 UTC (permalink / raw)
To: Michael Chan; +Cc: davem, netdev, edumazet, kuba, pabeni, gospo
Hello:
This series was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Wed, 7 Jun 2023 00:54:03 -0700 you wrote:
> This patchset has the following fixes for bnxt_en:
>
> 1. Add missing VNIC ID parameter in the FW message when getting an
> updated RSS configuration from the FW.
>
> 2. Fix a warning when doing ethtool reset on newer chips.
>
> [...]
Here is the summary with links:
- [net,1/6] bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg()
https://git.kernel.org/netdev/net/c/095d5dc0c1d9
- [net,2/6] bnxt_en: Don't issue AP reset during ethtool's reset operation
https://git.kernel.org/netdev/net/c/1d997801c7cc
- [net,3/6] bnxt_en: Query default VLAN before VNIC setup on a VF
https://git.kernel.org/netdev/net/c/1a9e4f501bc6
- [net,4/6] bnxt_en: Skip firmware fatal error recovery if chip is not accessible
https://git.kernel.org/netdev/net/c/83474a9b252a
- [net,5/6] bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event
https://git.kernel.org/netdev/net/c/319a7827df97
- [net,6/6] bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
https://git.kernel.org/netdev/net/c/1eb4ef125913
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] 8+ messages in thread