X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_compressdev%2Frte_compressdev_pmd.c;h=7f500d76d4a4f8dc492da5fa90abe437da0daf05;hb=35a7fe80c29446eab49ffd7e81a4f610fd1f98ce;hp=7de4f339e1094ce554390de52edcdb792bb90977;hpb=ed7dd94f7f664b86d026ce6104b5a6b255a9b881;p=dpdk.git diff --git a/lib/librte_compressdev/rte_compressdev_pmd.c b/lib/librte_compressdev/rte_compressdev_pmd.c index 7de4f339e1..7f500d76d4 100644 --- a/lib/librte_compressdev/rte_compressdev_pmd.c +++ b/lib/librte_compressdev/rte_compressdev_pmd.c @@ -2,6 +2,7 @@ * Copyright(c) 2017-2018 Intel Corporation */ +#include #include #include #include @@ -9,8 +10,6 @@ #include "rte_compressdev_internal.h" #include "rte_compressdev_pmd.h" -int compressdev_logtype; - /** * Parse name from argument */ @@ -21,7 +20,7 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused, struct rte_compressdev_pmd_init_params *params = extra_args; int n; - n = snprintf(params->name, RTE_COMPRESSDEV_NAME_MAX_LEN, "%s", value); + n = strlcpy(params->name, value, RTE_COMPRESSDEV_NAME_MAX_LEN); if (n >= RTE_COMPRESSDEV_NAME_MAX_LEN) return -EINVAL; @@ -47,7 +46,7 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused, return 0; } -int __rte_experimental +int rte_compressdev_pmd_parse_input_args( struct rte_compressdev_pmd_init_params *params, const char *args) @@ -83,7 +82,7 @@ free_kvlist: return ret; } -struct rte_compressdev * __rte_experimental +struct rte_compressdev * rte_compressdev_pmd_create(const char *name, struct rte_device *device, size_t private_data_size, @@ -92,24 +91,20 @@ rte_compressdev_pmd_create(const char *name, struct rte_compressdev *compressdev; if (params->name[0] != '\0') { - COMPRESSDEV_LOG(INFO, "[%s] User specified device name = %s\n", - device->driver->name, params->name); + COMPRESSDEV_LOG(INFO, "User specified device name = %s\n", + params->name); name = params->name; } - COMPRESSDEV_LOG(INFO, "[%s] - Creating compressdev %s\n", - device->driver->name, name); + COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name); - COMPRESSDEV_LOG(INFO, - "[%s] - Init parameters - name: %s, socket id: %d", - device->driver->name, name, - params->socket_id); + COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d", + name, params->socket_id); /* allocate device structure */ compressdev = rte_compressdev_pmd_allocate(name, params->socket_id); if (compressdev == NULL) { - COMPRESSDEV_LOG(ERR, "[%s] Failed to allocate comp device %s", - device->driver->name, name); + COMPRESSDEV_LOG(ERR, "Failed to allocate comp device %s", name); return NULL; } @@ -123,8 +118,8 @@ rte_compressdev_pmd_create(const char *name, if (compressdev->data->dev_private == NULL) { COMPRESSDEV_LOG(ERR, - "[%s] Cannot allocate memory for compressdev %s private data", - device->driver->name, name); + "Cannot allocate memory for compressdev" + " %s private data", name); rte_compressdev_pmd_release_device(compressdev); return NULL; @@ -136,13 +131,12 @@ rte_compressdev_pmd_create(const char *name, return compressdev; } -int __rte_experimental +int rte_compressdev_pmd_destroy(struct rte_compressdev *compressdev) { int retval; - COMPRESSDEV_LOG(INFO, "[%s] Closing comp device %s", - compressdev->device->driver->name, + COMPRESSDEV_LOG(INFO, "Closing comp device %s", compressdev->device->name); /* free comp device */