From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0067.outbound.protection.outlook.com [104.47.36.67]) by dpdk.org (Postfix) with ESMTP id 601521B291 for ; Tue, 10 Oct 2017 13:36:35 +0200 (CEST) Received: from CY4PR03CA0009.namprd03.prod.outlook.com (10.168.162.19) by CY1PR03MB2362.namprd03.prod.outlook.com (10.166.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 10 Oct 2017 11:36:34 +0000 Received: from BN1BFFO11FD005.protection.gbl (2a01:111:f400:7c10::1:124) by CY4PR03CA0009.outlook.office365.com (2603:10b6:903:33::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Tue, 10 Oct 2017 11:36:33 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD005.mail.protection.outlook.com (10.58.144.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Tue, 10 Oct 2017 11:36:33 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v9ABaJOg014848; Tue, 10 Oct 2017 04:36:30 -0700 From: Nipun Gupta To: CC: , , , Nipun Gupta Date: Tue, 10 Oct 2017 23:21:26 +0530 Message-ID: <1507657887-11366-3-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507657887-11366-1-git-send-email-nipun.gupta@nxp.com> References: <1507657887-11366-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131521089936366465; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(376002)(39860400002)(346002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(2950100002)(8936002)(6916009)(69596002)(498600001)(4326008)(68736007)(16586007)(50466002)(85426001)(316002)(36756003)(189998001)(2906002)(97736004)(356003)(48376002)(305945005)(2351001)(8656003)(47776003)(33646002)(5890100001)(76176999)(5003940100001)(106466001)(105606002)(50986999)(6666003)(77096006)(53936002)(54906003)(86362001)(50226002)(104016004)(81166006)(8676002)(81156014)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2362; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD005; 1:c14Vxvlmo2H01I44vQ52KxjpI6FYoQsVf5JHgFv1C9mQ7jEwBqbSItHJW0DUVAfWFrnD5gtBhTObA/LVa1/aMIuT5waJysLC6MSPDU2MDj1sGafsM6KMeQby6wyzFyyH MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 998117be-3bb8-484c-ba20-08d50fd32895 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CY1PR03MB2362; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 3:YNHcRUNfXtEco//4/Xnp24WqcyopvTQbEWizTqIcS2V372ivKYKj5QZ5a/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ryFzmjvJ0IRf65QbJAnjl8OSmsvwdk6aJSUcN3MWbXCnZ9oam1CE5I2uiX5/yhRiDOyiSu98ZWl3vY/9TXjDStGL4u2nmZYgbeDtyQD9FrqhXbql2WOovHjCbj5cMuqfd7D+oGgcnd+UOD/HIsx3fpkAY3JHeDhIl6D6okGmTdeLMDQNcTp34byQnmz7YdzDUT4OT1XeqbRblt9oBxxijRbJKsp2sLds+u+uZW7WK8rSAGY7b3NcHuPT6cUmMw== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123565025)(20161123563025)(20161123559100)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2362; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2362; X-Forefront-PRVS: 04569283F9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2362; 23:z/CwJXOHCAfb4SnXRKYpTouifK09WGfK9GLHAPwG2?= =?us-ascii?Q?NOV0fr5V6YjpWXav2ELpsGFPO1gkC7ji2w4nhfDI4ljy0nEXnj/0eMBXONbr?= =?us-ascii?Q?k9CG3YaKmxN+oQErxau9WajaE9r6yli0kc8M98bcXP31bUHrGQr+LGljqeXE?= =?us-ascii?Q?FTok8YJRq3PvEsyaqqpdTW93I42bun6wLf9LHYUIIW9oFAuQyqw7RWFmLzCm?= =?us-ascii?Q?YkdkFDx/UHFkNPyKotYuEm1yPv8vQfxzD68535ts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xy+ht5fMhV21/0IkEg0Sx0qtddqJcN7uSZBbgFoq5XdP4e+dRF5zW7AF?= =?us-ascii?Q?eEOX5dd+2NEJ++iauU6EfX8uZK1TWLYbKIa?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 6:k9vUUgYEslXRlBmQBDXj5fBZOY3WZWWRnN9Ig6w/S2PJqFfOxFgNxScVZaIEljIl+4+Qv3aOSwuYAPYSiHWTCJPVEKFM5rHv0FufkUYt4x7CbauIl+i0/7QPqx8zR6BI681Eq8DdNUMPd3+qjaP3v2myBsM6cgNAYYuD+VondqvzIm7PqO+wBEK++Pz2AnKscxDYvhcl1enE+8fFxs6PzEu75GP3ijqaL1KGDx6LNETg3vyAXu+7eNGHfLAjAEvlnrJmP8PP4ivWUi6YncN5KTI8e6j4ox9Hl1a1v4yHIdLg+hvJgWmi+FYB1HWe3713WSRLT1NfLun8Ndt29z+8rw==; 5:MAQ5MTdQI12l3bDOtQMgSPNP+BA74hVB0HJc5bamkZYzjNRCjVXYL5QTIuhFprMoKEJxyjS/LLJFioBvHXfQemYxUPTpNYh3LQpTQQT7h478YGJDPl/cZGtNyK6wYlPUSMwCjCpIipJGTh/mWxgUiA==; 24:P5WQ8yC8hMQzKdPcYrxiUBAeqQ+3LLXkC6GBy1qs6EVIlUxCaaff8xPzEwa9vBOTOTPjFXuFhOb5UQGVyrRLP0Y3SH1xSlMNRAadBhqbZdA=; 7:PAqz57TDclhCn/626CtnNAiiUlZgQa9dsy67WNZx0a3vmzQtWiJXHzkbSwpJaFm6AXVgHY1DjHqonA0FbsN8YkglQyyyQzuNXUxmBsShhszy+6fNCU6l4jAO30vHpmurFnHSZiU3MvlpaAmbj5dm7UZNTsLtQSBjxzSgoGVHPrS577xHa6h3j6/7iLMhhjxvH2MBNDBqtICpwzPHTEUr1OwduHnXcuOjs2wKwS9onoM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2017 11:36:33.3870 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2362 Subject: [dpdk-dev] [PATCH 3/4] event/dpaa2: support event eth adapter 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, 10 Oct 2017 11:36:35 -0000 Signed-off-by: Nipun Gupta --- drivers/event/Makefile | 4 +- drivers/event/dpaa2/Makefile | 2 + drivers/event/dpaa2/dpaa2_eventdev.c | 96 +++++++++++++++++++++++++++++++++++- drivers/event/dpaa2/dpaa2_eventdev.h | 8 +++ 4 files changed, 107 insertions(+), 3 deletions(-) diff --git a/drivers/event/Makefile b/drivers/event/Makefile index 3f6b898..accba6e 100644 --- a/drivers/event/Makefile +++ b/drivers/event/Makefile @@ -31,7 +31,7 @@ include $(RTE_SDK)/mk/rte.vars.mk -core-libs := librte_eal librte_eventdev +core-libs := librte_eal librte_ether librte_eventdev DIRS-$(CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV) += skeleton DEPDIRS-skeleton = $(core-libs) @@ -40,6 +40,6 @@ DEPDIRS-sw = $(core-libs) librte_kvargs librte_ring DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += octeontx DEPDIRS-octeontx = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV) += dpaa2 -DEPDIRS-dpaa2 = $(core-libs) librte_bus_fslmc +DEPDIRS-dpaa2 = $(core-libs) librte_bus_fslmc librte_pmd_dpaa2 include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile index 3497d09..2d1d7c4 100644 --- a/drivers/event/dpaa2/Makefile +++ b/drivers/event/dpaa2/Makefile @@ -45,6 +45,8 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal +CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 +CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc # versioning export map EXPORT_MAP := rte_pmd_dpaa2_event_version.map diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 6967741..ca782c3 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -53,11 +53,14 @@ #include #include #include +#include +#include #include #include #include #include +#include #include "dpaa2_eventdev.h" #include #include @@ -557,6 +560,92 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, RTE_SET_USED(f); } +static int +dpaa2_eventdev_eth_caps_get(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + uint32_t *caps) +{ + const char *ethdev_driver = eth_dev->device->driver->name; + + PMD_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + + if (!strcmp(ethdev_driver, "net_dpaa2")) + *caps = RTE_EVENT_ETH_RX_ADAPTER_DPAA2_CAP; + else + *caps = RTE_EVENT_ETH_RX_ADAPTER_SW_CAP; + + return 0; +} + +static int +dpaa2_eventdev_eth_queue_add(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + int32_t rx_queue_id, + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) +{ + struct dpaa2_eventdev *priv = dev->data->dev_private; + uint8_t ev_qid = queue_conf->ev.queue_id; + uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; + int ret; + + PMD_DRV_FUNC_TRACE(); + + ret = dpaa2_eth_eventq_attach(eth_dev, rx_queue_id, + dpcon_id, queue_conf); + if (ret) { + PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret); + return ret; + } + return 0; +} + +static int +dpaa2_eventdev_eth_queue_del(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + int32_t rx_queue_id) +{ + int ret; + + PMD_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + + ret = dpaa2_eth_eventq_detach(eth_dev, rx_queue_id); + if (ret) { + PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret); + return ret; + } + return 0; + + return 0; +} + +static int +dpaa2_eventdev_eth_start(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev) +{ + PMD_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + RTE_SET_USED(eth_dev); + + return 0; +} + +static int +dpaa2_eventdev_eth_stop(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev) +{ + PMD_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + RTE_SET_USED(eth_dev); + + return 0; +} + static const struct rte_eventdev_ops dpaa2_eventdev_ops = { .dev_infos_get = dpaa2_eventdev_info_get, .dev_configure = dpaa2_eventdev_configure, @@ -572,7 +661,12 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, .port_link = dpaa2_eventdev_port_link, .port_unlink = dpaa2_eventdev_port_unlink, .timeout_ticks = dpaa2_eventdev_timeout_ticks, - .dump = dpaa2_eventdev_dump + .dump = dpaa2_eventdev_dump, + .eth_rx_adapter_caps_get = dpaa2_eventdev_eth_caps_get, + .eth_rx_adapter_queue_add = dpaa2_eventdev_eth_queue_add, + .eth_rx_adapter_queue_del = dpaa2_eventdev_eth_queue_del, + .eth_rx_adapter_start = dpaa2_eventdev_eth_start, + .eth_rx_adapter_stop = dpaa2_eventdev_eth_stop, }; static int diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index f79f78a..ae8e07e 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -74,6 +74,14 @@ enum { DPAA2_EVENT_DPCI_MAX_QUEUES }; +#define RTE_EVENT_ETH_RX_ADAPTER_DPAA2_CAP \ + (RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT | \ + RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ | \ + RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) +/**< Ethernet Rx adapter cap to return If the packet transfers from + * the ethdev to eventdev with DPAA2 devices. + */ + struct dpaa2_dpcon_dev { TAILQ_ENTRY(dpaa2_dpcon_dev) next; struct fsl_mc_io dpcon; -- 1.9.1