From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0062.outbound.protection.outlook.com [104.47.41.62]) by dpdk.org (Postfix) with ESMTP id 5DF887CC9 for ; Wed, 31 May 2017 17:11:10 +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; bh=lVEFkITWWgm0ZrQH+BPbAT9YMSm8XUVVIlogrby3+tU=; b=T/FvQlQWuzPYBUWxy5dSg2dNiTsGVE9PnkDS1ki75ihBhFQ6XeOosDN6bNHrNIxWtsdFjrEAIioB5DHeCn7lNiGktbahaHLdNDmW9tsiJvBIYC91+QqHmPqMS8q7AZAH7kvsqHszl1yfTUP9zpOf02M7+FmKZ1l9kISR3JjiER4= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin (111.93.218.67) by BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Wed, 31 May 2017 15:11:04 +0000 Date: Wed, 31 May 2017 20:40:03 +0530 From: Jerin Jacob To: Nipun Gupta Cc: dev@dpdk.org, hemant.agrawal@nxp.com, harry.van.haaren@intel.com, bruce.richardson@intel.com, gage.eads@intel.com, shreyansh.jain@nxp.com Message-ID: <20170531151003.GB16598@jerin> References: <1495735671-4917-1-git-send-email-nipun.gupta@nxp.com> <1495735671-4917-11-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495735671-4917-11-git-send-email-nipun.gupta@nxp.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0081.INDPRD01.PROD.OUTLOOK.COM (10.174.56.21) To BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR0701MB1717: X-MS-Office365-Filtering-Correlation-Id: 10d7779e-836b-4a0b-67ea-08d4a8374337 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 3:qXSCgvhxuJxxHxmCvbUnnMDY2MyThKPl5SiqNt9qpPIiZdZp8/mbBhHC1yhazNQcpa3SDsXp3uL16WccGvXpghYGoRM0AsQy9s8OlDzFJkkKmdnnTTKcyX1GQO6oUi1nJYZfuqFD2FMiDE4tmmIMvaCvGui1nSaKKY5EtzPM37KycTv3jZAgbeQqRgcxd066SHkkfoKxM77f7gt2UEuOlfwvk9jDwnhFJcdiiV4l0BnagaxJxiTaLmTWFDd6bj9h5/W4XXA01aVDeKzfPKpiCSBpYClpUSDrnnrp+qBA3pnJ6lXr//QrhLJtoj+1HLbO00+jpcsox6lavD/CRIWz8w==; 25:ZP1olUwpHibJOyLOkcwZfH8x/kZ0uE03leSGJKhBklRjGjpZSOPD+tiM4dd3/LXNQyHe9EhMQhJ+1VhCVxW9Vs98j/ykJZf/qR+7UiVtgzu9Acsnr2TibGSj2wucSAvhJKUtpBSkld9DXuOCyyzsIT/zj3AnbYeIDdHs4mxWGzgWisN229zvvmxC99SHcwrvMvbNrLlmPEPd+gU9YGxUm4gz8Cpi13fAMbpR3A/P3BT8AZBBPg4ERNWuPiQfvNE1etUPPti9aYMFozhzGE00abgeY57YlIvMEPn0+9u+hs7bHM3gFmO4gxx0YcKd4odFMnPoL/zAgoWsGX1u97xkPPKDeRt7a5Go6fcptNzy6xgdp8BghPcBEpWSThoGaoEE9eS5SulGkEJExxbdKrQx6SePCQOynOA53eyZOzLUcpC3nI1c4ZHkTl+KL98uQFEHwRlL6eNYnBPtMaB5txnaITPkupkrgnPJ3q+k2ZpvvDM= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 31:D1+jePINoF6J1x7/opX7MCgswUHYWkGMe8CknQ3KXXvesPrRHjFR7+digHHnRg73Czw6Yr3gJw8EWsAWFCDE/iqzx/OotV7GZAmUIsREq/yvImc8fG3TX0w3WrOBJqcHaL1r91dUoU+7xr2YDm1hHrvfQ3kMcDlSPMRWv27rbOIYFp9XV4dVUVCfVdRGBftv9OosyUuwlhzRUcMmNTWx2rQhyZ83McxJ9MdQmH422LJ1UCZOY018eDiYJ6Nla+nu; 20:lEA4dIpWLKGr2o97PkxOPVDd0O7XVi7sX2VXUY1X2Eu6GXzRWpGwtJNbq/KuXV9M5TxjV6VY0K68Xw+BYnhGdLQ4pnYZH3ToC7BifV5Cef39CaurCIdlnuf8EccRpAIWpqfIwfvuFZzRwXGjq6WMAmv9G1p3nq2swRytR/rVYD6yrW5Ikz3CWPqHoHnxNjM6Sza2yJbPjs/jcwymIy3FFuKLNHe3Acvg/UnO/+3tJQiRH2x130XQ9XGi9NHef2QrnkTjscM1kiRdRbZ24qT1gd/2BKNqT8NEzraJpJ9q4yqfzH5hd2DrLWHeRm0mUV0Vrh4+wSLWoEwapIEEA+kLuNjzPbet9g1QJ/xlS/3TTOxggKA71Z1tMDRsISNwQ5oqtXzmJchMSdavVIL8BRUprMB0sgBxiww2EUS4TBVHYVQEevkegfJL2g6qvUL5yeOWM9hw8W/rZI+qOjMULWINch2B9zOL67bJ7F+AvE7F8a2dcvWjRj6VmL/Tm916sNsLhhZye83/ypm52A9bMeiu2WTBX9Cx4q1xEMdJGPE7MoxnPvz7oaj8TlH12Wo73NUoPKJDwZcGvezwempozs1Yk5AHVNmeUEw02DR62mWQqyE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148); SRVR:BN3PR0701MB1717; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 4:/OPSBpJjhpVgwIu0XLPJJFDQU6Ktn4P8nHvFBlIiTDUNriaMbkXN4YkY69TivNvl9sYF79STi9XgdGTF/DKZjMh/MPLUsZGsaoLQyReKcAM95t5D0xQ0Qh2eLVHzi1YW3IEVFX+avgTcWsvOYNj8F9dDizIsJwVG3Riz9ytQ+3OcwXxmXofrq1B7YT1xv9dhayUwh3Il51/vl7ggpRZhSu8DNOx4RTS75KKsw/2BHTNsLvNfmvAYl9fEosADqeSNfcSKN3RgybrogisLm3kgXFKnbZS9JJKEnpLsaxoAoxc0gE5K7nBzsf2zZYW+8gYJ9U0mgUky6d0a9hpxZsn7xF2qfPF05r/mpmRPBSZi4g+96ScnfRWU8krpffldP7aAMPBDLYp1Ow73zAH64CXfLz5ax9NgmylUXd/8KBv9gH9p6HbAXbnQI/sejEVqlX5Y8i7/gQapDOjHDwVfSd41nebHVM8jeKLQD1sfdHG/LjDaVooJsuXPNPRsXBQeWTgrrQVmJTX5ruOsifKb/x9ai1A2axIvm3zok/nCQ33n3ZeSYZipYbDwvgqEgBgJEThlGO+9r2zAkePMMuIEC5tFkXzHXnQPqcV1Lkc4SO/1WvXcNQHOynNcIXqVmQWAM3v2UurXghcKaEobzl7UTiYKVHShpyXcSAtci+aVgs4IPb9eLANCFgWnJltotauXe9FN+h+dKBCZfeVrTnytbTulr7cglFV4GRIxuZB0vDVy9TSPdinDQH3osjnHe0c01le5rFSJ9l91iesaewalLKQ2nOT8N/dc/Jw0d87r992QKv3svMQatK0gBPObqqn6cwnjivb5ekQQF9kJAJTIChHQxkd7Lf87N33jTZGk6jXOrqjabR2G6BVJskVdOtvZ4EGz X-Forefront-PRVS: 0324C2C0E2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39850400002)(39400400002)(39410400002)(39450400003)(39840400002)(13464003)(83506001)(6496005)(110136004)(72206003)(2906002)(8676002)(66066001)(6246003)(38730400002)(47776003)(25786009)(229853002)(42186005)(4326008)(4001350100001)(478600001)(50986999)(1076002)(55016002)(9686003)(23726003)(5009440100003)(6116002)(3846002)(54356999)(53936002)(42882006)(2950100002)(8656002)(6916009)(76176999)(5660300001)(7736002)(305945005)(81166006)(189998001)(33716001)(33656002)(50466002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1717; H:jerin; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1717; 23:7SxDuVJka9gAQsDTtDEVMHfA77vlRjn4AmLExfe?= =?us-ascii?Q?N+aXfAH0pHX5pigmg+9fddZ37Tot+Lay6iRuWzYfjDh0lvQexzoHcWa1ZTlb?= =?us-ascii?Q?aIZwqciXkCUUooJRLhTPpBLo4anUGRaMxIz7EJRnXJ+IEFKwUTPHGnkP9e8O?= =?us-ascii?Q?JR99AGvDZ6IIBhjtg5T8MldwEhEHgK80W8sQf8zSztRZ73KMzUPEXchAAOqF?= =?us-ascii?Q?1yCAeZGLllU1xqyDIofZorToRjJIaIBHsPPvZM3IhJqhCOWVeatLBVSLH8lZ?= =?us-ascii?Q?gKSNFKH48wG81CCMYceP4N51/Ec99fcb9KpnRjjxXMhwCewZ7u5k+PnG4g8I?= =?us-ascii?Q?xqdNDFMDITYfNLXxMTDJ+PUnN18fZZT6gnZNFTq/LrFzTNhpDsVRkhhcbDa6?= =?us-ascii?Q?YwBxxGzXXd7trHtj79luv89dUjVmOik9ZjyEDaBw964u52EcOcTIh0iaaD0w?= =?us-ascii?Q?rlRdCwic9NiGfpC/E7xxfHyQYUgq3EdFQgdtxoH+2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atorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2017 15:11:04.2016 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Subject: Re: [dpdk-dev] [PATCH 10/20] event/dpaa2: add initialization of event device 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: Wed, 31 May 2017 15:11:11 -0000 -----Original Message----- > Date: Thu, 25 May 2017 23:37:41 +0530 > From: Nipun Gupta > To: dev@dpdk.org > CC: hemant.agrawal@nxp.com, jerin.jacob@caviumnetworks.com, > harry.van.haaren@intel.com, bruce.richardson@intel.com, > gage.eads@intel.com, shreyansh.jain@nxp.com, Nipun Gupta > > Subject: [PATCH 10/20] event/dpaa2: add initialization of event device > X-Mailer: git-send-email 1.9.1 > > Signed-off-by: Nipun Gupta > --- > drivers/event/dpaa2/dpaa2_eventdev.c | 153 ++++++++++++++++++++++++++++++++++- > drivers/event/dpaa2/dpaa2_eventdev.h | 22 +++++ > 2 files changed, 171 insertions(+), 4 deletions(-) > > diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c > index 191901e..7fa17f2 100644 > --- a/drivers/event/dpaa2/dpaa2_eventdev.c > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c > @@ -30,17 +30,164 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > #include > +#include > +#include > +#include > +#include > +#include > +#include > #include > +#include > +#include Maintain alphabetical order in header inclusion. > > +#include > +#include > +#include > +#include > #include "dpaa2_eventdev.h" > +#include > +#include > + > +/* Clarifications > + * Evendev = SoC Instance > + * Eventport = DPIO Instance > + * Eventqueue = DPCON Instance > + * 1 Eventdev can have N Eventqueue > + * Soft Event Flow is DPCI Instance > + */ > + > +static uint16_t > +dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], > + uint16_t nb_events) > +{ > + RTE_SET_USED(port); > + RTE_SET_USED(ev); > + RTE_SET_USED(nb_events); > + > + return 0; > +} > + > +static uint16_t > +dpaa2_eventdev_enqueue(void *port, const struct rte_event *ev) > +{ > + return dpaa2_eventdev_enqueue_burst(port, ev, 1); > +} > + > +static uint16_t > +dpaa2_eventdev_dequeue_burst(void *port, struct rte_event ev[], > + uint16_t nb_events, uint64_t timeout_ticks) > +{ > + RTE_SET_USED(port); > + RTE_SET_USED(ev); > + RTE_SET_USED(nb_events); > + RTE_SET_USED(timeout_ticks); > + > + return 0; > +} > + > +static uint16_t > +dpaa2_eventdev_dequeue(void *port, struct rte_event *ev, > + uint64_t timeout_ticks) > +{ > + return dpaa2_eventdev_dequeue_burst(port, ev, 1, timeout_ticks); > +} > + > +static const struct rte_eventdev_ops dpaa2_eventdev_ops; > + > +static int > +dpaa2_eventdev_setup_dpci(struct dpaa2_dpci_dev *dpci_dev, > + struct dpaa2_dpcon_dev *dpcon_dev) > +{ > + struct dpci_rx_queue_cfg rx_queue_cfg; > + int ret, i; > + > + /*Do settings to get the frame on a DPCON object*/ > + rx_queue_cfg.options = DPCI_QUEUE_OPT_DEST; > + rx_queue_cfg.dest_cfg.dest_type = DPCI_DEST_DPCON; > + rx_queue_cfg.dest_cfg.dest_id = dpcon_dev->dpcon_id; > + rx_queue_cfg.dest_cfg.priority = DPAA2_EVENT_DEFAULT_DPCI_PRIO; > + > + for (i = 0 ; i < DPAA2_EVENT_DPCI_MAX_QUEUES; i++) { > + rx_queue_cfg.user_ctx = (uint64_t)(&dpci_dev->queue[i]); > + ret = dpci_set_rx_queue(&dpci_dev->dpci, > + CMD_PRI_LOW, > + dpci_dev->token, i, > + &rx_queue_cfg); > + if (ret) { > + PMD_DRV_LOG(ERR, PMD, > + "set_rx_q failed with err code: %d", ret); > + return ret; > + } > + } > + return 0; > +} > > static int > dpaa2_eventdev_create(const char *name) > { > - RTE_SET_USED(name); > + struct rte_eventdev *eventdev; > + struct dpaa2_eventdev *priv; > + struct dpaa2_dpcon_dev *dpcon_dev = NULL; > + struct dpaa2_dpci_dev *dpci_dev = NULL; > + int ret; > + > + eventdev = rte_event_pmd_vdev_init(name, > + sizeof(struct dpaa2_eventdev), > + rte_socket_id()); > + if (eventdev == NULL) { > + PMD_DRV_ERR("Failed to create eventdev vdev %s", name); > + goto fail; > + } > + > + eventdev->dev_ops = &dpaa2_eventdev_ops; > + eventdev->schedule = NULL; > + eventdev->enqueue = dpaa2_eventdev_enqueue; > + eventdev->enqueue_burst = dpaa2_eventdev_enqueue_burst; > + eventdev->dequeue = dpaa2_eventdev_dequeue; > + eventdev->dequeue_burst = dpaa2_eventdev_dequeue_burst; If it makes senses, you can return from here if its in multi process mode. > + > + priv = eventdev->data->dev_private; > + priv->max_event_queues = 0; > + > + do { > + dpcon_dev = rte_dpaa2_alloc_dpcon_dev(); > + if (!dpcon_dev) > + break; > + priv->evq_info[priv->max_event_queues].dpcon = dpcon_dev; > + > + dpci_dev = rte_dpaa2_alloc_dpci_dev(); > + if (!dpci_dev) { > + rte_dpaa2_free_dpcon_dev(dpcon_dev); > + break; > + } > + priv->evq_info[priv->max_event_queues].dpci = dpci_dev; > + > + ret = dpaa2_eventdev_setup_dpci(dpci_dev, dpcon_dev); > + if (ret) { > + PMD_DRV_LOG(ERR, PMD, > + "dpci setup failed with err code: %d", ret); > + return ret; > + } > + priv->max_event_queues++; > + } while (dpcon_dev && dpci_dev); > > return 0; > +fail: > + return -EFAULT; > } > > static int > @@ -61,9 +208,7 @@ > name = rte_vdev_device_name(vdev); > PMD_DRV_LOG(INFO, "Closing %s", name); > > - RTE_SET_USED(name); > - > - return 0; > + return rte_event_pmd_vdev_uninit(name); > }