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 4FD90A0562; Wed, 14 Apr 2021 19:06:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB311161BDD; Wed, 14 Apr 2021 19:06:57 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id F0CA24013F for ; Wed, 14 Apr 2021 19:06:55 +0200 (CEST) IronPort-SDR: R/qkII+dreifoekApcvN4aceJwqFCKjb3Ajugvc2puxMp71UxyFp/xcPo55h8Wuu+BOmIAwxhj ooVWrxwImcJQ== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="174792880" X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="174792880" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 10:06:53 -0700 IronPort-SDR: 6YGx5+tuJCbVWT9oI5TRnrSVFNyeF2PRvNM9TlTsPvbF8uZSGEftJ84IOLeI5PkxMNvpdGLLCp UBN2/RhLdkdQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="389461790" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga007.fm.intel.com with ESMTP; 14 Apr 2021 10:06:53 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 14 Apr 2021 10:06:53 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 14 Apr 2021 10:06:52 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2106.2 via Frontend Transport; Wed, 14 Apr 2021 10:06:52 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 14 Apr 2021 10:06:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HIVCIG9d7BW4lWM6WatQD9YuIihI64WFrZgpbo7/CSysHCboKnvuWBcDQd/EH1ikIUgullhThhZ+pd6koqh83PFeItJ43XCXLEm6UPVI887k2J7xjiLuCBi5S1GfPXF6CvIZsAAldKAY1z5As8bQ1Op4uBEeWW1V9A0j08K0Ba3fimh2BKkylnR1M6skEJaf90DgSGi749BEuwE+2lTZ7kYBnUxXQXAF7JJsx3xu4r30luil8skmWUJVKjJHF2/e44EZTpZVpGRaYyKLgUfJWcVk6UhpxwmntAxTY+ZQdUtACPGPt5uqvKWEpMFJpeQ6C5pqn1HTAJ8UqfUVdopNKw== 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=LgGCRajXM4noqimk+yn1JmSzvrB+tIW0BeReiMbkbN8=; b=XDntBpKfF7PkQde/vfRtMBAxcp9UPq/3JNOWMWFChb6Y98+pxHRwte95k7ro8raghfdCBnofey/RGOXqmVVi/iyfVUimb1AgCVggsyRkhuDzNAuVi3pMtrdmjzDTi/9Jf4Rd+7knQzf59cL8RGJcki+YyByJh5DKHC79SBcqUNURf5R5sbF35FW4bJIHDCj8UTWilcINJ/27NP278F7+JJUco6e2JrOGEwihW3frhLCgCqz9dI78cjU0w6aputIjfNiLJoOHZ80ENxx8ZBj+AxhmoZUXQzZsTE4reZrGDt04neW8o9tTb4DqpHQqptdCjn6ZquikKCN0hfUqd6br3Q== 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=LgGCRajXM4noqimk+yn1JmSzvrB+tIW0BeReiMbkbN8=; b=sMTKYihesVWOuaKHLklRHZ1jJQCIRUc98tOxJfHUnelAqn/2VBWVjbXvpZsxtXN1M4vaz5VAosDmRZ9md5MciqV326jfQgxgaWu3Ums43WyTsBoZPK+TiZF6NdHjjpV2no4JUtZs+Em2FPk35SxObCTpq7ZSU9F0WfrsFuhUhng= Received: from CO1PR11MB5172.namprd11.prod.outlook.com (2603:10b6:303:95::12) by CO1PR11MB4961.namprd11.prod.outlook.com (2603:10b6:303:93::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16; Wed, 14 Apr 2021 17:06:50 +0000 Received: from CO1PR11MB5172.namprd11.prod.outlook.com ([fe80::dc40:be89:aeb8:2d46]) by CO1PR11MB5172.namprd11.prod.outlook.com ([fe80::dc40:be89:aeb8:2d46%5]) with mapi id 15.20.4020.022; Wed, 14 Apr 2021 17:06:50 +0000 From: "Wang, Yipeng1" To: "Medvedkin, Vladimir" , "dev@dpdk.org" CC: "Ananyev, Konstantin" , "Chilikin, Andrey" , "Kinsella, Ray" , "Gobriel, Sameh" , "Richardson, Bruce" Thread-Topic: [PATCH v4 1/3] hash: add predictable RSS API Thread-Index: AQHXMGet6ip/rGmexEq9DhvcnBVKsKq0Pcvg Date: Wed, 14 Apr 2021 17:06:49 +0000 Message-ID: References: <1618168266-338017-1-git-send-email-vladimir.medvedkin@intel.com> <1618319973-391016-2-git-send-email-vladimir.medvedkin@intel.com> In-Reply-To: <1618319973-391016-2-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: e765287a-0276-4ae6-dd10-08d8ff67b1ba x-ms-traffictypediagnostic: CO1PR11MB4961: 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:849; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kc2UTf72ieMKtuvkjA/KlfJ4X+rdOmpwobjJu53XCiQg161skXxGRPHp9XKD/TBIkWjpxdo1n5WOpdwmc37ezQeG3MGUVEZ9yB1I6HSX5nhijXz1uINiBqkb2cyOOVAKLB3UpyV42yrtkK5LdcsbFvO+j2QIq7ue9PWIRWwgtKmI/R/ccO5lz1Ec2rvlI+NY11caa9V4iKRrcT2HpRlB5AqGJJpD5kyeP4pfu9ESL0+QKHfurnTW0Kp79A8rNjZk7lylxwoCPR0eicUwRcHJgwtKDnTr9JNNVVxW3qpDNQo1cy2jAT6BCYh2iUNUyfrnCHUQ7dX9Yn3v0Yom4mTf8Z/z8eWWOYcg7YD42bU8nulPBnL2Uni+r+BVSgj1touWrXm37F3dEUW7BFzHjXRD6DjKzP5Aql92s4VUYJfr6sQY07GSCCWiOy1nJkBAy0qVQE92amqLjqqL991Z0+JFOAvReO4D5e/clODHN0XpPpqIhqB5+G6s8CSZ7sWYIGRDw/bL4Z7siKS/TXNsujyVnYxJWKUfJ26VfU/+BoUxCrKVAqWkCBWq1Ew6H4yWKutMjt8Kx15chsWT0zajRZo/LGGexFG6p3noZBUK3vrm12s= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB5172.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(136003)(396003)(366004)(39860400002)(376002)(38100700002)(316002)(55016002)(186003)(9686003)(33656002)(5660300002)(4326008)(26005)(7696005)(110136005)(54906003)(107886003)(478600001)(64756008)(53546011)(71200400001)(52536014)(2906002)(66946007)(66446008)(8676002)(8936002)(76116006)(66556008)(66476007)(122000001)(86362001)(83380400001)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?8mYraItxdo1UCAp5bhvz8NRJ1INS7JeG6u8HcKBQ6bc8K7z78JvzyYFxeBPC?= =?us-ascii?Q?Knt6iBpyHTX5Zxoq62Dd8f2qDuuHerLZDdtIn46RFlK2A6WdOzPXh6Ze0Rk0?= =?us-ascii?Q?cyhfxHHyZmwIWbDjRKxFHuzGxOVfdNF7T6xHjEFLS4P081N0+gv6x3dwFJVO?= =?us-ascii?Q?ozLEXRhAKxb2Oop/BXcf00b1BH9n1cCdmJ6l+/IAaZzdb9KuD9vYZB/pxPsk?= =?us-ascii?Q?hC0jBgFrYNzgq5sZEeSBJ8ttA330Uf99yQkyVnLRaC9yL+7iM6ovAaIucj5O?= =?us-ascii?Q?OYvwuRKL4TM7KO9X2wyK1mdFd7aHV8kCtWVwh6/B9xeN08YzDhK5FD3HzkUc?= =?us-ascii?Q?KLzQsPzVLxx0q/5/YhU1o5DNEKEsATW05DTfFaNn09rtr7SbZwMWb9RKb9zO?= =?us-ascii?Q?TyVFglu3XT/0vYhn14+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ii?Q?j5sE0bUkeRdXHsg40k3QTF+k?= 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: CO1PR11MB5172.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e765287a-0276-4ae6-dd10-08d8ff67b1ba X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2021 17:06:49.8834 (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: yWzo/PtqaO1sG6LE8IpS6McO0PxGqg6VgQRwa6ZkPpnua64qVJtPHj9wjKkwc4MBMlD1Qp9Jsajyryudm6kG9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4961 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 1/3] hash: add predictable RSS API 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 13, 2021 6:20 AM > To: dev@dpdk.org > Cc: Ananyev, Konstantin ; Chilikin, Andrey > ; Kinsella, Ray ; Wang= , > Yipeng1 ; Gobriel, Sameh > ; Richardson, Bruce > > Subject: [PATCH v4 1/3] hash: add predictable RSS API >=20 > This patch adds predictable RSS API. > It is based on the idea of searching partial Toeplitz hash collisions. >=20 > Signed-off-by: Vladimir Medvedkin > --- > lib/librte_hash/meson.build | 3 +- > lib/librte_hash/rte_thash.c | 109 ++++++++++++++++++++++++ > lib/librte_hash/rte_thash.h | 198 > ++++++++++++++++++++++++++++++++++++++++++++ > lib/librte_hash/version.map | 8 ++ > 4 files changed, 317 insertions(+), 1 deletion(-) create mode 100644 > lib/librte_hash/rte_thash.c >=20 > diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build in= dex > 242859f..3546014 100644 > --- a/lib/librte_hash/meson.build > +++ b/lib/librte_hash/meson.build > @@ -8,6 +8,7 @@ headers =3D files('rte_fbk_hash.h', > 'rte_thash.h') > indirect_headers +=3D files('rte_crc_arm64.h') >=20 > -sources =3D files('rte_cuckoo_hash.c', 'rte_fbk_hash.c') > +sources =3D files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') > +deps +=3D ['net'] > deps +=3D ['ring'] > deps +=3D ['rcu'] > diff --git a/lib/librte_hash/rte_thash.c b/lib/librte_hash/rte_thash.c ne= w file > mode 100644 index 0000000..1325678 > --- /dev/null > +++ b/lib/librte_hash/rte_thash.c > @@ -0,0 +1,109 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2021 Intel Corporation > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define THASH_NAME_LEN 64 > + > +struct thash_lfsr { > + uint32_t ref_cnt; > + uint32_t poly; > + /**< polynomial associated with the lfsr */ > + uint32_t rev_poly; > + /**< polynomial to generate the sequence in reverse direction */ > + uint32_t state; > + /**< current state of the lfsr */ > + uint32_t rev_state; > + /**< current state of the lfsr for reverse direction */ > + uint32_t deg; /**< polynomial degree*/ > + uint32_t bits_cnt; /**< number of bits generated by lfsr*/ > +}; > + > +struct rte_thash_subtuple_helper { > + char name[THASH_NAME_LEN]; /** < Name of subtuple > configuration */ > + LIST_ENTRY(rte_thash_subtuple_helper) next; > + struct thash_lfsr *lfsr; > + uint32_t offset; /** < Offset of the m-sequence */ > + uint32_t len; /** < Length of the m-sequence */ > + uint32_t tuple_offset; /** < Offset in bits of the subtuple */ > + uint32_t tuple_len; /** < Length in bits of the subtuple > */ > + uint32_t lsb_msk; /** < (1 << reta_sz_log) - 1 */ > + __extension__ uint32_t compl_table[0] __rte_cache_aligned; > + /** < Complementary table */ > +}; > + > +struct rte_thash_ctx { > + char name[THASH_NAME_LEN]; > + LIST_HEAD(, rte_thash_subtuple_helper) head; > + uint32_t key_len; /** < Length of the NIC RSS hash key > */ > + uint32_t reta_sz_log; /** < size of the RSS ReTa in bits */ > + uint32_t subtuples_nb; /** < number of subtuples */ > + uint32_t flags; > + uint8_t hash_key[0]; > +}; > + > +struct rte_thash_ctx * > +rte_thash_init_ctx(const char *name __rte_unused, > + uint32_t key_len __rte_unused, uint32_t reta_sz __rte_unused, > + uint8_t *key __rte_unused, uint32_t flags __rte_unused) { > + return NULL; > +} > + > +struct rte_thash_ctx * > +rte_thash_find_existing(const char *name __rte_unused) { > + return NULL; > +} > + > +void > +rte_thash_free_ctx(struct rte_thash_ctx *ctx __rte_unused) { } > + > +int > +rte_thash_add_helper(struct rte_thash_ctx *ctx __rte_unused, > + const char *name __rte_unused, uint32_t len __rte_unused, > + uint32_t offset __rte_unused) > +{ > + return 0; > +} > + > +struct rte_thash_subtuple_helper * > +rte_thash_get_helper(struct rte_thash_ctx *ctx __rte_unused, > + const char *name __rte_unused) > +{ > + return NULL; > +} > + > +uint32_t > +rte_thash_get_complement(struct rte_thash_subtuple_helper *h > __rte_unused, > + uint32_t hash __rte_unused, uint32_t desired_hash __rte_unused) { > + return 0; > +} > + > +const uint8_t * > +rte_thash_get_key(struct rte_thash_ctx *ctx __rte_unused) { > + return NULL; > +} > + > +int > +rte_thash_adjust_tuple(struct rte_thash_ctx *ctx __rte_unused, > + struct rte_thash_subtuple_helper *h __rte_unused, > + uint8_t *tuple __rte_unused, unsigned int tuple_len __rte_unused, > + uint32_t desired_value __rte_unused, > + unsigned int attempts __rte_unused, > + rte_thash_check_tuple_t fn __rte_unused, void *userdata > __rte_unused) > +{ > + return 0; > +} > diff --git a/lib/librte_hash/rte_thash.h b/lib/librte_hash/rte_thash.h in= dex > 061efa2..f3e05fc 100644 > --- a/lib/librte_hash/rte_thash.h > +++ b/lib/librte_hash/rte_thash.h > @@ -1,5 +1,6 @@ > /* SPDX-License-Identifier: BSD-3-Clause > * Copyright(c) 2015-2019 Vladimir Medvedkin > + * Copyright(c) 2021 Intel Corporation > */ >=20 > #ifndef _RTE_THASH_H > @@ -222,6 +223,203 @@ rte_softrss_be(uint32_t *input_tuple, uint32_t > input_len, > return ret; > } >=20 > +/** @internal Minimum size of the RSS ReTa */ [Wang, Yipeng] Logarithm of minimum size. > +#define RTE_THASH_RETA_SZ_MIN 2U > +/** @internal Maximum size of the RSS ReTa */ > +#define RTE_THASH_RETA_SZ_MAX 16U > + > +/** > + * LFSR will ignore if generated m-sequence has more than 2^n -1 bits [Wang, Yipeng] Have you mentioned what is n here in the comment? > +*/ > }; > -- > 2.7.4 [Wang, Yipeng]=20 Acked-by: Yipeng Wang