/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2017 Intel Corporation
*/
+#include <rte_string_fns.h>
#include <rte_reorder.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
#include "rte_cryptodev_scheduler.h"
#include "scheduler_pmd_private.h"
-int scheduler_logtype_driver;
-
/** update the scheduler pmd's capability with attaching device's
* capability.
* For each device to be attached, the scheduler's capability should be
RTE_CRYPTODEV_NAME_MAX_LEN);
return -EINVAL;
}
- snprintf(sched_ctx->name, sizeof(sched_ctx->name), "%s",
- scheduler->name);
+ strlcpy(sched_ctx->name, scheduler->name, sizeof(sched_ctx->name));
if (strlen(scheduler->description) >
RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1) {
RTE_CRYPTODEV_SCHEDULER_DESC_MAX_LEN - 1);
return -EINVAL;
}
- snprintf(sched_ctx->description, sizeof(sched_ctx->description), "%s",
- scheduler->description);
+ strlcpy(sched_ctx->description, scheduler->description,
+ sizeof(sched_ctx->description));
/* load scheduler instance operations functions */
sched_ctx->ops.config_queue_pair = scheduler->ops->config_queue_pair;
return (*sched_ctx->ops.option_get)(dev, option_type, option);
}
-RTE_INIT(scheduler_init_log)
-{
- scheduler_logtype_driver = rte_log_register("pmd.crypto.scheduler");
-}
+
+RTE_LOG_REGISTER(scheduler_logtype_driver, pmd.crypto.scheduler, INFO);