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 96518A0352; Sun, 3 Nov 2019 09:59:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF8511C1C5; Sun, 3 Nov 2019 09:59:31 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00050.outbound.protection.outlook.com [40.107.0.50]) by dpdk.org (Postfix) with ESMTP id D9E3D1BEFA for ; Sun, 3 Nov 2019 09:59:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDBB3OodqaqDWUaqLqPQRRye3z8rLIuywZEubhhIF1mFkJEiLi+HLJqajeQkVVbcIHcIq4Rmb/ZeHD6zWuLHI+nJw/2dTML8iHQwis0WFOEEtHRyM2GFuQ6+81rE4fJNgpYIt3SzUu/B/puixA4u26AsvGhjbzpRRqvJ1BLQwfYwBemngoTLxNeuIyapuDy/yoITQDnCOepwJkUEuEMwvCgIQEkMN1S/qX+xK0Asp1xI4Wec88mR4NemfT/cBLCGvgSN0md+Y08k5XeO5sYtszhOGFgc34A9ipT3aUUshMntkfAD/Sk8I6UfKutsTunKaZ4Nf0P1BlYYJOWy4pwixQ== 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=Dofgo+6qqyZtAjzUr8PnHj1ltiT08jRgOOopMOyT3mU=; b=DvuoVEjxrwhfz6Fs4pDU3fm1p3Ym7bQvCrMBsoYcguKoGvB93GrXnGA0rcqajhNYVwUuEly7td2N2/smtgGVY+YfqFe7OOdHdZLKn2VqgU/jMX/ZIi8A05ZkBXlTEsH3Ne3mFY//Kd6PB7K6VXj3ll5I+mSR6+gMBcoDML68ehz7pUC2S/ijWEwoDAl3mOxZbElGa9jZ7rLm5ubSSGVX6D30IuDsZ0wniQQdzopEqzcYKoTvpAKbt4Uk0K/Jy+mQCEZLsh9mqX0ssS0XLdOhQyf93YGKOyoJQSE4m7VIYdF0XarpkeXZcuhRAtAeE02ADHI66NWGTDT4kSEI/+hS0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dofgo+6qqyZtAjzUr8PnHj1ltiT08jRgOOopMOyT3mU=; b=fpWHs8ryI1zuHKooTXvdbxM/cuEbBFUPWpmu/nQse/2s9LDtYkV586d7rXmSPG/SPSNkZeFiXTJz6BGQ0L5Y52LCm3rAaLZzGtjjbSR5BrFHnoGGxQ9amTcjT1N7Bsj1Cp3MZaaYUtqheGhIrVnHt25cGpp4Nvlhh0hU6g9AIkU= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3300.eurprd05.prod.outlook.com (10.171.186.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.24; Sun, 3 Nov 2019 08:59:28 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::9940:94f2:db23:aa2c]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::9940:94f2:db23:aa2c%4]) with mapi id 15.20.2408.024; Sun, 3 Nov 2019 08:59:28 +0000 From: Slava Ovsiienko To: "Wang, Haiyue" , "Liu, Yu Y" , Thomas Monjalon CC: "dev@dpdk.org" , "arybchenko@solarflare.com" , "Yigit, Ferruh" , "jerinjacobk@gmail.com" , "Ye, Xiaolong" , "Kinsella, Ray" , "Sun, Chenmin" , "Damjan Marion (damarion)" Thread-Topic: [PATCH v1 3/3] ethdev: enhance the API for getting burst mode information Thread-Index: AQHVkQY1BkrzvtNkw0WO7M2IFajIc6d3WxAAgAAYC4CAABc7cIABMfAAgABZXWA= Date: Sun, 3 Nov 2019 08:59:28 +0000 Message-ID: References: <20191031171139.105110-1-haiyue.wang@intel.com> <20191031171139.105110-3-haiyue.wang@intel.com> <20693558.VL3dRorq05@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=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 2591d953-6a45-4bf4-61a0-08d7603c2269 x-ms-traffictypediagnostic: AM4PR05MB3300: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0210479ED8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(39850400004)(136003)(346002)(396003)(366004)(189003)(199004)(13464003)(66476007)(66446008)(86362001)(76116006)(26005)(6246003)(7696005)(25786009)(66946007)(2906002)(55016002)(14454004)(64756008)(66066001)(6306002)(53546011)(316002)(6506007)(54906003)(186003)(110136005)(966005)(102836004)(229853002)(7416002)(9686003)(5660300002)(14444005)(7736002)(11346002)(476003)(256004)(8676002)(478600001)(8936002)(76176011)(66556008)(81156014)(99286004)(52536014)(305945005)(4326008)(71190400001)(33656002)(74316002)(446003)(486006)(6116002)(30864003)(3846002)(71200400001)(6436002)(81166006)(45080400002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3300; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GcIb2ZZ1AyF3R7ETT2L65oJCdTXa/n0st2n1AL7Ni8kuBuRiw9gs0dvLF0/PahNRK78geXJx89I/FREQdtwsKLzqgt73HGHnTHoyWAmVRpcZbgQwK+odRAOJ/LRResMmomRmaB86zDVd+35RIS4TrZepmuPRFliG9bb0LGY8VlBaim7TUnQ1saPx5ITSGv7IVEslNyhBdJlS6a1ZgoeLioQwhMwefONkUitfImVM7JANffOhRpKVUxw4+zgCMEu/kZavfjtODkuGBUwdx9YxczPaCDNEwuMJ+QIEvS/TA17RwRLTg1tAzR624SHAJvwnN77R5K4UDNu6ikA6aIHc3gPkoMU2CIbI3xfVIiXw2W8bf0gcdhnpRgejXKlWVRIVw73tQlFnSPm+v20FZj2wy60HQ7zSFHAntsk3NXsH890Cse/YjMgt4JRcDI1v4QZF x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2591d953-6a45-4bf4-61a0-08d7603c2269 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2019 08:59:28.7130 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ThvDuFh5PbWZ0NWIWR0cjaXl2Ocse6zRfd/t8q5y7Sg0QaU2sMVLKydYPVi+nF4h729akjyO+v6w1PD6ASWL7QBRSuE8taLmFwPfsfZ79M8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3300 Subject: Re: [dpdk-dev] [PATCH v1 3/3] ethdev: enhance the API for getting burst mode information 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: Wang, Haiyue > Sent: Sunday, November 3, 2019 4:34 > To: Slava Ovsiienko ; Liu, Yu Y > ; Thomas Monjalon > Cc: dev@dpdk.org; arybchenko@solarflare.com; Yigit, Ferruh > ; jerinjacobk@gmail.com; Ye, Xiaolong > ; Kinsella, Ray ; Sun, > Chenmin ; Damjan Marion (damarion) > > Subject: RE: [PATCH v1 3/3] ethdev: enhance the API for getting burst mod= e > information >=20 > Hi Thomas, Slava, >=20 > Please see the inline reply in one place. >=20 > > -----Original Message----- > > From: Slava Ovsiienko > > Sent: Saturday, November 2, 2019 16:39 > > To: Liu, Yu Y ; Wang, Haiyue > > ; Thomas Monjalon > > Cc: dev@dpdk.org; arybchenko@solarflare.com; Yigit, Ferruh > > ; jerinjacobk@gmail.com; Ye, Xiaolong > > ; Kinsella, Ray ; Sun, > > Chenmin ; Damjan Marion (damarion) > > > > Subject: RE: [PATCH v1 3/3] ethdev: enhance the API for getting burst > > mode information > > > > Hi > > > -----Original Message----- > > > From: Liu, Yu Y > > > Sent: Saturday, November 2, 2019 8:56 > > > To: Wang, Haiyue ; Thomas Monjalon > > > > > > Cc: dev@dpdk.org; arybchenko@solarflare.com; Yigit, Ferruh > > > ; jerinjacobk@gmail.com; Ye, Xiaolong > > > ; Kinsella, Ray ; > > > Sun, Chenmin ; Slava Ovsiienko > > > ; Damjan Marion (damarion) > > > ; Liu, Yu Y > > > Subject: RE: [PATCH v1 3/3] ethdev: enhance the API for getting > > > burst mode information > > > > > > Add Damjan from FD.io for awareness... > > > > > > Hi Thomas, > > > > > > Long time no see. Sorry I use outlook which is not friendly to > > > community email. > > > > > > >Anyway I will propose to replace this API in the next release. > > > Will your plan be affected by API/ABI stable plan? > > > BTW, if you propose new change in next release, it will make DPDK > > > consumer(FD.io) to change again. > > > So even if it is not affected to the API/ABI stable plan, do we > > > still have time to get a solution for everyone in DPDK 19.11 with > > > your contribution/acceleration? > > > > > > > I suspect a real hidden issue in Intel CPUs that you try to mitigat= e. > > > Please be rest assured it is not the case. > > > This request is just from one FD.io project internal bug " tx/rx > > > burst function is shown as nil" reported by Chenmin. > > > > Why just the presenting string with function name (possible with suffix= ) is > not enough? > > I would like to see this API (strings approach) in mlx5 either, > > dropping the entire feature does not look nice, as for me. > > > > We could consider some requirements for the name suffices to > > distinguish whether function uses vector instructions and which ones if= any. > > > > > My understanding is DPDK behavior was taken as bug for someone in > > > FD.io project and potentially will mislead other DPDK consumer. > > > > Why does FD.io code want to know which vector extension is used by burs= t > routines? > > Is it going to share/preserve some resources (registers, etc.)? Is it r= obust ? > > Burst routines might not know whether vector extensions is used (they > > might call libraries, even rte_memcpy() can use vectors in implicit fas= hion). > > >=20 > 1. >=20 > The original issue description is: > "VPP uses dladdr() to translate a function address to name, however, some > tx/rx functions in DPDK are invisible for dladdr(), which is because the= y are > defined as static." >=20 > 2. >=20 > So the RFC design is: one function, one description, like: > https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpatch > work.dpdk.org%2Fpatch%2F57644%2F&data=3D02%7C01%7Cviacheslavo > %40mellanox.com%7Ca99632b4e2444ec00b1f08d760065041%7Ca652971c7 > d2e4d9ba6a4d149256f461b%7C0%7C0%7C637083452540980873&sdat > a=3D4re5GOXPSwGk5BTOYLglafzgjBzRLk1gXyWKT47o8o0%3D&reserved=3D > 0 >=20 > +#ifdef RTE_ARCH_X86 > + else if (dev->rx_pkt_burst =3D=3D ice_recv_scattered_pkts_vec_avx2) > + len =3D snprintf(buf, sz, "AVX2 Vector Scattered Rx"); > + else if (dev->rx_pkt_burst =3D=3D ice_recv_scattered_pkts_vec) > + len =3D snprintf(buf, sz, "Vector Scattered Rx"); > + else if (dev->rx_pkt_burst =3D=3D ice_recv_pkts_vec_avx2) > + len =3D snprintf(buf, sz, "AVX2 Vector Rx"); > + else if (dev->rx_pkt_burst =3D=3D ice_recv_pkts_vec) > + len =3D snprintf(buf, sz, "Vector Rx"); #endif The application gets the routine names with dladdr(). OK, it happens. It is not clear for me why instead of direct replacement/extension of dladd= r functionality some new names were introduced and then converted to flags. =20 > 3. Since the main issue is as Damjan replied in another thread: > "people are reporting lower performance caused by DPDK deciding for > variety > of reasons to switch from vector PMD to scalar one." >=20 > And Ferruh replied also: > "As I understand this is to let applications to give informed decisio= n based > on what vectorization is used in the driver, currently this is not k= nown by > the application. >=20 > And as previously replied, the main target of the API is to define t= he vector > path, not all optimizations, so the number is limited." >=20 > So we enhanced it with bit, example detail is (Yes, we defined a lit= more, > so we removed it in this patch): There are might be a lot of various burst functions, vectorized or not, with various sets of supported offloads. Yes, identifying the engaged burst routine is meaningful, but it is not clear for me, why the vectorizing type should have dedicated means (flags) to identify ? >=20 > https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpatch > work.dpdk.org%2Fpatch%2F61196%2F&data=3D02%7C01%7Cviacheslavo > %40mellanox.com%7Ca99632b4e2444ec00b1f08d760065041%7Ca652971c7 > d2e4d9ba6a4d149256f461b%7C0%7C0%7C637083452540980873&sdat > a=3Dnm80Pt0fFWqmmrJcKY6ks4qRTJ7cjGJWEG1Wv6gxfSw%3D&reserved > =3D0 >=20 > 4. And thanks Jerin's suggestion, I think his word can be more accurate: = "This > would > help to reuse some of the flags to name conversion logic across all PM= Ds" > for the > reason we try to use bit to reduce some string format effort, it will = be > handled > by the API internally "burst_mode_options_append(struct > rte_eth_burst_mode *mode)". > Now the new API will return the string finally: >=20 > #define RTE_ETH_BURST_MODE_ALT_OPT_SIZE 1024 struct > rte_eth_burst_mode { > uint64_t options; >=20 > /**< Each PMD can fill specific burst mode information into this, and > * ethdev APIs will append the 'options' string format at its end. > */ > char alternate_options[RTE_ETH_BURST_MODE_ALT_OPT_SIZE]; > }; >=20 > So MLX PMD can add 'full_empw', 'mtsc_empw' etc into 'alternate_options' > firstly, assign 'RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE' to 'options' > as needed, then finally, 'alternate_options' will be "full_empw, Vector S= SE". For mlx5 tx_burst these flags have no meaning. All information regarding ro= utine is encoded within the name, mtsc stands for: m - multisegment t - TSO s - software tunnel parser c - check sum There are no two versions of mtsc_empw - "mtsc_empw, Vector SSE", "mtsc_emp= w, Vector Neon". If we developed vectorized version, I would prefer "mtsc_empw_sse". To summarize: - application uses routine names, gets with dladdr(). Nice. - compatible API providing names of internal routines is proposed. Nice. - users now are able to identify the engaged burst routine. Nice. - proposed API is extended, some vector related flags were added. Hmmm.... = Questionable.=20 Why vector related only? Why do we change the string format? (name -> nam= e, options) > Intel PMD can just assign "options", then finally, 'alternate_options' wi= ll be > "Vector SSE". As I see from initial patch, Intel PMD has dedicated routines with unique n= ames for each type of vectorization. Is there some burst routine with single name w= hich could operate with different vectorization types, depending on configuration? With best regards, Slava >=20 > How about the design idea ? Again, this 'options' is not to do standardiz= ation, > just want to reduce the duplicated name string things. >=20 > > With best regards, Slava > > > > > Haiyue is working with Chenmin to address the issue and with your > > > support it will be even better. > > > > > > Your support will be highly appreciated! > > > > > > Thanks & Regards, > > > Yu Liu > > > > > > -----Original Message----- > > > From: dev On Behalf Of Wang, Haiyue > > > Sent: Saturday, November 2, 2019 1:30 PM > > > To: Thomas Monjalon > > > Cc: dev@dpdk.org; arybchenko@solarflare.com; Yigit, Ferruh > > > ; jerinjacobk@gmail.com; Ye, Xiaolong > > > ; Kinsella, Ray ; > > > Sun, Chenmin ; Slava Ovsiienko > > > > > > Subject: Re: [dpdk-dev] [PATCH v1 3/3] ethdev: enhance the API for > > > getting burst mode information > > > > > > > -----Original Message----- > > > > From: Thomas Monjalon > > > > Sent: Saturday, November 2, 2019 06:46 > > > > To: Wang, Haiyue > > > > Cc: dev@dpdk.org; arybchenko@solarflare.com; Yigit, Ferruh > > > > ; jerinjacobk@gmail.com; Ye, Xiaolong > > > > ; Kinsella, Ray ; > > > > Sun, Chenmin ; Slava Ovsiienko > > > > > > > > Subject: Re: [PATCH v1 3/3] ethdev: enhance the API for getting > > > > burst mode information > > > > > > > > Thank you for trying to address comments done late. > > > > > > > > 31/10/2019 18:11, Haiyue Wang: > > > > > --- a/lib/librte_ethdev/rte_ethdev.h > > > > > +++ b/lib/librte_ethdev/rte_ethdev.h > > > > > > > > > > > +#define RTE_ETH_BURST_ALTIVEC (1ULL << 2) > > > > > +#define RTE_ETH_BURST_NEON (1ULL << 3) > > > > > +#define RTE_ETH_BURST_SSE (1ULL << 4) > > > > > +#define RTE_ETH_BURST_AVX2 (1ULL << 5) > > > > > +#define RTE_ETH_BURST_AVX512 (1ULL << 6) > > > > > > > > Of course, I still believe that giving a special treatment to > > > > vector instructions is wrong. > > > > You did not justify why it needs to be defined in bits instead of > > > > string. I am not asking again because anyway you don't really > > > > reply. I think you are executing an order you received and I don't > > > > want to blame you more. > > > > I suspect a real hidden issue in Intel CPUs that you try to mitigat= e. > > > > No need to reply to this comment. > > > > Anyway I will propose to replace this API in the next release. > > > > > > Never mind, if this design is truly ugly, drop it all now. I also > > > prefer to do the best, that's why open source is amazing, thanks! > > > ;-)