All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] bnxt_en: 2 bug fixes
@ 2021-08-15 20:15 Michael Chan
  2021-08-15 20:15 ` [PATCH net 1/2] bnxt_en: Disable aRFS if running on 212 firmware Michael Chan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ 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] 4+ messages in thread

* [PATCH net 1/2] bnxt_en: Disable aRFS if running on 212 firmware
  2021-08-15 20:15 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
@ 2021-08-15 20:15 ` Michael Chan
  2021-08-15 20:15 ` [PATCH net 2/2] bnxt_en: Add missing DMA memory barriers Michael Chan
  2021-08-16 10:40 ` [PATCH net 0/2] bnxt_en: 2 bug fixes patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ 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: 937 bytes --]

212 firmware broke aRFS, so disable it.  Traffic may stop after ntuple
filters are inserted and deleted by the 212 firmware.

Fixes: ae10ae740ad2 ("bnxt_en: Add new hardware RFS mode.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@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 dd2d2a5fef15..207ef7dc9bff 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10792,6 +10792,9 @@ static bool bnxt_rfs_supported(struct bnxt *bp)
 			return true;
 		return false;
 	}
+	/* 212 firmware is broken for aRFS */
+	if (BNXT_FW_MAJ(bp) == 212)
+		return false;
 	if (BNXT_PF(bp) && !BNXT_CHIP_TYPE_NITRO_A0(bp))
 		return true;
 	if (bp->flags & BNXT_FLAG_NEW_RSS_CAP)
-- 
2.18.1


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

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

* [PATCH net 2/2] bnxt_en: Add missing DMA memory barriers
  2021-08-15 20:15 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
  2021-08-15 20:15 ` [PATCH net 1/2] bnxt_en: Disable aRFS if running on 212 firmware Michael Chan
@ 2021-08-15 20:15 ` Michael Chan
  2021-08-16 10:40 ` [PATCH net 0/2] bnxt_en: 2 bug fixes patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ 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: 2317 bytes --]

Each completion ring entry has a valid bit to indicate that the entry
contains a valid completion event.  The driver's main poll loop
__bnxt_poll_work() has the proper dma_rmb() to make sure the valid
bit of the next entry has been checked before proceeding further.
But when we call bnxt_rx_pkt() to process the RX event, the RX
completion event consists of two completion entries and only the
first entry has been checked to be valid.  We need the same barrier
after checking the next completion entry.  Add missing dma_rmb()
barriers in bnxt_rx_pkt() and other similar locations.

Fixes: 67a95e2022c7 ("bnxt_en: Need memory barrier when processing the completion ring.")
Reported-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 207ef7dc9bff..8a97640cdfe7 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1788,6 +1788,10 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
 	if (!RX_CMP_VALID(rxcmp1, tmp_raw_cons))
 		return -EBUSY;
 
+	/* The valid test of the entry must be done first before
+	 * reading any further.
+	 */
+	dma_rmb();
 	prod = rxr->rx_prod;
 
 	if (cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP) {
@@ -2010,6 +2014,10 @@ static int bnxt_force_rx_discard(struct bnxt *bp,
 	if (!RX_CMP_VALID(rxcmp1, tmp_raw_cons))
 		return -EBUSY;
 
+	/* The valid test of the entry must be done first before
+	 * reading any further.
+	 */
+	dma_rmb();
 	cmp_type = RX_CMP_TYPE(rxcmp);
 	if (cmp_type == CMP_TYPE_RX_L2_CMP) {
 		rxcmp1->rx_cmp_cfa_code_errors_v2 |=
@@ -2475,6 +2483,10 @@ static int bnxt_poll_nitroa0(struct napi_struct *napi, int budget)
 		if (!TX_CMP_VALID(txcmp, raw_cons))
 			break;
 
+		/* The valid test of the entry must be done first before
+		 * reading any further.
+		 */
+		dma_rmb();
 		if ((TX_CMP_TYPE(txcmp) & 0x30) == 0x10) {
 			tmp_raw_cons = NEXT_RAW_CMP(raw_cons);
 			cp_cons = RING_CMP(tmp_raw_cons);
-- 
2.18.1


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

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

* Re: [PATCH net 0/2] bnxt_en: 2 bug fixes
  2021-08-15 20:15 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
  2021-08-15 20:15 ` [PATCH net 1/2] bnxt_en: Disable aRFS if running on 212 firmware Michael Chan
  2021-08-15 20:15 ` [PATCH net 2/2] bnxt_en: Add missing DMA memory barriers Michael Chan
@ 2021-08-16 10:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ 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] 4+ messages in thread

end of thread, other threads:[~2021-08-16 10:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 20:15 [PATCH net 0/2] bnxt_en: 2 bug fixes Michael Chan
2021-08-15 20:15 ` [PATCH net 1/2] bnxt_en: Disable aRFS if running on 212 firmware Michael Chan
2021-08-15 20:15 ` [PATCH net 2/2] bnxt_en: Add missing DMA memory barriers Michael Chan
2021-08-16 10:40 ` [PATCH net 0/2] bnxt_en: 2 bug fixes patchwork-bot+netdevbpf

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.