From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70040.outbound.protection.outlook.com [40.107.7.40]) by dpdk.org (Postfix) with ESMTP id 991205323 for ; Fri, 14 Sep 2018 14:40:12 +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=QbrDgAV5Qkdjel2zoboBy7D88+qjCN99wnfFYW6cdik=; b=OKerzMDnbABVFkikLqUM8NuzlUkaxGtxGGRBqDgZgI1Hi6ajloNTBuoJ44+IRQ6WbAefUThwD9XlDWxMW7cLk5WjkJ3QOPaPMwTfMigEmjXJrbZ1xqQsJy7SUXhpHWHfQCCCLBXAhiaC0gBmJlUUkMhZxnZIOxEz2Wrg8W4QgUw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from [10.232.134.144] (14.143.30.134) by DB7PR04MB4892.eurprd04.prod.outlook.com (2603:10a6:10:18::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 14 Sep 2018 12:40:08 +0000 To: Anoob Joseph , Pablo de Lara , Thomas Monjalon Cc: Ankur Dwivedi , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Anoob Joseph , 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: Akhil Goyal Message-ID: Date: Fri, 14 Sep 2018 18:09:54 +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: <1536033560-21541-4-git-send-email-ajoseph@caviumnetworks.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: BM1PR01CA0108.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::24) To DB7PR04MB4892.eurprd04.prod.outlook.com (2603:10a6:10:18::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b2cf9c2-27dc-4ab3-6057-08d61a3f361e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4892; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4892; 3:3+xt8b3q+oIQ74X0beDrELyatRUPdimoynxF4vC68MgIRpYCB8hh9M/xyQ5QeCPpef75NEu5pppc6JdDHAooHO2eInASZhuBlMRxJfBZyE/AsCLgzsh+5oNCddv+BEOSU9w3XEf02vqUo9aYcMav7yWTqUoXFnuzpLZIYMKygPgCB+KgmFM4/p3wjYaiX2dNTZoP6FiBZPwEsKH9TMvWEjC7Q6+a44i2NDX2uJFzPQmrOnHDfZPDd7hE8ukf7Py1; 25:6RY8EWoreZWJ+mpnip9jJr3tshLgj9tCLSiGmW/eHNROkLl9SkL5nxe7/ocKI7rz72EB25jN2ET23h4lVHkaOXLf9CsyAgC6SILEh6lVr/vgpjGcdQhSlG7inoNVU0mohUQ0ptPq0USJHvs5sDxRExoPnHh3eNPC4h8qJbeJ2lDwPoLDGwbUSUJ2hVR/IGu+3D8lPYsPqkdRrU8yd0+HPOEDaO4f9RFzoctt05LtALvdMt6vhR3wxUxlOC8c0bEjcuwTtqSRiFQVcddp+TFnkyLVuQF7NIM/flEVOTJGEJgwDbFSxqxlTLT2cCJV1aRzlw7BjdAfBBUibae1y83HZA==; 31:Ty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ypvqJYGMhSpWGCveE+fVxhCJg== 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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699050); SRVR:DB7PR04MB4892; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4892; X-Forefront-PRVS: 07954CC105 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(346002)(376002)(136003)(366004)(396003)(39860400002)(199004)(189003)(110136005)(6116002)(36756003)(105586002)(3260700006)(65956001)(486006)(2906002)(77096007)(446003)(26005)(229853002)(316002)(7736002)(31686004)(16576012)(47776003)(956004)(44832011)(11346002)(6246003)(25786009)(14444005)(5024004)(305945005)(66066001)(3846002)(67846002)(2616005)(8676002)(4326008)(476003)(53936002)(65806001)(54906003)(58126008)(5009440100003)(53546011)(230700001)(86362001)(6486002)(7416002)(97736004)(31696002)(186003)(16526019)(50466002)(52116002)(65826007)(386003)(81156014)(478600001)(23676004)(64126003)(106356001)(8936002)(6666003)(81166006)(2486003)(52146003)(5660300001)(68736007)(76176011)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4892; H:[10.232.134.144]; 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-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjdQUjA0TUI0ODkyOzIzOmYzMURna2dOY2xlMGVwcGhQZmVpOGRxT1ZW?= =?utf-8?B?eCs5Rm93ZnZtcWtWa01CRGsrTXFZUTNNYnRWME50YXVuVngzcmhwbG4zQjRC?= =?ut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xmWmz4FBhh48XU1yxF36CcM1mfa7nakldVJoQjOvZ56ywaIh96FOvy2hwYs6P9viEbwU7isayv7VH8J1a70WAkql0/V1xA8tZ0za4AbFys9aCgD0Jfwj++qqVFmjN8sRBqgYzD8eGEV6/+rW+Q6boHd+p9Tqo7LMr8kC7jLNJdwTZOEEo1m1DXg==; 5:6X2RQEg/NMvu690k/pngmZwycGgR/8OOIFpgPePm4G4lyLYq5IodXYPdqMBzx+nakh4ncquiTDiK/i35MdYGBQvmohH5NTE+aSDXM/nTJB+4Uhi+HOw86TfobciQcEsGpgh7AQMqxnPYukUPfPd2aMWu7KC1qDtAK0/vFHEwi98=; 7:P44NriTVtkCKfql0cqk8Yrw1NgVdy/6CvGHnAHtIQCNS/4Wjby4lRGupjNf99Z7I9e8ZlsuVYl+V9A/i0LSMMdP73VBTZTiwyduSa9BYLGOERlXmI4OMmvj5nVwF5PYfoEEHEj9EjwNv9EUWUpugupM7MY0sYb/dqb0IlKklXFY0JPsa/s/v//ENH9IHl2Gpx9cDpxjJqjjWs1S6El8lvKkZbit1Gx+upUg7BlwcHIgXlgUQBULT6i7ACm3TdF8w SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2018 12:40:08.7257 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b2cf9c2-27dc-4ab3-6057-08d61a3f361e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4892 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: Fri, 14 Sep 2018 12:40:13 -0000 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 > + }, > +}; > + > +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/ > + > +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_ */