From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B7D8A2EFC for ; Fri, 20 Sep 2019 11:29:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3202D1F384; Fri, 20 Sep 2019 11:29:55 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20073.outbound.protection.outlook.com [40.107.2.73]) by dpdk.org (Postfix) with ESMTP id 9124F1F380 for ; Fri, 20 Sep 2019 11:29:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c5zhKBZ0mC9IK4vjfMSXrlyJEKCNthQ6CDzd86k9+TmYOhGAylGtjaVMXxd5XFmRqMyabqEUb9MRsnx7fQeqOICiQdDDCjYbJSUuFvIBUZtVp6GQUU7c18xJv+l1suGyiStvOf4gcIN8iMKGIXkn9zGbHgrSqk+rEyjYc56BLIhS9YfVRQMdhOFOdPkkLF7bg8skzI6RWcB0dFvN5pgQa0I9nhRwnajU302YdzY9PcXFyRwXbDw2Mjx6XPfJbkjGal6OQBicDEFD7pM1VoK3Yfr9TH6yLOFSP/uOAWj7pUTajyMYDQBq/d2HOEujofrNohqKAwjqpndulXC12lebNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vDPr+Y0WrEJ6zlEO5QX09+ZoEdxG4jYQI2uoqBqItRM=; b=YOFPvFpRuWBOCZcOExgiiXHOs0fpOZGgFWvbZOF7ukhXR4sfOf2at7NjjfayuOdOu6SGrC8h2BaJ0WhzRidrGP0JuUUQdQz6Qvm5y9mhlTr7GTG1cN3qj1wae58yVdMIRJO+0B0gJTjjwv73+ZhHb85DXca8+dyrfSGB+iAogXbxogSmrfbYxLCH1ybdLxAVLmUnnugBiaH/j17SsnSXUKG6oyTjZB9EexvFKLsLMqhHSuVU+hg/69HAQCq+dGlWo3OOcfNnb0OryH9CWtgD9GFpRQXC/3lraK0Jx2083YR2zKP5BDkKXw90JHcHfC04uEdtdXRQtsqR8t6P+iTa7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vDPr+Y0WrEJ6zlEO5QX09+ZoEdxG4jYQI2uoqBqItRM=; b=OdPCfpYcTk14TCSbK1mg8vBUUItr3+WhMy+ViWKRkIOJOHs1yQE4/eMhpJKE8Lkt9MeHcs9CrxyGfVTSOThHIiasUIdgTo5mZxuLvaOmv8rMK9arN7F/ATqqX8RisvuMzRUePiE5BQjQ8PT2Emr7SIlxCewi71Pu3MPWVZQwJ4k= Received: from VE1PR04MB6639.eurprd04.prod.outlook.com (10.255.118.11) by VE1PR04MB6414.eurprd04.prod.outlook.com (20.179.232.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.20; Fri, 20 Sep 2019 09:29:52 +0000 Received: from VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::c045:5df2:ba1f:c3ee]) by VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::c045:5df2:ba1f:c3ee%5]) with mapi id 15.20.2284.023; Fri, 20 Sep 2019 09:29:52 +0000 From: Akhil Goyal To: Nagadheeraj Rottela , "pablo.de.lara.guarch@intel.com" , "mattias.ronnblom@ericsson.com" CC: "dev@dpdk.org" , Srikanth Jampala Thread-Topic: [PATCH v4 03/11] crypto/nitrox: create Nitrox symmetric cryptodev Thread-Index: AQHVXAy8OelshdY0hkWYKR07JN5iAKc0cLUw Date: Fri, 20 Sep 2019 09:29:52 +0000 Message-ID: References: <4b0fc70c-768a-a474-ace4-b69513412cae@ericsson.com> <20190826124836.21187-1-rnagadheeraj@marvell.com> <20190826124836.21187-4-rnagadheeraj@marvell.com> In-Reply-To: <20190826124836.21187-4-rnagadheeraj@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-originating-ip: [92.120.1.65] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a9ade981-2268-40d7-6cb9-08d73dad1759 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600167)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR04MB6414; x-ms-traffictypediagnostic: VE1PR04MB6414: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:337; x-forefront-prvs: 0166B75B74 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(396003)(346002)(366004)(376002)(199004)(189003)(66556008)(478600001)(26005)(2906002)(71190400001)(14454004)(25786009)(74316002)(76176011)(305945005)(7736002)(99286004)(6246003)(7696005)(2201001)(6116002)(3846002)(71200400001)(102836004)(6506007)(86362001)(186003)(52536014)(2501003)(316002)(14444005)(256004)(476003)(229853002)(55016002)(8936002)(66446008)(11346002)(64756008)(4326008)(5660300002)(8676002)(81156014)(9686003)(44832011)(486006)(81166006)(446003)(66476007)(66946007)(66066001)(76116006)(6436002)(54906003)(110136005)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6414; H:VE1PR04MB6639.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ZdHTgOwX8IaT4SWVMDyaQP+qBJoTIpJ15ZZj9q3LauY6kKx0xU6aMJzgudTcQqCNqvhmPa7M/Kd0wR/Ss8AER+9Dj0VYQbGTvfT/FBqOkFfrIzL0ZzvlCvu/I+CnYboEJ5ebrK6bpv/s5QyKiYWV3fZJ8kiIW3qjtQ9v30QmnYb3tAo9xoEFgg0wGbUQ59jDvGjjH6hzBjcVhK+ftxyl3iYYk+dnbY79eJduFfudYxDajdQHIEnZ0xOAhJCSL1qC+4GeXq0Wm6O8xfmzvokhmqeoWbJq27NrKzYghKA5KnVqQ3gHSZ1RXJreL0W4i3ep/yf344C2NeDLrlyev2jX1FlSe3VGes5j2ZLPPqxVNUWZDaUdFsOEExYwXqCyDCrasNS1J2NwN81LcfNkzQH8w2yMFEKoWFQx2r00NYBQ2Ts= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9ade981-2268-40d7-6cb9-08d73dad1759 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2019 09:29:52.4888 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XKQGvkP6/MW54y9o0py5iQFBtgZw599eykaVUsSVtL7WuV/45xhlH9L5KhhpZzH4Bs0SAnQ4v6yEynOo5I/KWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6414 Subject: Re: [dpdk-dev] [PATCH v4 03/11] crypto/nitrox: create Nitrox symmetric cryptodev 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" Hi Nagadheeraj, >=20 > Add Nitrox symmetric cryptodev with no operations. Cryptodev > operations will be added in the next set of patches. Also, registered > nitrox log type. >=20 > Signed-off-by: Nagadheeraj Rottela > --- > drivers/crypto/nitrox/Makefile | 2 + > drivers/crypto/nitrox/meson.build | 2 + > drivers/crypto/nitrox/nitrox_device.c | 9 ++++ > drivers/crypto/nitrox/nitrox_device.h | 6 +++ > drivers/crypto/nitrox/nitrox_logs.c | 14 ++++++ > drivers/crypto/nitrox/nitrox_logs.h | 16 +++++++ > drivers/crypto/nitrox/nitrox_sym.c | 83 > +++++++++++++++++++++++++++++++++++ > drivers/crypto/nitrox/nitrox_sym.h | 13 ++++++ > 8 files changed, 145 insertions(+) > create mode 100644 drivers/crypto/nitrox/nitrox_logs.c > create mode 100644 drivers/crypto/nitrox/nitrox_logs.h > create mode 100644 drivers/crypto/nitrox/nitrox_sym.c > create mode 100644 drivers/crypto/nitrox/nitrox_sym.h >=20 > diff --git a/drivers/crypto/nitrox/Makefile b/drivers/crypto/nitrox/Makef= ile > index bc0220964..06c96ccd7 100644 > --- a/drivers/crypto/nitrox/Makefile > +++ b/drivers/crypto/nitrox/Makefile > @@ -25,5 +25,7 @@ LDLIBS +=3D -lrte_cryptodev > # library source files > SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_device.c > SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_hal.c > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_logs.c > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_NITROX) +=3D nitrox_sym.c >=20 > include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/drivers/crypto/nitrox/meson.build > b/drivers/crypto/nitrox/meson.build > index f1c96b84d..1277cf58e 100644 > --- a/drivers/crypto/nitrox/meson.build > +++ b/drivers/crypto/nitrox/meson.build > @@ -11,4 +11,6 @@ allow_experimental_apis =3D true > sources =3D files( > 'nitrox_device.c', > 'nitrox_hal.c', > + 'nitrox_logs.c', > + 'nitrox_sym.c', > ) > diff --git a/drivers/crypto/nitrox/nitrox_device.c > b/drivers/crypto/nitrox/nitrox_device.c > index 5628c6d8b..ec2aae588 100644 > --- a/drivers/crypto/nitrox/nitrox_device.c > +++ b/drivers/crypto/nitrox/nitrox_device.c > @@ -6,6 +6,7 @@ >=20 > #include "nitrox_device.h" > #include "nitrox_hal.h" > +#include "nitrox_sym.h" >=20 > TAILQ_HEAD(ndev_list, nitrox_device); > static struct ndev_list ndev_list =3D TAILQ_HEAD_INITIALIZER(ndev_list); > @@ -63,6 +64,7 @@ nitrox_pci_probe(struct rte_pci_driver *pci_drv > __rte_unused, > struct rte_pci_device *pdev) > { > struct nitrox_device *ndev; > + int err; >=20 > /* Nitrox CSR space */ > if (!pdev->mem_resource[0].addr) > @@ -73,6 +75,12 @@ nitrox_pci_probe(struct rte_pci_driver *pci_drv > __rte_unused, > return -ENOMEM; >=20 > ndev_init(ndev, pdev); > + err =3D nitrox_sym_pmd_create(ndev); > + if (err) { > + ndev_release(ndev); > + return err; > + } > + > return 0; > } >=20 > @@ -85,6 +93,7 @@ nitrox_pci_remove(struct rte_pci_device *pdev) > if (!ndev) > return -ENODEV; >=20 > + nitrox_sym_pmd_destroy(ndev); Return values not checked. Return type of nitrox_sym_pmd_destroy is not voi= d. > ndev_release(ndev); > return 0; > } > diff --git a/drivers/crypto/nitrox/nitrox_device.h > b/drivers/crypto/nitrox/nitrox_device.h > index 0d0167de2..82ba8b4e4 100644 > --- a/drivers/crypto/nitrox/nitrox_device.h > +++ b/drivers/crypto/nitrox/nitrox_device.h > @@ -8,10 +8,16 @@ > #include > #include >=20 > +#define NITROX_DEV_NAME_MAX_LEN RTE_CRYPTODEV_NAME_MAX_LEN Why do you need a wrapper over RTE_CRYPTODEV_NAME_MAX_LEN > + > +struct nitrox_sym_device; > + > struct nitrox_device { > TAILQ_ENTRY(nitrox_device) next; > struct rte_pci_device *pdev; > uint8_t *bar_addr; > + struct nitrox_sym_device *sym_dev; > + struct rte_device rte_sym_dev; > uint16_t nr_queues; > }; >=20 > diff --git a/drivers/crypto/nitrox/nitrox_logs.c > b/drivers/crypto/nitrox/nitrox_logs.c > new file mode 100644 > index 000000000..007056cb4 > --- /dev/null > +++ b/drivers/crypto/nitrox/nitrox_logs.c > @@ -0,0 +1,14 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2019 Marvell International Ltd. > + */ > + > +#include > + > +int nitrox_logtype; > + > +RTE_INIT(nitrox_init_log) > +{ > + nitrox_logtype =3D rte_log_register("pmd.crypto.nitrox"); > + if (nitrox_logtype >=3D 0) > + rte_log_set_level(nitrox_logtype, RTE_LOG_NOTICE); > +} Logs can be squashed in your first patch. Let this patch be specifically to initialize/create the Nitrox symmetric cr= yptodev > diff --git a/drivers/crypto/nitrox/nitrox_logs.h > b/drivers/crypto/nitrox/nitrox_logs.h > new file mode 100644 > index 000000000..06fd21a95 > --- /dev/null > +++ b/drivers/crypto/nitrox/nitrox_logs.h > @@ -0,0 +1,16 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2019 Marvell International Ltd. > + */ > + > +#ifndef _NITROX_LOGS_H_ > +#define _NITROX_LOGS_H_ > + > +#define LOG_PREFIX "NITROX: " > + > +extern int nitrox_logtype; > + > +#define NITROX_LOG(level, fmt, args...) > \ > + rte_log(RTE_LOG_ ## level, nitrox_logtype, \ > + LOG_PREFIX "%s:%d " fmt, __func__, __LINE__, ## args) > + > +#endif /* _NITROX_LOGS_H_ */ > diff --git a/drivers/crypto/nitrox/nitrox_sym.c > b/drivers/crypto/nitrox/nitrox_sym.c > new file mode 100644 > index 000000000..c72016dd0 > --- /dev/null > +++ b/drivers/crypto/nitrox/nitrox_sym.c > @@ -0,0 +1,83 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2019 Marvell International Ltd. > + */ > + > +#include > + > +#include > +#include > + > +#include "nitrox_sym.h" > +#include "nitrox_device.h" > +#include "nitrox_logs.h" > + > +#define CRYPTODEV_NAME_NITROX_PMD crypto_nitrox In your previous patch, I could see that crypto_nitrox was used without the= macro while doing malloc. > + > +struct nitrox_sym_device { > + struct rte_cryptodev *cdev; > + struct nitrox_device *ndev; > +}; > + > +uint8_t nitrox_sym_drv_id; > +static const char nitrox_sym_drv_name[] =3D > RTE_STR(CRYPTODEV_NAME_NITROX_PMD); > +static const struct rte_driver nitrox_rte_sym_drv =3D { > + .name =3D nitrox_sym_drv_name, > + .alias =3D nitrox_sym_drv_name > +}; > + > +int > +nitrox_sym_pmd_create(struct nitrox_device *ndev) > +{ > + char name[NITROX_DEV_NAME_MAX_LEN]; > + struct rte_cryptodev_pmd_init_params init_params =3D { > + .name =3D "", > + .socket_id =3D ndev->pdev->device.numa_node, > + .private_data_size =3D sizeof(struct nitrox_sym_device) > + }; > + struct rte_cryptodev *cdev; > + > + rte_pci_device_name(&ndev->pdev->addr, name, sizeof(name)); > + snprintf(name + strlen(name), NITROX_DEV_NAME_MAX_LEN, > "_n5sym"); > + ndev->rte_sym_dev.driver =3D &nitrox_rte_sym_drv; > + ndev->rte_sym_dev.numa_node =3D ndev->pdev->device.numa_node; > + ndev->rte_sym_dev.devargs =3D NULL; > + cdev =3D rte_cryptodev_pmd_create(name, &ndev->rte_sym_dev, > + &init_params); > + if (!cdev) { > + NITROX_LOG(ERR, "Cryptodev '%s' creation failed\n", name); > + return -ENODEV; > + } > + > + ndev->rte_sym_dev.name =3D cdev->data->name; > + cdev->driver_id =3D nitrox_sym_drv_id; > + cdev->dev_ops =3D NULL; > + cdev->enqueue_burst =3D NULL; > + cdev->dequeue_burst =3D NULL; > + cdev->feature_flags =3D RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | > + RTE_CRYPTODEV_FF_HW_ACCELERATED | > + RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | > + RTE_CRYPTODEV_FF_IN_PLACE_SGL | > + RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | > + RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | > + RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT | > + RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT; Do you support all these features in this patchset? I believe these should be added where they are supported along with the fea= tures.ini changes. Regards, Akhil