From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03hn0224.outbound.protection.outlook.com [104.47.9.224]) by dpdk.org (Postfix) with ESMTP id BC13F1B1CE for ; Thu, 22 Feb 2018 10:35:29 +0100 (CET) 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; bh=fSLmQh5epbjMDgC8oI8tly4u6gZC/uzTD+y8gaBpRzo=; b=ZVEu3R0NtG1OTFBlT7984IbDKBo7lQRPUZidydKmUjkR183nDTBzs9xvZYJyWWKOM7KPuTaDtSKBx15eN1J+JK5IYRa/i1aYT+NGEH62OwMWabvbHIcOaUZZBXJiQ79iP5W2lZ3uo8HWKgLVsfOY3LpavwCgW5TfGaphuW5HM50= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (192.88.169.1) by HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 22 Feb 2018 09:35:27 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 22 Feb 2018 15:04:45 +0530 Message-Id: <1519292089-13851-6-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> References: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: BM1PR0101CA0061.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::23) To HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 00f7a5bd-a34c-4977-a37d-08d579d79bf1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0401MB2425; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 3:dnosf3jr7sCr2n1UFJSkekdeAxZ6ZQbTsFQA98CPY23YsG8t0xTk8CZFpJmGp9XgxAdB6+rYD1Lluh950X2Gt4IWveWyahnirgL+uID4hCrFvsm2WJeTCQcbzu5BjxreLqBRTalI5DVQt9YIrqezCSD9Qce0YM9HBzpdSGd9Z8+/7DN1YfMAe2PtYdAUv/wKBqj3uRpSX/LTTJNF8lmbkK3MD6hV1iGnIl4s7IBBX19gUb8SUs2po+duLEaIBkRH; 25:x0NEc+oLENeNq017tMkj6jbl8ChfAJlWBrEjt3Yg056AAT4Rhdjf1MkO/0PjDR4wsVOJCQffC6r+ts1dO/wlbcBdCg1p0f4Txpz93qxFAeGlPvPa4sZqol6hto3za9dv1cpYOUz/R2GCjTAdzFPdGbPUp2CyfVG85dCv9qshLaPgwWkdK7zlBqstMqjBBAE0jPaqZl31n5SgvnHwxFugSRoJZzay6L3IVAt2xnYNu+DE/TQYaYKy7agpxyKKsI+sx1NpeADoySi7ITLifcygTIy0BmDHYnSnP13KmwJN+zfuQcHj0PawPSnFHxNMCAOPg6luMZzPB60h8GBZVBS2dA==; 31:Ca+NH69dQkSzPJ4iUkEVYnMXdfL9/tUCWVor2WUhzp7JZwwzlGqOur7Mq4qnsllNQcUoe+AboSjbcVcFIVxJ0KF5YQQ8EHxkUe0FXuCGCP1AViE/DAzZcSuzNQCB4f7uwMO5nkX9jFHAFF6JxLCGWyRWtVE37MJE242O1TLv0Ta1U2EsJ+JvA1FWpm2B/vMFuMk2Kf0LdwecE+79YHukHpOqRNzi7t/bitl4apoZz4s= X-MS-TrafficTypeDiagnostic: HE1PR0401MB2425: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 20:rBn6+p2T0lVFJ/w7K+i915e8TjuJMXE2nPF1W3YvYmctsjq+u/NrgHkBNot+39lrVrccUANc0v+834jMKuP/tXVR9jcV/07cT6w+TH2/oQyMzOD2LN8s6SeaK1XmUApJ2K1R0YzodHxE1sjH8VaBdxmJ1IHRQIljfCrbc9qmo8tmk26pdim0YtUlil7+ug6H/e9g1ANu8CucZ53bSWRYEuhdhTwyszXy0p9n7XZM9J609dV7ashhMQ7Xu8LtLN9+JP6q/tk7f01XgsR22EWKvQyUbkbGwIvmr6hK1lL/XKk1JWOvHb0XKGAOapL1aF7qIFV3jBVFI1pT//tNNqadB3CUuyyGdxYIxBp2rGzcHiAtNGhzOMcPg8ZWdgOZaejn8vTXmir+t6jXshzEo9fmZJb9w1j8v0wYHo7JU2PSDDs381CVNNOsjfi96R4tHkabINPZX+3ACjpexD6JO9sSdSlK1bmE9Dn7CnyVrDcpOSjT127bDLxb2bftQebsA9Dh; 4:dowvgBKCfXN3+5XOsVmwWjKxZCGZ5ILruyeEfdBa0zGJ+/JPjUwJXqwSiOK/KRb7wpEj9Lu2/56b1pH4faYFSd6GeupScKd9XFquJBK31RhUYOsM6K6fYmkzzNb1bOk8jyTOzUiVyaZcs1zW5PGzUruLAeU/h6HJdal0hayLXnjrNCkmkc1s3vRP6MsLxXjzdzCsW+Vn7Sd6CO6qx9+f3RPi9c8PZgPMJrx8LZ5emHaIDysECgNBNNZUQ6mHKS4uqOssW4STq1KlmOJDe/O96o42M8jWNkcH4fym9dCS4KIzvj87729XgMxh4fdWc+P9uL50z5KEBnp5JdNpFs66Uib3mvVZ7cCd7L8eRBudplsWBtW13Q7tKOwICEieNqZH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(66839620246622)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001077)(6040501)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231101)(2232076)(944501161)(6055026)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0401MB2425; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0401MB2425; X-Forefront-PRVS: 059185FE08 X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(39380400002)(39860400002)(376002)(346002)(366004)(396003)(199004)(189003)(7736002)(66066001)(26005)(316002)(305945005)(16586007)(59450400001)(25786009)(4326008)(97736004)(386003)(6506007)(478600001)(50226002)(6486002)(47776003)(36756003)(105586002)(2906002)(81156014)(8936002)(6666003)(106356001)(81166006)(48376002)(86362001)(52116002)(6512007)(51416003)(53936002)(575784001)(16526019)(5660300001)(186003)(50466002)(6636002)(6116002)(8676002)(68736007)(3846002)(2950100002)(76176011)(59010400001); DIR:OUT; SFP:1501; SCL:5; SRVR:HE1PR0401MB2425; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0401MB2425; 23:y2DttVhLlWDLoxGL4iUCDxB1TqwAENHQtN/wDtA?= =?us-ascii?Q?hEHBxJijsREvvXmQlssDfFb2J+M0pPrB1pQK4eT56fEPbYKSJN1qVi2pmt4n?= =?us-ascii?Q?Bm3Vw8cqhz5lhuK17WJpdpGkxPEvvQC2ofks+51ZAK1KLMo6yskiom58OmXw?= =?us-ascii?Q?qClHD/PqZfp8IxM0sbS5CMnGgtfMpCZGmGSPtq/9VqWaFptEJOc47O8LIXff?= =?us-ascii?Q?P/HtrGmatOw4T5fz/r3wFbvRd/5Dn5qRxc2rGUhNzIwbX1bQaRb5nySL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BOflQbGddZqB1aRlGGZQFl96TwdZoBmzr6QtBlSmslPh9ZjYag07mLS+diQo0tT0BTPBX0IBfKxP6EBPCAlGbAj0bhWKcxyw96FZ4uhnjAwSbNvkl8pvS2r/8MA1iNbkt04JwP1mlgGg0IeeQiCD SpamDiagnosticOutput: 1:22 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2018 09:35:27.1839 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00f7a5bd-a34c-4977-a37d-08d579d79bf1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2425 Subject: [dpdk-dev] [PATCH 5/9] raw/dpaa2_cmdif: introduce DPAA2 command interface 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: Thu, 22 Feb 2018 09:35:30 -0000 Signed-off-by: Nipun Gupta --- MAINTAINERS | 6 + config/common_armv8a_linuxapp | 5 + config/common_base | 5 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 6 + drivers/raw/Makefile | 1 + drivers/raw/dpaa2_cmdif/Makefile | 33 +++++ drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 139 +++++++++++++++++++++ drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 35 ++++++ .../dpaa2_cmdif/rte_pmd_dpaa2_cmdif_version.map | 4 + mk/rte.app.mk | 1 + 10 files changed, 235 insertions(+) create mode 100644 drivers/raw/dpaa2_cmdif/Makefile create mode 100644 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c create mode 100644 drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h create mode 100644 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif_version.map diff --git a/MAINTAINERS b/MAINTAINERS index a646ca3..e06df3b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -725,6 +725,12 @@ F: drivers/crypto/zuc/ F: doc/guides/cryptodevs/zuc.rst F: doc/guides/cryptodevs/features/zuc.ini +Rawdev Drivers +-------------- + +DPAA2 CMDIF +M: Nipun Gupta +F: drivers/raw/dpaa2_cmdif/ Eventdev Drivers ---------------- diff --git a/config/common_armv8a_linuxapp b/config/common_armv8a_linuxapp index 507b28a..32e3cfe 100644 --- a/config/common_armv8a_linuxapp +++ b/config/common_armv8a_linuxapp @@ -94,3 +94,8 @@ CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048 # CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=y CONFIG_RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS=2048 + +# +# Compile DPAA2 Command Intefrace driver +# +CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF=y diff --git a/config/common_base b/config/common_base index ad03cf4..a549b54 100644 --- a/config/common_base +++ b/config/common_base @@ -587,6 +587,11 @@ CONFIG_RTE_RAWDEV_MAX_DEVS=10 CONFIG_RTE_LIBRTE_PMD_SKELETON_RAWDEV=y # +# Compile DPAA2 CMDIF support +# +CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF=n + +# # Compile librte_ring # CONFIG_RTE_LIBRTE_RING=y diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index afdbc34..ce1ffc5 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -42,3 +42,9 @@ CONFIG_RTE_LIBRTE_DPAA2_DEBUG_TX_FREE=n CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_INIT=n CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_DRIVER=n CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_RX=n + +# +# Compile DPAA2 Command Intefrace driver +# +CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF=y + diff --git a/drivers/raw/Makefile b/drivers/raw/Makefile index da7c8b4..129945b 100644 --- a/drivers/raw/Makefile +++ b/drivers/raw/Makefile @@ -5,5 +5,6 @@ include $(RTE_SDK)/mk/rte.vars.mk # DIRS-$() += DIRS-$(CONFIG_RTE_LIBRTE_PMD_SKELETON_RAWDEV) += skeleton_rawdev +DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF) += dpaa2_cmdif include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/raw/dpaa2_cmdif/Makefile b/drivers/raw/dpaa2_cmdif/Makefile new file mode 100644 index 0000000..1d91d0c --- /dev/null +++ b/drivers/raw/dpaa2_cmdif/Makefile @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2018 NXP + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_dpaa2_cmdif.a + +CFLAGS += -DALLOW_EXPERIMENTAL_API +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include + +LDLIBS += -lrte_bus_fslmc +LDLIBS += -lrte_eal +LDLIBS += -lrte_rawdev +LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_kvargs + +EXPORT_MAP := rte_pmd_dpaa2_cmdif_version.map + +LIBABIVER := 1 + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF) += dpaa2_cmdif.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c new file mode 100644 index 0000000..0d98d36 --- /dev/null +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -0,0 +1,139 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "rte_pmd_dpaa2_cmdif.h" +#include "dpaa2_cmdif_logs.h" + +/* Dynamic log type identifier */ +int dpaa2_cmdif_logtype; + +/* CMDIF driver name */ +#define DPAA2_CMDIF_PMD_NAME dpaa2_dpci + +/* CMDIF driver object */ +static struct rte_vdev_driver dpaa2_cmdif_drv; + +static const struct rte_rawdev_ops dpaa2_cmdif_ops = { +}; + +static int +dpaa2_cmdif_create(const char *name, + struct rte_vdev_device *vdev, + int socket_id) +{ + struct rte_rawdev *rawdev; + struct dpaa2_dpci_dev *cidev; + + /* Allocate device structure */ + rawdev = rte_rawdev_pmd_allocate(name, sizeof(struct dpaa2_dpci_dev), + socket_id); + if (!rawdev) { + DPAA2_CMDIF_ERR("Unable to allocate rawdevice"); + return -EINVAL; + } + + rawdev->dev_ops = &dpaa2_cmdif_ops; + rawdev->device = &vdev->device; + rawdev->driver_name = vdev->device.driver->name; + + /* For secondary processes, the primary has done all the work */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + + cidev = rte_dpaa2_alloc_dpci_dev(); + if (!cidev) { + DPAA2_CMDIF_ERR("Unable to allocate CI device"); + rte_rawdev_pmd_release(rawdev); + return -ENODEV; + } + + rawdev->dev_private = cidev; + + return 0; +} + +static int +dpaa2_cmdif_destroy(const char *name) +{ + int ret; + struct rte_rawdev *rdev; + + rdev = rte_rawdev_pmd_get_named_dev(name); + if (!rdev) { + DPAA2_CMDIF_ERR("Invalid device name (%s)", name); + return -EINVAL; + } + + /* The primary process will only free the DPCI device */ + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_dpaa2_free_dpci_dev(rdev->dev_private); + + ret = rte_rawdev_pmd_release(rdev); + if (ret) + DPAA2_CMDIF_DEBUG("Device cleanup failed"); + + return 0; +} + +static int +dpaa2_cmdif_probe(struct rte_vdev_device *vdev) +{ + const char *name; + int ret = 0; + + name = rte_vdev_device_name(vdev); + + DPAA2_CMDIF_INFO("Init %s on NUMA node %d", name, rte_socket_id()); + + ret = dpaa2_cmdif_create(name, vdev, rte_socket_id()); + + return ret; +} + +static int +dpaa2_cmdif_remove(struct rte_vdev_device *vdev) +{ + const char *name; + int ret; + + name = rte_vdev_device_name(vdev); + + DPAA2_CMDIF_INFO("Closing %s on NUMA node %d", name, rte_socket_id()); + + ret = dpaa2_cmdif_destroy(name); + + return ret; +} + +static struct rte_vdev_driver dpaa2_cmdif_drv = { + .probe = dpaa2_cmdif_probe, + .remove = dpaa2_cmdif_remove +}; + +RTE_PMD_REGISTER_VDEV(DPAA2_CMDIF_PMD_NAME, dpaa2_cmdif_drv); + +RTE_INIT(dpaa2_cmdif_init_log); + +static void +dpaa2_cmdif_init_log(void) +{ + dpaa2_cmdif_logtype = rte_log_register("dpaa2.cmdif"); + if (dpaa2_cmdif_logtype >= 0) + rte_log_set_level(dpaa2_cmdif_logtype, RTE_LOG_INFO); +} diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h new file mode 100644 index 0000000..5eb0885 --- /dev/null +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef __DPAA2_CMDIF_LOGS_H__ +#define __DPAA2_CMDIF_LOGS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern int dpaa2_cmdif_logtype; + +#define DPAA2_CMDIF_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "%s(): " fmt "\n", \ + __func__, ##args) + +#define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_LOG(DEBUG, ">>") + +#define DPAA2_CMDIF_DEBUG(fmt, args...) \ + DPAA2_CMDIF_LOG(DEBUG, fmt, ## args) +#define DPAA2_CMDIF_INFO(fmt, args...) \ + DPAA2_CMDIF_LOG(INFO, fmt, ## args) +#define DPAA2_CMDIF_ERR(fmt, args...) \ + DPAA2_CMDIF_LOG(ERR, fmt, ## args) +#define DPAA2_CMDIF_WARN(fmt, args...) \ + DPAA2_CMDIF_LOG(WARNING, fmt, ## args) + +#ifdef __cplusplus +} +#endif + +#endif /* __DPAA2_CMDIF_LOGS_H__ */ diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif_version.map b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif_version.map new file mode 100644 index 0000000..9b9ab1a --- /dev/null +++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif_version.map @@ -0,0 +1,4 @@ +DPDK_18.05 { + + local: *; +}; diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 3eb41d1..e82d965 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -230,6 +230,7 @@ endif # CONFIG_RTE_LIBRTE_EVENTDEV ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SKELETON_RAWDEV) += -lrte_pmd_skeleton_rawdev +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF) += -lrte_pmd_dpaa2_cmdif endif # CONFIG_RTE_LIBRTE_RAWDEV ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) -- 1.9.1