All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] bnxt_en: 2 bug fixes.
@ 2019-04-08 21:39 Michael Chan
  2019-04-08 21:39 ` [PATCH net 1/2] bnxt_en: Improve RX consumer index validity check Michael Chan
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Michael Chan @ 2019-04-08 21:39 UTC (permalink / raw)
  To: davem; +Cc: netdev

The first patch prevents possible driver crash if we get a bad RX index
from the hardware.  The second patch resets the device when the hardware
reports buffer error to recover from the error.

Please queue these for -stable also.  Thanks.

Michael Chan (2):
  bnxt_en: Improve RX consumer index validity check.
  bnxt_en: Reset device on RX buffer errors.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

-- 
2.5.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH net 1/2] bnxt_en: Improve RX consumer index validity check.
  2019-04-08 21:39 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
@ 2019-04-08 21:39 ` Michael Chan
  2019-04-08 21:39 ` [PATCH net 2/2] bnxt_en: Reset device on RX buffer errors Michael Chan
  2019-04-08 23:39 ` [PATCH net 0/2] bnxt_en: 2 bug fixes David Miller
  2 siblings, 0 replies; 18+ messages in thread
From: Michael Chan @ 2019-04-08 21:39 UTC (permalink / raw)
  To: davem; +Cc: netdev

There is logic to check that the RX/TPA consumer index is the expected
index to work around a hardware problem.  However, the potentially bad
consumer index is first used to index into an array to reference an entry.
This can potentially crash if the bad consumer index is beyond legal
range.  Improve the logic to use the consumer index for dereferencing
after the validity check and log an error message.

Fixes: fa7e28127a5a ("bnxt_en: Add workaround to detect bad opaque in rx completion (part 2)")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 0bb9d7b..3df847b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1133,6 +1133,8 @@ static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
 	tpa_info = &rxr->rx_tpa[agg_id];
 
 	if (unlikely(cons != rxr->rx_next_cons)) {
+		netdev_warn(bp->dev, "TPA cons %x != expected cons %x\n",
+			    cons, rxr->rx_next_cons);
 		bnxt_sched_reset(bp, rxr);
 		return;
 	}
@@ -1585,15 +1587,17 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
 	}
 
 	cons = rxcmp->rx_cmp_opaque;
-	rx_buf = &rxr->rx_buf_ring[cons];
-	data = rx_buf->data;
-	data_ptr = rx_buf->data_ptr;
 	if (unlikely(cons != rxr->rx_next_cons)) {
 		int rc1 = bnxt_discard_rx(bp, cpr, raw_cons, rxcmp);
 
+		netdev_warn(bp->dev, "RX cons %x != expected cons %x\n",
+			    cons, rxr->rx_next_cons);
 		bnxt_sched_reset(bp, rxr);
 		return rc1;
 	}
