All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4] bnxt_en: Misc. bug fixes.
@ 2018-10-05  4:25 Michael Chan
  2018-10-05  4:26 ` [PATCH net 1/4] bnxt_en: Fix VNIC reservations on the PF Michael Chan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Michael Chan @ 2018-10-05  4:25 UTC (permalink / raw)
  To: davem; +Cc: netdev

4 small bug fixes related to setting firmware message enables bits, possible
memory leak when probe fails, and ring accouting when RDMA driver is loaded.

Please queue these for -stable as well.  Thanks.

Michael Chan (1):
  bnxt_en: Fix VNIC reservations on the PF.

Vasundhara Volam (2):
  bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request
  bnxt_en: get the reduced max_irqs by the ones used by RDMA

Venkat Duvvuru (1):
  bnxt_en: free hwrm resources, if driver probe fails.

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 14 ++++++++------
 drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c |  6 +++---
 2 files changed, 11 insertions(+), 9 deletions(-)

-- 
2.5.1

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

* [PATCH net 1/4] bnxt_en: Fix VNIC reservations on the PF.
  2018-10-05  4:25 [PATCH net 0/4] bnxt_en: Misc. bug fixes Michael Chan
@ 2018-10-05  4:26 ` Michael Chan
  2018-10-05  4:26 ` [PATCH net 2/4] bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request Michael Chan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2018-10-05  4:26 UTC (permalink / raw)
  To: davem; +Cc: netdev

The enables bit for VNIC was set wrong when calling the HWRM_FUNC_CFG
firmware call to reserve VNICs.  This has the effect that the firmware
will keep a large number of VNICs for the PF, and having very few for
VFs.  DPDK driver running on the VFs, which requires more VNICs, may not
work properly as a result.

Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 0478e56..2564a92 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -4650,7 +4650,7 @@ __bnxt_hwrm_reserve_pf_rings(struct bnxt *bp, struct hwrm_func_cfg_input *req,
 				      FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS : 0;
 		enables |= ring_grps ?
 			   FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS : 0;
-		enables |= vnics ? FUNC_VF_CFG_REQ_ENABLES_NUM_VNICS : 0;
+		enables |= vnics ? FUNC_CFG_REQ_ENABLES_NUM_VNICS : 0;
 
 		req->num_rx_rings = cpu_to_le16(rx_rings);
 		req->num_hw_ring_grps = cpu_to_le16(ring_grps);
-- 
2.5.1

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

* [PATCH net 2/4] bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request
  2018-10-05  4:25 [PATCH net 0/4] bnxt_en: Misc. bug fixes Michael Chan
  2018-10-05  4:26 ` [PATCH net 1/4] bnxt_en: Fix VNIC reservations on the PF Michael Chan
@ 2018-10-05  4:26 ` Michael Chan
  2018-10-05  4:26 ` [PATCH net 3/4] bnxt_en: free hwrm resources, if driver probe fails Michael Chan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2018-10-05  4:26 UTC (permalink / raw)
  To: davem; +Cc: netdev

From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>

In HWRM_QUEUE_COS2BW_CFG request, enables field should have the bits
set only for the queue ids which are having the valid parameters.

This causes firmware to return error when the TC to hardware CoS queue
mapping is not 1:1 during DCBNL ETS setup.

