[dpdk-stable] patch 'net/bnxt: enforce IO barrier for doorbell command' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:33:08 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From b8201168460b06b705401564b2c94ba84bcf2cbc Mon Sep 17 00:00:00 2001
From: Gavin Hu <gavin.hu at arm.com>
Date: Mon, 16 Sep 2019 19:27:18 +0800
Subject: [PATCH] net/bnxt: enforce IO barrier for doorbell command

[ upstream commit dda8e0e48723fc90e6222fcc1b04b94f240ae9b2 ]

The doorbell ringing operation requires a rte_io_mb immediately to make
the command complete and visible to the device before reading the
response, otherwise it may read stale or invalid responses.

Fixes: ca241d9a0952 ("net/bnxt: use I/O device memory read/write API")

Signed-off-by: Gavin Hu <gavin.hu at arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a28439f51c..c4f743db05 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -142,6 +142,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
 	/* Ring channel doorbell */
 	bar = (uint8_t *)bp->bar0 + 0x100;
 	rte_write32(1, bar);
+	/*
+	 * Make sure the channel doorbell ring command complete before
+	 * reading the response to avoid getting stale or invalid
+	 * responses.
+	 */
+	rte_io_mb();
 
 	/* Poll for the valid bit */
 	for (i = 0; i < HWRM_CMD_TIMEOUT; i++) {
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:27.971134711 +0000
+++ 0041-net-bnxt-enforce-IO-barrier-for-doorbell-command.patch	2019-12-19 14:32:25.913294018 +0000
@@ -1,14 +1,15 @@
-From dda8e0e48723fc90e6222fcc1b04b94f240ae9b2 Mon Sep 17 00:00:00 2001
+From b8201168460b06b705401564b2c94ba84bcf2cbc Mon Sep 17 00:00:00 2001
 From: Gavin Hu <gavin.hu at arm.com>
 Date: Mon, 16 Sep 2019 19:27:18 +0800
 Subject: [PATCH] net/bnxt: enforce IO barrier for doorbell command
 
+[ upstream commit dda8e0e48723fc90e6222fcc1b04b94f240ae9b2 ]
+
 The doorbell ringing operation requires a rte_io_mb immediately to make
 the command complete and visible to the device before reading the
 response, otherwise it may read stale or invalid responses.
 
 Fixes: ca241d9a0952 ("net/bnxt: use I/O device memory read/write API")
-Cc: stable at dpdk.org
 
 Signed-off-by: Gavin Hu <gavin.hu at arm.com>
 Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
@@ -17,12 +18,12 @@
  1 file changed, 6 insertions(+)
 
 diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
-index d7c33d21e2..cdb6fa4f7e 100644
+index a28439f51c..c4f743db05 100644
 --- a/drivers/net/bnxt/bnxt_hwrm.c
 +++ b/drivers/net/bnxt/bnxt_hwrm.c
-@@ -146,6 +146,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
+@@ -142,6 +142,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
  	/* Ring channel doorbell */
- 	bar = (uint8_t *)bp->bar0 + mb_trigger_offset;
+ 	bar = (uint8_t *)bp->bar0 + 0x100;
  	rte_write32(1, bar);
 +	/*
 +	 * Make sure the channel doorbell ring command complete before
@@ -32,7 +33,7 @@
 +	rte_io_mb();
  
  	/* Poll for the valid bit */
- 	for (i = 0; i < timeout; i++) {
+ 	for (i = 0; i < HWRM_CMD_TIMEOUT; i++) {
 -- 
 2.20.1
 


More information about the stable mailing list