net/mlx5: fix matcher field usage for metadata entities
[dpdk.git] / drivers / net / mlx5 / mlx5_trigger.c
index f66b6ee..ab6937a 100644 (file)
@@ -106,9 +106,12 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
        unsigned int i;
        int ret = 0;
        enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
+       struct mlx5_rxq_data *rxq = NULL;
 
        for (i = 0; i < priv->rxqs_n; ++i) {
-               if ((*priv->rxqs)[i]->lro) {
+               rxq = (*priv->rxqs)[i];
+
+               if (rxq && rxq->lro) {
                        obj_type =  MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
                        break;
                }
@@ -402,6 +405,24 @@ mlx5_traffic_enable(struct rte_eth_dev *dev)
        unsigned int j;
        int ret;
 
+       /*
+        * Hairpin txq default flow should be created no matter if it is
+        * isolation mode. Or else all the packets to be sent will be sent
+        * out directly without the TX flow actions, e.g. encapsulation.
+        */
+       for (i = 0; i != priv->txqs_n; ++i) {
+               struct mlx5_txq_ctrl *txq_ctrl = mlx5_txq_get(dev, i);
+               if (!txq_ctrl)
+                       continue;
+               if (txq_ctrl->type == MLX5_TXQ_TYPE_HAIRPIN) {
+                       ret = mlx5_ctrl_flow_source_queue(dev, i);
+                       if (ret) {
+                               mlx5_txq_release(dev, i);
+                               goto error;
+                       }
+               }
+               mlx5_txq_release(dev, i);
+       }
        if (priv->config.dv_esw_en && !priv->config.vf)
                if (!mlx5_flow_create_esw_table_zero_flow(dev))
                        goto error;