X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fnfp%2Fnfp_net.c;h=1608bf5ea12beb0bce2fbb4fb379c47156eb5ff6;hb=cb99500de915040339f294b6ad2fc8edb4085b19;hp=9509dc8bd665bcc2476b31a0d96ff7771845b333;hpb=b142387b07600c320683255d237b9109299883d5;p=dpdk.git diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 9509dc8bd6..1608bf5ea1 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -80,7 +80,7 @@ static int nfp_net_start(struct rte_eth_dev *dev); static int nfp_net_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats); static int nfp_net_stats_reset(struct rte_eth_dev *dev); -static void nfp_net_stop(struct rte_eth_dev *dev); +static int nfp_net_stop(struct rte_eth_dev *dev); static uint16_t nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); @@ -788,7 +788,7 @@ error: } /* Stop device: disable rx and tx functions to allow for reconfiguring. */ -static void +static int nfp_net_stop(struct rte_eth_dev *dev) { int i; @@ -819,6 +819,8 @@ nfp_net_stop(struct rte_eth_dev *dev) nfp_eth_set_configured(dev->process_private, hw->pf_port_idx, 0); } + + return 0; } /* Set the link up. */ @@ -871,6 +873,9 @@ nfp_net_close(struct rte_eth_dev *dev) struct rte_pci_device *pci_dev; int i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + PMD_INIT_LOG(DEBUG, "Close"); hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -2987,6 +2992,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev) if (!(hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR)) eth_dev->data->dev_flags |= RTE_ETH_DEV_NOLIVE_MAC_ADDR; + eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; + PMD_INIT_LOG(INFO, "port %d VendorID=0x%x DeviceID=0x%x " "mac=%02x:%02x:%02x:%02x:%02x:%02x", eth_dev->data->port_id, pci_dev->id.vendor_id, @@ -3739,6 +3746,8 @@ static int eth_nfp_pci_remove(struct rte_pci_device *pci_dev) int port = 0; eth_dev = rte_eth_dev_allocated(pci_dev->device.name); + if (eth_dev == NULL) + return 0; /* port already released */ if ((pci_dev->id.device_id == PCI_DEVICE_ID_NFP4000_PF_NIC) || (pci_dev->id.device_id == PCI_DEVICE_ID_NFP6000_PF_NIC)) { port = get_pf_port_number(eth_dev->data->name);