net/ark: set generator delay thread name
[dpdk.git] / drivers / compress / mlx5 / mlx5_compress.c
index 25f7182..ec3c237 100644 (file)
@@ -43,6 +43,7 @@ struct mlx5_compress_priv {
        void *uar;
        uint32_t pdn; /* Protection Domain number. */
        uint8_t min_block_size;
+       uint8_t sq_ts_format; /* Whether SQ supports timestamp formats. */
        /* Minimum huffman block size supported by the device. */
        struct ibv_pd *pd;
        struct rte_compressdev_config dev_config;
@@ -76,8 +77,28 @@ static pthread_mutex_t priv_list_lock = PTHREAD_MUTEX_INITIALIZER;
 
 int mlx5_compress_logtype;
 
-const struct rte_compressdev_capabilities mlx5_caps[RTE_COMP_ALGO_LIST_END];
-
+static const struct rte_compressdev_capabilities mlx5_caps[] = {
+       {
+               .algo = RTE_COMP_ALGO_NULL,
+               .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM |
+                                     RTE_COMP_FF_CRC32_CHECKSUM |
+                                     RTE_COMP_FF_CRC32_ADLER32_CHECKSUM |
+                                     RTE_COMP_FF_SHAREABLE_PRIV_XFORM,
+       },
+       {
+               .algo = RTE_COMP_ALGO_DEFLATE,
+               .comp_feature_flags = RTE_COMP_FF_ADLER32_CHECKSUM |
+                                     RTE_COMP_FF_CRC32_CHECKSUM |
+                                     RTE_COMP_FF_CRC32_ADLER32_CHECKSUM |
+                                     RTE_COMP_FF_SHAREABLE_PRIV_XFORM |
+                                     RTE_COMP_FF_HUFFMAN_FIXED |
+                                     RTE_COMP_FF_HUFFMAN_DYNAMIC,
+               .window_size = {.min = 10, .max = 15, .increment = 1},
+       },
+       {
+               .algo = RTE_COMP_ALGO_LIST_END,
+       }
+};
 
 static void
 mlx5_compress_dev_info_get(struct rte_compressdev *dev,
@@ -225,6 +246,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
                goto err;
        }
        sq_attr.cqn = qp->cq.cq->id;
+       sq_attr.ts_format = mlx5_ts_format_conv(priv->sq_ts_format);
        ret = mlx5_devx_sq_create(priv->ctx, &qp->sq, log_ops_n, &sq_attr,
                                  socket_id);
        if (ret != 0) {
@@ -237,7 +259,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
                DRV_LOG(ERR, "Can't change SQ state to ready.");
                goto err;
        }
-       DRV_LOG(INFO, "QP %u: SQN=0x%X CQN=0x%X entries num = %u\n",
+       DRV_LOG(INFO, "QP %u: SQN=0x%X CQN=0x%X entries num = %u",
                (uint32_t)qp_id, qp->sq.sq->id, qp->cq.cq->id, qp->entries_n);
        return 0;
 err:
@@ -594,7 +616,7 @@ mlx5_compress_dequeue_burst(void *queue_pair, struct rte_comp_op **ops,
                        op->consumed = op->src.length;
                        op->produced = rte_be_to_cpu_32(cqe->byte_cnt);
                        MLX5_ASSERT(cqe->byte_cnt ==
-                                   qp->opaque_buf[idx].scattered_length);
+                                   opaq[idx].scattered_length);
                        switch (xform->csum_type) {
                        case RTE_COMP_CHECKSUM_CRC32:
                                op->output_chksum = (uint64_t)rte_be_to_cpu_32
@@ -711,7 +733,7 @@ mlx5_compress_hw_global_prepare(struct mlx5_compress_priv *priv)
                return -1;
        }
        priv->uar_addr = mlx5_os_get_devx_uar_reg_addr(priv->uar);
-       MLX5_ASSERT(qp->uar_addr);
+       MLX5_ASSERT(priv->uar_addr);
 #ifndef RTE_ARCH_64
        rte_spinlock_init(&priv->uar32_sl);
 #endif /* RTE_ARCH_64 */
@@ -794,6 +816,7 @@ mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,
        priv->pci_dev = pci_dev;
        priv->cdev = cdev;
        priv->min_block_size = att.compress_min_block_size;
+       priv->sq_ts_format = att.sq_ts_format;
        if (mlx5_compress_hw_global_prepare(priv) != 0) {
                rte_compressdev_pmd_destroy(priv->cdev);
                claim_zero(mlx5_glue->close_device(priv->ctx));