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 949DEA04BA; Wed, 7 Oct 2020 12:47:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0A6F2B8C; Wed, 7 Oct 2020 12:47:44 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 00840A3 for ; Wed, 7 Oct 2020 12:47:42 +0200 (CEST) IronPort-SDR: 2u8nJW9dVJEdm/pPz2dZ3ycdxYDFEocxP93L3Z8HiPekPmR/xqvAd31/KC2GifcowT3Mw3Q2Vp 8Ts0wjb4m8NA== X-IronPort-AV: E=McAfee;i="6000,8403,9766"; a="144281282" X-IronPort-AV: E=Sophos;i="5.77,346,1596524400"; d="scan'208";a="144281282" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 03:47:41 -0700 IronPort-SDR: 57wEEyDXxBjJMybviioQTNiGCnot+4liSUaU60lY2W222RWDgEYfk2rsYCKvEx6ramsfOPCfZt R4dCt+WGccGg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,346,1596524400"; d="scan'208";a="316154138" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 07 Oct 2020 03:47:40 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 7 Oct 2020 03:47:40 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 7 Oct 2020 03:47:40 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 7 Oct 2020 03:47:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QpKj7QqthTwnnVqHRiU1xjygPGbaq9T99h6nsTxRQhve5a9x5iXwikKC8VT5wffD/VRGqTtC9YnamUvMXSZxh1KoP7sVkbg0A+lX2rARnUi/u5FIrYu70XnLCNJlU7/LnIgsyAKUtGaF9NE7eav8aD0AOZnRBOtIeZZ/8pzE+/CWEWHZo6NSGirIje70oPpw2ZjLVRwKCDbMy/Av78EjXgA6GW30FDceFoBySO2GK984wEHupFa21QgTfknh3EG5tgjYzXJR7XjR7iNjlIa9/ossPl5oe9xGJ/YSGDEKRUA/8nfJS6hWO6GXTNjhWSOqrfu+ClVNgkblq1ndNKx9dw== 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=dRFCvjb+hslARdy9IH22zN4FRc1RcOAM3+bkRSYIMWo=; b=HQBRK7sjEfi06Px7IkeV+6AYX/t+ueGxGweaiUao/x9pPDQBm4HNRQhSYEppmpJafTDX2VWeTxjAqdqufCnG3ojIB00m3XmrgQnpkhwwjOo6znvPLldfHY9fkyAfnccQIkCUhaPuNJRT6l2Cwj1wxr69Pgc0RPOiHXlrzYIta1v8DttkUTDIcplOvrUzWoqkDyC1ssnW6+aFrDgR7s08s6BTvlDOFcPfPBiwsZccQAfMA3guVDAwS33Ro6LyVzcV1kkDk5Glx2dVbBWTmT6L/SO4/V6gP9Zq7P+DR0PaT+7lSX52mA3cfVahKtn/Oiu8W2hg7Jf6F7YDSSDFjDHjyQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dRFCvjb+hslARdy9IH22zN4FRc1RcOAM3+bkRSYIMWo=; b=xHZjr0VQxe3JNjxWSey6+vEG04FthaeAR3XSPrs59w4D9TnESqwhGlTnvqzW9Oa7ea1B2CP5w4f10h09tCA9MPdA53BEXytmAAq4uT08kC+oauLqOZdx7mmVhUTYD+HIf+MQdlK6kCWBV2faX1Dm4mm6C/8G6PBUr5SIpzbKtRo= Received: from DM6PR11MB2555.namprd11.prod.outlook.com (2603:10b6:5:c5::33) by DM5PR1101MB2220.namprd11.prod.outlook.com (2603:10b6:4:51::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.22; Wed, 7 Oct 2020 10:47:34 +0000 Received: from DM6PR11MB2555.namprd11.prod.outlook.com ([fe80::78d4:d670:95af:773d]) by DM6PR11MB2555.namprd11.prod.outlook.com ([fe80::78d4:d670:95af:773d%5]) with mapi id 15.20.3433.043; Wed, 7 Oct 2020 10:47:34 +0000 From: "Power, Ciara" To: Olivier Matz CC: "dev@dpdk.org" , Ray Kinsella , Neil Horman , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH v3 01/18] eal: add max SIMD bitwidth Thread-Index: AQHWlyrBAbDihkshFEi9z+NzKaB/wamKWNOAgAGiw0A= Date: Wed, 7 Oct 2020 10:47:34 +0000 Message-ID: References: <20200807155859.63888-1-ciara.power@intel.com> <20200930130415.11211-1-ciara.power@intel.com> <20200930130415.11211-2-ciara.power@intel.com> <20201006093217.GG21395@platinum> In-Reply-To: <20201006093217.GG21395@platinum> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [78.18.45.234] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 00679725-11c2-4bcf-b3b6-08d86aae6677 x-ms-traffictypediagnostic: DM5PR1101MB2220: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QGQMlS5ilCopEu4N9rGatzs0+XN79r55jCpv0Ykp3d6WGON6eoEHx9wMVAUstpY6ePZgaodjnRBQZvqAs9YnFURHikkey8ypAis04IxyQSLbmGBOKjnAjPL8KN+d9eU+pkGVf4nI0qMywqta6DJvAcoZ+xjUiPC6a8UUl2UvupMpfSnhzDkH11HvQ1dmahLQSnp+kE53SGaLkbd69xvIU23vLEimOaQyrXsKqAm6YxJA3fzSObleG9iGeoMWJhe9WQqyl/gp89icHWkTedXCUgsOt9dWI5x90Qt4e35+slkV52t6SwQ5UryAuvz15b1M3Gh2bcXBTP5Opvdpx39um4/cJuSJoBgNairGmLHhAQxAIcbaV8e1wdJo7508Mv50bnlyBWDAgx9jzLFt7/DAlQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2555.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(39860400002)(346002)(376002)(136003)(4326008)(186003)(9686003)(5660300002)(55016002)(2906002)(316002)(8936002)(54906003)(83380400001)(33656002)(86362001)(6506007)(83080400001)(7696005)(26005)(71200400001)(966005)(76116006)(8676002)(6916009)(107886003)(66946007)(66556008)(66476007)(64756008)(66446008)(478600001)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: Tp09ssyQd6IRBGCxcYbczsKK0NchyRVk1abUDrkjF7N52lx3Bdrgb7dkHXytoSwGU1TDb0uoctYh7SnyrH7RghuvjN4C6sC+CPKZ30PYb+PZNDYgn0bksN45EK+x7J1b/N4TnW48qxwkwtkf2NzhoAVfbCO/x/1Pa4AcAPqPlklM6t771aJSp2AKnLEotPN0Lp7l/Fry+fBEx8M3WIRWZnt10SxV/iSDkpkuVnFERmEESJKRwzoJzIKMe5Rrt8qdcfAsE6QiruOclokRLGnsQXEDJwxETdjTx5ShKNtaFR7SJc0bkM9AeuLUpqrCLXsn4qAtQamWSowokuyZMUTJtL2Qc7lLUjdojAoOCudqnXp4oTP3LRV7r+weTQnMKTMF7+ocdI7cDmRLazpfTsaZ+wKfkuuYt97Tu/IQ3Czi8YLMqIZiMDVc0S/rtvKMa/ZkcnGlDhYXCHUHOfuh+5EWONp5TMrwz0rsVyypr7dDZ9LN8EAqcS3g4XgBV8CF26J5zjbmQg8m/f4a67ezR1FHJgMesFMyWW1IfHVZkWPFXWIxOBxIa7Y7zr9BHhnwyT3zmmyy+5hho4MCqKS0OXw48847Ov5kcTWvEGd2ptg8WmKaG8ahdve1YMuXOpE+pz0ipKR8noJ6VGYDnmW8WHWwIw== 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: DM6PR11MB2555.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00679725-11c2-4bcf-b3b6-08d86aae6677 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2020 10:47:34.6491 (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: LVPnfrRpXCoEBEDeV/s6yEuo79yzFUDGd2+75x2qFYtUfdmGJPUA6HkicI9BNjo5nV7yFVcRoD+0NPJvDW6Ccg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2220 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 01/18] eal: add max SIMD bitwidth 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" Hi Olivier, Thanks for reviewing, some comments below. >-----Original Message----- >From: Olivier Matz >Sent: Tuesday 6 October 2020 10:32 >To: Power, Ciara >Cc: dev@dpdk.org; Ray Kinsella ; Neil Horman > >Subject: Re: [dpdk-dev] [PATCH v3 01/18] eal: add max SIMD bitwidth > >Hi Ciara, > >Please find some comments below. > >On Wed, Sep 30, 2020 at 02:03:57PM +0100, Ciara Power wrote: >> This patch adds a max SIMD bitwidth EAL configuration. The API allows >> for an app to set this value. It can also be set using EAL argument >> --force-max-simd-bitwidth, which will lock the value and override any >> modifications made by the app. >> >> Signed-off-by: Ciara Power >> >> --- >> v3: >> - Added enum value to essentially disable using max SIMD to choose >> paths, intended for use by ARM SVE. >> - Fixed parsing bitwidth argument to return an error for values >> greater than uint16_t. >> v2: Added to Doxygen comment for API. >> --- >> >> +uint16_t >> +rte_get_max_simd_bitwidth(void) >> +{ >> + const struct internal_config *internal_conf =3D >> + eal_get_internal_configuration(); >> + return internal_conf->max_simd_bitwidth.bitwidth; >> +} > >Should the return value be enum rte_max_simd_t? >If not, do we really need the enum definition? > I kept the return value and param value below as uint16_t to allow for arbi= trary values, and will allow it be more flexible for future additions as new enums won't = need to be added. For the set function below, this is used when a user passes the EAL command= line flag, which passes an integer value rather than an enum one. The enums are useful when checking the max_simd_bitwidth in drivers/libs, f= or example using "RTE_MAX_256_SIMD" instead of "256" in the condition checks. >> + >> +int >> +rte_set_max_simd_bitwidth(uint16_t bitwidth) { >> + struct internal_config *internal_conf =3D >> + eal_get_internal_configuration(); >> + if (internal_conf->max_simd_bitwidth.locked) { >> + RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user >runtime override enabled"); >> + return -EPERM; >> + } >> + >> + if (bitwidth !=3D RTE_MAX_SIMD_DISABLE && (bitwidth < >RTE_NO_SIMD || >> + !rte_is_power_of_2(bitwidth))) { >> + RTE_LOG(ERR, EAL, "Invalid bitwidth value!\n"); >> + return -EINVAL; >> + } >> + internal_conf->max_simd_bitwidth.bitwidth =3D bitwidth; >> + return 0; >> +} > >Same question, should the parameter be enum rte_max_simd_t? > >> +enum rte_max_simd_t { >> + RTE_NO_SIMD =3D 64, >> + RTE_MAX_128_SIMD =3D 128, >> + RTE_MAX_256_SIMD =3D 256, >> + RTE_MAX_512_SIMD =3D 512, >> + RTE_MAX_SIMD_DISABLE =3D UINT16_MAX, >> +}; > >What is the difference between RTE_NO_SIMD and >RTE_MAX_SIMD_DISABLE? RTE_NO_SIMD has value 64 to limit paths to scalar only. RTE_MAX_SIMD_DISABLE sets the highest value possible, so essentially disables the limit affecting which vector paths are taken. This disable option was added to allow for ARM SVE which will be later adde= d, Discussed with Honnappa on a previous version: https://patchwork.dpdk.org/p= atch/76097/=20 >The default value in internal_config is 0, so in my understanding >rte_get_max_simd_bitwidth() will return 0 if --force-max-simd-bitwidth is >not passed. Is it expected? > >Maybe I'm missing something, but I don't understand why the value in >internal_config is not set to the maximum supported SIMD bitwidth by >default, and optionally overriden by the command line argument, or by the >API. > The default value for max_simd_bitwidth is set depending on the architectur= e, 256 for x86/ppc, and UINT16_MAX for ARM. So for example the default on x86 allows for AVX2 a= nd under. The defaults can be seen in patch 2: https://patchwork.dpdk.org/patch/79339= /=20 Thanks, Ciara