+	rx_buf = &rxr->rx_buf_ring[cons];
+	data = rx_buf->data;
+	data_ptr = rx_buf->data_ptr;
 	prefetch(data_ptr);
 
 	misc = le32_to_cpu(rxcmp->rx_cmp_misc_v1);
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH net 2/2] bnxt_en: Reset device on RX buffer errors.
  2019-04-08 21:39 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
  2019-04-08 21:39 ` [PATCH net 1/2] bnxt_en: Improve RX consumer index validity check Michael Chan
@ 2019-04-08 21:39 ` Michael Chan
  2019-04-08 23:39 ` [PATCH net 0/2] bnxt_en: 2 bug fixes David Miller
  2 siblings, 0 replies; 18+ messages in thread
From: Michael Chan @ 2019-04-08 21:39 UTC (permalink / raw)
  To: davem; +Cc: netdev

If the RX completion indicates RX buffers errors, the RX ring will be
disabled by firmware and no packets will be received on that ring from
that point on.  Recover by resetting the device.

Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 3df847b..4c586ba 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1614,11 +1614,17 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
 
 	rx_buf->data = NULL;
 	if (rxcmp1->rx_cmp_cfa_code_errors_v2 & RX_CMP_L2_ERRORS) {
+		u32 rx_err = le32_to_cpu(rxcmp1->rx_cmp_cfa_code_errors_v2);
+
 		bnxt_reuse_rx_data(rxr, cons, data);
 		if (agg_bufs)
 			bnxt_reuse_rx_agg_bufs(cpr, cp_cons, agg_bufs);
 
 		rc = -EIO;
+		if (rx_err & RX_CMPL_ERRORS_BUFFER_ERROR_MASK) {
+			netdev_warn(bp->dev, "RX buffer error %x\n", rx_err);
+			bnxt_sched_reset(bp, rxr);
+		}
 		goto next_rx;
 	}
 
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes.
  2019-04-08 21:39 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
  2019-04-08 21:39 ` [PATCH net 1/2] bnxt_en: Improve RX consumer index validity check Michael Chan
  2019-04-08 21:39 ` [PATCH net 2/2] bnxt_en: Reset device on RX buffer errors Michael Chan
@ 2019-04-08 23:39 ` David Miller
  2 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2019-04-08 23:39 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Mon,  8 Apr 2019 17:39:53 -0400

> The first patch prevents possible driver crash if we get a bad RX index
> from the hardware.  The second patch resets the device when the hardware
> reports buffer error to recover from the error.
> 
> Please queue these for -stable also.  Thanks.

Series applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes
  2023-03-04  2:43 Michael Chan
@ 2023-03-06 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 18+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-06 21:30 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, kuba, edumazet, pabeni, gospo

Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri,  3 Mar 2023 18:43:56 -0800 you wrote:
> This series fixes 2 issues:
> 
> 1. A potential order-5 memory allocation failure during open.
> 2. Double memory free bug during shutdown.
> 
> Michael Chan (1):
>   bnxt_en: Avoid order-5 memory allocation for TPA data
> 
> [...]

Here is the summary with links:
  - [net,1/2] bnxt_en: Avoid order-5 memory allocation for TPA data
    https://git.kernel.org/netdev/net/c/accd7e23693a
  - [net,2/2] bnxt_en: Fix the double free during device removal
    https://git.kernel.org/netdev/net/c/89b59a84cb16

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] 18+ messages in thread

* [PATCH net 0/2] bnxt_en: 2 bug fixes
@ 2023-03-04  2:43 Michael Chan
  2023-03-06 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Chan @ 2023-03-04  2:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, edumazet, pabeni, gospo

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

This series fixes 2 issues:

1. A potential order-5 memory allocation failure during open.
2. Double memory free bug during shutdown.

Michael Chan (1):
  bnxt_en: Avoid order-5 memory allocation for TPA data

Selvin Xavier (1):
  bnxt_en: Fix the double free during device removal

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 25 +++++++++----------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c |  2 ++
 2 files changed, 14 insertions(+), 13 deletions(-)

-- 
2.32.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes
  2021-08-15 20:15 Michael Chan
@ 2021-08-16 10:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 18+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-16 10:40 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, kuba, gospo

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Sun, 15 Aug 2021 16:15:35 -0400 you wrote:
> The first one disables aRFS/NTUPLE on an older broken firmware version.
> The second one adds missing memory barriers related to completion ring
> handling.
> 
> Michael Chan (2):
>   bnxt_en: Disable aRFS if running on 212 firmware
>   bnxt_en: Add missing DMA memory barriers
> 
> [...]

Here is the summary with links:
  - [net,1/2] bnxt_en: Disable aRFS if running on 212 firmware
    https://git.kernel.org/netdev/net/c/976e52b718c3
  - [net,2/2] bnxt_en: Add missing DMA memory barriers
    https://git.kernel.org/netdev/net/c/828affc27ed4

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] 18+ messages in thread

