[3/4] net/bnxt: release hwrm lock before returning

Message ID 20191104202747.12897-4-lance.richardson@broadcom.com (mailing list archive)
State Superseded, archived
Headers
Series net/bnxt: rxq stop/start fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Lance Richardson Nov. 4, 2019, 8:27 p.m. UTC
  The function bnxt_vnic_rss_configure_thor() returns early when
all receive queues are stopped without releasing the hwrm
spinlock, which causes subsequent HWRM operations to hang. Fix
by ensuring that the lock is released before returning from
this function.

Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index ab6cb1dc3..bb4dcf4b2 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4337,8 +4337,10 @@  bnxt_vnic_rss_configure_thor(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 			}
 
 			/* Return if no rings are active. */
-			if (cnt == max_rings)
+			if (cnt == max_rings) {
+				HWRM_UNLOCK();
 				return 0;
+			}
 
 			/* Add rx/cp ring pair to RSS table. */
 			rxr = rxqs[k]->rx_ring;