Skip to contentSkip to conversation

bnx2x: Correctly determine MSIX vector count

PATCH Applied Chas Williams 4 participants 4 messages Jun 10, 2016 – Jun 21, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2x: Correctly determine MSIX vector count

From: "Charles (Chas) Williams" <[email protected]>

If MSIX is available, the vector count given by the table size is one less than the actual count. This count also limits the receive and transmit queue resources the VF can support.

Fixes 540a211084a7 ("bnx2x: driver core")
---
 drivers/net/bnx2x/bnx2x.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/bnx2x/bnx2x.c +5 -3
index 6edb2f9..4be732f 100644
@@ -9570,8 +9570,10 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc)
 static void bnx2x_init_rte(struct bnx2x_softc *sc)
 {
 	if (IS_VF(sc)) {
-		sc->max_tx_queues = BNX2X_VF_MAX_QUEUES_PER_VF;
-		sc->max_rx_queues = BNX2X_VF_MAX_QUEUES_PER_VF;
+		sc->max_tx_queues = min(BNX2X_VF_MAX_QUEUES_PER_VF,
+					sc->igu_sb_cnt);
+		sc->max_rx_queues = min(BNX2X_VF_MAX_QUEUES_PER_VF,
+					sc->igu_sb_cnt);
 	} else {
 		sc->max_tx_queues = 128;
 		sc->max_rx_queues = 128;
@@ -9713,7 +9715,7 @@ int bnx2x_attach(struct bnx2x_softc *sc)
 		pci_read(sc,
 			 (sc->devinfo.pcie_msix_cap_reg + PCIR_MSIX_CTRL), &val,
 			 2);
-		sc->igu_sb_cnt = (val & PCIM_MSIXCTRL_TABLE_SIZE);
+		sc->igu_sb_cnt = (val & PCIM_MSIXCTRL_TABLE_SIZE) + 1;
 	} else {
 		sc->igu_sb_cnt = 1;
 	}
Signature · 1 line
2.5.5
#1 lore raw
Quoted 10 lines · Chas Williams

From: "Charles (Chas) Williams" <[email protected]>

If MSIX is available, the vector count given by the table size is one less than the actual count. This count also limits the receive and transmit queue resources the VF can support.

Fixes 540a211084a7 ("bnx2x: driver core")

---

Since this patch not acked yet, adding all maintainers to cc

Acked-by on v1 1/1
#2 lore raw
In reply to Chas Williams
Quoted 45 lines

From: "Charles (Chas) Williams" <[email protected]>

If MSIX is available, the vector count given by the table size is one less than the actual count. This count also limits the receive and transmit queue resources the VF can support.

Fixes 540a211084a7 ("bnx2x: driver core")

---
drivers/net/bnx2x/bnx2x.c | 8 +++++---

1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/bnx2x/bnx2x.c +4 -2
index 6edb2f9..4be732f 100644
@@ -9570,8 +9570,10 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc
 *sc)
 static void bnx2x_init_rte(struct bnx2x_softc *sc)
 {
 	if (IS_VF(sc)) {
-		sc->max_tx_queues = BNX2X_VF_MAX_QUEUES_PER_VF;
-		sc->max_rx_queues = BNX2X_VF_MAX_QUEUES_PER_VF;
+		sc->max_tx_queues = min(BNX2X_VF_MAX_QUEUES_PER_VF,
+					sc->igu_sb_cnt);
+		sc->max_rx_queues = min(BNX2X_VF_MAX_QUEUES_PER_VF,
+					sc->igu_sb_cnt);
 	} else {
 		sc->max_tx_queues = 128;
		sc->max_rx_queues = 128;
drivers/net/bnx2x/bnx2x.c +1 -1
@@ -9713,7 +9715,7 @@ int bnx2x_attach(struct bnx2x_softc *sc)
 		pci_read(sc,
 			 (sc->devinfo.pcie_msix_cap_reg + PCIR_MSIX_CTRL), &val,
 			 2);
-		sc->igu_sb_cnt = (val & PCIM_MSIXCTRL_TABLE_SIZE);
+		sc->igu_sb_cnt = (val & PCIM_MSIXCTRL_TABLE_SIZE) + 1;
 	} else {
 		sc->igu_sb_cnt = 1;
 	}
Signature · 1 line
2.5.5
#3 lore raw
Quoted 10 lines · Harish Patil
Quoted 10 lines

From: "Charles (Chas) Williams" <[email protected]>

If MSIX is available, the vector count given by the table size is one less than the actual count. This count also limits the receive and transmit queue resources the VF can support.

Fixes 540a211084a7 ("bnx2x: driver core")

<snip>

Quoted 3 lines

Applied to dpdk-next-net/rel_16_07

/Bruce