net/mlx5: support single flow dump
[dpdk.git] / drivers / net / mlx5 / linux / mlx5_verbs.c
index b52ae2e..0b0759f 100644 (file)
 
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
-#include <rte_ethdev_driver.h>
+#include <ethdev_driver.h>
 #include <rte_common.h>
 
 #include <mlx5_glue.h>
 #include <mlx5_common.h>
 #include <mlx5_common_mr.h>
-#include <mlx5_rxtx.h>
 #include <mlx5_verbs.h>
+#include <mlx5_rx.h>
+#include <mlx5_tx.h>
 #include <mlx5_utils.h>
 #include <mlx5_malloc.h>
 
@@ -213,13 +214,22 @@ mlx5_rxq_ibv_cq_create(struct rte_eth_dev *dev, uint16_t idx)
        if (priv->config.cqe_comp && !rxq_data->hw_timestamp) {
                cq_attr.mlx5.comp_mask |=
                                MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE;
+               rxq_data->byte_mask = UINT32_MAX;
 #ifdef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT
-               cq_attr.mlx5.cqe_comp_res_format =
-                               mlx5_rxq_mprq_enabled(rxq_data) ?
-                               MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX :
-                               MLX5DV_CQE_RES_FORMAT_HASH;
+               if (mlx5_rxq_mprq_enabled(rxq_data)) {
+                       cq_attr.mlx5.cqe_comp_res_format =
+                                       MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX;
+                       rxq_data->mcqe_format =
+                                       MLX5_CQE_RESP_FORMAT_CSUM_STRIDX;
+               } else {
+                       cq_attr.mlx5.cqe_comp_res_format =
+                                       MLX5DV_CQE_RES_FORMAT_HASH;
+                       rxq_data->mcqe_format =
+                                       MLX5_CQE_RESP_FORMAT_HASH;
+               }
 #else
                cq_attr.mlx5.cqe_comp_res_format = MLX5DV_CQE_RES_FORMAT_HASH;
+               rxq_data->mcqe_format = MLX5_CQE_RESP_FORMAT_HASH;
 #endif
                /*
                 * For vectorized Rx, it must not be doubled in order to
@@ -234,7 +244,7 @@ mlx5_rxq_ibv_cq_create(struct rte_eth_dev *dev, uint16_t idx)
                        dev->data->port_id);
        }
 #ifdef HAVE_IBV_MLX5_MOD_CQE_128B_PAD
-       if (priv->config.cqe_pad) {
+       if (RTE_CACHE_LINE_SIZE == 128) {
                cq_attr.mlx5.comp_mask |= MLX5DV_CQ_INIT_ATTR_MASK_FLAGS;
                cq_attr.mlx5.flags |= MLX5DV_CQ_INIT_ATTR_FLAGS_CQE_PAD;
        }
@@ -712,7 +722,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
                return 0;
        rxq = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*rxq), 0, SOCKET_ID_ANY);
        if (!rxq) {
-               DEBUG("Port %u cannot allocate drop Rx queue memory.",
+               DRV_LOG(DEBUG, "Port %u cannot allocate drop Rx queue memory.",
                      dev->data->port_id);
                rte_errno = ENOMEM;
                return -rte_errno;
@@ -720,7 +730,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
        priv->drop_queue.rxq = rxq;
        rxq->ibv_cq = mlx5_glue->create_cq(ctx, 1, NULL, NULL, 0);
        if (!rxq->ibv_cq) {
-               DEBUG("Port %u cannot allocate CQ for drop queue.",
+               DRV_LOG(DEBUG, "Port %u cannot allocate CQ for drop queue.",
                      dev->data->port_id);
                rte_errno = errno;
                goto error;
@@ -733,7 +743,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)
                                                    .cq = rxq->ibv_cq,
                                              });
        if (!rxq->wq) {
-               DEBUG("Port %u cannot allocate WQ for drop queue.",
+               DRV_LOG(DEBUG, "Port %u cannot allocate WQ for drop queue.",
                      dev->data->port_id);
                rte_errno = errno;
                goto error;
@@ -776,8 +786,9 @@ mlx5_ibv_drop_action_create(struct rte_eth_dev *dev)
                                        .comp_mask = 0,
                                 });
        if (!ind_tbl) {
-               DEBUG("Port %u cannot allocate indirection table for drop"
-                     " queue.", dev->data->port_id);
+               DRV_LOG(DEBUG, "Port %u"
+                       " cannot allocate indirection table for drop queue.",
+                       dev->data->port_id);
                rte_errno = errno;
                goto error;
        }
@@ -797,7 +808,7 @@ mlx5_ibv_drop_action_create(struct rte_eth_dev *dev)
                        .pd = priv->sh->pd
                 });
        if (!hrxq->qp) {
-               DEBUG("Port %u cannot allocate QP for drop queue.",
+               DRV_LOG(DEBUG, "Port %u cannot allocate QP for drop queue.",
                      dev->data->port_id);
                rte_errno = errno;
                goto error;