X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=inline;f=drivers%2Fnet%2Fbnx2x%2Fbnx2x_ethdev.c;h=fe8cfd0ea4c2cf60decbd8bb4affb5c2b9930f42;hb=8bbf3164e7d71fa9eda6a221932954a1e4db0ae9;hp=011704932395b5f730a05aa7ab687a7c5b12f9cd;hpb=059113cced1c6a1ee98eb4e0446fe541f286691c;p=dpdk.git diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 0117049323..fe8cfd0ea4 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -87,7 +87,6 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) { struct bnx2x_softc *sc = dev->data->dev_private; int mp_ncpus = sysconf(_SC_NPROCESSORS_CONF); - int ret; PMD_INIT_FUNC_TRACE(); @@ -121,25 +120,6 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) return -ENXIO; } - if (IS_VF(sc)) { - if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_mbx_msg), - &sc->vf2pf_mbox_mapping, "vf2pf_mbox", - RTE_CACHE_LINE_SIZE) != 0) - return -ENOMEM; - - sc->vf2pf_mbox = (struct bnx2x_vf_mbx_msg *)sc->vf2pf_mbox_mapping.vaddr; - if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_bulletin), - &sc->pf2vf_bulletin_mapping, "vf2pf_bull", - RTE_CACHE_LINE_SIZE) != 0) - return -ENOMEM; - - sc->pf2vf_bulletin = (struct bnx2x_vf_bulletin *)sc->pf2vf_bulletin_mapping.vaddr; - - ret = bnx2x_vf_get_resources(sc, sc->num_queues, sc->num_queues); - if (ret) - return ret; - } - return 0; } @@ -442,7 +422,7 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf) sc->bar[BAR0].base_addr = (void *)pci_dev->mem_resource[0].addr; if (is_vf) sc->bar[BAR1].base_addr = (void *) - ((uint64_t)pci_dev->mem_resource[0].addr + PXP_VF_ADDR_DB_START); + ((uintptr_t)pci_dev->mem_resource[0].addr + PXP_VF_ADDR_DB_START); else sc->bar[BAR1].base_addr = pci_dev->mem_resource[2].addr; @@ -466,6 +446,7 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf) ret = bnx2x_attach(sc); if (ret) { PMD_DRV_LOG(ERR, "bnx2x_attach failed (%d)", ret); + return ret; } eth_dev->data->mac_addrs = (struct ether_addr *)sc->link_params.mac_addr; @@ -479,7 +460,30 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf) PMD_DRV_LOG(INFO, "portID=%d vendorID=0x%x deviceID=0x%x", eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id); - return ret; + if (IS_VF(sc)) { + if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_mbx_msg), + &sc->vf2pf_mbox_mapping, "vf2pf_mbox", + RTE_CACHE_LINE_SIZE) != 0) + return -ENOMEM; + + sc->vf2pf_mbox = (struct bnx2x_vf_mbx_msg *) + sc->vf2pf_mbox_mapping.vaddr; + + if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_vf_bulletin), + &sc->pf2vf_bulletin_mapping, "vf2pf_bull", + RTE_CACHE_LINE_SIZE) != 0) + return -ENOMEM; + + sc->pf2vf_bulletin = (struct bnx2x_vf_bulletin *) + sc->pf2vf_bulletin_mapping.vaddr; + + ret = bnx2x_vf_get_resources(sc, sc->max_tx_queues, + sc->max_rx_queues); + if (ret) + return ret; + } + + return 0; } static int