* [PATCH net 0/2] bnxt_en: 2 bug fixes
@ 2021-08-15 20:15 Michael Chan
  2021-08-16 10:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Chan @ 2021-08-15 20:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

The first one disables aRFS/NTUPLE on an older broken firmware version.
The second one adds missing memory barriers related to completion ring
handling.

Michael Chan (2):
  bnxt_en: Disable aRFS if running on 212 firmware
  bnxt_en: Add missing DMA memory barriers

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.18.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes.
  2021-05-15  7:25 Michael Chan
@ 2021-05-17 21:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 18+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-17 21:10 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, kuba, gospo

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Sat, 15 May 2021 03:25:17 -0400 you wrote:
> The first one fixes a bug to properly identify some recently added HyperV
> device IDs.  The second one fixes device context memory set up on systems
> with 64K page size.
> 
> Please queue these for -stable as well.  Thanks.
> 
> Andy Gospodarek (1):
>   bnxt_en: Include new P5 HV definition in VF check.
> 
> [...]

Here is the summary with links:
  - [net,1/2] bnxt_en: Include new P5 HV definition in VF check.
    https://git.kernel.org/netdev/net/c/ab21494be9dc
  - [net,2/2] bnxt_en: Fix context memory setup for 64K page size.
    https://git.kernel.org/netdev/net/c/702279d2ce46

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] 18+ messages in thread

* [PATCH net 0/2] bnxt_en: 2 bug fixes.
@ 2021-05-15  7:25 Michael Chan
  2021-05-17 21:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Chan @ 2021-05-15  7:25 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

The first one fixes a bug to properly identify some recently added HyperV
device IDs.  The second one fixes device context memory set up on systems
with 64K page size.

Please queue these for -stable as well.  Thanks.

Andy Gospodarek (1):
  bnxt_en: Include new P5 HV definition in VF check.

Michael Chan (1):
  bnxt_en: Fix context memory setup for 64K page size.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 +++---------
 drivers/net/ethernet/broadcom/bnxt/bnxt.h | 10 ++++++++++
 2 files changed, 13 insertions(+), 9 deletions(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes.
  2021-02-11  7:24 Michael Chan
@ 2021-02-11 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 18+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-11 22:50 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, kuba, gospo

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Thu, 11 Feb 2021 02:24:22 -0500 you wrote:
> Two unrelated fixes.  The first one fixes intermittent false TX timeouts
> during ring reconfigurations.  The second one fixes a formatting
> discrepancy between the stored and the running FW versions.
> 
> Please also queue these for -stable.  Thanks.
> 
> Edwin Peer (1):
>   bnxt_en: reverse order of TX disable and carrier off
> 
> [...]

Here is the summary with links:
  - [net,1/2] bnxt_en: reverse order of TX disable and carrier off
    https://git.kernel.org/netdev/net/c/132e0b65dc2b
  - [net,2/2] bnxt_en: Fix devlink info's stored fw.psid version format.
    https://git.kernel.org/netdev/net/c/db28b6c77f40

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] 18+ messages in thread

* [PATCH net 0/2] bnxt_en: 2 bug fixes.
@ 2021-02-11  7:24 Michael Chan
  2021-02-11 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Chan @ 2021-02-11  7:24 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

Two unrelated fixes.  The first one fixes intermittent false TX timeouts
during ring reconfigurations.  The second one fixes a formatting
discrepancy between the stored and the running FW versions.

Please also queue these for -stable.  Thanks.

Edwin Peer (1):
  bnxt_en: reverse order of TX disable and carrier off

Vasundhara Volam (1):
  bnxt_en: Fix devlink info's stored fw.psid version format.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 3 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes.
  2020-03-02  3:07 Michael Chan
