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 29B0EA0547; Sat, 10 Apr 2021 02:32:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0CF4141117; Sat, 10 Apr 2021 02:32:19 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 8917F40688 for ; Sat, 10 Apr 2021 02:32:17 +0200 (CEST) IronPort-SDR: 0prafKN4gZ7df3HeXBeDqgS48mptsFizsv65/eb/lb0vYHgqEKtOsvnxcPLaEhMv5RAjrcBMM5 PgA1B+XSKpig== X-IronPort-AV: E=McAfee;i="6000,8403,9949"; a="180995586" X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="180995586" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2021 17:32:16 -0700 IronPort-SDR: y184SVtuSsvFaqR00F4uTFTuLfgKbFzpFilCqvJFtYa8VnN9OpyRR2dKKFOrRkCJqmC1H1wsSY ICBNfZej2DLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,210,1613462400"; d="scan'208";a="416481872" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga008.fm.intel.com with ESMTP; 09 Apr 2021 17:32:15 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 9 Apr 2021 17:32:15 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Fri, 9 Apr 2021 17:32:15 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Fri, 9 Apr 2021 17:32:15 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.49) 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.2106.2; Fri, 9 Apr 2021 17:32:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BjaAo8dmNoI6mF/Pg10Q8x79PFS6eq5+NuLrsXTeP71wQftOI1wo0kHUcHRdQEUNNaI/PXR+PEmaACUvsWpvL2GRijKDv5EYQ/pG877Ymniwz04pajqWBeuH+X0/kbO835EjgY4I4PEJ7jwzfwMhMeBZSNITLjUV0esjh885BqxXrHbrdou3c40m+qDc+GHoKLWlmlWzp9x2dwK7ZeuZHPp6MLymNF1L7pjsnD2+tX8iPcgz2/Xyp0LqxbXti/tb4GjtGJkRcuhYF3YjqIvmk996uLve3gYWFAEVPvADEteN/v9RnboO3/Q7lTJB9cw0hx5pIb6m/leHixY8PLAxkw== 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=pLchFuhfDoJougfqqpgY33W/9vcCPgm0OwZJgpzBn5Q=; b=mNPcEKdMT2CuTMPr4+1/6Eyu393hYuN/aZ0tkjhalLfNHVT2UbY1VP+B/XqaNs3jmHqIQew5en6NAyhRBwOQY9dB6PR1COGB710OUUiYnIXe0rHymUyFcyFRgRn6r0n1gpqHGc0zP4FwoQh7MntElbvQ7QzM75nkYfKxVpJk64vCsOt5HspopWmckPtfl/akMBVtHUOHj7KcxieVBrLyJLpcMkW//dBF/uw5PN8yx1PkzXbLLO+uj9mjnVIyLJNjVyYKWSeIen2B1oVZsLntcxCxXvf69T8/0Dd4+3AQBRx+QXRhYoEE6XlhLoXGYI5YviExas+HPAdS8Uz55ARSYA== 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=pLchFuhfDoJougfqqpgY33W/9vcCPgm0OwZJgpzBn5Q=; b=iEPM1RKPYTkNFZB6VwJfc70SE0B61e2m8T3MRZQQGittHlqD1lVY2E/zT1VU9TWx7AyQ0rcpavrBvFk1Py+nHZ4TFdBLHQP4CqaupILL2yumf1bYq7LrypdJpgM4h5J1C3jYK9hO/izdd7eZyvhYY1CuPA70atiuzbZ0rd0BHoQ= Received: from BYAPR11MB3494.namprd11.prod.outlook.com (2603:10b6:a03:86::15) by BY5PR11MB4166.namprd11.prod.outlook.com (2603:10b6:a03:191::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.32; Sat, 10 Apr 2021 00:32:11 +0000 Received: from BYAPR11MB3494.namprd11.prod.outlook.com ([fe80::8446:4da6:a155:5b3e]) by BYAPR11MB3494.namprd11.prod.outlook.com ([fe80::8446:4da6:a155:5b3e%7]) with mapi id 15.20.3999.032; Sat, 10 Apr 2021 00:32:11 +0000 From: "Wang, Yipeng1" To: "Medvedkin, Vladimir" , "dev@dpdk.org" CC: "Ananyev, Konstantin" , "Chilikin, Andrey" , "Kinsella, Ray" , "Gobriel, Sameh" , "Richardson, Bruce" , Stephen Hemminger Thread-Topic: [PATCH v2 0/3] Predictable RSS feature Thread-Index: AQHXKx4rAAfFS70iKkmVT3Hi2nqFsaqs5btQ Date: Sat, 10 Apr 2021 00:32:11 +0000 Message-ID: References: <1615919077-77774-1-git-send-email-vladimir.medvedkin@intel.com> <1617738643-258635-1-git-send-email-vladimir.medvedkin@intel.com> In-Reply-To: <1617738643-258635-1-git-send-email-vladimir.medvedkin@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [108.161.24.24] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 73899610-9013-41bc-261c-08d8fbb814b1 x-ms-traffictypediagnostic: BY5PR11MB4166: 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:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hwok1C5ikEuUG3ksxO0dgudFXsyxJZkUH+Yx/kzDx807NQSFtVewZO0jCnTBpTtbpoQxrx4Qrct0bUs2oCQUJ83Bsk2+wHKWuKoJRTfKdIvQbgdceNmDsJVWx/vM+NR9kzACkWvJTO1mk1sugJbvA1hJJgByvvXzzSyRJNCk1RtDd3RWKY45S2y8mS8xyvRqcqalpMXu/WcYFpyrxUil8pTBipvUTS/xwGtIpTQ7Z2EzyihtOYU+1pW2mv5l7+l4WWCP2Lby0XLJP35/XLU1o/GLWgc2/pwVt//q3JhZvh2yKz1YekYZMKytmOKKJ11gUm7GA5jlFv41U/eUyYaM33/gDx0sx1yybB550I12/b/3GytAMZdWkblMv1iImWDTAMT0G89sf8EGwocU9iZUtLmWAYuBNK15pMSI8HJA3T7dRvEG6OhR2v0R4fMkBNJXmHJE3YOJfdz7lXwt8Da9UKonlyeFzDJWlKH7NZdTt4rV3NCSVpcb6VAWuxcKPWyFK04C2422jKb03g65xqtSMxYee03c118dcd6s0VzH7BzN6HTbfDIyoPCyQLQHhvWRjgYM2GT0iYiLsLnfMDPXTs/VdRiXreGxB2+oX4Aaw49B6pA+CO1V/t0aFW9zgylo+NtniTtSEru+e1HaQieZYKDMrlGKvAcPk9R5CM8dWJE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3494.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(39860400002)(346002)(396003)(366004)(136003)(66446008)(83380400001)(86362001)(110136005)(26005)(76116006)(7696005)(186003)(316002)(54906003)(5660300002)(8676002)(8936002)(33656002)(38100700001)(4326008)(52536014)(6506007)(66476007)(64756008)(71200400001)(53546011)(66556008)(55016002)(9686003)(478600001)(2906002)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?6PgRHw437wgj64qxu8WbYNNWzEq+lUaw+ikdpMRTZWm4OOoBLdZopPsaSOSj?= =?us-ascii?Q?r+ycy2lxgqbGII17StTf7gweWAj0ccTaYikCcQCAkEmR0ur1XfHmWWc1SM7J?= =?us-ascii?Q?sW9kSJpvd8/4pvZCgzwMcI8AET0/CUgpy/sM8kiGhiW64UArgsw1udlAhmgJ?= =?us-ascii?Q?BGXl3dMACaV7DwFSukBbCiJQGXvX1xglcjuJrgx8LEhFC7YzKaAbKIculFTu?= =?us-ascii?Q?pkxC+Muiu6y8gA+8f16rH0gn6s1OGMBu5XShOdMW8MlTUJ8YjPvBWsZ7r6Mx?= =?us-ascii?Q?7jd8P4a7GEI0rGlVCq0ryoGxceWW/iIjPZo11/GOdsMqKRov98w/Xu5bmPAs?= =?us-ascii?Q?vrzYKZKQPf5DmF+iWZKSP+XVTrVgAFxK8zeNJX7Ugew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QQKWO91tIeBU8OXMdaDdPlJF1cvOVaOac1j2SLzbOlHbMKG8?= =?us-ascii?Q?VGRAjMvgqu2e5IT6E2DgGlks?= 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: BYAPR11MB3494.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73899610-9013-41bc-261c-08d8fbb814b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2021 00:32:11.0944 (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: twm3L6bDN9MKOH6JZmUzEvPi3FRMEgw7qBqCEpWZV8UA9TIgYaNoOp3L5k4UQ7vXsnI/4/7x/bac/GHOgkt6ow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4166 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 0/3] Predictable RSS feature 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" > -----Original Message----- > From: Medvedkin, Vladimir > Sent: Tuesday, April 6, 2021 12:51 PM > To: dev@dpdk.org > Cc: Ananyev, Konstantin ; Chilikin, Andrey > ; Kinsella, Ray ; Wang= , > Yipeng1 ; Gobriel, Sameh > ; Richardson, Bruce > > Subject: [PATCH v2 0/3] Predictable RSS feature >=20 > This patch series introduces predictable RSS feature. > It is based on the idea of searching for partial hash collisions within T= oeplitz > hash. >=20 > The Toeplitz hash function is a homomorphism between (G, ^) and (H, ^), > where (G, ^) - is a group of tuples and (H, ^) is a group of hashes with = respect > to XOR operation. So tuples and hashes could be treated as n-dimension an= d > 32-dimension vector spaces over GF(2). > So, f(x ^ y) =3D=3D f(x) ^ f(y) > where f - is the toeplitz hash function and x, y are tuples. >=20 > The ability to predict partial collisions allows user to compute input ha= sh value > with desired LSB values. > Usually number of LSB's are defined by the size of RSS Redirection Table. >=20 > There could be number of use cases, for example: > 1) NAT. Using this library it is possible to select a new port number on = a > translation in the way that rss hash for original tuple will have the sam= e LSB's > as rss hash for reverse tuple. > 2) IPSec/MPLS/Vxlan. It is possible to choose tunnel id to be pinned to a > desired queue. > 3) TCP stack. It is possible to choose a source port number for outgoing > connections in the way that received replies will be assigned to desired > queue. > 4) RSS hash key generation. Hash key initialization with random values do= es > not guarantee an uniform distribution amongst queues. This library uses > mathematically proved algorithm to complete the rss hash key to provide t= he > best distribution. >=20 > v2: > - added extra API rte_thash_adjust_tuple() > - added extra tests for rte_thash_adjust_tuple() > - added extra fields to rte_thash_subtuple_helper struct > - fixed typos >=20 > Vladimir Medvedkin (3): > hash: add predictable RSS API > hash: add predictable RSS implementation > test/hash: add additional thash tests >=20 > app/test/test_thash.c | 468 +++++++++++++++++++++++++++++++- > lib/librte_hash/meson.build | 3 +- > lib/librte_hash/rte_thash.c | 637 > ++++++++++++++++++++++++++++++++++++++++++++ > lib/librte_hash/rte_thash.h | 180 +++++++++++++ > lib/librte_hash/version.map | 8 + > 5 files changed, 1289 insertions(+), 7 deletions(-) create mode 100644 > lib/librte_hash/rte_thash.c >=20 > -- > 2.7.4 [Wang, Yipeng]=20 Hi, Vladimir, thanks for the patch! I haven't fully understood every bit of the algorithm yet,=20 but I did see issues that this patch could potentially solve. My understanding is that there are some restrictions for the current implem= entation, for example, it only supports port(16-bit) manipulation, but not multiple f= ields or IP.=20 Still, I think it should be good for the use cases you listed. I would love= to hear more feedbacks from people who are more familiar with doing NAT in producti= on systems. For me, besides the comments I sent earlier, good documentation and references are needed with clear usage examples, as = others pointed out already. Also, the current API design seems a bit cumbersome. To use the library, one needs: Init_ctx Add_helper. Get_helper Get_complement Then in a loop: Adjust_tuples Then XOR with the current tuple I wonder if an alternative all-in-one API could be designed for simpler use= cases. Thanks!