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 98161A0579; Thu, 8 Apr 2021 17:56:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B770141122; Thu, 8 Apr 2021 17:56:14 +0200 (CEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 8AFBC4068B for ; Thu, 8 Apr 2021 17:56:13 +0200 (CEST) Received: by mail-pf1-f169.google.com with SMTP id q5so2130630pfh.10 for ; Thu, 08 Apr 2021 08:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1DHu1/agNIWMNkVvaEUXOeO1tFnIxa8CYfcK7UDiYKI=; b=HHEuLlbI0grjwCohrxxHx9HH0z3CkgI6Fh+nRjGcwwF3cHDTdqr84VHy0Voz5uRPfl t4ZD7XZoJXgMqGtnyJ+dnw49YjcIANth2UJBwbh1oNiQ2y3QSuJM+PUxmqG1AJNh0tIh 0Rt/R8xR2AE0W0/QjrWepxjOkBnIv9K9s/9IwydZ93Tl1inHgK/4Kepj/5VjbSs3ANty CchYbpI7ZfkeBJvzBBvqXzYzH3tS+jqYL+A614Neq9oseisww7/0VkAgd45lSJ1LLE9f 6J10me6xm6XaR7aBb2gU1iNS/kKZ8idOrIT1LBbuU89gd5FXvR9TbQm3gdKXJtyFFOF2 3P/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1DHu1/agNIWMNkVvaEUXOeO1tFnIxa8CYfcK7UDiYKI=; b=Gd7CDEcXnCCvtpgo8vcQkZSmKYeRtwUYtrD5+WqQ5GQilug0iQS/fbhHR0T7gpRGU3 1jLJgbcHPJZd432QBB6dGleoZhSUBcnYWLGOTQIvZSlZzValZZ4aJPOSkPAOlRYf2Ha9 UdKAepMC3EGxvSWsnNZFH7j/gcGOqPI9QrqdqqOxr1gAvKz7THi43UuDHnD6FuI7z3AF n3Vr/up5flQzDShMQGV3ePeqm491BPLW3em7CttihUil5HT/Fbd4ZK8HIiDUFVah698X MniBnpwkBDOGo+8q4fLwOxxAUF9ICRKHFp3HK6WbcNy9Ap0zWT6JjaTsa91QzMCUwlDt x4iA== X-Gm-Message-State: AOAM532wF2lNV6HD8NeNcGr/8Dbbbq85DHyO/KH36kpqHvCP7NPNk4wQ WS7YqItBGDMKf8Meyx4t+saJsQ== X-Google-Smtp-Source: ABdhPJxfAiQbkB57GEV8Gqw/dcODc4q0mdbxxPSyBG1eiHYkIGf02R/6arnL7NsGWZre2enH0fytWQ== X-Received: by 2002:a63:36ce:: with SMTP id d197mr7508004pga.237.1617897372562; Thu, 08 Apr 2021 08:56:12 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id t18sm24814922pfh.57.2021.04.08.08.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 08:56:12 -0700 (PDT) Date: Thu, 8 Apr 2021 08:56:04 -0700 From: Stephen Hemminger To: Vladimir Medvedkin Cc: dev@dpdk.org, konstantin.ananyev@intel.com, andrey.chilikin@intel.com, ray.kinsella@intel.com, yipeng1.wang@intel.com, sameh.gobriel@intel.com, bruce.richardson@intel.com Message-ID: <20210408085604.7af44b12@hermes.local> In-Reply-To: <1617738643-258635-1-git-send-email-vladimir.medvedkin@intel.com> References: <1615919077-77774-1-git-send-email-vladimir.medvedkin@intel.com> <1617738643-258635-1-git-send-email-vladimir.medvedkin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" On Tue, 6 Apr 2021 20:50:40 +0100 Vladimir Medvedkin wrote: > 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. > > 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 (3): > hash: add predictable RSS API > hash: add predictable RSS implementation > test/hash: add additional thash tests > > 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 > It would be good to show how this could be used in an application. Maybe yet another variant/flag to l3fwd example.