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 483BEA0524; Mon, 19 Apr 2021 18:00:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27ECD4138A; Mon, 19 Apr 2021 18:00:04 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id BE339412E6 for ; Mon, 19 Apr 2021 18:00:02 +0200 (CEST) IronPort-SDR: Eh/U7lY0rvSATp64aTf7SgEyoNY+i5j3H0O5x/EnDyTI6mbHf7CEvkscJqJ48s3u7ZZO7s1qbh elXsUzlM4pvg== X-IronPort-AV: E=McAfee;i="6200,9189,9959"; a="193228596" X-IronPort-AV: E=Sophos;i="5.82,234,1613462400"; d="scan'208";a="193228596" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2021 09:00:00 -0700 IronPort-SDR: Vy3DJC2Ep/rCLeil8Mgu/i70UzX8tqM9bs+f0/FgNHaBGlTMZY4GPp+To9cPfPctqN0ETyIvEI gSDUR5a3ap5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,234,1613462400"; d="scan'208";a="462785365" Received: from silpixa00400072.ir.intel.com ([10.237.222.213]) by orsmga001.jf.intel.com with ESMTP; 19 Apr 2021 08:59:57 -0700 From: Vladimir Medvedkin To: dev@dpdk.org Cc: konstantin.ananyev@intel.com, andrey.chilikin@intel.com, ray.kinsella@intel.com, yipeng1.wang@intel.com, sameh.gobriel@intel.com, bruce.richardson@intel.com Date: Mon, 19 Apr 2021 16:59:50 +0100 Message-Id: <1618847995-91229-1-git-send-email-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618319973-391016-1-git-send-email-vladimir.medvedkin@intel.com> References: <1618319973-391016-1-git-send-email-vladimir.medvedkin@intel.com> Subject: [dpdk-dev] [PATCH v5 0/5] 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" This patch series introduces predictable RSS feature. It is based on the idea of searching for partial hash collisions within Toeplitz hash. 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 and 32-dimension vector spaces over GF(2). So, f(x ^ y) == f(x) ^ f(y) where f - is the toeplitz hash function and x, y are tuples. The ability to predict partial collisions allows user to compute input hash value with desired LSB values. Usually number of LSB's are defined by the size of RSS Redirection Table. 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 same 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 does not guarantee an uniform distribution amongst queues. This library uses mathematically proved algorithm to complete the rss hash key to provide the best distribution. v5: - added documentation - added release notes - added logging v4: - RETA_SZ macros were moved to .h - fixed typos v3: - reworked rte_thash_adjust_tuple() - added extra comments - fixed typos - rte_thash_adjust_tuple() API was putted into the first commit 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 Vladimir Medvedkin (5): hash: add predictable RSS API hash: add predictable RSS implementation test/hash: add additional thash tests doc: add thash documentation maintainers: claim maintainership of the hash library MAINTAINERS | 2 + app/test/test_thash.c | 469 ++++++- doc/guides/prog_guide/img/predictable_snat_1.svg | 1444 +++++++++++++++++++++ doc/guides/prog_guide/img/predictable_snat_2.svg | 1444 +++++++++++++++++++++ doc/guides/prog_guide/img/rss_queue_assign.svg | 1454 ++++++++++++++++++++++ doc/guides/prog_guide/index.rst | 1 + doc/guides/prog_guide/toeplitz_hash_lib.rst | 289 +++++ doc/guides/rel_notes/release_21_05.rst | 6 + lib/librte_hash/meson.build | 3 +- lib/librte_hash/rte_thash.c | 682 ++++++++++ lib/librte_hash/rte_thash.h | 199 +++ lib/librte_hash/version.map | 8 + 12 files changed, 5994 insertions(+), 7 deletions(-) create mode 100644 doc/guides/prog_guide/img/predictable_snat_1.svg create mode 100644 doc/guides/prog_guide/img/predictable_snat_2.svg create mode 100644 doc/guides/prog_guide/img/rss_queue_assign.svg create mode 100644 doc/guides/prog_guide/toeplitz_hash_lib.rst create mode 100644 lib/librte_hash/rte_thash.c -- 2.7.4