align SPDX Mellanox copyrights
[dpdk.git] / drivers / net / mlx5 / mlx5_trigger.c
index 4e396b7..ee08c56 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright 2015 6WIND S.A.
- * Copyright 2015 Mellanox.
+ * Copyright 2015 Mellanox Technologies, Ltd
  */
 
 #include <unistd.h>
@@ -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);