@ 2020-03-02  3:17 ` David Miller
  0 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2020-03-02  3:17 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Sun,  1 Mar 2020 22:07:16 -0500

> This first patch fixes a rare but possible crash in pci_disable_msix()
> when the MTU is changed.  The 2nd patch fixes a regression in error
> code handling when flashing a file to NVRAM.

Applied.

> Please also queue these for -stable.  Thanks.

Queued up, thanks Michael.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH net 0/2] bnxt_en: 2 bug fixes.
@ 2020-03-02  3:07 Michael Chan
  2020-03-02  3:17 ` David Miller
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Chan @ 2020-03-02  3:07 UTC (permalink / raw)
  To: davem; +Cc: netdev

This first patch fixes a rare but possible crash in pci_disable_msix()
when the MTU is changed.  The 2nd patch fixes a regression in error
code handling when flashing a file to NVRAM.

Please also queue these for -stable.  Thanks.

Edwin Peer (1):
  bnxt_en: fix error handling when flashing from file

Vasundhara Volam (1):
  bnxt_en: reinitialize IRQs when MTU is modified

 drivers/net/ethernet/broadcom/bnxt/bnxt.c         |  4 ++--
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 24 +++++++++++------------
 2 files changed, 13 insertions(+), 15 deletions(-)

-- 
2.5.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes.
  2016-11-11  5:11 Michael Chan
@ 2016-11-13 17:37 ` David Miller
  0 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2016-11-13 17:37 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Fri, 11 Nov 2016 00:11:41 -0500

> Bug fixes in bnxt_setup_tc() and VF vitual link state.

Series applied, thanks Michael.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH net 0/2] bnxt_en: 2 bug fixes.
@ 2016-11-11  5:11 Michael Chan
  2016-11-13 17:37 ` David Miller
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Chan @ 2016-11-11  5:11 UTC (permalink / raw)
  To: davem; +Cc: netdev

Bug fixes in bnxt_setup_tc() and VF vitual link state.

Michael Chan (2):
  bnxt_en: Fix ring arithmetic in bnxt_setup_tc().
  bnxt_en: Fix VF virtual link state.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c       | 11 ++++++-----
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c |  4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes.
  2016-05-04 20:56 Michael Chan
@ 2016-05-04 21:12 ` David Miller
  0 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2016-05-04 21:12 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Wed,  4 May 2016 16:56:42 -0400

> Fix crash on ppc64 due to missing memory barrier and restore multicast
> after reset.

Looks good, series applied, thanks.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH net 0/2] bnxt_en: 2 bug fixes.
@ 2016-05-04 20:56 Michael Chan
  2016-05-04 21:12 ` David Miller
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Chan @ 2016-05-04 20:56 UTC (permalink / raw)
  To: davem; +Cc: netdev

Fix crash on ppc64 due to missing memory barrier and restore multicast
after reset.

Michael Chan (2):
  bnxt_en: Need memory barrier when processing the completion ring.
  bnxt_en: Setup multicast properly after resetting device.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-03-06 21:31 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08 21:39 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
2019-04-08 21:39 ` [PATCH net 1/2] bnxt_en: Improve RX consumer index validity check Michael Chan
2019-04-08 21:39 ` [PATCH net 2/2] bnxt_en: Reset device on RX buffer errors Michael Chan
2019-04-08 23:39 ` [PATCH net 0/2] bnxt_en: 2 bug fixes David Miller
  -- strict thread matches above, loose matches on Subject: below --
2023-03-04  2:43 Michael Chan
2023-03-06 21:30 ` patchwork-bot+netdevbpf
2021-08-15 20:15 Michael Chan
2021-08-16 10:40 ` patchwork-bot+netdevbpf
2021-05-15  7:25 Michael Chan
2021-05-17 21:10 ` patchwork-bot+netdevbpf
2021-02-11  7:24 Michael Chan
2021-02-11 22:50 ` patchwork-bot+netdevbpf
2020-03-02  3:07 Michael Chan
2020-03-02  3:17 ` David Miller
2016-11-11  5:11 Michael Chan
2016-11-13 17:37 ` David Miller
2016-05-04 20:56 Michael Chan
2016-05-04 21:12 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.