1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
6 #include <rte_bus_vdev.h>
7 #include <rte_common.h>
8 #include <rte_malloc.h>
10 #include <rte_compressdev_pmd.h>
12 #include "isal_compress_pmd_private.h"
14 #define RTE_COMP_ISAL_WINDOW_SIZE 15
15 #define RTE_COMP_ISAL_LEVEL_ZERO 0 /* ISA-L Level 0 used for fixed Huffman */
16 #define RTE_COMP_ISAL_LEVEL_ONE 1
17 #define RTE_COMP_ISAL_LEVEL_TWO 2
18 #define RTE_COMP_ISAL_LEVEL_THREE 3 /* Optimised for AVX512 & AVX2 only */
19 #define CHKSUM_SZ_CRC 8
20 #define CHKSUM_SZ_ADLER 4
22 #define STRINGIFY(s) #s
23 #define ISAL_TOSTRING(maj, min, patch) \
24 STRINGIFY(maj)"."STRINGIFY(min)"."STRINGIFY(patch)
25 #define ISAL_VERSION_STRING \
26 ISAL_TOSTRING(ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION)
28 /* Verify and set private xform parameters */
30 isal_comp_set_priv_xform_parameters(struct isal_priv_xform *priv_xform,
31 const struct rte_comp_xform *xform)
36 /* Set compression private xform variables */
37 if (xform->type == RTE_COMP_COMPRESS) {
38 /* Set private xform type - COMPRESS/DECOMPRESS */
39 priv_xform->type = RTE_COMP_COMPRESS;
41 /* Set private xform algorithm */
42 if (xform->compress.algo != RTE_COMP_ALGO_DEFLATE) {
43 if (xform->compress.algo == RTE_COMP_ALGO_NULL) {
44 ISAL_PMD_LOG(ERR, "By-pass not supported\n");
47 ISAL_PMD_LOG(ERR, "Algorithm not supported\n");
50 priv_xform->compress.algo = RTE_COMP_ALGO_DEFLATE;
52 /* Set private xform window size, 32K supported */
53 if (xform->compress.window_size == RTE_COMP_ISAL_WINDOW_SIZE)
54 priv_xform->compress.window_size =
55 RTE_COMP_ISAL_WINDOW_SIZE;
57 ISAL_PMD_LOG(ERR, "Window size not supported\n");
61 /* Set private xform huffman type */
62 switch (xform->compress.deflate.huffman) {
63 case(RTE_COMP_HUFFMAN_DEFAULT):
64 priv_xform->compress.deflate.huffman =
65 RTE_COMP_HUFFMAN_DEFAULT;
67 case(RTE_COMP_HUFFMAN_FIXED):
68 priv_xform->compress.deflate.huffman =
69 RTE_COMP_HUFFMAN_FIXED;
71 case(RTE_COMP_HUFFMAN_DYNAMIC):
72 priv_xform->compress.deflate.huffman =
73 RTE_COMP_HUFFMAN_DYNAMIC;
76 ISAL_PMD_LOG(ERR, "Huffman code not supported\n");
80 /* Set private xform checksum */
81 switch (xform->compress.chksum) {
82 /* Raw deflate by default */
83 case(RTE_COMP_CHECKSUM_NONE):
84 priv_xform->compress.chksum = IGZIP_DEFLATE;
86 case(RTE_COMP_CHECKSUM_CRC32):
87 priv_xform->compress.chksum = IGZIP_GZIP_NO_HDR;
89 case(RTE_COMP_CHECKSUM_ADLER32):
90 priv_xform->compress.chksum = IGZIP_ZLIB_NO_HDR;
92 case(RTE_COMP_CHECKSUM_CRC32_ADLER32):
93 ISAL_PMD_LOG(ERR, "Combined CRC and ADLER checksum not"
97 ISAL_PMD_LOG(ERR, "Checksum type not supported\n");
98 priv_xform->compress.chksum = IGZIP_DEFLATE;
102 /* Set private xform level.
103 * Checking compliance with compressdev API, -1 <= level => 9
105 if (xform->compress.level < RTE_COMP_LEVEL_PMD_DEFAULT ||
106 xform->compress.level > RTE_COMP_LEVEL_MAX) {
107 ISAL_PMD_LOG(ERR, "Compression level out of range\n");
110 /* Check for Compressdev API level 0, No compression
111 * not supported in ISA-L
113 else if (xform->compress.level == RTE_COMP_LEVEL_NONE) {
114 ISAL_PMD_LOG(ERR, "No Compression not supported\n");
117 /* If using fixed huffman code, level must be 0 */
118 else if (priv_xform->compress.deflate.huffman ==
119 RTE_COMP_HUFFMAN_FIXED) {
120 ISAL_PMD_LOG(DEBUG, "ISA-L level 0 used due to a"
121 " fixed huffman code\n");
122 priv_xform->compress.level = RTE_COMP_ISAL_LEVEL_ZERO;
123 priv_xform->level_buffer_size =
124 ISAL_DEF_LVL0_DEFAULT;
126 /* Mapping API levels to ISA-L levels 1,2 & 3 */
127 switch (xform->compress.level) {
128 case RTE_COMP_LEVEL_PMD_DEFAULT:
129 /* Default is 1 if not using fixed huffman */
130 priv_xform->compress.level =
131 RTE_COMP_ISAL_LEVEL_ONE;
132 priv_xform->level_buffer_size =
133 ISAL_DEF_LVL1_DEFAULT;
135 case RTE_COMP_LEVEL_MIN:
136 priv_xform->compress.level =
137 RTE_COMP_ISAL_LEVEL_ONE;
138 priv_xform->level_buffer_size =
139 ISAL_DEF_LVL1_DEFAULT;
141 case RTE_COMP_ISAL_LEVEL_TWO:
142 priv_xform->compress.level =
143 RTE_COMP_ISAL_LEVEL_TWO;
144 priv_xform->level_buffer_size =
145 ISAL_DEF_LVL2_DEFAULT;
147 /* Level 3 or higher requested */
149 /* Check for AVX512, to use ISA-L level 3 */
150 if (rte_cpu_get_flag_enabled(
151 RTE_CPUFLAG_AVX512F)) {
152 priv_xform->compress.level =
153 RTE_COMP_ISAL_LEVEL_THREE;
154 priv_xform->level_buffer_size =
155 ISAL_DEF_LVL3_DEFAULT;
157 /* Check for AVX2, to use ISA-L level 3 */
158 else if (rte_cpu_get_flag_enabled(
160 priv_xform->compress.level =
161 RTE_COMP_ISAL_LEVEL_THREE;
162 priv_xform->level_buffer_size =
163 ISAL_DEF_LVL3_DEFAULT;
165 ISAL_PMD_LOG(DEBUG, "Requested ISA-L level"
166 " 3 or above; Level 3 optimized"
167 " for AVX512 & AVX2 only."
168 " level changed to 2.\n");
169 priv_xform->compress.level =
170 RTE_COMP_ISAL_LEVEL_TWO;
171 priv_xform->level_buffer_size =
172 ISAL_DEF_LVL2_DEFAULT;
178 /* Set decompression private xform variables */
179 else if (xform->type == RTE_COMP_DECOMPRESS) {
181 /* Set private xform type - COMPRESS/DECOMPRESS */
182 priv_xform->type = RTE_COMP_DECOMPRESS;
184 /* Set private xform algorithm */
185 if (xform->decompress.algo != RTE_COMP_ALGO_DEFLATE) {
186 if (xform->decompress.algo == RTE_COMP_ALGO_NULL) {
187 ISAL_PMD_LOG(ERR, "By pass not supported\n");
190 ISAL_PMD_LOG(ERR, "Algorithm not supported\n");
193 priv_xform->decompress.algo = RTE_COMP_ALGO_DEFLATE;
195 /* Set private xform checksum */
196 switch (xform->decompress.chksum) {
197 /* Raw deflate by default */
198 case(RTE_COMP_CHECKSUM_NONE):
199 priv_xform->decompress.chksum = ISAL_DEFLATE;
201 case(RTE_COMP_CHECKSUM_CRC32):
202 priv_xform->decompress.chksum = ISAL_GZIP_NO_HDR;
204 case(RTE_COMP_CHECKSUM_ADLER32):
205 priv_xform->decompress.chksum = ISAL_ZLIB_NO_HDR;
207 case(RTE_COMP_CHECKSUM_CRC32_ADLER32):
208 ISAL_PMD_LOG(ERR, "Combined CRC and ADLER checksum not"
212 ISAL_PMD_LOG(ERR, "Checksum type not supported\n");
213 priv_xform->decompress.chksum = ISAL_DEFLATE;
217 /* Set private xform window size, 32K supported */
218 if (xform->decompress.window_size == RTE_COMP_ISAL_WINDOW_SIZE)
219 priv_xform->decompress.window_size =
220 RTE_COMP_ISAL_WINDOW_SIZE;
222 ISAL_PMD_LOG(ERR, "Window size not supported\n");
229 /* Compression using chained mbufs for input/output data */
231 chained_mbuf_compression(struct rte_comp_op *op, struct isal_comp_qp *qp)
234 uint32_t remaining_offset;
235 uint32_t remaining_data = op->src.length;
236 struct rte_mbuf *src = op->m_src;
237 struct rte_mbuf *dst = op->m_dst;
239 /* check for source/destination offset passing multiple segments
240 * and point compression stream to input/output buffer.
242 remaining_offset = op->src.offset;
243 while (remaining_offset >= src->data_len) {
244 remaining_offset -= src->data_len;
247 qp->stream->avail_in = RTE_MIN(src->data_len - remaining_offset,
249 qp->stream->next_in = rte_pktmbuf_mtod_offset(src, uint8_t *,
252 remaining_offset = op->dst.offset;
253 while (remaining_offset >= dst->data_len) {
254 remaining_offset -= dst->data_len;
257 qp->stream->avail_out = dst->data_len - remaining_offset;
258 qp->stream->next_out = rte_pktmbuf_mtod_offset(dst, uint8_t *,
261 if (unlikely(!qp->stream->next_in || !qp->stream->next_out)) {
262 ISAL_PMD_LOG(ERR, "Invalid source or destination buffer\n");
263 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
267 while (qp->stream->internal_state.state != ZSTATE_END) {
268 /* Last segment of data */
269 if (remaining_data <= src->data_len)
270 qp->stream->end_of_stream = 1;
272 /* Execute compression operation */
273 ret = isal_deflate(qp->stream);
275 remaining_data = op->src.length - qp->stream->total_in;
277 if (ret != COMP_OK) {
278 ISAL_PMD_LOG(ERR, "Compression operation failed\n");
279 op->status = RTE_COMP_OP_STATUS_ERROR;
283 if (qp->stream->avail_in == 0 &&
284 qp->stream->total_in != op->src.length) {
285 if (src->next != NULL) {
287 qp->stream->next_in =
288 rte_pktmbuf_mtod(src, uint8_t *);
289 qp->stream->avail_in =
290 RTE_MIN(remaining_data, src->data_len);
293 "Not enough input buffer segments\n");
294 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
299 if (qp->stream->avail_out == 0 &&
300 qp->stream->internal_state.state != ZSTATE_END) {
301 if (dst->next != NULL) {
303 qp->stream->next_out =
304 rte_pktmbuf_mtod(dst, uint8_t *);
305 qp->stream->avail_out = dst->data_len;
308 "Not enough output buffer segments\n");
310 RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
319 /* Decompression using chained mbufs for input/output data */
321 chained_mbuf_decompression(struct rte_comp_op *op, struct isal_comp_qp *qp)
324 uint32_t consumed_data, src_remaining_offset, dst_remaining_offset;
325 uint32_t remaining_data = op->src.length;
326 struct rte_mbuf *src = op->m_src;
327 struct rte_mbuf *dst = op->m_dst;
329 /* check for offset passing multiple segments
330 * and point decompression state to input/output buffer
332 src_remaining_offset = op->src.offset;
333 while (src_remaining_offset >= src->data_len) {
334 src_remaining_offset -= src->data_len;
337 qp->state->avail_in = RTE_MIN(src->data_len - src_remaining_offset,
339 qp->state->next_in = rte_pktmbuf_mtod_offset(src, uint8_t *,
340 src_remaining_offset);
342 dst_remaining_offset = op->dst.offset;
343 while (dst_remaining_offset >= dst->data_len) {
344 dst_remaining_offset -= dst->data_len;
347 qp->state->avail_out = dst->data_len - dst_remaining_offset;
348 qp->state->next_out = rte_pktmbuf_mtod_offset(dst, uint8_t *,
349 dst_remaining_offset);
351 while (qp->state->block_state != ISAL_BLOCK_FINISH) {
353 ret = isal_inflate(qp->state);
355 /* Check for first segment, offset needs to be accounted for */
356 if (remaining_data == op->src.length) {
357 consumed_data = src->data_len - src_remaining_offset;
359 consumed_data = src->data_len;
361 if (qp->state->avail_in == 0
362 && op->consumed != op->src.length) {
363 op->consumed += consumed_data;
364 remaining_data -= consumed_data;
366 if (src->next != NULL) {
369 rte_pktmbuf_mtod(src, uint8_t *);
370 qp->state->avail_in =
371 RTE_MIN(remaining_data, src->data_len);
375 if (ret == ISAL_OUT_OVERFLOW) {
376 ISAL_PMD_LOG(ERR, "Decompression operation ran "
377 "out of space, but can be recovered.\n%d bytes "
378 "consumed\t%d bytes produced\n",
379 consumed_data, qp->state->total_out);
381 RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE;
383 } else if (ret < 0) {
384 ISAL_PMD_LOG(ERR, "Decompression operation failed\n");
385 op->status = RTE_COMP_OP_STATUS_ERROR;
389 if (qp->state->avail_out == 0 &&
390 qp->state->block_state != ISAL_BLOCK_FINISH) {
391 if (dst->next != NULL) {
393 qp->state->next_out =
394 rte_pktmbuf_mtod(dst, uint8_t *);
395 qp->state->avail_out = dst->data_len;
398 "Not enough output buffer segments\n");
400 RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
409 /* Stateless Compression Function */
411 process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp,
412 struct isal_priv_xform *priv_xform)
415 op->status = RTE_COMP_OP_STATUS_SUCCESS;
417 /* Required due to init clearing level_buf */
418 uint8_t *temp_level_buf = qp->stream->level_buf;
420 /* Initialize compression stream */
421 isal_deflate_init(qp->stream);
423 qp->stream->level_buf = temp_level_buf;
425 /* Set Checksum flag */
426 qp->stream->gzip_flag = priv_xform->compress.chksum;
428 /* Stateless operation, input will be consumed in one go */
429 qp->stream->flush = NO_FLUSH;
431 /* set compression level & intermediate level buffer size */
432 qp->stream->level = priv_xform->compress.level;
433 qp->stream->level_buf_size = priv_xform->level_buffer_size;
435 /* Set op huffman code */
436 if (priv_xform->compress.deflate.huffman == RTE_COMP_HUFFMAN_FIXED)
437 isal_deflate_set_hufftables(qp->stream, NULL,
438 IGZIP_HUFFTABLE_STATIC);
439 else if (priv_xform->compress.deflate.huffman ==
440 RTE_COMP_HUFFMAN_DEFAULT)
441 isal_deflate_set_hufftables(qp->stream, NULL,
442 IGZIP_HUFFTABLE_DEFAULT);
443 /* Dynamically change the huffman code to suit the input data */
444 else if (priv_xform->compress.deflate.huffman ==
445 RTE_COMP_HUFFMAN_DYNAMIC)
446 isal_deflate_set_hufftables(qp->stream, NULL,
447 IGZIP_HUFFTABLE_DEFAULT);
449 if (op->m_src->pkt_len < (op->src.length + op->src.offset)) {
450 ISAL_PMD_LOG(ERR, "Input mbuf(s) not big enough.\n");
451 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
455 if (op->dst.offset >= op->m_dst->pkt_len) {
456 ISAL_PMD_LOG(ERR, "Output mbuf(s) not big enough"
457 " for offset provided.\n");
458 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
463 if (op->m_src->nb_segs > 1 || op->m_dst->nb_segs > 1) {
464 ret = chained_mbuf_compression(op, qp);
469 qp->stream->end_of_stream = 1; /* All input consumed in one */
470 /* Point compression stream to input buffer */
471 qp->stream->avail_in = op->src.length;
472 qp->stream->next_in = rte_pktmbuf_mtod_offset(op->m_src,
473 uint8_t *, op->src.offset);
475 /* Point compression stream to output buffer */
476 qp->stream->avail_out = op->m_dst->data_len - op->dst.offset;
477 qp->stream->next_out = rte_pktmbuf_mtod_offset(op->m_dst,
478 uint8_t *, op->dst.offset);
480 if (unlikely(!qp->stream->next_in || !qp->stream->next_out)) {
481 ISAL_PMD_LOG(ERR, "Invalid source or destination"
483 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
487 /* Execute compression operation */
488 ret = isal_deflate_stateless(qp->stream);
490 /* Check that output buffer did not run out of space */
491 if (ret == STATELESS_OVERFLOW) {
492 ISAL_PMD_LOG(ERR, "Output buffer not big enough\n");
493 op->status = RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
497 /* Check that input buffer has been fully consumed */
498 if (qp->stream->avail_in != (uint32_t)0) {
499 ISAL_PMD_LOG(ERR, "Input buffer could not be read"
501 op->status = RTE_COMP_OP_STATUS_ERROR;
505 if (ret != COMP_OK) {
506 ISAL_PMD_LOG(ERR, "Compression operation failed\n");
507 op->status = RTE_COMP_OP_STATUS_ERROR;
512 op->consumed = qp->stream->total_in;
513 if (qp->stream->gzip_flag == IGZIP_DEFLATE) {
514 op->produced = qp->stream->total_out;
515 } else if (qp->stream->gzip_flag == IGZIP_ZLIB_NO_HDR) {
516 op->produced = qp->stream->total_out - CHKSUM_SZ_ADLER;
517 op->output_chksum = qp->stream->internal_state.crc + 1;
519 op->produced = qp->stream->total_out - CHKSUM_SZ_CRC;
520 op->output_chksum = qp->stream->internal_state.crc;
526 /* Stateless Decompression Function */
528 process_isal_inflate(struct rte_comp_op *op, struct isal_comp_qp *qp,
529 struct isal_priv_xform *priv_xform)
533 op->status = RTE_COMP_OP_STATUS_SUCCESS;
535 /* Initialize decompression state */
536 isal_inflate_init(qp->state);
538 /* Set Checksum flag */
539 qp->state->crc_flag = priv_xform->decompress.chksum;
541 if (op->m_src->pkt_len < (op->src.length + op->src.offset)) {
542 ISAL_PMD_LOG(ERR, "Input mbuf(s) not big enough.\n");
543 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
547 if (op->dst.offset >= op->m_dst->pkt_len) {
548 ISAL_PMD_LOG(ERR, "Output mbuf not big enough for "
549 "offset provided.\n");
550 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
555 if (op->m_src->nb_segs > 1 || op->m_dst->nb_segs > 1) {
556 ret = chained_mbuf_decompression(op, qp);
561 /* Point decompression state to input buffer */
562 qp->state->avail_in = op->src.length;
563 qp->state->next_in = rte_pktmbuf_mtod_offset(op->m_src,
564 uint8_t *, op->src.offset);
566 /* Point decompression state to output buffer */
567 qp->state->avail_out = op->m_dst->data_len - op->dst.offset;
568 qp->state->next_out = rte_pktmbuf_mtod_offset(op->m_dst,
569 uint8_t *, op->dst.offset);
571 if (unlikely(!qp->state->next_in || !qp->state->next_out)) {
572 ISAL_PMD_LOG(ERR, "Invalid source or destination"
574 op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
578 /* Execute decompression operation */
579 ret = isal_inflate_stateless(qp->state);
581 if (ret == ISAL_OUT_OVERFLOW) {
582 ISAL_PMD_LOG(ERR, "Output buffer not big enough\n");
583 op->status = RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
587 /* Check that input buffer has been fully consumed */
588 if (qp->state->avail_in != (uint32_t)0) {
589 ISAL_PMD_LOG(ERR, "Input buffer could not be read"
591 op->status = RTE_COMP_OP_STATUS_ERROR;
595 if (ret != ISAL_DECOMP_OK && ret != ISAL_END_INPUT) {
596 ISAL_PMD_LOG(ERR, "Decompression operation failed\n");
597 op->status = RTE_COMP_OP_STATUS_ERROR;
600 op->consumed = op->src.length - qp->state->avail_in;
602 op->produced = qp->state->total_out;
603 op->output_chksum = qp->state->crc;
608 /* Process compression/decompression operation */
610 process_op(struct isal_comp_qp *qp, struct rte_comp_op *op,
611 struct isal_priv_xform *priv_xform)
613 switch (priv_xform->type) {
614 case RTE_COMP_COMPRESS:
615 process_isal_deflate(op, qp, priv_xform);
617 case RTE_COMP_DECOMPRESS:
618 process_isal_inflate(op, qp, priv_xform);
621 ISAL_PMD_LOG(ERR, "Operation Not Supported\n");
629 isal_comp_pmd_enqueue_burst(void *queue_pair, struct rte_comp_op **ops,
632 struct isal_comp_qp *qp = queue_pair;
635 int16_t num_enq = RTE_MIN(qp->num_free_elements, nb_ops);
637 for (i = 0; i < num_enq; i++) {
638 if (unlikely(ops[i]->op_type != RTE_COMP_OP_STATELESS)) {
639 ops[i]->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
640 ISAL_PMD_LOG(ERR, "Stateful operation not Supported\n");
641 qp->qp_stats.enqueue_err_count++;
644 retval = process_op(qp, ops[i], ops[i]->private_xform);
645 if (unlikely(retval < 0) ||
646 ops[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
647 qp->qp_stats.enqueue_err_count++;
651 retval = rte_ring_enqueue_burst(qp->processed_pkts, (void *)ops,
653 qp->num_free_elements -= retval;
654 qp->qp_stats.enqueued_count += retval;
661 isal_comp_pmd_dequeue_burst(void *queue_pair, struct rte_comp_op **ops,
664 struct isal_comp_qp *qp = queue_pair;
665 uint16_t nb_dequeued;
667 nb_dequeued = rte_ring_dequeue_burst(qp->processed_pkts, (void **)ops,
669 qp->num_free_elements += nb_dequeued;
670 qp->qp_stats.dequeued_count += nb_dequeued;
675 /* Create ISA-L compression device */
677 compdev_isal_create(const char *name, struct rte_vdev_device *vdev,
678 struct rte_compressdev_pmd_init_params *init_params)
680 struct rte_compressdev *dev;
682 dev = rte_compressdev_pmd_create(name, &vdev->device,
683 sizeof(struct isal_comp_private), init_params);
685 ISAL_PMD_LOG(ERR, "failed to create compressdev vdev");
689 dev->dev_ops = isal_compress_pmd_ops;
691 /* register rx/tx burst functions for data path */
692 dev->dequeue_burst = isal_comp_pmd_dequeue_burst;
693 dev->enqueue_burst = isal_comp_pmd_enqueue_burst;
695 ISAL_PMD_LOG(INFO, "\nISA-L library version used: "ISAL_VERSION_STRING);
700 /** Remove compression device */
702 compdev_isal_remove_dev(struct rte_vdev_device *vdev)
704 struct rte_compressdev *compdev;
707 name = rte_vdev_device_name(vdev);
711 compdev = rte_compressdev_pmd_get_named_dev(name);
715 return rte_compressdev_pmd_destroy(compdev);
718 /** Initialise ISA-L compression device */
720 compdev_isal_probe(struct rte_vdev_device *dev)
722 struct rte_compressdev_pmd_init_params init_params = {
726 const char *name, *args;
729 name = rte_vdev_device_name(dev);
733 args = rte_vdev_device_args(dev);
735 retval = rte_compressdev_pmd_parse_input_args(&init_params, args);
738 "Failed to parse initialisation arguments[%s]\n", args);
742 return compdev_isal_create(name, dev, &init_params);
745 static struct rte_vdev_driver compdev_isal_pmd_drv = {
746 .probe = compdev_isal_probe,
747 .remove = compdev_isal_remove_dev,
750 RTE_PMD_REGISTER_VDEV(COMPDEV_NAME_ISAL_PMD, compdev_isal_pmd_drv);
751 RTE_PMD_REGISTER_PARAM_STRING(COMPDEV_NAME_ISAL_PMD,
753 RTE_LOG_REGISTER(isal_logtype_driver, pmd.compress.isal, INFO);