From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chas Williams <3chas3@gmail.com> Subject: [PATCH] bnx2x: Correctly determine MSIX vector count Date: Fri, 10 Jun 2016 18:18:52 -0400 Message-ID: <1465597132-11674-1-git-send-email-3chas3@gmail.com> Cc: harish.patil@qlogic.com, "Charles (Chas) Williams" To: dev@dpdk.org Return-path: Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by dpdk.org (Postfix) with ESMTP id BFE622A07 for ; Sat, 11 Jun 2016 00:19:00 +0200 (CEST) Received: by mail-qk0-f194.google.com with SMTP id l185so6348136qkc.2 for ; Fri, 10 Jun 2016 15:19:00 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: "Charles (Chas) Williams" 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") Signed-off-by: Chas Williams --- drivers/net/bnx2x/bnx2x.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 6edb2f9..4be732f 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -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; } -- 2.5.5