From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 717F1A3168 for ; Thu, 17 Oct 2019 10:47:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA3A31E8F4; Thu, 17 Oct 2019 10:47:54 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10089.outbound.protection.outlook.com [40.107.1.89]) by dpdk.org (Postfix) with ESMTP id 390861E8DC for ; Thu, 17 Oct 2019 10:47:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DiD1YjRHoC+dzqS6qAkJ0iIrMGy5LF2GrydSH8qUpkG98UL88Ca46v95iusKpOdxXLd/lAX6HaIfyWJQb1kXBCwJ0nIpiYb8u9DPZ9o/imZ2fu5xSAyIMj+UCKZRl9YckH9LkZ0l4MBXcK45o3rTbmqYXQ7aAg9MiENaF78sA0cGAPZbHnhQ+CZvxD+N/23kSitSwz0nMD62qnweDVIcgs7mD470jliNIFzi3wFKOyNwvwahnl6Yu8Y7QCJBQX8h54ysyhIW4V8H90Jr7NiQN+DOm0yMfExVUyuSDweEOmKo96Nu8mJLP2+7D4cwxir18qit4xbBjtV0fC3jco4jjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BddmbtdNIxTZH6WJklMfAwGRq8vO7dQzP3qhGckSPdM=; b=hbX483c3l2+ywTT7SB4muOpDAfJ/kyofHNA/xmnblZ/GFp59XiKQqnAzQKQP5ottnOc33tWq98wvFrBYpe+mD4DRrnRCGGD4EivjBkIZ8RnGqKYgi4QITp/3roCeQdt40scYWdr7x/+sfDrsqaajirwwdICT4kjpVFa31OyDkyQFYmfYC1vZzOqN/SSYxIyPT2MDCtPCoKQGhLj2nPZS2VE/21ux0tPHOgJ/Mtzv/CglXSOoxMV28u9GJs8qWNMnck5hVfe8pL8YlnM1/3AVXx6cYGSHORqkENqBlZg9YAsxLWRrtBZvWVzGLum0QZYnLYlT2hPBVlMCJK+hjf0DSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BddmbtdNIxTZH6WJklMfAwGRq8vO7dQzP3qhGckSPdM=; b=ZuJPoIHOugW44diL8Urnd+BvXAhSS9/IzV6FO4EHVMO6EHjeEC7QSxHIMzYbtx+WZMp8kXyut7WuUrDi7NASsl2LVpfL2sTyrBsnsnzrOjTXlS/Y/4wIIN6reko5mbif53PuLndPV0Ic94brMPeiBXpCosVOWOr+urRsgsC6jf0= Received: from VI1PR04MB4480.eurprd04.prod.outlook.com (20.177.53.224) by VI1PR04MB6829.eurprd04.prod.outlook.com (52.133.244.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.23; Thu, 17 Oct 2019 08:47:52 +0000 Received: from VI1PR04MB4480.eurprd04.prod.outlook.com ([fe80::681a:2c5b:e170:683]) by VI1PR04MB4480.eurprd04.prod.outlook.com ([fe80::681a:2c5b:e170:683%6]) with mapi id 15.20.2347.023; Thu, 17 Oct 2019 08:47:52 +0000 From: Nipun Gupta To: "dev@dpdk.org" CC: "jerinj@marvell.com" , Hemant Agrawal Thread-Topic: [PATCH 2/2 v2] event/dpaa2: support Tx adapter Thread-Index: AQHVhMcl5Cva9LRI90KBkaU5leX5TadehYcQ Date: Thu, 17 Oct 2019 08:47:52 +0000 Message-ID: References: <20191004115725.1915-1-nipun.gupta@nxp.com> <20191017082904.17543-1-nipun.gupta@nxp.com> <20191017082904.17543-2-nipun.gupta@nxp.com> In-Reply-To: <20191017082904.17543-2-nipun.gupta@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; x-originating-ip: [92.120.1.68] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 51efdf6c-de1d-4c12-217e-08d752deb245 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: VI1PR04MB6829:|VI1PR04MB6829: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 01930B2BA8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(136003)(346002)(376002)(396003)(39860400002)(199004)(189003)(13464003)(99286004)(8936002)(74316002)(7736002)(305945005)(44832011)(486006)(55016002)(7696005)(6246003)(11346002)(66066001)(66446008)(66946007)(25786009)(476003)(6436002)(66476007)(66556008)(64756008)(1730700003)(316002)(5640700003)(446003)(8676002)(76116006)(76176011)(54906003)(4326008)(256004)(2351001)(5660300002)(478600001)(71200400001)(71190400001)(33656002)(229853002)(26005)(86362001)(53546011)(52536014)(2501003)(9686003)(81166006)(81156014)(3846002)(6116002)(102836004)(186003)(2906002)(6506007)(14454004)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB6829; H:VI1PR04MB4480.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1sup3AaGsTOk8cRrG4arbMocTEJOY1JG8VwiwJHH67aY2YZO3uwndVrV8qAnYrlDOD3gF0Gg3xP5nVxXndQqoE6pkkbmCRqSkqfKp39NR7t/8DiyTs7TsYlIKb+aTglagFdcHSLiU0mNEOtBbTpN82/O/uIJWoA+1t3ceJkf9qptMGKFe1qtuXAMZjlnhuIThm+Oi3UFXzaG5IFwIypJOLUEBy2bPIN1eWOPWS4vIN9Rlcj5ofRf5OizXT42bs4tQyd+wqkkr78zHQtEL23aFE+G/Nzz4NjmHD3yhbhDM7mjJNn8MkfdMd/nWetEDAakYVYzcq7IHQph+RtXJAFWbSeCTkXcE5ryUDoOnJOpSfK2XJVx+xceRvSM0Xk0Wp+OoY2tw2JTyLXAALL6gnC7shYXWdGEWWq1AmZz/JAqEE4= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51efdf6c-de1d-4c12-217e-08d752deb245 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2019 08:47:52.1517 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bgkiiHTSnSqqefGGozKK6faExvCJAUW2nsxpYeIXUYiTLLzz+dmEBJ4R+/qts8yt+Wiof8nsyWd8SZWzsAvjCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6829 Subject: Re: [dpdk-dev] [PATCH 2/2 v2] event/dpaa2: support Tx 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Forgot to add in patch: Acked-by: Hemant Agrawal > -----Original Message----- > From: Nipun Gupta > Sent: Thursday, October 17, 2019 1:59 PM > To: dev@dpdk.org > Cc: jerinj@marvell.com; Hemant Agrawal ; > Nipun Gupta > Subject: [PATCH 2/2 v2] event/dpaa2: support Tx adapter >=20 > This patch adds the support of Tx adapter for DPAA2 platform >=20 > Signed-off-by: Nipun Gupta > --- >=20 > Changes in v2: > - Fix build with RTE_LIBRTE_ETHDEV_DEBUG enabled >=20 > drivers/event/dpaa2/Makefile | 2 +- > drivers/event/dpaa2/dpaa2_eventdev.c | 75 > ++++++++++++++++++++++++++-- > drivers/event/dpaa2/dpaa2_eventdev.h | 3 +- > 3 files changed, 73 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile > index c6ab326da..c4019d688 100644 > --- a/drivers/event/dpaa2/Makefile > +++ b/drivers/event/dpaa2/Makefile > @@ -20,7 +20,7 @@ CFLAGS +=3D -I$(RTE_SDK)/drivers/event/dpaa2 > LDLIBS +=3D -lrte_eal -lrte_eventdev > LDLIBS +=3D -lrte_common_dpaax > LDLIBS +=3D -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 > -LDLIBS +=3D -lrte_bus_vdev -lrte_mempool -lrte_mbuf > +LDLIBS +=3D -lrte_bus_vdev -lrte_mempool -lrte_mbuf -lrte_ethdev > CFLAGS +=3D -I$(RTE_SDK)/drivers/net/dpaa2 > CFLAGS +=3D -I$(RTE_SDK)/drivers/net/dpaa2/mc >=20 > diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c > b/drivers/event/dpaa2/dpaa2_eventdev.c > index 56cea5f90..4ee2c460e 100644 > --- a/drivers/event/dpaa2/dpaa2_eventdev.c > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include >=20 > #include > #include > @@ -947,6 +948,66 @@ dpaa2_eventdev_crypto_stop(const struct > rte_eventdev *dev, > return 0; > } >=20 > +static int > +dpaa2_eventdev_tx_adapter_create(uint8_t id, > + const struct rte_eventdev *dev) > +{ > + RTE_SET_USED(id); > + RTE_SET_USED(dev); > + > + /* Nothing to do. Simply return. */ > + return 0; > +} > + > +static int > +dpaa2_eventdev_tx_adapter_caps(const struct rte_eventdev *dev, > + const struct rte_eth_dev *eth_dev, > + uint32_t *caps) > +{ > + RTE_SET_USED(dev); > + RTE_SET_USED(eth_dev); > + > + *caps =3D RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT; > + return 0; > +} > + > +static uint16_t > +dpaa2_eventdev_txa_enqueue_same_dest(void *port, > + struct rte_event ev[], > + uint16_t nb_events) > +{ > + struct rte_mbuf *m[DPAA2_EVENT_MAX_PORT_ENQUEUE_DEPTH], > *m0; > + uint8_t qid, i; > + > + RTE_SET_USED(port); > + > + m0 =3D (struct rte_mbuf *)ev[0].mbuf; > + qid =3D rte_event_eth_tx_adapter_txq_get(m0); > + > + for (i =3D 0; i < nb_events; i++) > + m[i] =3D (struct rte_mbuf *)ev[i].mbuf; > + > + return rte_eth_tx_burst(m0->port, qid, m, nb_events); > +} > + > +static uint16_t > +dpaa2_eventdev_txa_enqueue(void *port, > + struct rte_event ev[], > + uint16_t nb_events) > +{ > + struct rte_mbuf *m =3D (struct rte_mbuf *)ev[0].mbuf; > + uint8_t qid, i; > + > + RTE_SET_USED(port); > + > + for (i =3D 0; i < nb_events; i++) { > + qid =3D rte_event_eth_tx_adapter_txq_get(m); > + rte_eth_tx_burst(m->port, qid, &m, 1); > + } > + > + return nb_events; > +} > + > static struct rte_eventdev_ops dpaa2_eventdev_ops =3D { > .dev_infos_get =3D dpaa2_eventdev_info_get, > .dev_configure =3D dpaa2_eventdev_configure, > @@ -964,11 +1025,13 @@ static struct rte_eventdev_ops > dpaa2_eventdev_ops =3D { > .timeout_ticks =3D dpaa2_eventdev_timeout_ticks, > .dump =3D dpaa2_eventdev_dump, > .dev_selftest =3D test_eventdev_dpaa2, > - .eth_rx_adapter_caps_get =3D dpaa2_eventdev_eth_caps_get, > - .eth_rx_adapter_queue_add =3D dpaa2_eventdev_eth_queue_add, > - .eth_rx_adapter_queue_del =3D dpaa2_eventdev_eth_queue_del, > - .eth_rx_adapter_start =3D dpaa2_eventdev_eth_start, > - .eth_rx_adapter_stop =3D dpaa2_eventdev_eth_stop, > + .eth_rx_adapter_caps_get =3D dpaa2_eventdev_eth_caps_get, > + .eth_rx_adapter_queue_add =3D dpaa2_eventdev_eth_queue_add, > + .eth_rx_adapter_queue_del =3D dpaa2_eventdev_eth_queue_del, > + .eth_rx_adapter_start =3D dpaa2_eventdev_eth_start, > + .eth_rx_adapter_stop =3D dpaa2_eventdev_eth_stop, > + .eth_tx_adapter_caps_get =3D dpaa2_eventdev_tx_adapter_caps, > + .eth_tx_adapter_create =3D > dpaa2_eventdev_tx_adapter_create, > .crypto_adapter_caps_get =3D dpaa2_eventdev_crypto_caps_get, > .crypto_adapter_queue_pair_add =3D > dpaa2_eventdev_crypto_queue_add, > .crypto_adapter_queue_pair_del =3D > dpaa2_eventdev_crypto_queue_del, > @@ -1035,6 +1098,8 @@ dpaa2_eventdev_create(const char *name) > eventdev->enqueue_forward_burst =3D > dpaa2_eventdev_enqueue_burst; > eventdev->dequeue =3D dpaa2_eventdev_dequeue; > eventdev->dequeue_burst =3D dpaa2_eventdev_dequeue_burst; > + eventdev->txa_enqueue =3D dpaa2_eventdev_txa_enqueue; > + eventdev->txa_enqueue_same_dest =3D > dpaa2_eventdev_txa_enqueue_same_dest; >=20 > /* For secondary processes, the primary has done all the work */ > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h > b/drivers/event/dpaa2/dpaa2_eventdev.h > index 7c5d00550..785e52032 100644 > --- a/drivers/event/dpaa2/dpaa2_eventdev.h > +++ b/drivers/event/dpaa2/dpaa2_eventdev.h > @@ -38,7 +38,8 @@ enum { > #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) > + RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID | > \ > + RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT) >=20 > /**< Crypto Rx adapter cap to return If the packet transfers from > * the cryptodev to eventdev with DPAA2 devices. > -- > 2.17.1