From: Lee Daly Date: Wed, 9 May 2018 16:14:28 +0000 (+0100) Subject: compress/isal: add basic PMD ops X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=53a9baa98c36c3e532a7f4d83686361edb8a1acc;p=dpdk.git compress/isal: add basic PMD ops Add basic device poll mode driver operations to give ability to start, stop, close device etc. Signed-off-by: Lee Daly Reviewed-by: Pablo de Lara --- diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c b/drivers/compress/isal/isal_compress_pmd_ops.c index cff05b4086..2f828c5f7a 100644 --- a/drivers/compress/isal/isal_compress_pmd_ops.c +++ b/drivers/compress/isal/isal_compress_pmd_ops.c @@ -2,18 +2,71 @@ * Copyright(c) 2018 Intel Corporation */ +#include #include +#include "isal_compress_pmd_private.h" + +static const struct rte_compressdev_capabilities isal_pmd_capabilities[] = { + RTE_COMP_END_OF_CAPABILITIES_LIST() +}; + +/** Configure device */ +static int +isal_comp_pmd_config(struct rte_compressdev *dev __rte_unused, + struct rte_compressdev_config *config __rte_unused) +{ + return 0; +} + +/** Start device */ +static int +isal_comp_pmd_start(__rte_unused struct rte_compressdev *dev) +{ + return 0; +} + +/** Stop device */ +static void +isal_comp_pmd_stop(__rte_unused struct rte_compressdev *dev) +{ +} + +/** Close device */ +static int +isal_comp_pmd_close(struct rte_compressdev *dev) +{ + /* Free private data */ + struct isal_comp_private *internals = dev->data->dev_private; + + rte_mempool_free(internals->priv_xform_mp); + return 0; +} + +/** Get device info */ +static void +isal_comp_pmd_info_get(struct rte_compressdev *dev __rte_unused, + struct rte_compressdev_info *dev_info) +{ + if (dev_info != NULL) { + dev_info->capabilities = isal_pmd_capabilities; + dev_info->feature_flags = RTE_COMPDEV_FF_CPU_AVX512 | + RTE_COMPDEV_FF_CPU_AVX2 | + RTE_COMPDEV_FF_CPU_AVX | + RTE_COMPDEV_FF_CPU_SSE; + } +} + struct rte_compressdev_ops isal_pmd_ops = { - .dev_configure = NULL, - .dev_start = NULL, - .dev_stop = NULL, - .dev_close = NULL, + .dev_configure = isal_comp_pmd_config, + .dev_start = isal_comp_pmd_start, + .dev_stop = isal_comp_pmd_stop, + .dev_close = isal_comp_pmd_close, .stats_get = NULL, .stats_reset = NULL, - .dev_infos_get = NULL, + .dev_infos_get = isal_comp_pmd_info_get, .queue_pair_setup = NULL, .queue_pair_release = NULL, diff --git a/drivers/compress/isal/isal_compress_pmd_private.h b/drivers/compress/isal/isal_compress_pmd_private.h index 09ecfb730c..efbe68b992 100644 --- a/drivers/compress/isal/isal_compress_pmd_private.h +++ b/drivers/compress/isal/isal_compress_pmd_private.h @@ -18,6 +18,18 @@ struct isal_comp_private { struct rte_mempool *priv_xform_mp; }; +/** ISA-L queue pair */ +struct isal_comp_qp { + /* Queue Pair Identifier */ + uint16_t id; + /* Unique Queue Pair Name */ + char name[RTE_COMPRESSDEV_NAME_MAX_LEN]; + /* Queue pair statistics */ + struct rte_compressdev_stats qp_stats; + /* Number of free elements on ring */ + uint16_t num_free_elements; +} __rte_cache_aligned; + /** device specific operations function pointer structure */ extern struct rte_compressdev_ops *isal_compress_pmd_ops;