Fixes: 2e8ef77ee0ff ("bnxt_en: Add TC to hardware QoS queue mapping logic.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
index ddc98c3..a85d2be 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
@@ -98,13 +98,13 @@ static int bnxt_hwrm_queue_cos2bw_cfg(struct bnxt *bp, struct ieee_ets *ets,
 
 	bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_COS2BW_CFG, -1, -1);
 	for (i = 0; i < max_tc; i++) {
-		u8 qidx;
+		u8 qidx = bp->tc_to_qidx[i];
 
 		req.enables |= cpu_to_le32(
-			QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID0_VALID << i);
+			QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID0_VALID <<
+			qidx);
 
 		memset(&cos2bw, 0, sizeof(cos2bw));
-		qidx = bp->tc_to_qidx[i];
 		cos2bw.queue_id = bp->q_info[qidx].queue_id;
 		if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_STRICT) {
 			cos2bw.tsa =
-- 
2.5.1

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

* [PATCH net 3/4] bnxt_en: free hwrm resources, if driver probe fails.
  2018-10-05  4:25 [PATCH net 0/4] bnxt_en: Misc. bug fixes Michael Chan
  2018-10-05  4:26 ` [PATCH net 1/4] bnxt_en: Fix VNIC reservations on the PF Michael Chan
  2018-10-05  4:26 ` [PATCH net 2/4] bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request Michael Chan
@ 2018-10-05  4:26 ` Michael Chan
  2018-10-05  4:26 ` [PATCH net 4/4] bnxt_en: get the reduced max_irqs by the ones used by RDMA Michael Chan
  2018-10-05  4:42 ` [PATCH net 0/4] bnxt_en: Misc. bug fixes David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2018-10-05  4:26 UTC (permalink / raw)
  To: davem; +Cc: netdev

From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>

When the driver probe fails, all the resources that were allocated prior
to the failure must be freed. However, hwrm dma response memory is not
getting freed.

This patch fixes the problem described above.

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

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 2564a92..3718984 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3017,10 +3017,11 @@ static void bnxt_free_hwrm_resources(struct bnxt *bp)
 {
 	struct pci_dev *pdev = bp->pdev;
 
-	dma_free_coherent(&pdev->dev, PAGE_SIZE, bp->hwrm_cmd_resp_addr,
-			  bp->hwrm_cmd_resp_dma_addr);
-
-	bp->hwrm_cmd_resp_addr = NULL;
+	if (bp->hwrm_cmd_resp_addr) {
+		dma_free_coherent(&pdev->dev, PAGE_SIZE, bp->hwrm_cmd_resp_addr,
+				  bp->hwrm_cmd_resp_dma_addr);
+		bp->hwrm_cmd_resp_addr = NULL;
+	}
 }
 
 static int bnxt_alloc_hwrm_resources(struct bnxt *bp)
@@ -9057,6 +9058,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	bnxt_clear_int_mode(bp);
 
 init_err_pci_clean:
+	bnxt_free_hwrm_resources(bp);
 	bnxt_cleanup_pci(bp);
 
 init_err_free:
-- 
2.5.1

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

* [PATCH net 4/4] bnxt_en: get the reduced max_irqs by the ones used by RDMA
  2018-10-05  4:25 [PATCH net 0/4] bnxt_en: Misc. bug fixes Michael Chan
                   ` (2 preceding siblings ...)
  2018-10-05  4:26 ` [PATCH net 3/4] bnxt_en: free hwrm resources, if driver probe fails Michael Chan
@ 2018-10-05  4:26 ` Michael Chan
  2018-10-05  4:42 ` [PATCH net 0/4] bnxt_en: Misc. bug fixes David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2018-10-05  4:26 UTC (permalink / raw)
  To: davem; +Cc: netdev

From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>

When getting the max rings supported, get the reduced max_irqs
by the ones used by RDMA.

If the number MSIX is the limiting factor, this bug may cause the
max ring count to be higher than it should be when RDMA driver is
loaded and may result in ring allocation failures.

Fixes: 30f529473ec9 ("bnxt_en: Do not modify max IRQ count after RDMA driver requests/frees IRQs.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 3718984..e2d9254 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8622,7 +8622,7 @@ static void _bnxt_get_max_rings(struct bnxt *bp, int *max_rx, int *max_tx,
 	*max_tx = hw_resc->max_tx_rings;
 	*max_rx = hw_resc->max_rx_rings;
 	*max_cp = min_t(int, bnxt_get_max_func_cp_rings_for_en(bp),
-			hw_resc->max_irqs);
+			hw_resc->max_irqs - bnxt_get_ulp_msix_num(bp));
 	*max_cp = min_t(int, *max_cp, hw_resc->max_stat_ctxs);
 	max_ring_grps = hw_resc->max_hw_ring_grps;
 	if (BNXT_CHIP_TYPE_NITRO_A0(bp) && BNXT_PF(bp)) {
-- 
2.5.1

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

* Re: [PATCH net 0/4] bnxt_en: Misc. bug fixes.
  2018-10-05  4:25 [PATCH net 0/4] bnxt_en: Misc. bug fixes Michael Chan
                   ` (3 preceding siblings ...)
  2018-10-05  4:26 ` [PATCH net 4/4] bnxt_en: get the reduced max_irqs by the ones used by RDMA Michael Chan
@ 2018-10-05  4:42 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-10-05  4:42 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

From: Michael Chan <michael.chan@broadcom.com>
Date: Fri,  5 Oct 2018 00:25:59 -0400

> 4 small bug fixes related to setting firmware message enables bits, possible
> memory leak when probe fails, and ring accouting when RDMA driver is loaded.
> 
> Please queue these for -stable as well.  Thanks.

Series applied and queued up for -stable.

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

end of thread, other threads:[~2018-10-05 11:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05  4:25 [PATCH net 0/4] bnxt_en: Misc. bug fixes Michael Chan
2018-10-05  4:26 ` [PATCH net 1/4] bnxt_en: Fix VNIC reservations on the PF Michael Chan
2018-10-05  4:26 ` [PATCH net 2/4] bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request Michael Chan
2018-10-05  4:26 ` [PATCH net 3/4] bnxt_en: free hwrm resources, if driver probe fails Michael Chan
2018-10-05  4:26 ` [PATCH net 4/4] bnxt_en: get the reduced max_irqs by the ones used by RDMA Michael Chan
2018-10-05  4:42 ` [PATCH net 0/4] bnxt_en: Misc. bug fixes 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.