net/bnx2x: move PCI device ids to the driver
[dpdk.git] / drivers / net / bnx2x / bnx2x.c
index f1bc2dd..95fbad8 100644 (file)
@@ -22,7 +22,6 @@
 #include "ecore_init_ops.h"
 
 #include "rte_version.h"
-#include "rte_pci_dev_ids.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -9552,8 +9551,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;
@@ -9570,7 +9571,7 @@ void bnx2x_load_firmware(struct bnx2x_softc *sc)
        int f;
        struct stat st;
 
-       fwname = sc->devinfo.device_id == BNX2X_DEV_ID_57711
+       fwname = sc->devinfo.device_id == CHIP_NUM_57711
                ? FW_NAME_57711 : FW_NAME_57810;
        f = open(fwname, O_RDONLY);
        if (f < 0) {
@@ -9680,9 +9681,6 @@ int bnx2x_attach(struct bnx2x_softc *sc)
 
        sc->state = BNX2X_STATE_CLOSED;
 
-       /* Init RTE stuff */
-       bnx2x_init_rte(sc);
-
        pci_write_long(sc, PCICFG_GRC_ADDRESS, PCICFG_VENDOR_ID_OFFSET);
 
        sc->igu_base_addr = IS_VF(sc) ? PXP_VF_ADDR_IGU_START : BAR_IGU_INTMEM;
@@ -9695,11 +9693,14 @@ 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;
        }
 
+       /* Init RTE stuff */
+       bnx2x_init_rte(sc);
+
        if (IS_PF(sc)) {
 /* get device info and set params */
                if (bnx2x_get_device_info(sc) != 0) {