From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0074.outbound.protection.outlook.com [104.47.37.74]) by dpdk.org (Postfix) with ESMTP id 4BB002B9A for ; Mon, 17 Sep 2018 06:40:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oBWJI1gCi1jpza5gXTYwxzPsZdp8bIuzJxQucXjWkuI=; b=bqwplJCYmLUoDejTLivp1ZtISH67TgYLfiUha5NbcuPBY7m3MDs+3wOFfuvTWATHD4tdIkPdHSC4HNrK3X1E/ZehG9BTHrHcIWZdQTzEuw0YrT6l8hjUlEgsv/GKHPn6axRV7cqV+GSb+ljgDzj6mfPG8zS0PYo6tavJIlvHBrA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from [10.88.100.222] (115.113.156.2) by SN6PR07MB4911.namprd07.prod.outlook.com (2603:10b6:805:3c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Mon, 17 Sep 2018 04:39:57 +0000 To: Akhil Goyal , Anoob Joseph , Pablo de Lara , Thomas Monjalon Cc: Ankur Dwivedi , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj References: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> <1536033560-21541-4-git-send-email-ajoseph@caviumnetworks.com> From: "Joseph, Anoob" Message-ID: <5d7c6f9e-5865-a356-e1c2-5a85908055a0@caviumnetworks.com> Date: Mon, 17 Sep 2018 10:10:49 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: MAXPR0101CA0021.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:c::31) To SN6PR07MB4911.namprd07.prod.outlook.com (2603:10b6:805:3c::29) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8b3ad586-5512-41d7-306b-08d61c57a188 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4911; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 3:7PwPb8xE1ztTDN2oBHEsygHVtiRKwjNrSfWJHL8At2oY2f2YoW7bVhfF42DavIGh1OjdugOSdB0yNhsZ8CGjyuWAMLNoeM0FpRajmrLkeaooJHcOUD+D6JCYV3PmONEosoTzZPzn+vV9i23cPJlS9G5d7LM+6xvcZRgijJwUytjmFQlr06oyUCBLuRAdlZBKcs+9HHIGc1WzPwl+2cmtQHRtvVVbyC12YSyJOGvT2X7asAfzyIqDJ/xoRKvi0qMP; 25:G9k3FO1S/slg0H1pCOJ1y8S/PtMFNGDJhXji33Y2uvEMpjFHh4z9TJly+ll1xSlFx/PIzEZFx1RnN/9iOFj++exL7vxc+FTJ1X7LALk+2axYpePn9kgMFsl3MBwatd0Ab2w7zGwenF20EZUT96jvAufxX5L8lA4CVfHcA/DjQqPgzmzr6vWljKT9ZXBDKV3jdtqJMmhWRM87nqq3BuZmZ7MyIQm5pETfZQrDBve/6IqHba4oBnLsXmWka/1YZdMdSx9C9l1UuAK3odJR5IVAXRmUp7BKRwf1BUAjEr4IYe2YYq4OTudEWFFZb6P7vGt5Rgv6++3QxrQBZ4Rv3esEyQ==; 31:eEoI9XyQJoMzFpuy9vf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wbwzllI5SH3IGTyriLa4zSbTjetxUVoBRlfNY53zxxRvqGmcehbYOUWKDdHASFCJke6kWzXKmR3Ksmdp3XvgnHKcMWfTYTW3DMNvrdh3x0LttoKu6tA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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)(10201501046)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:SN6PR07MB4911; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4911; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(346002)(396003)(136003)(366004)(39860400002)(376002)(199004)(189003)(956004)(11346002)(53546011)(2616005)(229853002)(476003)(6486002)(2870700001)(105586002)(3260700006)(25786009)(305945005)(106356001)(64126003)(7736002)(446003)(53936002)(31696002)(3846002)(486006)(2906002)(6116002)(68736007)(386003)(93886005)(8936002)(72206003)(42882007)(478600001)(36756003)(81156014)(81166006)(52116002)(76176011)(2486003)(52146003)(23676004)(316002)(5660300001)(16526019)(16576012)(58126008)(54906003)(110136005)(31686004)(67846002)(65826007)(26005)(77096007)(107886003)(97736004)(47776003)(6666003)(4326008)(8676002)(6246003)(50466002)(5024004)(14444005)(65806001)(66066001)(65956001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4911; H:[10.88.100.222]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjZQUjA3TUI0OTExOzIzOm1ZalduQ3lVNUhxT1RHckNna1MwVUgzVjhy?= =?utf-8?B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ByObS08wuEiP0qpx5ALdbisbECcLsrezcm7frsEI6BaZcPoGG2EdfSO+dHbfcdDwbxj/PngbYRs4WalP7jP+WqzMA204horCojTKWSiC7CTw0sXOZQewjBs0b+NDijMDt++6u8NNG+dmmK9UQ==; 5:ZsVCkAywcLnVTJ6KYP9moG3PPsd5/fyZKhW6UZuiSQpxhg2U5QoaTgIiuP8Ld68+NZ7rLXK0iV6Rz3w1wV3Pugqvf5PXilJIywuv8JubSLQDeUdx2p/uE6kd+dAK0eZdc8lTMpUYhyHvyMXeYwBIFRvxRuU+GE8NGP8LUiL8rKg=; 7:kMsyA2hqi8cmDKjhcaNLOYUzNpjj/DotC9XMWq9L+6V+6ayoLT8iVwwv7Fg4d4e9JmTF61abh9tiHQasTH/PXO5SaelnFFVJplCQMekzRK347lTp0kPTmhVnZrQipvfDWIVtfDAFAPw6N42UeOmKGt/9MWgBhAryNkV172ioI/XsJGSRH7JRWo75/ewom/nVEUkzsTc4K+0RMKXi2Xx418uh3x5IjHg4Abq62X7B3YkzFE6XW9coaOSSqkLV0Jdn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 04:39:57.7995 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b3ad586-5512-41d7-306b-08d61c57a188 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4911 Subject: Re: [dpdk-dev] [PATCH v2 03/33] crypto/octeontx: add PCI probe and remove 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: Mon, 17 Sep 2018 04:40:04 -0000 Hi Akhil, See inline. Thanks, Anoob On 14-09-2018 18:09, Akhil Goyal wrote: > External Email > > On 9/4/2018 9:28 AM, Anoob Joseph wrote: >> From: Ankur Dwivedi >> >> Adding basic PCI probe/remove functions for OcteonTX crypto device. >> Initialization function for logging is also added. >> >> Signed-off-by: Ankur Dwivedi >> Signed-off-by: Anoob Joseph >> Signed-off-by: Murthy NSSR >> Signed-off-by: Nithin Dabilpuram >> Signed-off-by: Ragothaman Jayaraman >> Signed-off-by: Srisivasubramanian S >> Signed-off-by: Tejasree Kondoj >> --- >>   drivers/crypto/octeontx/Makefile            |   5 ++ >>   drivers/crypto/octeontx/meson.build         |   4 +- >>   drivers/crypto/octeontx/otx_cryptodev.c     | 132 >> ++++++++++++++++++++++++++++ >>   drivers/crypto/octeontx/otx_cryptodev.h     |  20 +++++ >>   drivers/crypto/octeontx/otx_cryptodev_ops.c |  15 ++++ >>   drivers/crypto/octeontx/otx_cryptodev_ops.h |  11 +++ >>   6 files changed, 186 insertions(+), 1 deletion(-) >>   create mode 100644 drivers/crypto/octeontx/otx_cryptodev.c >>   create mode 100644 drivers/crypto/octeontx/otx_cryptodev.h >>   create mode 100644 drivers/crypto/octeontx/otx_cryptodev_ops.c >>   create mode 100644 drivers/crypto/octeontx/otx_cryptodev_ops.h >> >> diff --git a/drivers/crypto/octeontx/Makefile >> b/drivers/crypto/octeontx/Makefile >> index 65bd02f..12fec75 100644 >> --- a/drivers/crypto/octeontx/Makefile >> +++ b/drivers/crypto/octeontx/Makefile >> @@ -20,6 +20,11 @@ LDLIBS += -lrte_pci -lrte_bus_pci >>   VPATH += $(RTE_SDK)/drivers/crypto/octeontx >> >>   CFLAGS += -O3 -DCPT_MODEL=CRYPTO_OCTEONTX >> +CFLAGS += -I$(RTE_SDK)/drivers/common/cpt >> + >> +# PMD code >> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += otx_cryptodev.c >> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO) += otx_cryptodev_ops.c >> >>   # export include files >>   SYMLINK-y-include += >> diff --git a/drivers/crypto/octeontx/meson.build >> b/drivers/crypto/octeontx/meson.build >> index 261bb77..6564090 100644 >> --- a/drivers/crypto/octeontx/meson.build >> +++ b/drivers/crypto/octeontx/meson.build >> @@ -7,6 +7,8 @@ endif >>   deps += ['bus_pci'] >>   name = 'octeontx_crypto' >> >> -sources = files() >> +sources = files('otx_cryptodev.c', >> +             'otx_cryptodev_ops.c') >> >>   cflags += '-DCPT_MODEL=CRYPTO_OCTEONTX' >> +includes += include_directories('../../common/cpt') >> diff --git a/drivers/crypto/octeontx/otx_cryptodev.c >> b/drivers/crypto/octeontx/otx_cryptodev.c >> new file mode 100644 >> index 0000000..df88a84 >> --- /dev/null >> +++ b/drivers/crypto/octeontx/otx_cryptodev.c >> @@ -0,0 +1,132 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2018 Cavium, Inc >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +/* CPT common headers */ >> +#include "cpt_pmd_logs.h" >> + >> +#include "otx_cryptodev.h" >> +#include "otx_cryptodev_ops.h" >> + >> +static int otx_cryptodev_logtype; >> + >> +static struct rte_pci_id pci_id_cpt_table[] = { >> +     { >> +             RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, >> CPT_81XX_PCI_VF_DEVICE_ID), >> +     }, >> +     /* sentinel */ >> +     { >> +     .device_id = 0 > indentation Will fix it. >> +     }, >> +}; >> + >> +static void >> +otx_cpt_init_log(void) >> +{ >> +     /* Bus level logs */ >> +     otx_cryptodev_logtype = rte_log_register("pmd.crypto.octeontx"); >> +     if (otx_cryptodev_logtype >= 0) >> +             rte_log_set_level(otx_cryptodev_logtype, RTE_LOG_NOTICE); >> +} >> + >> +static void >> +otx_cpt_logtype_init(void) >> +{ >> +     cpt_logtype = otx_cryptodev_logtype; >> +} >> + >> +static int >> +otx_cpt_pci_probe(struct rte_pci_driver *pci_drv, >> +                     struct rte_pci_device *pci_dev) >> +{ >> +     struct rte_cryptodev *cryptodev; >> +     char name[RTE_CRYPTODEV_NAME_MAX_LEN]; >> +     int retval; >> + >> +     if (pci_drv == NULL) >> +             return -ENODEV; >> + >> +     rte_pci_device_name(&pci_dev->addr, name, sizeof(name)); >> + >> +     cryptodev = rte_cryptodev_pmd_allocate(name, rte_socket_id()); >> +     if (cryptodev == NULL) >> +             return -ENOMEM; >> + >> +     cryptodev->device = &pci_dev->device; >> +     cryptodev->device->driver = &pci_drv->driver; >> +     cryptodev->driver_id = otx_cryptodev_driver_id; >> + >> +     /* init user callbacks */ >> +     TAILQ_INIT(&(cryptodev->link_intr_cbs)); >> + >> +     /* init logtype used in common */ >> +     otx_cpt_logtype_init(); >> + >> +     /* Invoke PMD device initialization function */ >> +     retval = otx_cpt_dev_create(cryptodev); >> +     if (retval == 0) >> +             return 0; >> + >> +     CPT_LOG_ERR("[DRV %s]: Failed to create device " >> +                     "(vendor_id: 0x%x device_id: 0x%x", >> +                     pci_drv->driver.name, >> +                     (unsigned int) pci_dev->id.vendor_id, >> +                     (unsigned int) pci_dev->id.device_id); >> + >> +     cryptodev->attached = RTE_CRYPTODEV_DETACHED; >> + >> +     return -ENXIO; >> +} >> + >> +static int >> +otx_cpt_pci_remove(struct rte_pci_device *pci_dev) >> +{ >> +     struct rte_cryptodev *cryptodev; >> +     char name[RTE_CRYPTODEV_NAME_MAX_LEN]; >> + >> +     if (pci_dev == NULL) >> +             return -EINVAL; >> + >> +     rte_pci_device_name(&pci_dev->addr, name, sizeof(name)); >> + >> +     cryptodev = rte_cryptodev_pmd_get_named_dev(name); >> +     if (cryptodev == NULL) >> +             return -ENODEV; >> + >> +     if (pci_dev->driver == NULL) >> +             return -ENODEV; >> + >> +     /* 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->device->driver = NULL; >> +     cryptodev->data = NULL; >> + >> +     return 0; >> +} >> + >> +static struct rte_pci_driver otx_cryptodev_pmd = { >> +             .id_table = pci_id_cpt_table, >> +             .drv_flags = RTE_PCI_DRV_NEED_MAPPING, >> +             .probe = otx_cpt_pci_probe, >> +             .remove = otx_cpt_pci_remove, >> +}; > remove extra spaces/ Between otx_cryptodev_pmd, otx_cryptodev_drv & RTE_INIT(otx_cpt_init_log)? Which all ones you want removed? >> + >> +static struct cryptodev_driver otx_cryptodev_drv; >> + >> +RTE_INIT(otx_cpt_init_log); >> +RTE_PMD_REGISTER_PCI(CRYPTODEV_NAME_OCTEONTX_PMD, otx_cryptodev_pmd); >> +RTE_PMD_REGISTER_PCI_TABLE(CRYPTODEV_NAME_OCTEONTX_PMD, >> pci_id_cpt_table); >> +RTE_PMD_REGISTER_CRYPTO_DRIVER(otx_cryptodev_drv, >> otx_cryptodev_pmd.driver, >> +             otx_cryptodev_driver_id); >> diff --git a/drivers/crypto/octeontx/otx_cryptodev.h >> b/drivers/crypto/octeontx/otx_cryptodev.h >> new file mode 100644 >> index 0000000..99d3346 >> --- /dev/null >> +++ b/drivers/crypto/octeontx/otx_cryptodev.h >> @@ -0,0 +1,20 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2018 Cavium, Inc >> + */ >> + >> +#ifndef _OTX_CRYPTODEV_H_ >> +#define _OTX_CRYPTODEV_H_ >> + >> +/* Cavium OcteonTX Crypto PMD device name */ >> +#define CRYPTODEV_NAME_OCTEONTX_PMD  crypto_octeontx >> + >> +/* Device ID */ >> +#define PCI_VENDOR_ID_CAVIUM             0x177d >> +#define CPT_81XX_PCI_VF_DEVICE_ID        0xa041 >> + >> +/* >> + * Crypto device driver ID >> + */ >> +uint8_t otx_cryptodev_driver_id; >> + >> +#endif /* _OTX_CRYPTODEV_H_ */ >> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c >> b/drivers/crypto/octeontx/otx_cryptodev_ops.c >> new file mode 100644 >> index 0000000..1b5f108 >> --- /dev/null >> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c >> @@ -0,0 +1,15 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2018 Cavium, Inc >> + */ >> + >> +#include >> + >> +#include "otx_cryptodev.h" >> +#include "otx_cryptodev_ops.h" >> + >> +int >> +otx_cpt_dev_create(struct rte_cryptodev *c_dev) >> +{ >> +     RTE_SET_USED(c_dev); >> +     return 0; >> +} >> diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.h >> b/drivers/crypto/octeontx/otx_cryptodev_ops.h >> new file mode 100644 >> index 0000000..3f2d829 >> --- /dev/null >> +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.h >> @@ -0,0 +1,11 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2018 Cavium, Inc >> + */ >> + >> +#ifndef _OTX_CRYPTODEV_OPS_H_ >> +#define _OTX_CRYPTODEV_OPS_H_ >> + >> +int >> +otx_cpt_dev_create(struct rte_cryptodev *c_dev); >> + >> +#endif /* _OTX_CRYPTODEV_OPS_H_ */ >