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 038C3A0C43; Mon, 18 Oct 2021 12:40:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4F7D40142; Mon, 18 Oct 2021 12:40:21 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 1C5BB40141 for ; Mon, 18 Oct 2021 12:40:19 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="228170073" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="228170073" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 03:40:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="493533976" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga008.jf.intel.com with ESMTP; 18 Oct 2021 03:40:03 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 18 Oct 2021 03:40:03 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 18 Oct 2021 03:40:03 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.176) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 18 Oct 2021 03:40:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LM5hc3KEk26nVLYylU0oYqwqq4jp+n9qVON6ePIZ/5TwwSWxS8qq7a0pREInvY5GWqysYGngtfuPG5ARD0tN8jyVIKhKt7sNkqo4S9DXxXy/GwrGs3SiLiNonX47C+n8WM26D8mDjqsNVQ2irqikEOnUxOmFEpXKMeJ0TGnPnLqRzIBvrpOYKZP+PuUVbgigR+3zsciBT4+j1qlejp1OAMCjaSVB9J8G96ut8eLOOItXMSvD0QMRG9uOQOhCp0N0JJF1EOZwlu3eR0w7GHZJGobA0i0GpgFdqgFkx1gUoqjl1Za0kWIjdyC6SWpk4UHnOOo+r48GXiqtZRAwt32drQ== 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=S7DtWNJR3+FNL9iBGyoMx2g8zo+DS2qkEInYwfi1Rj8=; b=eiuiHZ+eiYpDMGcFC6zVP+NLTjlDxQjthVqjUPcL5jW8YNf15jzRADLUxRlmauJxpHVHt39vaQ4iZ1xZAoS0z0j1NpWP8dQR0PFEG4F8EQ5JOTVY7SrOLnPmSGgENLQu+0OQDmribnxMiMUKvH6ADcJyRih4zy7WvvjO+A10KXdmVFaPoaJ0IaBmno46eDJqmWZLQMEHGU/yKj9Rtt5P05g7BpYUvrIvSSQ/XX/6WvpYU4M6NQ2+d8aKnIiB7NNvORchLO5ZtIs7osMoE2kl05k8uMstZmloRr/M6n25RUyypO5ICEPDLIUNE4n5ZU1DR+rvHVfhEAcyLNf+3QgWxw== 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=S7DtWNJR3+FNL9iBGyoMx2g8zo+DS2qkEInYwfi1Rj8=; b=tb8h6/5BFLFIW9KUNITXjVmTKEGAhG/PBTwt7MJ2VaPoHYu/rwkbGoPobCduur1Ud24mv/ZROVJCMk+3uHgdoiUxrsQclVhctf+aErpSBV6jCjTf2LjRCVdiVxJhNUM9dxfnXeWaq7WL+Y59/HpNxYHsJOInUMWAM3vDd0RoW+k= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3626.namprd11.prod.outlook.com (2603:10b6:5:146::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Mon, 18 Oct 2021 10:40:00 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4608.018; Mon, 18 Oct 2021 10:40:00 +0000 From: "Ananyev, Konstantin" To: Stephen Hemminger , "Medvedkin, Vladimir" CC: "dev@dpdk.org" , "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" Thread-Topic: [PATCH v2 1/5] hash: add new toeplitz hash implementation Thread-Index: AQHXwadNOF4Q/XnCPUyc1mGjrjKXSavUSHgAgARI32A= Date: Mon, 18 Oct 2021 10:40:00 +0000 Message-ID: References: <1634290206-251913-1-git-send-email-vladimir.medvedkin@intel.com> <1634290206-251913-2-git-send-email-vladimir.medvedkin@intel.com> <20211015095834.469a4efd@hermes.local> In-Reply-To: <20211015095834.469a4efd@hermes.local> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ffed85e0-204c-441f-f612-08d99223a309 x-ms-traffictypediagnostic: DM6PR11MB3626: 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:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9u+tZRol6r/MRPHndh8zfv2yEsY+dczV+DFfDhyXKkzugcAIeFnl4SGDzoSkx0fIHfbOdusGPJnjfVmq4E81CEa2zCkRST0suZy4KH28BXdKc3RtHCbLeB/TXFRbXPyyZ8+eUIBWKV2ouNFTKX4I6Naky83t3HxxfLxP+SE3skJJDAd2gjr1VYLwNTX+aTky+vFxaRLFq1o4Q+2Z1Xly2+G1cNm9QkA/d9CdU84idfz02PzeCLLRYzK32CAWSPgQeIpFN8GVDawoCsVXk/C2d5i1/8maDD9alzmcsrTfxMiHeekjOXYccYNa9i2NROq/A9Qak0vm4glrFAT1ZN/Ed6gjziyAwNfHt499wAFQV+DL8rm7+mjoAZjZhkk9Bg6PqPzHr8Hql2GGY8FUYjauvxsJUdDHu8YxBaPKHTXX8M8Y5eWGpQ2E6hyBFMivWiseREzMGVP8Ll4GLmyKurkVpXkW9Pn/5uO25hfzkkeaVU5rj+bp95dDdluIsg3iOzzKfXEJC83LYRw0aEJaSk5P04YDbuBq3Ak1ZpU4dbKwTkJjj+qIq6QRD8VLGngv4uPwgJYuggjT91/jRouaDhkIt7kf+APGKIaPaNZaOhTHztENkkhpHupZ4QAlsKYMviLm9BkGnweT+AdBk+mD3enn/FjDvYSQ2mCOAlMwzZ5JPBpqH5qH+miNGMvLQa12OZuOQJtiOIdJdcGcrZ1sfMAOwQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38100700002)(86362001)(122000001)(5660300002)(66476007)(26005)(6506007)(71200400001)(66446008)(508600001)(186003)(64756008)(66556008)(8676002)(66946007)(55236004)(316002)(52536014)(83380400001)(76116006)(6636002)(38070700005)(8936002)(82960400001)(2906002)(7696005)(33656002)(107886003)(110136005)(9686003)(4326008)(54906003)(55016002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?t/5ehver3Bn0jWarnRXFLZCyBqtLzj6cZuP2GrD+xtOmuK8vhGM8akMAE2gh?= =?us-ascii?Q?HiaIdHHl1R5Po2RYj+HZdu2vY8LmdYU/ix5xHdbBC9t5ZrmuMbWWu15/9fWn?= =?us-ascii?Q?2qM2K/ICaL5TC+2WM9xwQ9xLi2MO1qexNYn6TD64VtLVo+rciUM2EvLITrLW?= =?us-ascii?Q?PVzlQGwfX/WKpQJigUL8qewqkaPPreFopqU0oAthqY2tse8DGG+lfBPgdLgt?= =?us-ascii?Q?S5k8paBbdKYMGsavWG0isJDOGf4hO1EHqJr1/xBErcAutjJ6mkjVkd/T5NcR?= =?us-ascii?Q?MH64DDQlcuoX+M6BthUwuc+o+/kRzXMWvwu1O85FPas4i+gNKKwSF7QQtmSw?= =?us-ascii?Q?xbhj+mq7uVuLq0ur6ODIPE8jefO9OSbbkfRDZ051npqp0nVR6fvj8pcL78Io?= =?us-ascii?Q?di0nBaMZ+aWDJlVd7dXLmJ6Y4BIWEvevJrCQl6drs0uT0wrSjbp5XAmf1xEY?= =?us-ascii?Q?2psZiqTtFjrakHugaMksp1N8aFef9bvYlcD3QvAdWUje5AW2ZkinfSxBizFj?= =?us-ascii?Q?jUZ9vg/aQy3SzCGCc8XI9CwrLZgcZsf1NNm6neWwQUMKS+rOnDxV/tW7efAh?= =?us-ascii?Q?LPFveJIWJAjs2upui+wAzRNfDqluJrVr4HX/U8AxmllU7r2LnRbhCz2pm5yv?= =?us-ascii?Q?M9FeXnXqZsgndKwJatjDhFFYgw2OJQQAc1SM5QSLIS3FVbB+CrZne9SlMtzO?= =?us-ascii?Q?btK/xiKWN/cO0IjM3l2rZ1XIKyYlTiEcE+sUZyAOeK8OMU3ttAblmqJSsBtx?= =?us-ascii?Q?gYHKmlfCE3x2jrFYiIIYcC32cdrrly9U9YsUczWNqsl8goqvFbLC8pqGdNyj?= =?us-ascii?Q?u0zaVpsCJRSyMurGxUTkSkiEWhxylWM90Z9P4gLRzi6gwpTkiUk/+IkMU626?= =?us-ascii?Q?f81VCf1gSUxCa2zMXMgV3WJ5hXHh2iqL+9nKSDjD1r+jT0m6QmRvtjgEvUeX?= =?us-ascii?Q?oZ4SR5OCt8SC22zrXBsTeAXTAMajDxAvEo0s1ulBkXhdL4nFr9uPqPND+yNI?= =?us-ascii?Q?Qkuv1L6S8xLbE1Ugot20rGD2vbdkpzYEuKZMNN0V3ckjY0zwBFJZnmWEBRWB?= =?us-ascii?Q?f19JmgDa1Cw8+4UbQeMdpi9fpvjm5JDGQbNb50NiQH8MlzywcumrKOG4oSog?= =?us-ascii?Q?2eU+f0yB20yTu5ZEYgLXBJhB2M88z1iDA8PZyqevXGukGHQXsizyyy0mv3qU?= =?us-ascii?Q?Tkmj5a96iV+w9i31wTRA/dO+BiKSjsP+0usMEgR2aZ8R5NCwugr/TXMe52zi?= =?us-ascii?Q?kkUWl8kyZ6w528U1ZQ878dSWl8EheMRbCF5Fv7gZlD3JXEyeF0QRcIVnGwzL?= =?us-ascii?Q?dKL1vK5baDKXs+idFssM2hJe?= 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: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffed85e0-204c-441f-f612-08d99223a309 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2021 10:40:00.5346 (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: 8UfFXDA9/4kUxKsLY4LDvoNviXuHuYq7fyu7EuHyx5BVf/8ussFCcTqDvnQfNQXPMNvChhEhgGENXCuLNLxUJGruTa8hOzEdfzGHuAHBQgs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3626 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 1/5] hash: add new toeplitz hash implementation 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 Sender: "dev" > On Fri, 15 Oct 2021 10:30:02 +0100 > Vladimir Medvedkin wrote: >=20 > > + m[i * 8 + j] =3D (rss_key[i] << j)| > > + (uint8_t)((uint16_t)(rss_key[i + 1]) >> > > + (8 - j)); > > + } >=20 > This ends up being harder than necessary to read. Maybe split into > multiple statements and/or use temporary variable. >=20 > > +RTE_INIT(rte_thash_gfni_init) > > +{ > > + rte_thash_gfni_supported =3D 0; >=20 > Not necessary in C globals are initialized to zero by default. >=20 > By removing that the constructor can be totally behind #ifdef >=20 > > +__rte_internal > > +static inline __m512i > > +__rte_thash_gfni(const uint64_t *mtrx, const uint8_t *tuple, > > + const uint8_t *secondary_tuple, int len) > > +{ > > + __m512i permute_idx =3D _mm512_set_epi8(7, 6, 5, 4, 7, 6, 5, 4, > > + 6, 5, 4, 3, 6, 5, 4, 3, > > + 5, 4, 3, 2, 5, 4, 3, 2, > > + 4, 3, 2, 1, 4, 3, 2, 1, > > + 3, 2, 1, 0, 3, 2, 1, 0, > > + 2, 1, 0, -1, 2, 1, 0, -1, > > + 1, 0, -1, -2, 1, 0, -1, -2, > > + 0, -1, -2, -3, 0, -1, -2, -3); >=20 > NAK >=20 > Please don't put the implementation in an inline. This makes it harder > to support (API/ABI) and blocks other architectures from implementing > same thing with different instructions. I don't really understand your reasoning here. rte_thash_gfni.h is an arch-specific header, which provides arch-specific optimizations for RSS hash calculation (Vladimir pls correct me if I am wrong here). We do have dozens of inline functions that do use arch-specific instruction= s (both x86 and arm) for different purposes: sync primitives, memory-ordering, cache manipulations, LPM lookup, TSX, pow= er-saving, etc. That's a usual trade-off taken for performance reasons, when extra function= call costs too much comparing to the operation itself. Why it suddenly became a problem for that particular case and how exactly i= t blocks other architectures? Also I don't understand how it makes things harder in terms of API/ABI stab= ility. As I can see this patch doesn't introduce any public structs/unions. All functions take as arguments just raw data buffers and length. To summarize - in general, I don't see any good reason why this patch shoul= dn't be allowed. Konstantin =20