net/mlx5: support basic flow items and actions
[dpdk.git] / drivers / net / mlx5 / mlx5_trigger.c
index d9f7d00..2399243 100644 (file)
 
 /* DPDK headers don't like -pedantic. */
 #ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
+#pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
+#pragma GCC diagnostic error "-Wpedantic"
 #endif
 
 #include "mlx5.h"
@@ -64,6 +64,9 @@ mlx5_dev_start(struct rte_eth_dev *dev)
        struct priv *priv = dev->data->dev_private;
        int err;
 
+       if (mlx5_is_secondary())
+               return -E_RTE_SECONDARY;
+
        priv_lock(priv);
        if (priv->started) {
                priv_unlock(priv);
@@ -80,12 +83,14 @@ mlx5_dev_start(struct rte_eth_dev *dev)
                      " %s",
                      (void *)priv, strerror(err));
                /* Rollback. */
-               priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_ALLMULTI);
-               priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_PROMISC);
+               priv_special_flow_disable_all(priv);
                priv_mac_addrs_disable(priv);
                priv_destroy_hash_rxqs(priv);
        }
+       if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_NONE)
+               priv_fdir_enable(priv);
        priv_dev_interrupt_handler_install(priv, dev);
+       err = priv_flow_start(priv);
        priv_unlock(priv);
        return -err;
 }
@@ -103,16 +108,20 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
 {
        struct priv *priv = dev->data->dev_private;
 
+       if (mlx5_is_secondary())
+               return;
+
        priv_lock(priv);
        if (!priv->started) {
                priv_unlock(priv);
                return;
        }
        DEBUG("%p: cleaning up and destroying hash RX queues", (void *)dev);
-       priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_ALLMULTI);
-       priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_PROMISC);
+       priv_special_flow_disable_all(priv);
        priv_mac_addrs_disable(priv);
        priv_destroy_hash_rxqs(priv);
+       priv_fdir_disable(priv);
+       priv_flow_stop(priv);
        priv_dev_interrupt_handler_uninstall(priv, dev);
        priv->started = 0;
        priv_unlock(priv);