From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0043.outbound.protection.outlook.com [104.47.33.43]) by dpdk.org (Postfix) with ESMTP id 7B08F1B7BB for ; Tue, 24 Oct 2017 13:32:33 +0200 (CEST) Received: from BN6PR03CA0087.namprd03.prod.outlook.com (2603:10b6:405:6f::25) by SN2PR03MB2368.namprd03.prod.outlook.com (2603:10b6:804:e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Tue, 24 Oct 2017 11:32:31 +0000 Received: from BL2FFO11FD056.protection.gbl (2a01:111:f400:7c09::190) by BN6PR03CA0087.outlook.office365.com (2603:10b6:405:6f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Tue, 24 Oct 2017 11:32:31 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD056.mail.protection.outlook.com (10.173.161.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.156.4 via Frontend Transport; Tue, 24 Oct 2017 11:32:30 +0000 Received: from [10.232.134.49] (B35197-11.ap.freescale.net [10.232.134.49]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v9OBWRFs022654; Tue, 24 Oct 2017 04:32:28 -0700 To: Declan Doherty , References: <20171020212113.4543-1-declan.doherty@intel.com> <20171020212113.4543-3-declan.doherty@intel.com> From: Akhil Goyal Message-ID: Date: Tue, 24 Oct 2017 17:02:26 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171020212113.4543-3-declan.doherty@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131533183511191505; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(376002)(346002)(39860400002)(2980300002)(1110001)(1109001)(3190300001)(339900001)(24454002)(199003)(189002)(68736007)(498600001)(97736004)(8936002)(189998001)(50466002)(5660300001)(64126003)(31686004)(229853002)(2906002)(65826007)(36756003)(83506002)(23676002)(85426001)(105606002)(53936002)(6246003)(33646002)(106466001)(77096006)(76176999)(316002)(104016004)(110136005)(81166006)(230700001)(81156014)(47776003)(8676002)(53546010)(53946003)(54356999)(305945005)(65806001)(356003)(31696002)(50986999)(65956001)(2950100002)(575784001)(86362001)(58126008)(2101003)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2368; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD056; 1:v7U0iqprWLC25nAy+C6I+H6FV8ubCG95FT4KyHTuJ7FSyVVdp4omNUbil/SlwpNn4TqDaGwZekft3Ii3tL0xptNtUCVNWkbt27seUBs10PLEScbMAQxKzI/Kk/CLWXsf X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 325e3012-e7e5-4917-30bc-08d51ad2e9b9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4628075)(201703131517081)(2017052603199); SRVR:SN2PR03MB2368; X-Microso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7YuZ2Nf0ZwsdLF2fzPRvnYePC5QVErSuxnVGe0EXaB5FmCSuRF7xO1EyLrQe2vzVrdhd7FBkGgFo0lMh+D89Z66HLtkynbApC+XFcV7H32mpzNNBy9zGinFKUEXsQuRBtI/Y6KzeTdusOv1b58u+RExkkhpFzlXFPeuqZ436h02PhdiCoIWp5iPJabI74cVo/kSpQT9TDaxMtSIJwbVklZC4OMYIDFHA/PYeJyUEIrMoVj/QD4Fbm7HZfKnm9Nhvox8WcGWOZifiEdnhFDbQFg2XonQmcYbvzc= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231020)(100000703101)(100105400095)(6055026)(6096035)(20161123559100)(20161123565025)(20161123556025)(20161123561025)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2368; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2368; X-Forefront-PRVS: 047001DADA X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjJQUjAzTUIyMzY4OzIzOkpHaWRJd0hVd0RPS2ZiOFdRaHpRa1gvTXR3?= =?utf-8?B?Ti9VYWFtN1A3VjViSEVsUDYvNEpuWEhBSWNrejd6T29qRDZVdWVTbXBZYkpr?= =?utf-8?B?ZUJwcnM5MnlQR1pzT1piWXBXd1V3c2YycXcvaFVSRW5ORjZUU2hWNXpTNjFj?= =?utf-8?B?M2hWU24xRmNlaDZyUkg5Q3RSZExKY0UzQ1Y1NUlLN1hvZTFaQzlFV1hsY2Vu?= =?utf-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u6qUAd8nqfxylOWDtLB43pYNTMZfoFueQ9UdK2zb1j8Oqp4wydeHLagm3lyIiWqzepzXvD1QclcDea9pyPCyNQHh3yG8A8sreUPHvpaWQcQJtKlnWmPbbPeoxC/7Tjg8wm5i7IUHxLqfo28iiiak/5EowxboeKjU+ZdaNuQLMlTo8OMXCv2/+aG7DZJzrR8osjsBEJ6LadDavDovbzuDGwNc1PmiVQzSG87PZkd4VBIg==; 5:sY4dCuJtrHztT73ymDKzBrFkB8AtcmOWMG8x9TGITDAaveNiyIOnH/yJXvbqG0UhzXxLaSdgbjo2nZID8dFYYQfR+LjViBQJUXb6ZPot2mswqAAk95Uc2Yt325zVQzw31En6/YHNcRm0U+6wzxN4Uc1QRWI2SOFZf4SgCA9lb88=; 24:uKMUWJ54aKrWxpxOBdsJfQl8gzmTOOThNu3H411vqdNTY5OqAOitFqcRenNcJcFd4BzXZ2yYyZbkwWtPYlM0vxMQVA43XrexI6ch+ZE++I0=; 7:83y/sPRgK77/QdR79NtL2zhf81LD+zeUz+yBm6cAdZ/n/CLIjn05j7tZJRwBwdrovtVIAdr7q49dtHPZT82t3UnDBCdlcrtBBwwi8/3WGP0p5jGXj4s16CyGk2pYeGQcczcXX3d+F0XopY+nbC7Lcgc8TkqwY0485knsz6y253JQme59JArwP0xK0JBhJXknZjej1sQksR0WU8kyFaexgqxHTG76Uv1gt135y67OLaQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2017 11:32:30.7603 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 325e3012-e7e5-4917-30bc-08d51ad2e9b9 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2368 Subject: Re: [dpdk-dev] [PATCH 2/3] cryptodev: break dependency on virtual device bus 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: , X-List-Received-Date: Tue, 24 Oct 2017 11:32:34 -0000 On 10/21/2017 2:51 AM, Declan Doherty wrote: > Removes any dependency of librte_cryptodev on the virtual device > infrastructure code and removes the functions which were virtual > device specific. > > Updates all virtual PMDs to remove dependencies on rte_cryptodev_vdev.h > and replaces those calls with the new bus independent functions. > > Signed-off-by: Declan Doherty > --- > drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 55 ++++-------- > drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 72 +++++++-------- > drivers/crypto/armv8/rte_armv8_pmd.c | 41 +++------ > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 11 +-- > drivers/crypto/dpaa_sec/dpaa_sec.c | 14 +-- > drivers/crypto/kasumi/rte_kasumi_pmd.c | 47 ++++------ > drivers/crypto/mrvl/rte_mrvl_pmd.c | 56 ++++-------- > drivers/crypto/null/null_crypto_pmd.c | 72 ++++++--------- > drivers/crypto/openssl/rte_openssl_pmd.c | 42 +++------ > drivers/crypto/scheduler/scheduler_pmd.c | 45 +++------- > drivers/crypto/scheduler/scheduler_pmd_ops.c | 3 +- > drivers/crypto/snow3g/rte_snow3g_pmd.c | 41 ++++----- > drivers/crypto/zuc/rte_zuc_pmd.c | 41 ++++----- > lib/librte_cryptodev/Makefile | 1 - > lib/librte_cryptodev/rte_cryptodev_pmd.c | 120 ------------------------- > lib/librte_cryptodev/rte_cryptodev_vdev.h | 100 --------------------- > lib/librte_cryptodev/rte_cryptodev_version.map | 2 - > 17 files changed, 190 insertions(+), 573 deletions(-) > delete mode 100644 lib/librte_cryptodev/rte_cryptodev_vdev.h > > diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > index 29c14e5..2dd2576 100644 > --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c > @@ -35,7 +35,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -486,22 +485,24 @@ static int aesni_gcm_remove(struct rte_vdev_device *vdev); > static int > aesni_gcm_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct aesni_gcm_private *internals; > enum aesni_gcm_vector_mode vector_mode; > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > - > /* Check CPU for support for AES instruction set */ > if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) { > GCM_LOG_ERR("AES instructions not supported by CPU"); > return -EFAULT; > } > > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > + if (dev == NULL) { > + GCM_LOG_ERR("driver %s: create failed", init_params->name); > + return -ENODEV; > + } > + > /* Check CPU for supported vector instruction set */ > if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2)) > vector_mode = RTE_AESNI_GCM_AVX2; > @@ -510,14 +511,6 @@ aesni_gcm_create(const char *name, > else > vector_mode = RTE_AESNI_GCM_SSE; > > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct aesni_gcm_private), init_params->socket_id, > - vdev); > - if (dev == NULL) { > - GCM_LOG_ERR("failed to create cryptodev vdev"); > - goto init_error; > - } > - > dev->driver_id = cryptodev_driver_id; > dev->dev_ops = rte_aesni_gcm_pmd_ops; > > @@ -552,22 +545,17 @@ aesni_gcm_create(const char *name, > internals->max_nb_sessions = init_params->max_nb_sessions; > > return 0; > - > -init_error: > - GCM_LOG_ERR("driver %s: create failed", init_params->name); > - > - aesni_gcm_remove(vdev); > - return -EFAULT; > } > > static int > aesni_gcm_probe(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct aesni_gcm_private), > rte_socket_id(), > - {0} > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > const char *name; > const char *input_args; > @@ -576,17 +564,7 @@ aesni_gcm_probe(struct rte_vdev_device *vdev) > if (name == NULL) > return -EINVAL; > input_args = rte_vdev_device_args(vdev); > - rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + rte_cryptodev_pmd_parse_input_args(&init_params, input_args); > > return aesni_gcm_create(name, vdev, &init_params); > } > @@ -594,6 +572,7 @@ aesni_gcm_probe(struct rte_vdev_device *vdev) > static int > aesni_gcm_remove(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > const char *name; > > name = rte_vdev_device_name(vdev); > @@ -603,7 +582,11 @@ aesni_gcm_remove(struct rte_vdev_device *vdev) > GCM_LOG_INFO("Closing AESNI crypto device %s on numa socket %u\n", > name, rte_socket_id()); > > - return 0; > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > + > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_vdev_driver aesni_gcm_pmd_drv = { > diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > index 49242fc..440a09f 100644 > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > @@ -36,7 +36,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -715,15 +714,23 @@ static int cryptodev_aesni_mb_remove(struct rte_vdev_device *vdev); > static int > cryptodev_aesni_mb_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct aesni_mb_private *internals; > enum aesni_mb_vector_mode vector_mode; > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > + /* Check CPU for support for AES instruction set */ > + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) { > + MB_LOG_ERR("AES instructions not supported by CPU"); > + return -EFAULT; > + } > + > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > + if (dev == NULL) { > + MB_LOG_ERR("failed to create cryptodev vdev"); > + return -ENODEV; > + } > > /* Check CPU for supported vector instruction set */ > if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F)) > @@ -735,14 +742,6 @@ cryptodev_aesni_mb_create(const char *name, > else > vector_mode = RTE_AESNI_MB_SSE; > > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct aesni_mb_private), init_params->socket_id, > - vdev); > - if (dev == NULL) { > - MB_LOG_ERR("failed to create cryptodev vdev"); > - goto init_error; > - } > - > dev->driver_id = cryptodev_driver_id; > dev->dev_ops = rte_aesni_mb_pmd_ops; > > @@ -779,41 +778,33 @@ cryptodev_aesni_mb_create(const char *name, > internals->max_nb_sessions = init_params->max_nb_sessions; > > return 0; > -init_error: > - MB_LOG_ERR("driver %s: cryptodev_aesni_create failed", > - init_params->name); > - > - cryptodev_aesni_mb_remove(vdev); > - return -EFAULT; > } > > static int > cryptodev_aesni_mb_probe(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct aesni_mb_private), > rte_socket_id(), > - "" > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > - const char *name; > - const char *input_args; > + const char *name, *args; > + int retval; > > name = rte_vdev_device_name(vdev); > if (name == NULL) > return -EINVAL; > - input_args = rte_vdev_device_args(vdev); > - rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + > + args = rte_vdev_device_args(vdev); > + > + retval = rte_cryptodev_pmd_parse_input_args(&init_params, args); > + if (retval) { > + MB_LOG_ERR("Failed to parse initialisation arguments[%s]\n", > + args); > + return -EINVAL; > + } > > return cryptodev_aesni_mb_create(name, vdev, &init_params); > } > @@ -821,6 +812,7 @@ cryptodev_aesni_mb_probe(struct rte_vdev_device *vdev) > static int > cryptodev_aesni_mb_remove(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > const char *name; > > name = rte_vdev_device_name(vdev); > @@ -830,7 +822,11 @@ cryptodev_aesni_mb_remove(struct rte_vdev_device *vdev) > RTE_LOG(INFO, PMD, "Closing AESNI crypto device %s on numa socket %u\n", > name, rte_socket_id()); > > - return 0; > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > + > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_vdev_driver cryptodev_aesni_mb_pmd_drv = { > diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c > index dbe6bee..2d2f3ff 100644 > --- a/drivers/crypto/armv8/rte_armv8_pmd.c > +++ b/drivers/crypto/armv8/rte_armv8_pmd.c > @@ -36,7 +36,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -759,7 +758,7 @@ armv8_crypto_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, > static int > cryptodev_armv8_crypto_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct armv8_crypto_private *internals; > @@ -786,14 +785,7 @@ cryptodev_armv8_crypto_create(const char *name, > return -EFAULT; > } > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > - > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct armv8_crypto_private), > - init_params->socket_id, > - vdev); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > if (dev == NULL) { > ARMV8_CRYPTO_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > @@ -832,11 +824,12 @@ cryptodev_armv8_crypto_create(const char *name, > static int > cryptodev_armv8_crypto_init(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct armv8_crypto_private), > rte_socket_id(), > - {0} > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > const char *name; > const char *input_args; > @@ -845,18 +838,7 @@ cryptodev_armv8_crypto_init(struct rte_vdev_device *vdev) > if (name == NULL) > return -EINVAL; > input_args = rte_vdev_device_args(vdev); > - rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') { > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - } > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + rte_cryptodev_pmd_parse_input_args(&init_params, input_args); > > return cryptodev_armv8_crypto_create(name, vdev, &init_params); > } > @@ -865,6 +847,7 @@ cryptodev_armv8_crypto_init(struct rte_vdev_device *vdev) > static int > cryptodev_armv8_crypto_uninit(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > const char *name; > > name = rte_vdev_device_name(vdev); > @@ -875,7 +858,11 @@ cryptodev_armv8_crypto_uninit(struct rte_vdev_device *vdev) > "Closing ARMv8 crypto device %s on numa socket %u\n", > name, rte_socket_id()); > > - return 0; > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > + > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_vdev_driver armv8_crypto_pmd_drv = { > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > index 0a466ba..2359ee6 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -1990,16 +1990,7 @@ cryptodev_dpaa2_sec_remove(struct rte_dpaa2_device *dpaa2_dev) > if (ret) > return ret; > > - /* free crypto device */ > - rte_cryptodev_pmd_release_device(cryptodev); > - > - if (rte_eal_process_type() == RTE_PROC_PRIMARY) > - rte_free(cryptodev->data->dev_private); > - > - cryptodev->device = NULL; > - cryptodev->data = NULL; > - > - return 0; > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_dpaa2_driver rte_dpaa2_sec_driver = { > diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c > index 53f004e..bb39b75 100644 > --- a/drivers/crypto/dpaa_sec/dpaa_sec.c > +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c > @@ -1517,19 +1517,7 @@ cryptodev_dpaa_sec_remove(struct rte_dpaa_device *dpaa_dev) > if (ret) > return ret; > > - /* free crypto device */ > - rte_cryptodev_pmd_release_device(cryptodev); > - > - if (rte_eal_process_type() == RTE_PROC_PRIMARY) > - rte_free(cryptodev->data->dev_private); > - > - PMD_INIT_LOG(INFO, "Closing dpaa crypto device %s", > - cryptodev->data->name); > - > - cryptodev->device = NULL; > - cryptodev->data = NULL; > - > - return 0; > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_dpaa_driver rte_dpaa_sec_driver = { > diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c > index 7a00bd3..03f0a86 100644 > --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c > +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c > @@ -35,7 +35,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -553,15 +552,17 @@ static int cryptodev_kasumi_remove(struct rte_vdev_device *vdev); > static int > cryptodev_kasumi_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct kasumi_private *internals; > uint64_t cpu_flags = 0; > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > + if (dev == NULL) { > + KASUMI_LOG_ERR("failed to create cryptodev vdev"); > + goto init_error; > + } > > /* Check CPU for supported vector instruction set */ > if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX)) > @@ -569,14 +570,6 @@ cryptodev_kasumi_create(const char *name, > else > cpu_flags |= RTE_CRYPTODEV_FF_CPU_SSE; > > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct kasumi_private), init_params->socket_id, > - vdev); > - if (dev == NULL) { > - KASUMI_LOG_ERR("failed to create cryptodev vdev"); > - goto init_error; > - } > - > dev->driver_id = cryptodev_driver_id; > dev->dev_ops = rte_kasumi_pmd_ops; > > @@ -605,11 +598,12 @@ cryptodev_kasumi_create(const char *name, > static int > cryptodev_kasumi_probe(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct kasumi_private), > rte_socket_id(), > - {0} > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > const char *name; > const char *input_args; > @@ -619,17 +613,7 @@ cryptodev_kasumi_probe(struct rte_vdev_device *vdev) > return -EINVAL; > input_args = rte_vdev_device_args(vdev); > > - rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + rte_cryptodev_pmd_parse_input_args(&init_params, input_args); > > return cryptodev_kasumi_create(name, vdev, &init_params); > } > @@ -637,6 +621,7 @@ cryptodev_kasumi_probe(struct rte_vdev_device *vdev) > static int > cryptodev_kasumi_remove(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > const char *name; > > name = rte_vdev_device_name(vdev); > @@ -647,7 +632,11 @@ cryptodev_kasumi_remove(struct rte_vdev_device *vdev) > " on numa socket %u\n", > name, rte_socket_id()); > > - return 0; > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > + > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_vdev_driver cryptodev_kasumi_pmd_drv = { > diff --git a/drivers/crypto/mrvl/rte_mrvl_pmd.c b/drivers/crypto/mrvl/rte_mrvl_pmd.c > index 6a9c8da..63895c5 100644 > --- a/drivers/crypto/mrvl/rte_mrvl_pmd.c > +++ b/drivers/crypto/mrvl/rte_mrvl_pmd.c > @@ -36,7 +36,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -720,26 +719,14 @@ mrvl_crypto_pmd_dequeue_burst(void *queue_pair, > static int > cryptodev_mrvl_crypto_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct mrvl_crypto_private *internals; > struct sam_init_params sam_params; > int ret; > > - if (init_params->name[0] == '\0') { > - ret = rte_cryptodev_pmd_create_dev_name( > - init_params->name, name); > - > - if (ret < 0) { > - MRVL_CRYPTO_LOG_ERR("failed to create unique name"); > - return ret; > - } > - } > - > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct mrvl_crypto_private), > - init_params->socket_id, vdev); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > if (dev == NULL) { > MRVL_CRYPTO_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > @@ -796,40 +783,28 @@ cryptodev_mrvl_crypto_create(const char *name, > static int > cryptodev_mrvl_crypto_init(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { }; > - const char *name; > - const char *input_args; > + struct rte_cryptodev_pmd_init_params init_params = { }; > + const char *name, *args; > int ret; > > name = rte_vdev_device_name(vdev); > if (name == NULL) > return -EINVAL; > - input_args = rte_vdev_device_args(vdev); > - > - if (!input_args) > - return -EINVAL; > + args = rte_vdev_device_args(vdev); > > + init_params.private_data_size = sizeof(struct mrvl_crypto_private); > init_params.max_nb_queue_pairs = sam_get_num_inst() * SAM_HW_RING_NUM; > init_params.max_nb_sessions = > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS; > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS; > init_params.socket_id = rte_socket_id(); > > - ret = rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > + ret = rte_cryptodev_pmd_parse_input_args(&init_params, args); > if (ret) { > - RTE_LOG(ERR, PMD, "Failed to parse input arguments\n"); > - return ret; > - } > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') { > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > + RTE_LOG(ERR, PMD, > + "Failed to parse initialisation arguments[%s]\n", > + args); > + return -EINVAL; > } > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > > return cryptodev_mrvl_crypto_create(name, vdev, &init_params); > } > @@ -843,6 +818,7 @@ cryptodev_mrvl_crypto_init(struct rte_vdev_device *vdev) > static int > cryptodev_mrvl_crypto_uninit(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > const char *name = rte_vdev_device_name(vdev); > > if (name == NULL) > @@ -854,7 +830,11 @@ cryptodev_mrvl_crypto_uninit(struct rte_vdev_device *vdev) > > sam_deinit(); > > - return 0; > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > + > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > /** > diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c > index d5d2bb3..4b9a58a 100644 > --- a/drivers/crypto/null/null_crypto_pmd.c > +++ b/drivers/crypto/null/null_crypto_pmd.c > @@ -33,7 +33,6 @@ > #include > #include > #include > -#include > #include > #include > > @@ -183,28 +182,19 @@ null_crypto_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, > return nb_dequeued; > } > > -static int cryptodev_null_remove(const char *name); > - > /** Create crypto device */ > static int > cryptodev_null_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct null_crypto_private *internals; > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > - > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct null_crypto_private), > - init_params->socket_id, > - vdev); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > if (dev == NULL) { > NULL_CRYPTO_LOG_ERR("failed to create cryptodev vdev"); > - goto init_error; > + return -EFAULT; > } > > dev->driver_id = cryptodev_driver_id; > @@ -224,61 +214,53 @@ cryptodev_null_create(const char *name, > internals->max_nb_sessions = init_params->max_nb_sessions; > > return 0; > - > -init_error: > - NULL_CRYPTO_LOG_ERR("driver %s: cryptodev_null_create failed", > - init_params->name); > - cryptodev_null_remove(init_params->name); > - > - return -EFAULT; > } > > /** Initialise null crypto device */ > static int > cryptodev_null_probe(struct rte_vdev_device *dev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct null_crypto_private), > rte_socket_id(), > - {0} > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > - const char *name; > + const char *name, *args; > + int retval; > > name = rte_vdev_device_name(dev); > if (name == NULL) > return -EINVAL; > > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", > - name, init_params.socket_id); > - if (init_params.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + args = rte_vdev_device_args(dev); > + > + retval = rte_cryptodev_pmd_parse_input_args(&init_params, args); > + if (retval) { > + RTE_LOG(ERR, PMD, > + "Failed to parse initialisation arguments[%s]\n", args); > + return -EINVAL; > + } > > return cryptodev_null_create(name, dev, &init_params); > } > > -/** Uninitialise null crypto device */ > static int > -cryptodev_null_remove(const char *name) > +cryptodev_null_remove_dev(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > + const char *name; > + > + name = rte_vdev_device_name(vdev); > if (name == NULL) > return -EINVAL; > > - RTE_LOG(INFO, PMD, "Closing null crypto device %s on numa socket %u\n", > - name, rte_socket_id()); > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > > - return 0; > -} > - > -static int > -cryptodev_null_remove_dev(struct rte_vdev_device *dev) > -{ > - return cryptodev_null_remove(rte_vdev_device_name(dev)); > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_vdev_driver cryptodev_null_pmd_drv = { > diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c > index 95c0236..25c1154 100644 > --- a/drivers/crypto/openssl/rte_openssl_pmd.c > +++ b/drivers/crypto/openssl/rte_openssl_pmd.c > @@ -34,7 +34,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -1668,19 +1667,12 @@ openssl_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, > static int > cryptodev_openssl_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct openssl_private *internals; > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > - > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct openssl_private), > - init_params->socket_id, > - vdev); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > if (dev == NULL) { > OPENSSL_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > @@ -1718,11 +1710,12 @@ cryptodev_openssl_create(const char *name, > static int > cryptodev_openssl_probe(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct openssl_private), > rte_socket_id(), > - {0} > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > const char *name; > const char *input_args; > @@ -1732,17 +1725,7 @@ cryptodev_openssl_probe(struct rte_vdev_device *vdev) > return -EINVAL; > input_args = rte_vdev_device_args(vdev); > > - rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + rte_cryptodev_pmd_parse_input_args(&init_params, input_args); > > return cryptodev_openssl_create(name, vdev, &init_params); > } > @@ -1751,17 +1734,18 @@ cryptodev_openssl_probe(struct rte_vdev_device *vdev) > static int > cryptodev_openssl_remove(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > const char *name; > > name = rte_vdev_device_name(vdev); > if (name == NULL) > return -EINVAL; > > - RTE_LOG(INFO, PMD, > - "Closing OPENSSL crypto device %s on numa socket %u\n", > - name, rte_socket_id()); > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > > - return 0; > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_vdev_driver cryptodev_openssl_pmd_drv = { > diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c > index 3170f7f..40ab304 100644 > --- a/drivers/crypto/scheduler/scheduler_pmd.c > +++ b/drivers/crypto/scheduler/scheduler_pmd.c > @@ -33,7 +33,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -45,7 +44,7 @@ > uint8_t cryptodev_driver_id; > > struct scheduler_init_params { > - struct rte_crypto_vdev_init_params def_p; > + struct rte_cryptodev_pmd_init_params def_p; > uint32_t nb_slaves; > enum rte_cryptodev_scheduler_mode mode; > uint32_t enable_ordering; > @@ -107,21 +106,18 @@ cryptodev_scheduler_create(const char *name, > uint32_t i; > int ret; > > - if (init_params->def_p.name[0] == '\0') > - snprintf(init_params->def_p.name, > - sizeof(init_params->def_p.name), > - "%s", name); > - > - dev = rte_cryptodev_vdev_pmd_init(init_params->def_p.name, > - sizeof(struct scheduler_ctx), > - init_params->def_p.socket_id, > - vdev); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, > + &init_params->def_p); > if (dev == NULL) { > CS_LOG_ERR("driver %s: failed to create cryptodev vdev", > name); > return -EFAULT; > } > > + if (init_params->wcmask != 0) > + RTE_LOG(INFO, PMD, " workers core mask = %"PRIx64"\n", > + init_params->wcmask); > + > dev->driver_id = cryptodev_driver_id; > dev->dev_ops = rte_crypto_scheduler_pmd_ops; > > @@ -240,10 +236,7 @@ cryptodev_scheduler_remove(struct rte_vdev_device *vdev) > sched_ctx->slaves[i].dev_id); > } > > - RTE_LOG(INFO, PMD, "Closing Crypto Scheduler device %s on numa " > - "socket %u\n", name, rte_socket_id()); > - > - return 0; > + return rte_cryptodev_pmd_destroy(dev); > } > > /** Parse integer from integer argument */ > @@ -304,7 +297,7 @@ static int > parse_name_arg(const char *key __rte_unused, > const char *value, void *extra_args) > { > - struct rte_crypto_vdev_init_params *params = extra_args; > + struct rte_cryptodev_pmd_init_params *params = extra_args; > > if (strlen(value) >= RTE_CRYPTODEV_NAME_MAX_LEN - 1) { > CS_LOG_ERR("Invalid name %s, should be less than " > @@ -462,10 +455,11 @@ cryptodev_scheduler_probe(struct rte_vdev_device *vdev) > { > struct scheduler_init_params init_params = { > .def_p = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + "", > + sizeof(struct scheduler_ctx), > rte_socket_id(), > - "" > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }, > .nb_slaves = 0, > .mode = CDEV_SCHED_MODE_NOT_SET, > @@ -481,19 +475,6 @@ cryptodev_scheduler_probe(struct rte_vdev_device *vdev) > scheduler_parse_init_params(&init_params, > rte_vdev_device_args(vdev)); > > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", > - name, > - init_params.def_p.socket_id); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.def_p.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.def_p.max_nb_sessions); > - if (init_params.def_p.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.def_p.name); > - if (init_params.wcmask != 0) > - RTE_LOG(INFO, PMD, " workers core mask = %"PRIx64"\n", > - init_params.wcmask); > > return cryptodev_scheduler_create(name, > vdev, > diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c > index d379534..fef686f 100644 > --- a/drivers/crypto/scheduler/scheduler_pmd_ops.c > +++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c > @@ -37,7 +37,6 @@ > #include > #include > #include > -#include > #include > > #include "scheduler_pmd_private.h" > @@ -347,7 +346,7 @@ scheduler_pmd_info_get(struct rte_cryptodev *dev, > { > struct scheduler_ctx *sched_ctx = dev->data->dev_private; > uint32_t max_nb_sessions = sched_ctx->nb_slaves ? > - UINT32_MAX : RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS; > + UINT32_MAX : RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS; > uint32_t i; > > if (!dev_info) > diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c > index 8e1d1ec..7cd6114 100644 > --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c > +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c > @@ -35,7 +35,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -559,19 +558,13 @@ static int cryptodev_snow3g_remove(struct rte_vdev_device *vdev); > static int > cryptodev_snow3g_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct snow3g_private *internals; > uint64_t cpu_flags = RTE_CRYPTODEV_FF_CPU_SSE; > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > - > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct snow3g_private), init_params->socket_id, > - vdev); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > if (dev == NULL) { > SNOW3G_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > @@ -605,11 +598,12 @@ cryptodev_snow3g_create(const char *name, > static int > cryptodev_snow3g_probe(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct snow3g_private), > rte_socket_id(), > - {0} > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > const char *name; > const char *input_args; > @@ -619,17 +613,7 @@ cryptodev_snow3g_probe(struct rte_vdev_device *vdev) > return -EINVAL; > input_args = rte_vdev_device_args(vdev); > > - rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + rte_cryptodev_pmd_parse_input_args(&init_params, input_args); > > return cryptodev_snow3g_create(name, vdev, &init_params); > } > @@ -637,17 +621,22 @@ cryptodev_snow3g_probe(struct rte_vdev_device *vdev) > static int > cryptodev_snow3g_remove(struct rte_vdev_device *vdev) > { > + struct rte_cryptodev *cryptodev; > const char *name; > > name = rte_vdev_device_name(vdev); > if (name == NULL) > return -EINVAL; > > - RTE_LOG(INFO, PMD, "Closing SNOW 3G crypto device %s" > + RTE_LOG(INFO, PMD, "Closing KASUMI crypto device %s" > " on numa socket %u\n", > name, rte_socket_id()); > > - return 0; > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > + > + return rte_cryptodev_pmd_destroy(cryptodev); > } > > static struct rte_vdev_driver cryptodev_snow3g_pmd_drv = { > diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c > index f1f9291..fb894f1 100644 > --- a/drivers/crypto/zuc/rte_zuc_pmd.c > +++ b/drivers/crypto/zuc/rte_zuc_pmd.c > @@ -35,7 +35,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -463,19 +462,14 @@ static int cryptodev_zuc_remove(struct rte_vdev_device *vdev); > static int > cryptodev_zuc_create(const char *name, > struct rte_vdev_device *vdev, > - struct rte_crypto_vdev_init_params *init_params) > + struct rte_cryptodev_pmd_init_params *init_params) > { > struct rte_cryptodev *dev; > struct zuc_private *internals; > uint64_t cpu_flags = RTE_CRYPTODEV_FF_CPU_SSE; > > - if (init_params->name[0] == '\0') > - snprintf(init_params->name, sizeof(init_params->name), > - "%s", name); > > - dev = rte_cryptodev_vdev_pmd_init(init_params->name, > - sizeof(struct zuc_private), init_params->socket_id, > - vdev); > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > if (dev == NULL) { > ZUC_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > @@ -509,11 +503,12 @@ cryptodev_zuc_create(const char *name, > static int > cryptodev_zuc_probe(struct rte_vdev_device *vdev) > { > - struct rte_crypto_vdev_init_params init_params = { > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS, > - RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS, > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + sizeof(struct zuc_private), > rte_socket_id(), > - {0} > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS, > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS > }; > const char *name; > const char *input_args; > @@ -523,17 +518,7 @@ cryptodev_zuc_probe(struct rte_vdev_device *vdev) > return -EINVAL; > input_args = rte_vdev_device_args(vdev); > > - rte_cryptodev_vdev_parse_init_params(&init_params, input_args); > - > - RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name, > - init_params.socket_id); > - if (init_params.name[0] != '\0') > - RTE_LOG(INFO, PMD, " User defined name = %s\n", > - init_params.name); > - RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n", > - init_params.max_nb_queue_pairs); > - RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > - init_params.max_nb_sessions); > + rte_cryptodev_pmd_parse_input_args(&init_params, input_args); > > return cryptodev_zuc_create(name, vdev, &init_params); > } > @@ -541,17 +526,23 @@ cryptodev_zuc_probe(struct rte_vdev_device *vdev) > static int > cryptodev_zuc_remove(struct rte_vdev_device *vdev) > { > + > + struct rte_cryptodev *cryptodev; > const char *name; > > name = rte_vdev_device_name(vdev); > if (name == NULL) > return -EINVAL; > > - RTE_LOG(INFO, PMD, "Closing ZUC crypto device %s" > + RTE_LOG(INFO, PMD, "Closing KASUMI crypto device %s" > " on numa socket %u\n", > name, rte_socket_id()); > TYPO..The log message is not correct in multiple files.