From patchwork Tue Aug 27 07:07:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Saxena X-Patchwork-Id: 172250 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5396291ily; Tue, 27 Aug 2019 00:09:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbh2yr8787sIQljP/k5ijXYGcHzYCPw6EVLo8zWDr/A2gIz5YUafneDlfQmnSyGfCwyhl6 X-Received: by 2002:a50:e611:: with SMTP id y17mr22315944edm.66.1566889773050; Tue, 27 Aug 2019 00:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566889773; cv=none; d=google.com; s=arc-20160816; b=bYotvZbHv0cINDtmSSzAbHNku9LRXEP2r57v+p52CzWBgyrAUIfb4FVVBEtEXZumBQ fMgMG+U949H/Uc590b0AGLLsiWNv/TT5JkizERQg/KwugFW9j+MZE774FCIyEsOW3dl7 Hw9HpBw8c98idcl/OoJBoRHrt8Q0UwlGUqOEbyKd8RhhAyjazFqKUm0JgkHkGBY+Ft69 jATWR4E5xfnDfH5AMwX1VtQYAoNnfymvC4yWD/xIRUERBEPPM0tRe6OmxQul8XZel+Gx Se6kkLg5kFD9uGABsHIqH5QwCWweTQeqaDth1euRr8ZvJCWs76c9vt+jRA+t+pi9y6Uf wvTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=i5N3T66YhwE++Olp3QJktTEwyhXAsX/WKplpbgCNjXs=; b=b5ve+Otsvn1oxWzyVdb87IgzWnrobewq28fqTguAsuGuJzUQ5nUta9Ph+69jUE0aT/ pTpiJCEjYAqWwBQABcTrzh33KDlvXWWKuk8bszo2Ge74GzSkA3kWjAc/R08vhTsOZ8SU LB7FVi2DIrf0FvnRvn3n/d4iovcVY30N/0GHGYH47iKh0ZSJEX2ptwQ20WyHofZ7/UDb AaMujwPZuoMt1xhrW+TS1fQGSOcxREHIdJEOsHKOGEhgRXNJDpx6jeLejp+FW9Jw3BJi PXEmuTsVghIv1o3NL+P5FVVV38fI6AJMUkmt0Kikv+3quIdjxLLKoByjit2rzAoq7BGA AHDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k40si8671225edb.14.2019.08.27.00.09.32; Tue, 27 Aug 2019 00:09:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D311B1041; Tue, 27 Aug 2019 09:09:19 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 816EA1BF7C; Tue, 27 Aug 2019 09:09:15 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0C9152005BF; Tue, 27 Aug 2019 09:09:15 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 91BAE2001BC; Tue, 27 Aug 2019 09:09:12 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 7C9F1402DE; Tue, 27 Aug 2019 15:09:08 +0800 (SGT) From: Sachin Saxena To: dev@dpdk.org Cc: thomas@monjalon.net, stable@dpdk.org, Hemant Agrawal Date: Tue, 27 Aug 2019 12:37:01 +0530 Message-Id: <20190827070730.11206-2-sachin.saxena@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190827070730.11206-1-sachin.saxena@nxp.com> References: <20190827070730.11206-1-sachin.saxena@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v1 01/30] bus/dpaa: fix DPAA SEC blacklist case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal The black list of dpaa_sec devices fails. EAL: failed to parse device "dpaa:dpaa_sec-1" This patch address following issues: - bus usages dpaa-sec while the driver usage dpaa_sec - bus usages numbers from 0 to MAX_SEC - while driver probe usages sec number form max-fman_device +1 Fixes: 6e0752205bb2 ("bus/dpaa: support device blacklisting") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Reviewed-by: Sachin Saxena --- doc/guides/cryptodevs/dpaa_sec.rst | 6 +++--- drivers/bus/dpaa/dpaa_bus.c | 6 +++--- drivers/crypto/dpaa_sec/dpaa_sec.c | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/dpaa_sec.rst b/doc/guides/cryptodevs/dpaa_sec.rst index 0a2600634..3a3e30aaf 100644 --- a/doc/guides/cryptodevs/dpaa_sec.rst +++ b/doc/guides/cryptodevs/dpaa_sec.rst @@ -85,11 +85,11 @@ For blacklisting a DPAA device, following commands can be used. .. code-block:: console - -b "dpaa_bus:dpaa-secX" -- ... - e.g. "dpaa_bus:dpaa-sec0" + -b "dpaa:dpaa_sec-X" -- ... + e.g. "dpaa:dpaa_sec-1" or to disable all 4 SEC devices - -b "dpaa_sec:dpaa-sec0" -b "dpaa_sec:dpaa-sec1" -b "dpaa_sec:dpaa-sec2" -b "dpaa_sec:dpaa-sec3" + -b "dpaa:dpaa_sec-1" -b "dpaa:dpaa_sec-2" -b "dpaa:dpaa_sec-3" -b "dpaa:dpaa_sec-4" Limitations ----------- diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 07cc5c667..f7d1a5b63 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -218,7 +218,7 @@ dpaa_create_device_list(void) * allocated for dev->name/ */ memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN); - sprintf(dev->name, "dpaa-sec%d", i); + sprintf(dev->name, "dpaa_sec-%d", i+1); DPAA_BUS_LOG(INFO, "%s cryptodev added", dev->name); dev->device.name = dev->name; dev->device.devargs = dpaa_devargs_lookup(dev); @@ -397,7 +397,7 @@ rte_dpaa_bus_parse(const char *name, void *out_name) * without separator. Both need to be handled. * It is also possible that "name=fm1-mac3" is passed along. */ - DPAA_BUS_DEBUG("Parse device name (%s)\n", name); + DPAA_BUS_DEBUG("Parse device name (%s)", name); /* Check for dpaa_bus:fm1-mac3 style */ dup_name = strdup(name); @@ -428,7 +428,7 @@ rte_dpaa_bus_parse(const char *name, void *out_name) for (i = 0; i < RTE_LIBRTE_DPAA_MAX_CRYPTODEV; i++) { char sec_name[16]; - snprintf(sec_name, 16, "dpaa-sec%d", i); + snprintf(sec_name, 16, "dpaa_sec-%d", i+1); if (strcmp(sec_name, sep) == 0) { if (out_name) strcpy(out_name, sep); diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 122c80a07..1754862be 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2678,8 +2678,7 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, int retval; - snprintf(cryptodev_name, sizeof(cryptodev_name), "dpaa_sec-%d", - dpaa_dev->id.dev_id); + snprintf(cryptodev_name, sizeof(cryptodev_name), "%s", dpaa_dev->name); cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); if (cryptodev == NULL)