X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx4%2Fmlx4.c;h=34c2bbb3735d108eb66d5461aac1edf4bdc5ef4a;hb=0f20acbf5edaeab8e4c9d400e443679d48008569;hp=ad7c805d67156fe038ce6a12f99175d4ba1cbcda;hpb=c0722108df38d0217d5c67475491097ab0ac9df8;p=dpdk.git diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index ad7c805d67..34c2bbb373 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -81,7 +81,7 @@ const char *pmd_mlx4_init_params[] = { NULL, }; -static void mlx4_dev_stop(struct rte_eth_dev *dev); +static int mlx4_dev_stop(struct rte_eth_dev *dev); /** * Initialize shared data between primary and secondary process. @@ -343,13 +343,13 @@ err: * @param dev * Pointer to Ethernet device structure. */ -static void +static int mlx4_dev_stop(struct rte_eth_dev *dev) { struct mlx4_priv *priv = dev->data->dev_private; if (!priv->started) - return; + return 0; DEBUG("%p: detaching flows from all RX queues", (void *)dev); priv->started = 0; dev->tx_pkt_burst = mlx4_tx_burst_removed; @@ -360,6 +360,8 @@ mlx4_dev_stop(struct rte_eth_dev *dev) mlx4_flow_sync(priv, NULL); mlx4_rxq_intr_disable(priv); mlx4_rss_deinit(priv); + + return 0; } /** @@ -376,6 +378,8 @@ mlx4_dev_close(struct rte_eth_dev *dev) struct mlx4_priv *priv = dev->data->dev_private; unsigned int i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; DEBUG("%p: closing device \"%s\"", (void *)dev, ((priv->ctx != NULL) ? priv->ctx->device->name : "")); @@ -1027,11 +1031,11 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) ERROR("can not allocate rte ethdev"); goto port_error; } - eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; eth_dev->data->dev_private = priv; eth_dev->data->mac_addrs = priv->mac; eth_dev->device = &pci_dev->device; rte_eth_copy_pci_info(eth_dev, pci_dev); + eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; /* Initialize local interrupt handle for current port. */ memset(&priv->intr_handle, 0, sizeof(struct rte_intr_handle)); priv->intr_handle.fd = -1;