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 1715242B09; Mon, 15 May 2023 03:59:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C40E040ED6; Mon, 15 May 2023 03:59:10 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 69C9840395 for ; Mon, 15 May 2023 03:59:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684115948; x=1715651948; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=z8L6pWW+tYgVuyO4zRwIJwEHnyTEEQRey2qaOlougzk=; b=njSdGIyFJ62Iie2tsNtri7h7Bd3r704Akel6jJzvHYvlxooz9qSkFvi4 cki2Z/jYqkpwGAZt/a2WDBme8SVyGBWyEKGzJFxSblRQyWpznxjmeJsgt fOEXbqbi68eEEYN8fQ4gmu1bkTzlfWir7bMYEQDxcBh0GPwGRt+ZFWcBz W/uTcPqPpDiGWTx5bmw265sXZ1EXOn9IVrOQcvjDIhQJDWu4WWxweq3RW IDDs/tG3ewVxeqrHG9gm0jbkq/YlDHnHB4q9H0xB3TCCzwDeZwATPxhSg l8vbb53BRS4U4oZdFFGjiYwEmSMZe18G5lI4enWKG94bbE4FTC6bDIR8o w==; X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="414480803" X-IronPort-AV: E=Sophos;i="5.99,275,1677571200"; d="scan'208";a="414480803" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2023 18:59:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="694848525" X-IronPort-AV: E=Sophos;i="5.99,275,1677571200"; d="scan'208";a="694848525" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga007.jf.intel.com with ESMTP; 14 May 2023 18:59:04 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 14 May 2023 18:59:03 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Sun, 14 May 2023 18:59:03 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.42) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Sun, 14 May 2023 18:59:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XpP4oA9gwSKS7eU1F18TIz6XtlSUcFAumBHLQmY/8wLoSiW2zNCOhxNCKBsNwYW+tV6HKmV96i3C73QuGnKHjwz6sFaJATTpwzZOMKoAeveG7HPdqxBFJeyi7e5xGyWLVyWeWcVw38omAEI5GXjTALGbwpDRrM0UrU4lIcG8NIiTBqLiIKvZ9DO+V0Udsg3hlTGehgl3j6MWJ/cYOdoOA2Shp9z6ayFdaIR8qZ6bmrEivTBKs1HwlxcJUWewvRJU/VSXEk+CZQhXayEstAMhBMGwFg+JGXMA0v+IEIEaW1aIm9j2K7WHM8r/Gx3zvgdj0u/f3aI1/UIHq0WoVG6XsA== 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=e01rYK4slTUMJiSxi/pAPeedhdr6uGquDQZUY+ggKaA=; b=FuOlmdVQ3nXES88V2XCuHPfACHnc/WvkOXsme63kOzKrhmj4P2LiOacYBoy7pwP3nRA6G37PxkXNc1aDAbvwgPtSRHBnbnsRv8dCu9oAgy2QBGhxY55l5Q6MMYxRtabWvjHt9oWBjBZtbliVI+5MptF6QawITzNPVSJNcifTNTWYsp5q7yK7BFw0hu7UqGDXzowdw1SfnEPbUb4iunZ7QXzImThxW7mqFy/a2XtI/3KmLIdgxCm/wQf8ZcT68cKBsKNgdsfxyVMnF3VPJ4ZQ1zCBMZ0ibccUB4TtDr1uhKu+GZePdiGOAa5QUkXp8uN8KEX4m4gyq4b1wdC5fMNr3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by IA1PR11MB7295.namprd11.prod.outlook.com (2603:10b6:208:428::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.29; Mon, 15 May 2023 01:59:00 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e570:d9a7:df1b:1589]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e570:d9a7:df1b:1589%6]) with mapi id 15.20.6387.030; Mon, 15 May 2023 01:59:00 +0000 From: "Zhang, Qi Z" To: "Zhang, Qi Z" , Feifei Wang , "Richardson, Bruce" , Konstantin Ananyev , "Zhang, Yuying" , "Xing, Beilei" , David Christensen , Ruifeng Wang CC: "dev@dpdk.org" , "nd@arm.com" , "Honnappa Nagarahalli" Subject: RE: [PATCH v2] net/i40e: remove redundant judgment Thread-Topic: [PATCH v2] net/i40e: remove redundant judgment Thread-Index: AQHZYUb6pZ3945Elkku6Wif5jzf/xa8+8XYwgBvtiGA= Date: Mon, 15 May 2023 01:59:00 +0000 Message-ID: References: <20211220054246.4031616-1-feifei.wang2@arm.com> <20230328072828.386576-1-feifei.wang2@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|IA1PR11MB7295:EE_ x-ms-office365-filtering-correlation-id: 881f84c8-4358-4692-eab4-08db54e7f380 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: olKbzdUKDj5ySo1P06FSCeTdtiBSpOmbofZt19Bzj4Mvaksgtp7L61lxeyPVtOFwl2/Sp2PzX3WjhkMWv/a2jLQxMYyyNZLJDBO7o4JQLDWoGR+42o9Ai2o+J1iEFC2MBNIz7JK1oRNcJvoTavpLEBgqsjaVN9Ubh90ImcVWc73PwMuZKDzMMSW2acUrLjfUsvWLNpKkihcWLcmVN763aePXtxt7KoAU9YW86G6eN0dsz68tU7EWHW6uLQ9VaSXvJZ14eRNk//Bu9Ol5TzeRLIYbPvI7X+NA7ENkqdHK+1a9iazqxvXlFijJQq8HTpnzC95MU137Dwg6vRKpYSC+weyYGtvnIFWM9DoPWylfyg/oms1YPaquAwSXwb0C2SzsCJHxyMgFR9hgD0cNg30jfva8jAwCQEq6xPg0C79oJeSIP4MQ9jvIsVVMVX4KWE9Ba67XgVrHrUfBwzwGnrNbpWv0BToQjlVReJVVlk2w3zvSwKtiq6FErCAqozJdxN0BWeWv3mbz+hciRho87IasSS8aPpmKLiLju++OcyHXmatYVGtb+9bjwiUd/wDWTgIaAGEV5dGLVEyE6wB3zmmXjMBGJd0keqU24OWLGwe94PZAGL3TjOsLq1Jpd/mB75S0Vj0Fp+e5D0BKEyDh3CkhXg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(396003)(376002)(346002)(136003)(39860400002)(451199021)(33656002)(86362001)(110136005)(54906003)(316002)(76116006)(66556008)(66446008)(64756008)(66946007)(66476007)(4326008)(478600001)(7696005)(71200400001)(55016003)(8936002)(8676002)(5660300002)(52536014)(41300700001)(2906002)(38070700005)(82960400001)(921005)(122000001)(38100700002)(26005)(186003)(53546011)(9686003)(6506007)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8zJK+3suszIrcKz9W83yP7wXzWPiWUGNae+9nkaYGB1kE4qvgDPrL+zX3Y6n?= =?us-ascii?Q?9av2m5loLhKpFIn8boJsJLk1NtKcurWRWN0FNMsOR9nhzdfNHiKWLaVdNrAO?= =?us-ascii?Q?p12/6TcB0qYg52Kh4s0SPWHglmEr9sAwKRviK4pRxh1dnAhL1ds4PvcbNCpV?= =?us-ascii?Q?a2U+/zi/JBMQtlbhvEwFUmF2FYhyJ6znwfNqYytiVFjuPiNFm6XJi5ruXQ9a?= =?us-ascii?Q?3eX5NpZMtbmL2j0dnF8w5QYFxHLzES7YfHN/MJEH5x5lzZzUzSwUnv4nFqW2?= =?us-ascii?Q?2MhftbBidV84d1xdvqUwWXAcSrWEitFUfCB9yQ4RjoQwmxGynzcOWN8UWGGZ?= =?us-ascii?Q?Oag2KQPWJ8DfDiQqlBl3+zIx2L0W6+Cj8z96/ubH3fuCmheqNv9HXMZu31nc?= =?us-ascii?Q?BhZ6jNAwJZ6OxzzkR7IG5b5+UU45Ik2W4Pc+jXNZ3vqERuaGFo3Qfc2u6IZ6?= =?us-ascii?Q?/xmV2xLsOrqV+WNwjN6esl+Pe14FgKucQu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us-ascii?Q?XZJfX4RZua5zRVDyp7GSz4kaDuJP/YLAU+IfsxDdcbONV2e+kI5K1VujZSEB?= =?us-ascii?Q?FUvaCe/YSMexePM6RoRKtxB6Y6xWsNmGyRcVWhtWc+dx0pQuEmzLVn0s/mxv?= =?us-ascii?Q?8yKLzYVmVIfNGXw14pXkpeR+ye5drT5ixK438sSVjQBFGyQeO9DzD72cayu/?= =?us-ascii?Q?zDzucxOzwuKdeOWMq6vZ4Tiu3DNYLoC9YQvcYbIz?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 881f84c8-4358-4692-eab4-08db54e7f380 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2023 01:59:00.2596 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gWUm9VlP7D74a/G1Uyx5j4yH53YDfZxS67yP70CP/vVLnE5SPuV3zshyVuPOHv+Y2R9dx71PyYKH9GuoqILy1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB7295 X-OriginatorOrg: intel.com 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: Zhang, Qi Z > Sent: Thursday, April 27, 2023 3:38 PM > To: Feifei Wang ; Richardson, Bruce > ; Konstantin Ananyev > ; Zhang, Yuying > ; Xing, Beilei ; David > Christensen ; Ruifeng Wang > > Cc: dev@dpdk.org; nd@arm.com; Honnappa Nagarahalli > > Subject: RE: [PATCH v2] net/i40e: remove redundant judgment >=20 >=20 >=20 > > -----Original Message----- > > From: Feifei Wang > > Sent: Tuesday, March 28, 2023 3:28 PM > > To: Richardson, Bruce ; Konstantin Ananyev > > ; Zhang, Yuying > > ; Xing, Beilei ; David > > Christensen ; Ruifeng Wang > > > > Cc: dev@dpdk.org; nd@arm.com; Feifei Wang ; > > Honnappa Nagarahalli > > Subject: [PATCH v2] net/i40e: remove redundant judgment > > > > Merged variable updates under the same condition. It reduces branch. > > > > In ampere-altra, there is no performance improvement with this patch. > > In x86 sse and avx2 path, there is also no performance improvement. >=20 > Thanks for sharing the results. While the code implements some best > practices, such as reducing branching and adding compiler hints, which > should generally improve performance, it's not necessary to highlight tha= t it > didn't provide benefits on certain specific platforms. >=20 > Would it be ok to remove the last two lines when merging the patch? Ping >=20 > Otherwise > Acked-by: Qi Zhang >=20 >=20 > > > > > > v2: > > 1. add change for avx and altivec path. > > > > Suggested-by: Honnappa Nagarahalli > > Signed-off-by: Feifei Wang > > Reviewed-by: Ruifeng Wang > > --- > > drivers/net/i40e/i40e_rxtx_common_avx.h | 9 +++++---- > > drivers/net/i40e/i40e_rxtx_vec_altivec.c | 9 +++++---- > > drivers/net/i40e/i40e_rxtx_vec_neon.c | 9 +++++---- > > drivers/net/i40e/i40e_rxtx_vec_sse.c | 9 +++++---- > > 4 files changed, 20 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_rxtx_common_avx.h > > b/drivers/net/i40e/i40e_rxtx_common_avx.h > > index cfc1e63173..85958d6c81 100644 > > --- a/drivers/net/i40e/i40e_rxtx_common_avx.h > > +++ b/drivers/net/i40e/i40e_rxtx_common_avx.h > > @@ -198,14 +198,15 @@ i40e_rxq_rearm_common(struct i40e_rx_queue > *rxq, > > __rte_unused bool avx512) #endif > > > > rxq->rxrearm_start +=3D RTE_I40E_RXQ_REARM_THRESH; > > - if (rxq->rxrearm_start >=3D rxq->nb_rx_desc) > > + rx_id =3D rxq->rxrearm_start - 1; > > + > > + if (unlikely(rxq->rxrearm_start >=3D rxq->nb_rx_desc)) { > > rxq->rxrearm_start =3D 0; > > + rx_id =3D rxq->nb_rx_desc - 1; > > + } > > > > rxq->rxrearm_nb -=3D RTE_I40E_RXQ_REARM_THRESH; > > > > - rx_id =3D (uint16_t)((rxq->rxrearm_start =3D=3D 0) ? > > - (rxq->nb_rx_desc - 1) : (rxq->rxrearm_start - 1)); > > - > > /* Update the tail pointer on the NIC */ > > I40E_PCI_REG_WC_WRITE(rxq->qrx_tail, rx_id); } diff --git > > a/drivers/net/i40e/i40e_rxtx_vec_altivec.c > > b/drivers/net/i40e/i40e_rxtx_vec_altivec.c > > index 2dfa04599c..8672ad1c41 100644 > > --- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c > > +++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c > > @@ -89,14 +89,15 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq) > > } > > > > rxq->rxrearm_start +=3D RTE_I40E_RXQ_REARM_THRESH; > > - if (rxq->rxrearm_start >=3D rxq->nb_rx_desc) > > + rx_id =3D rxq->rxrearm_start - 1; > > + > > + if (unlikely(rxq->rxrearm_start >=3D rxq->nb_rx_desc)) { > > rxq->rxrearm_start =3D 0; > > + rx_id =3D rxq->nb_rx_desc - 1; > > + } > > > > rxq->rxrearm_nb -=3D RTE_I40E_RXQ_REARM_THRESH; > > > > - rx_id =3D (uint16_t)((rxq->rxrearm_start =3D=3D 0) ? > > - (rxq->nb_rx_desc - 1) : (rxq->rxrearm_start - 1)); > > - > > /* Update the tail pointer on the NIC */ > > I40E_PCI_REG_WRITE(rxq->qrx_tail, rx_id); } diff --git > > a/drivers/net/i40e/i40e_rxtx_vec_neon.c > > b/drivers/net/i40e/i40e_rxtx_vec_neon.c > > index 12e6f1cbcb..49391fe4c7 100644 > > --- a/drivers/net/i40e/i40e_rxtx_vec_neon.c > > +++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c > > @@ -64,14 +64,15 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq) > > } > > > > rxq->rxrearm_start +=3D RTE_I40E_RXQ_REARM_THRESH; > > - if (rxq->rxrearm_start >=3D rxq->nb_rx_desc) > > + rx_id =3D rxq->rxrearm_start - 1; > > + > > + if (unlikely(rxq->rxrearm_start >=3D rxq->nb_rx_desc)) { > > rxq->rxrearm_start =3D 0; > > + rx_id =3D rxq->nb_rx_desc - 1; > > + } > > > > rxq->rxrearm_nb -=3D RTE_I40E_RXQ_REARM_THRESH; > > > > - rx_id =3D (uint16_t)((rxq->rxrearm_start =3D=3D 0) ? > > - (rxq->nb_rx_desc - 1) : (rxq->rxrearm_start - 1)); > > - > > rte_io_wmb(); > > /* Update the tail pointer on the NIC */ > > I40E_PCI_REG_WRITE_RELAXED(rxq->qrx_tail, rx_id); diff --git > > a/drivers/net/i40e/i40e_rxtx_vec_sse.c > > b/drivers/net/i40e/i40e_rxtx_vec_sse.c > > index bdc979a839..baf83cb3df 100644 > > --- a/drivers/net/i40e/i40e_rxtx_vec_sse.c > > +++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c > > @@ -77,14 +77,15 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq) > > } > > > > rxq->rxrearm_start +=3D RTE_I40E_RXQ_REARM_THRESH; > > - if (rxq->rxrearm_start >=3D rxq->nb_rx_desc) > > + rx_id =3D rxq->rxrearm_start - 1; > > + > > + if (unlikely(rxq->rxrearm_start >=3D rxq->nb_rx_desc)) { > > rxq->rxrearm_start =3D 0; > > + rx_id =3D rxq->nb_rx_desc - 1; > > + } > > > > rxq->rxrearm_nb -=3D RTE_I40E_RXQ_REARM_THRESH; > > > > - rx_id =3D (uint16_t)((rxq->rxrearm_start =3D=3D 0) ? > > - (rxq->nb_rx_desc - 1) : (rxq->rxrearm_start - 1)); > > - > > /* Update the tail pointer on the NIC */ > > I40E_PCI_REG_WC_WRITE(rxq->qrx_tail, rx_id); } > > -- > > 2.25.1