X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fionic%2Fionic_ethdev.c;h=600333e20fd56bb14ee02e6355a164ac75e9a441;hb=ac61aa646322dc100689e03dbffdc9c5536cc23d;hp=363f0cf0035d9426f231c6e7cb62dacf480896b4;hpb=eec10fb0ce6bbf1d00f87a491c7d89f995c911e4;p=dpdk.git diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 363f0cf003..600333e20f 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -24,8 +24,8 @@ static int ionic_dev_info_get(struct rte_eth_dev *eth_dev, static int ionic_dev_configure(struct rte_eth_dev *dev); static int ionic_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int ionic_dev_start(struct rte_eth_dev *dev); -static void ionic_dev_stop(struct rte_eth_dev *dev); -static void ionic_dev_close(struct rte_eth_dev *dev); +static int ionic_dev_stop(struct rte_eth_dev *dev); +static int ionic_dev_close(struct rte_eth_dev *dev); static int ionic_dev_set_link_up(struct rte_eth_dev *dev); static int ionic_dev_set_link_down(struct rte_eth_dev *dev); static int ionic_dev_link_update(struct rte_eth_dev *eth_dev, @@ -59,8 +59,6 @@ static int ionic_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, static int ionic_dev_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version, size_t fw_size); -int ionic_logtype; - static const struct rte_pci_id pci_id_ionic_map[] = { { RTE_PCI_DEVICE(IONIC_PENSANDO_VENDOR_ID, IONIC_DEV_ID_ETH_PF) }, { RTE_PCI_DEVICE(IONIC_PENSANDO_VENDOR_ID, IONIC_DEV_ID_ETH_VF) }, @@ -942,7 +940,7 @@ ionic_dev_start(struct rte_eth_dev *eth_dev) /* * Stop device: disable rx and tx functions to allow for reconfiguring. */ -static void +static int ionic_dev_stop(struct rte_eth_dev *eth_dev) { struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); @@ -953,30 +951,36 @@ ionic_dev_stop(struct rte_eth_dev *eth_dev) err = ionic_lif_stop(lif); if (err) IONIC_PRINT(ERR, "Cannot stop LIF: %d", err); + + return err; } /* * Reset and stop device. */ -static void +static int ionic_dev_close(struct rte_eth_dev *eth_dev) { struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); int err; IONIC_PRINT_CALL(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; err = ionic_lif_stop(lif); if (err) { IONIC_PRINT(ERR, "Cannot stop LIF: %d", err); - return; + return -1; } err = eth_ionic_dev_uninit(eth_dev); if (err) { IONIC_PRINT(ERR, "Cannot destroy LIF: %d", err); - return; + return -1; } + + return 0; } static int @@ -999,6 +1003,7 @@ eth_ionic_dev_init(struct rte_eth_dev *eth_dev, void *init_params) return 0; rte_eth_copy_pci_info(eth_dev, pci_dev); + eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; lif->index = adapter->nlifs; lif->eth_dev = eth_dev; @@ -1063,11 +1068,6 @@ eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev) ionic_lif_deinit(lif); ionic_lif_free(lif); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - eth_dev->tx_pkt_prepare = NULL; - return 0; } @@ -1318,10 +1318,4 @@ static struct rte_pci_driver rte_ionic_pmd = { RTE_PMD_REGISTER_PCI(net_ionic, rte_ionic_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ionic, pci_id_ionic_map); RTE_PMD_REGISTER_KMOD_DEP(net_ionic, "* igb_uio | uio_pci_generic | vfio-pci"); - -RTE_INIT(ionic_init_log) -{ - ionic_logtype = rte_log_register("pmd.net.ionic"); - if (ionic_logtype >= 0) - rte_log_set_level(ionic_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(ionic_logtype, pmd.net.ionic, NOTICE);