From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9E0044385A; Sun, 7 Jan 2024 21:57:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BAF3402C9; Sun, 7 Jan 2024 21:57:11 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2081.outbound.protection.outlook.com [40.107.13.81]) by mails.dpdk.org (Postfix) with ESMTP id A1DDF402B1 for ; Sun, 7 Jan 2024 21:57:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RI4P28Rt3SM3kfpRf8Jp/WTJ/KazivXzN4+I5AjPSBbXIDLHv22I4813kmyXq33KJOopGswVCqeCQpfKrD6FG3Ei0Pk5hR2adj8rixNQmqsYOUPdewEl2QiF7W7YMTMOI1KNEmZjS/VEo5WypBbxVpCe/7cwuInDi9N8UIeslA+dmJ1SeJr1ranAz7ptC1CatiHrIpTg6LPim5vAg9FJFPycVus84y00vc10+U6szdZ5qXNxi4bbwWjHDenz01bUz3G+v4B74apOzJl6ieOT0J46kGxdpToOn6m+0loiLGQ9uQYaiaG65x+MOj4CFj2umi0dNwE98ouOyp+2th+UtA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fNrmQz/EfOliR2pqkIA4qBQBG5UPnLvjV/CFSCEIhuM=; b=RsBN9VGog94e2jgCJTGHrTlQzE4pwTjxk/kNoc71T41zNcU3R/WsbwC8vfgdfsWG6DW9yxpEIwt5AfOOGbFoFWdsTehPY0nshUwgxxIcxUptezlblHlgTE/hH18+dWv+Vd36nmxhO4Y1Jj5AFO8ZBdSNvZyw5LOdajqoh/YlBDOCjBwzNhkacGP86Ry5Y3wF4DaTust191bzH3Olot1Hl+FR1hcJlmI8Kyncou+eDdl1FHxJPvkt7ZidkfP5Aqrdhy3kmC/FaTlTbvYjTOUaNjqZxwXbCOeOqVX6wWC8HX6nV7fZJZ5XifKk+ruJ7PeQqTM44w9jAxfzmGjm94I1+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fNrmQz/EfOliR2pqkIA4qBQBG5UPnLvjV/CFSCEIhuM=; b=saXTZ9D2/6lwPX5Q3CB583WK97RIHPNVMYffocv1NaTKfadQ2nMZ3+Fl7bK169ySzMuGv/px0V6FSgL5f7MpnKu0JJ9rabbkcYwb18wbBL7R6k/us8yunF8jHfX+DXvWqoxygG9Yj1BhN3rFJQ9e7mvSIZA39WOp0sBb8BWy+LE= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by PAXPR08MB6589.eurprd08.prod.outlook.com (2603:10a6:102:159::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Sun, 7 Jan 2024 20:57:07 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::6ee5:b854:81e:c23e]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::6ee5:b854:81e:c23e%7]) with mapi id 15.20.7159.020; Sun, 7 Jan 2024 20:57:07 +0000 From: Honnappa Nagarahalli To: Stephen Hemminger , "dev@dpdk.org" CC: nd , nd Subject: RE: unnecessary rx callbacks when zero packets Thread-Topic: unnecessary rx callbacks when zero packets Thread-Index: AQHaQZA0T4QMxPSltEOfXqesiIHfc7DO1MUw Date: Sun, 7 Jan 2024 20:57:07 +0000 Message-ID: References: <20240107093721.512f1365@hermes.local> In-Reply-To: <20240107093721.512f1365@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 9786244C4D85394DAA7A74C2C443C2C2.0 x-checkrecipientchecked: true authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBAPR08MB5814:EE_|PAXPR08MB6589:EE_ x-ms-office365-filtering-correlation-id: 9e8a25c3-9d81-47a9-a4bc-08dc0fc335d2 nodisclaimer: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k/njb6ZfAUkTDm015KKe8MLCtWQkKcM1mgncgq6ruJVCtGE85UWaa/Fed0YR0nVcZY1KjAf13bXgQ8vrze1C6EM0QY/zgd05cqOOKJ/WU1qsrFdtkP3nzzpudx7p0XaYPIRcBifwQLLtx/cA9BvyUmS47WUhA8Zo98M+Y4QYX0s109GE9bqhVI+v/h0KZWjPNH2uHy2wmmAUb/04xZt2mUwro0za68LGTV1mTKm8BkKbzrBpmZe/Prj8BAI9P9S62RQIp6YqpQPeSEOVA1EM3j7d/fhz03ee0vjEMysCXQG3f2USwmDEgTlBe1d2BvSnpngmsmcSZc2V4nXwinc0HyNG8KT6qIE/jaJh0Qni68omfKs/vsida9MlrubPRq1KnB2s5sVkFjepfHf0CBZllwaqVC1dd3wQiz0hqGEc4z4bh9227DC6HlyHMwO/XR+wiOY8uDlfk/Iii8hufyTJ39TGfoO3MJdzVV38Yx1cSvu9C/r49oXpDmGT90fuYOD7kWR/vMxqQUWAJKdyVQ0JE+6LOPaobxaX7JjaZBAsFqrCPIcrxW+lXP2CuzX+OVzXBckiNGBjbW69tszloC1H+qMpb+7hYAOHoLUEcbTM68a/MlA5VJ+szb40LBXAJMHp x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(346002)(366004)(376002)(39850400004)(230922051799003)(64100799003)(1800799012)(186009)(451199024)(122000001)(38100700002)(41300700001)(7696005)(2906002)(55016003)(5660300002)(38070700009)(54906003)(110136005)(9686003)(53546011)(33656002)(86362001)(6506007)(316002)(8676002)(8936002)(52536014)(4326008)(66946007)(66556008)(66476007)(76116006)(64756008)(66446008)(83380400001)(71200400001)(478600001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UNCkExBozvNP5mMwBEnqtiWYHm7+VF6DfTr9XaeXoQ2ur4511ViPpIaSORWR?= =?us-ascii?Q?aNg74TQLyYCMaLrRyniyY0fOhMHG1hfkhMQ6cs9o1ECwUqjUC5jpCs/ep821?= =?us-ascii?Q?56PkF6bB2nknGya3ngZL5c7v5N+gL+WH3NAUo25j+Y52D+GuW8Tni2AEOFuy?= =?us-ascii?Q?MeMyHKANhBpuCdNyjWtPfTm7rozHtUQEst+IyxyCdtDeGyBcf1olvE/BQ8yo?= =?us-ascii?Q?itLLA7S0gKhAvrIpCLSiegJwy+vxtxEHygHqQr/EXA5GM7JhYT6tBaokObFc?= =?us-ascii?Q?TsxvoVddcySU8JrB7/sOWVnr8z8hc/nGxO6avpN5tXYJB6dpFywQL7BDCEH+?= =?us-ascii?Q?velq09dZ0JXeFlg4BTfr1NQfGnwTsCwrRPPTYrXKTF4V3pAZgy/sdNKxJ7gD?= =?us-ascii?Q?JpNHFIv+N7ZfYG98cUoBW6YITNOhris+fdqrNq8LZgZ2L6y6lFn6hv5Q5vkd?= =?us-ascii?Q?WDqPNusBh3Ezl3lK97Yl/xxX1qRb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ii?Q?UWVTRvKZqf9EpiUWATohR2Pw3Ip65FH6x+PvlqX+Pcl+4FAyfWux0GXEaHUJ?= =?us-ascii?Q?p84qGpYPkqZymIZeD+hV75OTySpnguTmoP8hH3Ycgg/9z/7D0gOi0OPuunnc?= =?us-ascii?Q?Rbdh/mkGK000z/p4XoDkuvhkGSNlGgL5zQ9ejdYqx5n3LZMfdNkxc4ZUrmpe?= =?us-ascii?Q?HndRihuzzKT5JnIfr/7xKxfXoPKqlFqxH3biKb8nzncz27Zd8MZV3d9bQH5f?= =?us-ascii?Q?QaoIjFMN0E8bA6+YsYXpSdUY7kmhYp9vJ5HGdDYI95KF0jewyNy65JQADTIo?= =?us-ascii?Q?MQMjxg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBAPR08MB5814.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e8a25c3-9d81-47a9-a4bc-08dc0fc335d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2024 20:57:07.5777 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: i/xqaFnrlDsxbe9GDvkULrW5XyG6/zba1KbAjqXIIBxH/291JSBiNhTbLXdVz6sFX+cxKtNIrVTReQUDsB+FIOLxBybPFaoMdQK1iAIqvkg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6589 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Stephen Hemminger > Sent: Sunday, January 7, 2024 11:37 AM > To: dev@dpdk.org > Subject: unnecessary rx callbacks when zero packets >=20 > I noticed while looking at packet capture that currently the receive call= backs > get called even if there are no packets. This seems unnecessary since if = nb_rx is > zero, then there are no packets to look at. My one concern is that an > application could be using callbacks as some form of scheduling mechanism > which would be broken. Is it possible that the call back functions are maintaining statistics on z= ero packet polls? >=20 > The change would be: >=20 >=20 > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index > 21e3a21903ec..f64bf977c46e 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -6077,7 +6077,7 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t > queue_id, > nb_rx =3D p->rx_pkt_burst(qd, rx_pkts, nb_pkts); >=20 > #ifdef RTE_ETHDEV_RXTX_CALLBACKS > - { > + if (nb_rx > 0) { > void *cb; >=20 > /* rte_memory_order_release memory order was used when th= e