net/mlx5: rename ib in names
[dpdk.git] / drivers / net / mlx5 / mlx5_trigger.c
index 0801cb6..a9af2e6 100644 (file)
@@ -11,6 +11,7 @@
 #include <rte_alarm.h>
 
 #include "mlx5.h"
+#include "mlx5_mr.h"
 #include "mlx5_rxtx.h"
 #include "mlx5_utils.h"
 #include "rte_pmd_mlx5.h"
@@ -111,7 +112,6 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
 
        for (i = 0; i < priv->rxqs_n; ++i) {
                rxq = (*priv->rxqs)[i];
-
                if (rxq && rxq->lro) {
                        obj_type =  MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
                        break;
@@ -269,6 +269,7 @@ error:
 int
 mlx5_dev_start(struct rte_eth_dev *dev)
 {
+       struct mlx5_priv *priv = dev->data->dev_private;
        int ret;
        int fine_inline;
 
@@ -307,6 +308,7 @@ mlx5_dev_start(struct rte_eth_dev *dev)
                mlx5_txq_stop(dev);
                return -rte_errno;
        }
+       /* Set started flag here for the following steps like control flow. */
        dev->data->dev_started = 1;
        ret = mlx5_rx_intr_vec_enable(dev);
        if (ret) {
@@ -321,6 +323,8 @@ mlx5_dev_start(struct rte_eth_dev *dev)
                        dev->data->port_id);
                goto error;
        }
+       /* Set a mask and offset of dynamic metadata flows into Rx queues*/
+       mlx5_flow_rxq_dynf_metadata_set(dev);
        /*
         * In non-cached mode, it only needs to start the default mreg copy
         * action and no flow created by application exists anymore.
@@ -337,7 +341,18 @@ mlx5_dev_start(struct rte_eth_dev *dev)
        dev->rx_pkt_burst = mlx5_select_rx_function(dev);
        /* Enable datapath on secondary process. */
        mlx5_mp_req_start_rxtx(dev);
-       mlx5_dev_interrupt_handler_install(dev);
+       if (priv->sh->intr_handle.fd >= 0) {
+               priv->sh->port[priv->dev_port - 1].ih_port_id =
+                                       (uint32_t)dev->data->port_id;
+       } else {
+               DRV_LOG(INFO, "port %u starts without LSC and RMV interrupts.",
+                       dev->data->port_id);
+               dev->data->dev_conf.intr_conf.lsc = 0;
+               dev->data->dev_conf.intr_conf.rmv = 0;
+       }
+       if (priv->sh->intr_handle_devx.fd >= 0)
+               priv->sh->port[priv->dev_port - 1].devx_ih_port_id =
+                                       (uint32_t)dev->data->port_id;
        return 0;
 error:
        ret = rte_errno; /* Save rte_errno before cleanup. */
@@ -379,7 +394,8 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
        /* All RX queue flags will be cleared in the flush interface. */
        mlx5_flow_list_flush(dev, &priv->flows, true);
        mlx5_rx_intr_vec_disable(dev);
-       mlx5_dev_interrupt_handler_uninstall(dev);
+       priv->sh->port[priv->dev_port - 1].ih_port_id = RTE_MAX_ETHPORTS;
+       priv->sh->port[priv->dev_port - 1].devx_ih_port_id = RTE_MAX_ETHPORTS;
        mlx5_txq_stop(dev);
        mlx5_rxq_stop(dev);
 }