X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5_trigger.c;h=ee08c56770a52bb24d832ad167e88532e5afd468;hb=2ae831fb42b1aa273cf4ef20775fa964463be083;hp=4e396b7f029ee391a97724749f132e249e81c481;hpb=a6d83b6a9209a198fa5a7d2f9cbb37190e256f9c;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 4e396b7f02..ee08c56770 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright 2015 6WIND S.A. - * Copyright 2015 Mellanox. + * Copyright 2015 Mellanox Technologies, Ltd */ #include @@ -150,40 +150,46 @@ mlx5_dev_start(struct rte_eth_dev *dev) dev->data->dev_started = 1; ret = mlx5_flow_create_drop_queue(dev); if (ret) { - ERROR("%p: Drop queue allocation failed: %s", - (void *)dev, strerror(rte_errno)); + DRV_LOG(ERR, "port %u drop queue allocation failed: %s", + dev->data->port_id, strerror(rte_errno)); goto error; } - DEBUG("%p: allocating and configuring hash RX queues", (void *)dev); + DRV_LOG(DEBUG, "port %u allocating and configuring hash Rx queues", + dev->data->port_id); rte_mempool_walk(mlx5_mp2mr_iter, priv); ret = mlx5_txq_start(dev); if (ret) { - ERROR("%p: Tx Queue allocation failed: %s", - (void *)dev, strerror(rte_errno)); + DRV_LOG(ERR, "port %u Tx queue allocation failed: %s", + dev->data->port_id, strerror(rte_errno)); goto error; } ret = mlx5_rxq_start(dev); if (ret) { - ERROR("%p: Rx Queue allocation failed: %s", - (void *)dev, strerror(rte_errno)); + DRV_LOG(ERR, "port %u Rx queue allocation failed: %s", + dev->data->port_id, strerror(rte_errno)); goto error; } ret = mlx5_rx_intr_vec_enable(dev); if (ret) { - ERROR("%p: Rx interrupt vector creation failed", - (void *)dev); + DRV_LOG(ERR, "port %u Rx interrupt vector creation failed", + dev->data->port_id); goto error; } mlx5_xstats_init(dev); - /* Update link status and Tx/Rx callbacks for the first time. */ - memset(&dev->data->dev_link, 0, sizeof(struct rte_eth_link)); - INFO("Forcing port %u link to be up", dev->data->port_id); - ret = mlx5_force_link_status_change(dev, ETH_LINK_UP); + ret = mlx5_traffic_enable(dev); if (ret) { - DEBUG("Failed to set port %u link to be up", - dev->data->port_id); + DRV_LOG(DEBUG, "port %u failed to set defaults flows", + dev->data->port_id); goto error; } + ret = mlx5_flow_start(dev, &priv->flows); + if (ret) { + DRV_LOG(DEBUG, "port %u failed to set flows", + dev->data->port_id); + goto error; + } + dev->tx_pkt_burst = mlx5_select_tx_function(dev); + dev->rx_pkt_burst = mlx5_select_rx_function(dev); mlx5_dev_interrupt_handler_install(dev); return 0; error: @@ -221,7 +227,8 @@ mlx5_dev_stop(struct rte_eth_dev *dev) dev->tx_pkt_burst = removed_tx_burst; rte_wmb(); usleep(1000 * priv->rxqs_n); - DEBUG("%p: cleaning up and destroying hash RX queues", (void *)dev); + DRV_LOG(DEBUG, "port %u cleaning up and destroying hash Rx queues", + dev->data->port_id); mlx5_flow_stop(dev, &priv->flows); mlx5_traffic_disable(dev); mlx5_rx_intr_vec_disable(dev);