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 DCD42A328D for ; Tue, 22 Oct 2019 19:03:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A28811BF41; Tue, 22 Oct 2019 19:03:05 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 7386D1BF3D for ; Tue, 22 Oct 2019 19:03:03 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9MGvFDV027331; Tue, 22 Oct 2019 10:03:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=sFAm1znBwCp/W7D53AyV5n6UWbR0aEKddjeeEzftcfg=; b=Y1LIPeDqZlNxgxKhMHNlA5iW+8umUw9rDf2JsUehQO0KDkrIID+li1i7pG94tapIMC+R B2Eq/WDfJDoADT22tEB/VlSt2Uye3RRipw13xoOVVzAwo4s86wuAkf0LIzoeYrLDZpwC OdpUXlx0dLWyx/rZXkti/d4w9BHIA7cIcXIebRQe632I53QyCNk01kuDmQuY0ZEKKNas BTWYiqmssSEpHCjxhYcDPmgHyH4AWC9btfggjbZBm/gslGWz3wVljZc9mDWLOwnIMbgx Z2hBt60tTyL97QRolK1ZwScdwfAN3uk30uDio8e0yIBBltGW3Zx4ZV/4GJO1wTepl3qW Fw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2vsw611wf8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2019 10:03:02 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Oct 2019 10:03:00 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (104.47.42.57) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 22 Oct 2019 10:03:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZGdmk4mFoohm/USLkAqT80mrGnxu7X9f1ai/I3wkMB3jrlVqFIb5SEDRu1qWY524Q1Kdk6z4kU7S9cECzxnCVKpdCSUG0n4TKYEz7z7Qh+efl73Y0EUrrCyjIvTAS6hKkXFjYVfDT1effvIreUFVUSI+Xs1+U2MOLZMkxNY2DvbHpGHuok9TmzsvsnLNEhk/pZw+zjALaKHn9hdbMzuOZykGhyzgD3ol6pYAaK3GGLcPAOh47SgMHg4pPcRYK57XFmK+NxOjyv7UmBySKohliXxWDFarAK8/TUb7vNQhxFU0XmkF5VTsMBcowR6wES2qRBVTqTIMrW9LDB0DrNUJzw== 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=sFAm1znBwCp/W7D53AyV5n6UWbR0aEKddjeeEzftcfg=; b=CPYwSUJz8cE/MJXdPQyZAJ1IdKz4iek6FBC50Csflgp80DpvPAlN02rbwlYdhHH0uSgKVaBlIgtwKz4rzmIeAABzNn0XlOZLRrwY1clu4DhW9ORfcZo1h4p25oyLBKyc7MYuHjgKQOpVplSMK/zMrtdj1kZn2sxbfXmW4bWRmW9OfQHA6lOQ3YjX2uviAM0lq3sYiongVyxothrqEBUpbqdCTl97R4pInhxvLM5IVdklqp4V4JGI6Becx3UnGIaWywWXyruyAWM29jPsDp9fqH12NNhg4IYuyQtkKvSV6FhNX1xwoSlQEO8nyO/SRTD7Wyrdt9Hx0syZ3C4iAq0H1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sFAm1znBwCp/W7D53AyV5n6UWbR0aEKddjeeEzftcfg=; b=Rs0G/1ai/PS9vz39eeNUaVSeQjoHGMHmxwTdZTndkvG3I/vW7PL0iI1alMUDqTN9r+vMWStyR57jtIj51xtEPJSexA0hekUSHha4Wyj5k8BXFdVSZaAxNDPA8sRnaNkDqJJRdpRFv4nczPwvaiet2aZmKbsmBrI6uQ9kti31b6A= Received: from BN6PR1801MB1859.namprd18.prod.outlook.com (10.161.154.35) by BN6PR1801MB1827.namprd18.prod.outlook.com (10.161.154.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2367.24; Tue, 22 Oct 2019 17:02:59 +0000 Received: from BN6PR1801MB1859.namprd18.prod.outlook.com ([fe80::9c:1e0f:afef:9410]) by BN6PR1801MB1859.namprd18.prod.outlook.com ([fe80::9c:1e0f:afef:9410%6]) with mapi id 15.20.2347.029; Tue, 22 Oct 2019 17:02:59 +0000 From: Pavan Nikhilesh Bhagavatula To: "Varghese, Vipin" , Jerin Jacob Kollanukkaran , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Kovacevic, Marko" , Ori Kam , "Nicolau, Radu" , Akhil Goyal , "Kantecki, Tomasz" , Sunil Kumar Kori CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v6 08/10] examples/l2fwd-event: add eventdev main loop Thread-Index: AQHVh75w7xGx+BciV0m+qgvjJ1dD9qdlSjCggACzjoCAAOKyIA== Date: Tue, 22 Oct 2019 17:02:58 +0000 Message-ID: References: <20191002205754.11746-1-pbhagavatula@marvell.com> <20191014182247.961-1-pbhagavatula@marvell.com> <20191014182247.961-9-pbhagavatula@marvell.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D3DCA5B@BGSMSX101.gar.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D3DE2EB@BGSMSX101.gar.corp.intel.com> In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D3DE2EB@BGSMSX101.gar.corp.intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.171.227.191] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b807e89d-a86d-403a-43cd-08d75711b0ed x-ms-traffictypediagnostic: BN6PR1801MB1827: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2582; x-forefront-prvs: 01986AE76B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(136003)(39860400002)(396003)(376002)(199004)(189003)(51914003)(25786009)(486006)(8936002)(81156014)(81166006)(86362001)(476003)(186003)(71190400001)(11346002)(446003)(256004)(71200400001)(3846002)(52536014)(76116006)(66556008)(64756008)(66446008)(6116002)(2906002)(66476007)(66946007)(33656002)(5660300002)(6306002)(9686003)(55016002)(99286004)(4326008)(110136005)(229853002)(6246003)(7736002)(305945005)(478600001)(6436002)(316002)(66066001)(966005)(6506007)(74316002)(26005)(6636002)(14454004)(102836004)(7696005)(76176011)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1801MB1827; H:BN6PR1801MB1859.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lxvj7QNVSo0EAACS96Kayrg5kYxX6gSZz+O/PNmW/1Kp4YuZwnUDUMWDO1svTOugFIyLSrTv/0+Q4MoYtyVvnB7jRGYn1q2nFrwlSimS7tWSmmY/P9IXxebzyTITxBruf7D+0ilpiXByCHKPQSGV3Mdyb4Gtd9tTZIcWypdWug+DqAskWJ6GfkpKLUXj/2nr9/5PD4IcQByAI5fo9+31K/kpPM5vqcd7TTncUtogfYPy5xkhde6OPxmMTRKff8BCoA3Wb9ITC7JJljvctEOvuY2483gOJ/AQlOV7kZFySEAkMN9ayw4z4zT657Q7qbVSesNXcztN+/vPzh8kjkM/uaVawvce6OnFwRpnkmRqoPjCn0CbQ44yzbZPW89seiO1CpI4x0FQ9Mor6WPnMffF4D/m6HIIukal+wZNupI/Rb3h9+OWjrNnWhkZzxjoGf6MECE8I80prLMOwKXiZ1dl3ZLZGGcSzA3R1kM2y/rW9E8= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b807e89d-a86d-403a-43cd-08d75711b0ed X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2019 17:02:58.8645 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5d2Xd/0KtKDGvIoHrbZQj5nkt2LJF22H/7xqlHJ/akOwlXStjIDRHs+LfHp4baoWeT5yEyUqf2zEENTxVlxiS8KFXTT+Ea0VMzjPsUdtYU4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1801MB1827 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-22_03:2019-10-22,2019-10-22 signatures=0 Subject: Re: [dpdk-dev] [PATCH v6 08/10] examples/l2fwd-event: add eventdev main loop 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" >> >> + /* Read packet from eventdev */ >> >> + if (!rte_event_dequeue_burst(event_d_id, port_id, >> >&ev, 1, 0)) >> >> + continue; >> >Is not this unlikely `nb_burst =3D=3D 0` >> > >> >> Not necessarily refer >> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- >3A__mails.dpdk.org_archives_dev_2018- >2DJuly_108610.html&d=3DDwIFAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DE3Sg >YMjtKCMVsB-fmvgGV3o- >g_fjLhk5Pupi9ijohpc&m=3DHyS43be9AB6KIroLm8d2EK4M6_lE_fZua3CTxY >5vbiU&s=3DFcZlWlkbhYkrQ3HApkxAX6A17gyHQZ0cYoDeG3KkwTw&e=3D > >Thanks for the article and links it is helpful. Following the article >suggestion, should not the code be enhanced for execute code rather >than continue? > Do you mean there would be a difference between the below cases? void case1() { while (1) { if (!(random() & 0x1)) continue; } } void case2() { while (1) { uint8_t is_one =3D random() & 0x1; if (is_one =3D=3D 0) continue; } } AFAIK both the above cases compile to the same asm. >snipped >> >> + /* Read packet from eventdev */ >> >> + nb_rx =3D rte_event_dequeue_burst(event_d_id, >> >port_id, ev, >> >> + deq_len, 0); >> >> + if (nb_rx =3D=3D 0) >> >Can we use `unlikely`? >> >> Not necessarily refer >> https://urldefense.proofpoint.com/v2/url?u=3Dhttps- >3A__mails.dpdk.org_archives_dev_2018- >2DJuly_108610.html&d=3DDwIFAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DE3Sg >YMjtKCMVsB-fmvgGV3o- >g_fjLhk5Pupi9ijohpc&m=3DHyS43be9AB6KIroLm8d2EK4M6_lE_fZua3CTxY >5vbiU&s=3DFcZlWlkbhYkrQ3HApkxAX6A17gyHQZ0cYoDeG3KkwTw&e=3D >Same as above. > >> >> >> + continue; >> >> + >> >> + for (i =3D 0; i < nb_rx; i++) { >> >> + l2fwd_event_fwd(rsrc, &ev[i], tx_q_id, >> >timer_period, >> >> + flags); >> >> + } >> >> + >> >> + if (flags & L2FWD_EVENT_TX_ENQ) { >> >> + nb_tx =3D >> >rte_event_enqueue_burst(event_d_id, port_id, >> >> + ev, nb_rx); >> >> + while (nb_tx < nb_rx && !rsrc->force_quit) >> >> + nb_tx +=3D >> >> rte_event_enqueue_burst(event_d_id, >> >> + port_id, ev + nb_tx, >> >> + nb_rx - nb_tx); >> >Can we use `continue` as we do not transmit from the same worker >int >> >his case? >> >> I'm not sure I follow what you meant here. We are trying to transmit >the work >> present on the worker till we succeed, if we do a continue then we >would loose >> the untransmitted packets. >Maybe I mistook the L2FWD against ETHDEV_EVENT flags. As per my >current understanding L2FWD_EVENT_TX_ENQ uses extra queue stage >for single-event-enqueue for TX adapter, while >L2FWD_EVENT_TX_DIRECT allows the worker to do transmit via port. >May be this is wrong expectation. > The above is understanding is correct. I just don't see how a continue out = of the while loop would help. In the above case we are going to retry enqueue(TX_ENQ) or transmit(TX_DIRE= CT) until we succeed. >> >> @see examples/eventdev_pipeline/pipeline_worker_generic.c +109 >I will check the same and get back as required. > >> >> >> + } >> >> + >> >snipped