{
struct bnx2x_softc *sc = dev->data->dev_private;
int mp_ncpus = sysconf(_SC_NPROCESSORS_CONF);
- int ret;
PMD_INIT_FUNC_TRACE();
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;
}
if (sc->old_bulletin.valid_bitmap & (1 << CHANNEL_DOWN)) {
PMD_DRV_LOG(ERR, "PF indicated channel is down."
"VF device is no longer operational");
- dev->data->dev_link.link_status = 0;
+ dev->data->dev_link.link_status = ETH_LINK_DOWN;
}
return old_link_status == dev->data->dev_link.link_status ? -1 : 0;
sc->mac_ops.mac_addr_remove(dev, index);
}
-static struct eth_dev_ops bnx2x_eth_dev_ops = {
+static const struct eth_dev_ops bnx2x_eth_dev_ops = {
.dev_configure = bnx2x_dev_configure,
.dev_start = bnx2x_dev_start,
.dev_stop = bnx2x_dev_stop,
/*
* dev_ops for virtual function
*/
-static struct eth_dev_ops bnx2xvf_eth_dev_ops = {
+static const struct eth_dev_ops bnx2xvf_eth_dev_ops = {
.dev_configure = bnx2x_dev_configure,
.dev_start = bnx2x_dev_start,
.dev_stop = bnx2x_dev_stop,
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;
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