From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0056.outbound.protection.outlook.com [104.47.1.56]) by dpdk.org (Postfix) with ESMTP id 4EF29255 for ; Tue, 18 Sep 2018 14:13:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OO7/FhwiVApf+y9tRnkVHIQTkOn/TdjJWrscLVno9cw=; b=THe8cNn8hwIiNOf5UP/n1P9Sd1Wx3blgVFn2FPW2dSuMLZxZii8k1boPZtuxSTNmbUpSGBGSqS1aYy1+8ZnR8wmStUg5VJ+87wMOksy5ntJwl5xbEVfWe1+Ajf2/fXFgI8z5tfZRpCFDdItuLBay+cmTL1fQkmLChqIY9rjgZCs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.144] (14.143.30.134) by DB7PR04MB4889.eurprd04.prod.outlook.com (2603:10a6:10:18::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Tue, 18 Sep 2018 12:13:53 +0000 To: Gagandeep Singh , dev@dpdk.org Cc: Hemant Agrawal References: <20180913060846.29930-1-g.singh@nxp.com> <20180913060846.29930-3-g.singh@nxp.com> From: Akhil Goyal Message-ID: Date: Tue, 18 Sep 2018 17:43:38 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180913060846.29930-3-g.singh@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: BM1PR01CA0100.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::16) To DB7PR04MB4889.eurprd04.prod.outlook.com (2603:10a6:10:18::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42135320-ccfb-477c-05f3-08d61d603404 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4889; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4889; 3:KDkn197ngcAbmcuPKBRvMIKA+UxKnWWQ0KLnWpnlrbcWYuKGgvcQIoBNr8Ci3uluRXkDyxDojIL4JyQrDA3XKN3+jjpw0LdrWq2AwyKc0qOvE6Cjbj+CKRL1sHlyikKN7+Zt+5KViMm2a+g5qA3ma4L9Fd7oH46dhR7d0rZyAdXlr+FFfKQA6Fu5UEua+FAR1RDko5E7OAkYh712mv0KO1jmSrBB0l6Z3woIe4QP4bGQfD8hwtMfTnAmgnR1V0lP; 25:kAOLe6DtuQnk/xg5IlzLVK9PhcP05dD5KkQygB5ThcvwjW+oMOe3+qQBWal6IQWg2QalYUI7sTK5LdXrHhNscW0twqrT67CEoj6P0lVf3jFuobqrqZbuEfbPBx2bSYVi4kGybPZxBNW9ktRKC07ADZbj8V000A/fW5ecqG+91RTsDFTdOTemA9X5FBEtR+Bh3HTZxHdItaFRoKjC/ebkh+xnJqjm3FtVjz5kkf9enD06iBmlOgIHBWBB2ZbKExMYYmwDOkPKWYfvjuqdZqRMNWxFmzt1DvMzwpnQvq6b+9B8l0j3AmZyY62+gA+UiQ8PwzZ7ARLF48SbVnDT0eXojA==; 31:+buSCzKzuvGgpMhQPLYSRwMkuM2SrlAO42qerXexivUdA6npk2vwyvtYXP95IlBXFFSMD2cm2MIYeAwBOMMxERYAhJzm9MyoGKQdwbzS2Yinwo2ceWQGIDWwenTth8uNEETJBipo0dWmQoVpyww+RzE6r9ntcn05HCGs+4uIQEw1RHxpfVdgGAbiDzHM8N/BPJShmzRTDOW/lvqVExdgOYI+0UD2Llxy/r1uAzAPJqE= X-MS-TrafficTypeDiagnostic: DB7PR04MB4889: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4889; 20:BFuabnhYHA5Bf/yzx8kZT+1senpBWpxMrjzJh2CHg2hc6gosmsZ1Lso8QLMl49MxTqR84YMvm+azOUynIGg1fL/iQ7YA2MUMDYeA3qa3lbdup9lP6SQ7zw7oBAnzdHR5Ng8d6E+cMBCDX6zeaw1Mjf8P/kLfV226GSIoRihQNfjiBVut83GAVZ9OLTk4vb8c+ldGA4c3WuFAgsNPiepbd17g379o0Ffv9hNfToahMKEHzE39jK4ggSHWCnwYo8Lu1KrdGPqYFjT392rtG9EVwIbrTedp0OFrabdky2pnB5NavJq1B4XFLNIHHxiG7AlF9PyeJWvJhpdSjlP7bmyn/QAA93JqT1c/gFatsfvwhSdvznfF3NO6Wg6FvXUlszWpKXLvEY4xzyfY4WOyLYz/BrbqUIveJJ9BBekyBqpptIfPxo/RioYGLQgVcukBHNCEgk1N1IKWIzkN1/CfyU5tMZZ5jBIK+ZpY2je40AS0C+ZJTQvo02hBNXzQEBfDN9nT; 4:RcvrknqiFeQaSg3U/npNMI9dqR3HR6FfsJAakBmiB6nJZS/+j1603nW6bhm2tf7TqIQds5iDVssDPRKXnGPsCCNWnGgLSNiwbeId9M6/zvWESOspX1Dzx5Sig/XHCjlZfc36x7gSrrtcbKB+YGVj/CHU+v04tkjP5ep672nQ9bMiwLbWpWTD7PHXb5I0GztX7nP+jIMIOrgKcOIEgN7B3F3aEqq15Z1j4K3C0TSkB2gHFyP4M5ingLfl9naBWcYhwYhfABiFFtx9xxIfky22X3iXkbme3Noa8ZlGr+GF9NZ/jrXV+BdVmB6IjH6RSWMV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:DB7PR04MB4889; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4889; X-Forefront-PRVS: 0799B1B2D7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(346002)(396003)(366004)(136003)(39860400002)(376002)(189003)(199004)(6116002)(3846002)(81156014)(81166006)(16576012)(68736007)(316002)(53936002)(6486002)(229853002)(5660300001)(6666003)(65826007)(8936002)(25786009)(36756003)(77096007)(26005)(58126008)(47776003)(3260700006)(2906002)(5009440100003)(64126003)(31696002)(16526019)(66066001)(2616005)(53546011)(956004)(386003)(11346002)(305945005)(4326008)(65806001)(2486003)(52146003)(476003)(105586002)(7736002)(86362001)(14444005)(575784001)(76176011)(8676002)(65956001)(52116002)(486006)(106356001)(230700001)(67846002)(478600001)(446003)(97736004)(23676004)(50466002)(31686004)(44832011)(6246003)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4889; H:[10.232.134.144]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjdQUjA0TUI0ODg5OzIzOmUreGVzeExLVE9uS3J5RmJqS3JZdVFnNy93?= =?utf-8?B?eWpnZlpMUzNnV0dPNjh2QVNZTTJpakdBc3d5NVF4c0RTVDJxV2t1Y1dXY2cv?= =?utf-8?B?Z0Mvd1JKbnU1ZTl2cE1EOWhIL3NWSDk4SnpwZmhrMmt1UTlUd3k1ZHo4RVJM?= =?utf-8?B?Qjg0TE1zNlNrK1hTVC9XMW5sLzZOc0pvZmVFUnlKTU8rNmwrdGFDK202bk8y?= =?utf-8?B?MkJ2UDFxNkExWUN2dV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iqDIBr/FcvvmZbdyZ6YVLx1mZg2kMRlkQIxGzME7yHJuY=; 7:NAMRhSsUuEPznr21E4VroxWqAx+y/iy2w//GwQrEx1+jGp5A3OtVEaL+IMvq/tmawE7Qx3/nN/uZhCqM7u6rHP1jcVMl8Pr9sKR9BiGrh6HRp+IJfRu8WVeH9j/OF802w8Kp19O1xHQOTqPIY7L1kI+396+sCd0FeNONr2J9voWTnSV8l5jUf1EyLD9+A3zOrxlXX3AlZ168smEHZVpdKXwOZ+HLfH6yJk7r2BDFNG1zzwxR9Dva6IyGYnGp+7St SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2018 12:13:53.7732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42135320-ccfb-477c-05f3-08d61d603404 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4889 Subject: Re: [dpdk-dev] [PATCH 02/10] crypto/caam_jr: introduce basic driver 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, 18 Sep 2018 12:13:56 -0000 Hi Gagan, On 9/13/2018 11:38 AM, Gagandeep Singh wrote: > From: Hemant Agrawal > > This patch introduces basic support for caam_jr crypto driver. > > Signed-off-by: Gagandeep Singh > Signed-off-by: Hemant Agrawal > --- > config/common_base | 8 + > config/common_linuxapp | 1 + > config/defconfig_arm64-dpaa-linuxapp-gcc | 4 + > drivers/crypto/Makefile | 1 + > drivers/crypto/caam_jr/Makefile | 40 +++++ > drivers/crypto/caam_jr/caam_jr.c | 157 ++++++++++++++++++ > drivers/crypto/caam_jr/caam_jr_log.h | 42 +++++ > drivers/crypto/caam_jr/meson.build | 11 ++ > .../caam_jr/rte_pmd_caam_jr_version.map | 4 + > drivers/crypto/meson.build | 2 +- > 10 files changed, 269 insertions(+), 1 deletion(-) > create mode 100644 drivers/crypto/caam_jr/Makefile > create mode 100644 drivers/crypto/caam_jr/caam_jr.c > create mode 100644 drivers/crypto/caam_jr/caam_jr_log.h > create mode 100644 drivers/crypto/caam_jr/meson.build > create mode 100644 drivers/crypto/caam_jr/rte_pmd_caam_jr_version.map > > diff --git a/config/common_base b/config/common_base > index 4bcbaf923..a73f063d1 100644 > --- a/config/common_base > +++ b/config/common_base > @@ -479,6 +479,14 @@ CONFIG_RTE_CRYPTO_MAX_DEVS=64 > CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO=n > CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO_DEBUG=n > > +# > +# Compile NXP CAAM JR crypto Driver > +# > +CONFIG_RTE_LIBRTE_PMD_CAAM_JR=n > +CONFIG_RTE_LIBRTE_PMD_CAAM_JR_BE=n > +CONFIG_RTE_LIBRTE_PMD_CAAM_JR_DEBUG=n Do you really need DEBUG? > +CONFIG_RTE_CAAM_JR_PMD_MAX_NB_SESSIONS=2048 MAX_NB_SESSIONS is no more used in any of the drivers. Do you have a limitation in your hardware? > + > # > # Compile NXP DPAA2 crypto sec driver for CAAM HW > # > diff --git a/config/common_linuxapp b/config/common_linuxapp > index 9c5ea9d89..c1c7c4287 100644 > --- a/config/common_linuxapp > +++ b/config/common_linuxapp > @@ -35,6 +35,7 @@ CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=y > CONFIG_RTE_LIBRTE_DPAA_PMD=y > CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=y > CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=y > +CONFIG_RTE_LIBRTE_PMD_CAAM_JR=y > > # NXP FSLMC BUS and DPAA2 drivers > CONFIG_RTE_LIBRTE_FSLMC_BUS=y > diff --git a/config/defconfig_arm64-dpaa-linuxapp-gcc b/config/defconfig_arm64-dpaa-linuxapp-gcc > index c47aec0a6..e5343f7a9 100644 > --- a/config/defconfig_arm64-dpaa-linuxapp-gcc > +++ b/config/defconfig_arm64-dpaa-linuxapp-gcc > @@ -21,3 +21,7 @@ CONFIG_RTE_PKTMBUF_HEADROOM=128 > # NXP DPAA Bus > CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER=n > CONFIG_RTE_LIBRTE_DPAA_HWDEBUG=n > + > +# NXP CAAM_JR driver > +CONFIG_RTE_LIBRTE_PMD_CAAM_JR=y > +CONFIG_RTE_LIBRTE_PMD_CAAM_JR_BE=y > diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile > index c480cbd37..e3711d703 100644 > --- a/drivers/crypto/Makefile > +++ b/drivers/crypto/Makefile > @@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk > DIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += aesni_gcm > DIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += aesni_mb > DIRS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += armv8 > +DIRS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr > DIRS-$(CONFIG_RTE_LIBRTE_PMD_CCP) += ccp > DIRS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL) += openssl > DIRS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += scheduler > diff --git a/drivers/crypto/caam_jr/Makefile b/drivers/crypto/caam_jr/Makefile > new file mode 100644 > index 000000000..46d752af7 > --- /dev/null > +++ b/drivers/crypto/caam_jr/Makefile > @@ -0,0 +1,40 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright 2017 NXP > + > +include $(RTE_SDK)/mk/rte.vars.mk > + > +# > +# library name > +# > +LIB = librte_pmd_caam_jr.a > + > +# build flags > +CFLAGS += -DALLOW_EXPERIMENTAL_API > +CFLAGS += -D _GNU_SOURCE > +ifeq ($(CONFIG_RTE_LIBRTE_CAAM_JR_DEBUG),y) > +CFLAGS += -O0 -g > +CFLAGS += "-Wno-error" > +else > +CFLAGS += -O3 > +CFLAGS += $(WERROR_FLAGS) > +endif > + > +CFLAGS += -I$(RTE_SDK)/drivers/crypto/caam_jr > +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include > +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal > + > +# versioning export map > +EXPORT_MAP := rte_pmd_caam_jr_version.map > + > +# library version > +LIBABIVER := 1 > + > +# library source files > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr.c > +# library dependencies > + > +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring > +LDLIBS += -lrte_cryptodev > +LDLIBS += -lrte_bus_vdev > + > +include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c > new file mode 100644 > index 000000000..68779cba5 > --- /dev/null > +++ b/drivers/crypto/caam_jr/caam_jr.c > @@ -0,0 +1,157 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2017-2018 NXP > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#define CRYPTODEV_NAME_CAAM_JR_PMD crypto_caam_jr > +static uint8_t cryptodev_driver_id; > +int caam_jr_logtype; > + > + > +/* > + * @brief Release the resources used by the SEC user space driver. > + * > + * Reset and release SEC's job rings indicated by the User Application at > + * init_job_ring() and free any memory allocated internally. > + * Call once during application tear down. > + * > + * @note In case there are any descriptors in-flight (descriptors received by > + * SEC driver for processing and for which no response was yet provided to UA), > + * the descriptors are discarded without any notifications to User Application. > + * > + * @retval ::0 is returned for a successful execution > + * @retval ::-1 is returned if SEC driver release is in progress > + */ > + > +static int > +caam_jr_dev_uninit(struct rte_cryptodev *dev) > +{ > + > + if (dev == NULL) > + return -ENODEV; > + > + > + CAAM_JR_INFO("Closing DPAA_SEC device %s", dev->data->name); > + > + > + return 0; > +} remove extra spacing. > + > +static int > +caam_jr_dev_init(const char *name, > + struct rte_vdev_device *vdev, > + struct rte_cryptodev_pmd_init_params *init_params) > +{ > + struct rte_cryptodev *dev; > + > + PMD_INIT_FUNC_TRACE(); > + > + dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); > + if (dev == NULL) { > + CAAM_JR_ERR("failed to create cryptodev vdev"); > + goto cleanup; > + } > + > + dev->driver_id = cryptodev_driver_id; > + dev->dev_ops = NULL; > + > + /* For secondary processes, we don't initialise any further as primary > + * has already done this work. Only check we don't need a different > + * RX function > + */ > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { > + CAAM_JR_WARN("Device already init by primary process"); > + return 0; > + } > + > + RTE_LOG(INFO, PMD, "%s cryptodev init\n", dev->data->name); > + > + return 0; > + > +cleanup: > + CAAM_JR_ERR("driver %s: cryptodev_caam_jr_create failed", > + init_params->name); > + > + return -ENXIO; > +} > + > +/** Initialise CAAM JR crypto device */ > +static int > +cryptodev_caam_jr_probe(struct rte_vdev_device *vdev) > +{ > + struct rte_cryptodev_pmd_init_params init_params = { > + "", > + 128, > + rte_socket_id(), > + RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS > + }; > + const char *name; > + const char *input_args; > + > + name = rte_vdev_device_name(vdev); > + if (name == NULL) > + return -EINVAL; > + > + input_args = rte_vdev_device_args(vdev); > + rte_cryptodev_pmd_parse_input_args(&init_params, input_args); > + > + return caam_jr_dev_init(name, vdev, &init_params); > +} > + > +/** Uninitialise CAAM JR crypto device */ > +static int > +cryptodev_caam_jr_remove(struct rte_vdev_device *vdev) > +{ > + struct rte_cryptodev *cryptodev; > + const char *name; > + > + name = rte_vdev_device_name(vdev); > + if (name == NULL) > + return -EINVAL; > + > + cryptodev = rte_cryptodev_pmd_get_named_dev(name); > + if (cryptodev == NULL) > + return -ENODEV; > + > + caam_jr_dev_uninit(cryptodev); > + > + return rte_cryptodev_pmd_destroy(cryptodev); > +} > + > +static struct rte_vdev_driver cryptodev_caam_jr_drv = { > + .probe = cryptodev_caam_jr_probe, > + .remove = cryptodev_caam_jr_remove > +}; > + > +static struct cryptodev_driver caam_jr_crypto_drv; > + > +RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_CAAM_JR_PMD, cryptodev_caam_jr_drv); > +RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CAAM_JR_PMD, > + "max_nb_queue_pairs=" > + "max_nb_sessions=" max_nb_sessions may not be needed > + "socket_id="); > +RTE_PMD_REGISTER_CRYPTO_DRIVER(caam_jr_crypto_drv, cryptodev_caam_jr_drv.driver, > + cryptodev_driver_id); > + > +RTE_INIT(caam_jr_init_log) > +{ > + caam_jr_logtype = rte_log_register("pmd.crypto.caam"); > + if (caam_jr_logtype >= 0) > + rte_log_set_level(caam_jr_logtype, RTE_LOG_NOTICE); > +}