From: Fan Zhang <roy.fan.zhang@intel.com>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com
Subject: [dpdk-dev] [PATCH] crypto/scheduler: fix name parameter parsing
Date: Mon, 30 Jan 2017 11:19:13 +0000 [thread overview]
Message-ID: <1485775153-237825-1-git-send-email-roy.fan.zhang@intel.com> (raw)
This patch fixes the name parsing issue. Originally, the unique
scheduler name created by system is not passed to vdev
initializer.
Fixes: 8b483eae ("crypto/scheduler: register scheduler vdev driver")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
drivers/crypto/scheduler/scheduler_pmd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c
index 62418d0..eeafbe6 100644
--- a/drivers/crypto/scheduler/scheduler_pmd.c
+++ b/drivers/crypto/scheduler/scheduler_pmd.c
@@ -116,19 +116,22 @@ static int
cryptodev_scheduler_create(const char *name,
struct scheduler_init_params *init_params)
{
- char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN];
+ char crypto_dev_name[RTE_CRYPTODEV_NAME_MAX_LEN] = {0};
struct rte_cryptodev *dev;
struct scheduler_ctx *sched_ctx;
if (init_params->def_p.name[0] == '\0') {
int ret = rte_cryptodev_pmd_create_dev_name(
- init_params->def_p.name,
+ crypto_dev_name,
RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
if (ret < 0) {
CS_LOG_ERR("failed to create unique name");
return ret;
}
+ } else {
+ strncpy(crypto_dev_name, init_params->def_p.name,
+ RTE_CRYPTODEV_NAME_MAX_LEN - 1);
}
dev = rte_cryptodev_pmd_virtual_dev_init(crypto_dev_name,
--
2.7.4
next reply other threads:[~2017-01-30 11:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 11:19 Fan Zhang [this message]
2017-01-30 16:46 ` De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485775153-237825-1-git-send-email-roy.fan.zhang@intel.com \
--to=roy.fan.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=pablo.de.lara.guarch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).