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 279A1A2F67 for ; Fri, 4 Oct 2019 14:30:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 408A21C21B; Fri, 4 Oct 2019 14:30:14 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40061.outbound.protection.outlook.com [40.107.4.61]) by dpdk.org (Postfix) with ESMTP id 9516A1C216 for ; Fri, 4 Oct 2019 14:30:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TVpMzz44wABCHnSQaEKG6GJkZHbIpUC5YZB+oz9joAZcoS1oG5BThIdL/JTC4YUkqThz634wK/KGTyzxjA43+gSW1+Ks0ldqywQrez5RhIWE03TOZG71oLTAFIOE2IBtmBcymI4sEBwBMEIWVanVtQ9Tpio61v1gwLOPRuzTY2oMpG7uOajdhgzDaUc2590jWRiRs2C0s8EIZisnu5uZGFGB8APuzxCqPCJsGzALRG2jVo/ovKkOHjwr65H9RrIHajcaZ0I58C6kp8v7J8VHxwxTMQXZv/u3j5Fk68cWsTFmPszS/OKt/SB6cTIymzMimSOd2tlCs+qPhNAak5ifaw== 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=eQY5Ln1KbaRxeX5U7Z80Zx3NmL2+9LCmOIXal+YJtrI=; b=fGCbtpwzUZRbbTOGwlHVkGBUIzgGdtzL9xQ/5XY//eI1SSEnEvDcmqhiTLPR5lHXKCF8nokXzwfZ9+b4uaVcaPJA9IqnPhV/SgiI5gFFF0942ZTYxs50mczCx/cPg3ag+dJ3CtFrLVbqyH1hZSEUGl2WbmSgLvAV8PAyFBHBP2L9hkyOCO5IpPM/+LRcJ0OT6C6BgOQVy1hKr/IGKEoFSBrws+QnApJgUBoQPz1TVC7ynU/sTtbpZ2sMAdyud5n1232VxFAU8JBAtPIYDznnJTNSmlpU9m9ita4I3GQlPnU4RHV/fD8lYD914Vwnfn8eCpN3MJKl1d3jtuoY17p8ag== 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=eQY5Ln1KbaRxeX5U7Z80Zx3NmL2+9LCmOIXal+YJtrI=; b=tA9TqBiyOh3tLEoT4nBDHOV3BUNSZRgPLoYermkqD/bhyHM/116K3ejdzLx68SUsYcm/URdhxll3mP7kceeBGvY2nxVWU7LWCZ/ROpBBgPzhkw5OyZD39Y9zRkd9xDTWr1wK49LlH8hM2q3zYQuzztqz3USPZPCWC00QzCv3W+E= Received: from VI1PR04MB4480.eurprd04.prod.outlook.com (20.177.53.224) by VI1PR04MB4400.eurprd04.prod.outlook.com (20.177.55.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Fri, 4 Oct 2019 12:30:06 +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.2305.023; Fri, 4 Oct 2019 12:30:06 +0000 From: Nipun Gupta To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" , "bruce.richardson@intel.com" , Akhil Goyal , Marko Kovacevic , Ori Kam , Radu Nicolau , Tomasz Kantecki , Sunil Kumar Kori CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5 02/10] examples/l2fwd-event: add infra for eventdev Thread-Index: AQHVeWQjwo0LxnWerUiEqgWg0urrm6dKa5QA Date: Fri, 4 Oct 2019 12:30:06 +0000 Message-ID: References: <20190924094209.3827-1-pbhagavatula@marvell.com> <20191002205754.11746-1-pbhagavatula@marvell.com> <20191002205754.11746-3-pbhagavatula@marvell.com> In-Reply-To: <20191002205754.11746-3-pbhagavatula@marvell.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: fb3db6f0-6125-4b96-189e-08d748c69686 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: VI1PR04MB4400:|VI1PR04MB4400: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 018093A9B5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(376002)(366004)(136003)(39860400002)(346002)(13464003)(189003)(199004)(66066001)(8936002)(316002)(81166006)(110136005)(33656002)(81156014)(25786009)(6246003)(256004)(102836004)(5660300002)(14454004)(71190400001)(71200400001)(6506007)(52536014)(53546011)(55016002)(9686003)(44832011)(26005)(64756008)(6116002)(229853002)(6436002)(3846002)(486006)(478600001)(7696005)(74316002)(66446008)(66556008)(66476007)(2906002)(2501003)(2201001)(476003)(99286004)(66946007)(446003)(7736002)(11346002)(86362001)(76116006)(76176011)(4326008)(305945005)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4400; H:VI1PR04MB4480.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: C2jmrR2GAARUZokCoP9EomE+8eadApo+ZrpSCPkYDbpKlh2eGSJOx5ncUkGC9lJiIv9J+sldDp8Nb084Mw+zycLYYAad5rc7Nv3G7GLhmu9tNl4Ypd5m6zQ0TwuaTQA64+TqY05AbrxgcGvvF9TW6ftz/rpTXht7mZyoMOP5y/G0IRRa2onQxM9C58cehKsVKP8aqCWEWHU5DPQFdhm3hA5wtDkvWbvHNucWdiCtgJ4Hv15cDokQtEjmVYvow/mlG+3MpVn2tMlbvh+zfqSO+hV4l4rGXIYWVLVvg01yY4HSFMmMKVl1IrNSAm3fyvNo7b3T+0Ut/7dUz2GjAC6A2QOCJZkQw6Ge7ky0IFpLQvpUvdFhPjG+e9CUeso98wFKAUJDfLxR3h/OJbYb2akDS+Hze0hHNPRRZHd6TTGsLRo= 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: fb3db6f0-6125-4b96-189e-08d748c69686 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2019 12:30:06.1779 (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: U+Kp0YZ/wSJaqeIRsLc0+kot82RoBbeVWCYZ3ASDu2zwtkOsHjN9T1wFvQJoFwWsfvxP58zEl8dYO/rgdWkHUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4400 Subject: Re: [dpdk-dev] [PATCH v5 02/10] examples/l2fwd-event: add infra for eventdev 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" > -----Original Message----- > From: dev On Behalf Of > pbhagavatula@marvell.com > Sent: Thursday, October 3, 2019 2:28 AM > To: jerinj@marvell.com; bruce.richardson@intel.com; Akhil Goyal > ; Marko Kovacevic ; > Ori Kam ; Radu Nicolau ; > Tomasz Kantecki ; Sunil Kumar Kori > ; Pavan Nikhilesh > Cc: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v5 02/10] examples/l2fwd-event: add infra for > eventdev >=20 > From: Pavan Nikhilesh >=20 > Add infra to select event device as a mode to process packets through > command line arguments. Also, allow the user to select the schedule type > to be either RTE_SCHED_TYPE_ORDERED or RTE_SCHED_TYPE_ATOMIC. >=20 > Usage: >=20 > `--mode=3D"eventdev"` or `--mode=3D"poll"` > `--eventq-sched=3D"ordered"` or `--eventq-sched=3D"atomic"` >=20 > Signed-off-by: Sunil Kumar Kori > Signed-off-by: Pavan Nikhilesh > --- > examples/l2fwd-event/Makefile | 1 + > examples/l2fwd-event/l2fwd_common.h | 3 ++ > examples/l2fwd-event/l2fwd_event.c | 34 ++++++++++++++++++++ > examples/l2fwd-event/l2fwd_event.h | 21 ++++++++++++ > examples/l2fwd-event/main.c | 50 +++++++++++++++++++++++++++-- > examples/l2fwd-event/meson.build | 1 + > 6 files changed, 108 insertions(+), 2 deletions(-) > create mode 100644 examples/l2fwd-event/l2fwd_event.c > create mode 100644 examples/l2fwd-event/l2fwd_event.h >=20 > index 887a979d5..01b1d531d 100644 > --- a/examples/l2fwd-event/main.c > +++ b/examples/l2fwd-event/main.c > @@ -2,6 +2,7 @@ > * Copyright(C) 2019 Marvell International Ltd. > */ >=20 > +#include "l2fwd_event.h" > #include "l2fwd_poll.h" >=20 > /* display usage */ > @@ -16,7 +17,12 @@ l2fwd_event_usage(const char *prgname) > " --[no-]mac-updating: Enable or disable MAC addresses > updating (enabled by default)\n" > " When enabled:\n" > " - The source MAC address is replaced by the TX port MAC > address\n" > - " - The destination MAC address is replaced by > 02:00:00:00:00:TX_PORT_ID\n", > + " - The destination MAC address is replaced by > 02:00:00:00:00:TX_PORT_ID\n" > + " --mode: Packet transfer mode for I/O, poll or eventdev\n" > + " Default mode =3D eventdev\n" > + " --eventq-sched: Event queue schedule type, ordered or > atomic.\n" > + " Default: atomic\n" > + " Valid only if --mode=3Deventdev\n\n", > prgname); Please also add parallel mode for completeness. > } >=20 > @@ -71,6 +77,26 @@ l2fwd_event_parse_timer_period(const char *q_arg) > return n; > } >=20 > +static void > +l2fwd_event_parse_mode(const char *optarg, > + struct l2fwd_resources *l2fwd_rsrc) > +{ > + if (!strncmp(optarg, "poll", 4)) > + l2fwd_rsrc->event_mode =3D false; > + else if (!strncmp(optarg, "eventdev", 8)) > + l2fwd_rsrc->event_mode =3D true; > +} > + > +static void > +l2fwd_event_parse_eventq_sched(const char *optarg, > + struct l2fwd_resources *l2fwd_rsrc) > +{ > + if (!strncmp(optarg, "ordered", 7)) > + l2fwd_rsrc->sched_type =3D RTE_SCHED_TYPE_ORDERED; > + else if (!strncmp(optarg, "atomic", 6)) > + l2fwd_rsrc->sched_type =3D RTE_SCHED_TYPE_ATOMIC; > +} > + > static const char short_options[] =3D > "p:" /* portmask */ > "q:" /* number of queues */ > @@ -79,6 +105,8 @@ static const char short_options[] =3D >=20