From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id F3C8BA05D3 for ; Wed, 24 Apr 2019 04:59:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 639EC1B4DA; Wed, 24 Apr 2019 04:59:14 +0200 (CEST) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30073.outbound.protection.outlook.com [40.107.3.73]) by dpdk.org (Postfix) with ESMTP id AAB4D1B112; Wed, 24 Apr 2019 04:59:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lnt8YOMD/YzgX1Uki/7lEyglruN/UzHIhZB4Y93BWbA=; b=ZlIBaJevKtFNVVCt020BW1hhO0QfskQorkA89tSTHDCvXKGl6nCOcUuWetYSw2EA+KBKnOUar7mZ64ce7mfroBDHVIJPWqOyNKkfT/8wX4pezbKWUt/BOwpfflxE7mrW+fTLBgjq27ZmR39K8RPiPukTm8VQKJBCY9Wi1UDorUA= Received: from AM0PR08MB4418.eurprd08.prod.outlook.com (20.179.35.207) by AM0PR08MB4338.eurprd08.prod.outlook.com (20.179.33.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Wed, 24 Apr 2019 02:59:11 +0000 Received: from AM0PR08MB4418.eurprd08.prod.outlook.com ([fe80::21aa:85a4:d79:8f94]) by AM0PR08MB4418.eurprd08.prod.outlook.com ([fe80::21aa:85a4:d79:8f94%5]) with mapi id 15.20.1813.017; Wed, 24 Apr 2019 02:59:11 +0000 From: "Ruifeng Wang (Arm Technology China)" To: Pavan Nikhilesh Bhagavatula , "thomas@monjalon.net" CC: "dev@dpdk.org" , "jerinj@marvell.com" , Marko Kovacevic , Ori Kam , Bruce Richardson , Pablo de Lara , Radu Nicolau , "Akhil.goyal@nxp.com" , Tomasz Kantecki , "stable@dpdk.org" , nd Thread-Topic: [dpdk-dev] [PATCH] examples/l3fwd: fix em mode datapath selection Thread-Index: AQHU+bS+BsWxyhdriEKvwJbvdfyfwqZKmaxg Date: Wed, 24 Apr 2019 02:59:10 +0000 Message-ID: References: <20190410072836.17496-1-pbhagavatula@marvell.com> <2029347.cZ2XlDF34S@xps> <1979146.r4zusaNbqz@xps> In-Reply-To: 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=Ruifeng.Wang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f5f77ba8-fde8-4c04-1f16-08d6c860d386 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR08MB4338; x-ms-traffictypediagnostic: AM0PR08MB4338: x-ms-exchange-purlcount: 1 x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 00179089FD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(346002)(376002)(136003)(366004)(13464003)(189003)(199004)(52536014)(8936002)(7696005)(71190400001)(25786009)(6436002)(4326008)(81166006)(81156014)(71200400001)(66066001)(97736004)(478600001)(76116006)(229853002)(14454004)(68736007)(74316002)(73956011)(7736002)(66476007)(64756008)(66556008)(72206003)(66446008)(7416002)(66946007)(486006)(99286004)(476003)(316002)(256004)(110136005)(53936002)(9686003)(33656002)(2501003)(305945005)(446003)(11346002)(54906003)(53546011)(5660300002)(6246003)(6306002)(55016002)(6506007)(186003)(26005)(76176011)(93886005)(86362001)(3846002)(6116002)(102836004)(2906002)(55236004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB4338; H:AM0PR08MB4418.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 448uNOPNQutfX0rnKJFeQ0TPGM4ey1q7c3RD1Jcs/JXhBMkQfssJXWz9u6aqTzLr8IE/smYFXIWPMN4k2IU58/PKw4gapI9Gg/gpbEqlQx3aE/quviekAOZiOsVEXp96v4GuA8Fq3zQsefnmTnIt34u4lf9CWfK+tL/WyelSOeLv9CiWCw6JFCIrk4PY/1ORJkCFIcS0lUbsZo2fkzW87kL+4JtGDoVEcLH/nQ+lzNv51X11Y0rDyJzCaItGf0IbL/HuiX0WPBeb5cT30NOgwzOq3WwbVPnOZkZX8WkriHvflKUtAMvfJGSDp+t6xAl0QFSfqZoxDyIrpYtgzcbHRsrxDj1s4VeEnD7uNImj+KDWPAuW7esvFpCKIyPPIqxLWtjzow1LtdrRRCWQtGDqY7DEo68bmHgj+OaKVyWdo00= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5f77ba8-fde8-4c04-1f16-08d6c860d386 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2019 02:59:10.9951 (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-Transport-CrossTenantHeadersStamped: AM0PR08MB4338 Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: fix em mode datapath selection 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" Message-ID: <20190424025910.I07PYv01mZaDwOU8R0qwfq6RxrbFeXNJ2WwGbi20rqI@z> Hi, > -----Original Message----- > From: dev On Behalf Of Pavan Nikhilesh > Bhagavatula > Sent: Tuesday, April 23, 2019 17:13 > To: thomas@monjalon.net > Cc: dev@dpdk.org; jerinj@marvell.com; Marko Kovacevic > ; Ori Kam ; Bruce > Richardson ; Pablo de Lara > ; Radu Nicolau ; > Akhil.goyal@nxp.com; Tomasz Kantecki ; > stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: fix em mode datapath > selection >=20 >=20 >=20 > >-----Original Message----- > >From: dev On Behalf Of Thomas Monjalon > >Sent: Tuesday, April 23, 2019 2:05 PM > >To: Pavan Nikhilesh Bhagavatula > >Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran ; Marko > >Kovacevic ; Ori Kam ; > >Bruce Richardson ; Pablo de Lara > >; Radu Nicolau > >; Akhil Goyal ; Tomasz > >Kantecki ; stable@dpdk.org > >Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: fix em mode datapath > >selection > > > >23/04/2019 04:47, Pavan Nikhilesh Bhagavatula: > >>From: Thomas Monjalon > >> >10/04/2019 09:29, Pavan Nikhilesh Bhagavatula: > >> >> From: Pavan Nikhilesh > >> >> > >> >> Currently, l3wfd em mode has two datapath modes em_sequential > and > >> >> em_hlm. We can select either of them by defining > >> >NO_HASH_MULTI_LOOKUP > >> >> to one or zero. > >> >> The code checks if NO_HASH_MULTI_LOOKUP is defined or not > instead > >> >> of checking for the value. > >> >> > >> >> Fixes: 52c97adc1f0f ("examples/l3fwd: fix exact match > >> >> performance") > >> >> Cc: stable@dpdk.org > >> >> > >> >> Signed-off-by: Pavan Nikhilesh > >> >> --- > >> >> --- a/examples/l3fwd/l3fwd_em.c > >> >> +++ b/examples/l3fwd/l3fwd_em.c > >> >> #if defined RTE_ARCH_X86 || defined > RTE_MACHINE_CPUFLAG_NEON > >-#if > >> >> defined(NO_HASH_MULTI_LOOKUP) > >> >> +#if NO_HASH_MULTI_LOOKUP > >> > > >> >A quick grep shows that it used in another place with #ifdef: > >> > > >> >examples/l3fwd/l3fwd.h:#if !defined(NO_HASH_MULTI_LOOKUP) && > >> >defined(RTE_MACHINE_CPUFLAG_NEON) > >> > > >> > > >> > >> #if !defined(NO_HASH_MULTI_LOOKUP) && > >> defined(RTE_MACHINE_CPUFLAG_NEON) #define > >NO_HASH_MULTI_LOOKUP 1 > >> #endif > >> > >> This macro is used to set l3fwd_em_sequential as the default EM > >> datapath on AARCH64 as its performance is better. > >> (http://patches.dpdk.org/patch/49372/) > >> > >> make -C examples/l3fwd #Selects l3fwd_em_sequential by defau= lt > on > >AARCH 64 > >> > >> Currently, we cannot select em_hlm without manually editing the macro > >> as using the below command still sets em_sequential as the default > >> datapath because the macro modified in the patch that selects the > >> datapath > >checks if NO_HASH_MULTI_LOOKUP is defined or not rather than its value. > >> > >> EXTRA_CFLAGS=3D'-DNO_HASH_MULTI_LOOKUP=3D0' make -C > examples/l3fwd > >> > >> I hope I cleared up things a bit. > > > >In my understanding, we should check the value in the other case too, > >instead of #if defined. >=20 > That will lead to undefined and redefined error: >=20 > [dpdk] # make -C examples/l3fwd > make: Entering directory '/root/pavan/dpdk-int/examples/l3fwd' > CC main.o > CC l3fwd_lpm.o > In file included from /root/dpdk/examples/l3fwd/l3fwd_lpm.c:28:0: > /root/dpdk/examples/l3fwd/l3fwd.h:14:6: error: > "NO_HASH_MULTI_LOOKUP" is not defined, evaluates to 0 [-Werror=3Dundef] > #if !NO_HASH_MULTI_LOOKUP && > defined(RTE_MACHINE_CPUFLAG_NEON) >=20 > [dpdk] # EXTRA_CFLAGS=3D'-DNO_HASH_MULTI_LOOKUP=3D0' make -C > examples/l3fwd > make: Entering directory '/root/dpdk/examples/l3fwd' > CC main.o = ] > #define NO_HASH_MULTI_LOOKUP 1 > n file included from /root/dpdk/examples/l3fwd/l3fwd_lpm.c:28:0: > :0:0: note: > = ] #define > NO_HASH_MULTI_LOOKUP 1is the location of the previous definition >=20 > > > > Actually I looked at this EM lookup mode selection issue as well, and my fi= rst solution is the same as yours :) I didn't find out a way to enable selection without using compile options (= -DNO_HASH_MULTI_LOOKUP etc.).=20 Maybe we can use both HASH_MULTI_LOOKUP and NO_HASH_MULTI_LOOKUP like below= : --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -11,8 +11,8 @@ =20 #define RTE_LOGTYPE_L3FWD RTE_LOGTYPE_USER1 =20 -#if !defined(NO_HASH_MULTI_LOOKUP) && defined(RTE_MACHINE_CPUFLAG_NEON) -#define NO_HASH_MULTI_LOOKUP 1 +#if !defined(HASH_MULTI_LOOKUP) && defined(RTE_MACHINE_CPUFLAG_NEON) +#define NO_HASH_MULTI_LOOKUP #endif Not sure if this is a good idea. PS: if we are controlling selection using compile options, it is better to = be documented somewhere.