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 0F581A034C; Thu, 18 Aug 2022 13:45:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A998F40DDC; Thu, 18 Aug 2022 13:45:03 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id DB95D40156 for ; Thu, 18 Aug 2022 13:45:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660823102; x=1692359102; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=xMJGGLkgLvaWo7EyLKaQKixgl+sijM9PSkLZbB0DMzU=; b=ADxs+mPiJkeOwWbgRKc176BthWa7K5RXIdgpU3nx0Q9vmTGZMvziJiUa Mhwo9xPbEpu9GTTTBeVmko2UVBVvW9hfpSCSqPMavDOU05Vuisy3rwM5J DLtYaT3skmH+BtkuqD8uM5/UXydHsmETiWzrTrUem72K2SlJbb5pJrMrB L/Z6DTko8fcFlwUcJcAiLd4rj6AWnqSsGd+JnlLnoFhWoXX7TroyAB07t l9ibflOx2C3K26MwUlXx0pUX8R+qGJaAMJnRV75af8uEktWibdQgNT3/l gKPdidX6tcPy1DsAPZvsojtZ3krjs4bBkKUg7bmWcTp4jwLDpU9/fMquj Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10442"; a="292735205" X-IronPort-AV: E=Sophos;i="5.93,246,1654585200"; d="scan'208";a="292735205" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2022 04:44:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,246,1654585200"; d="scan'208";a="668069692" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by fmsmga008.fm.intel.com with ESMTP; 18 Aug 2022 04:44:49 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Subject: [PATCH 0/6] pipeline: make the hash function configurable per table Date: Thu, 18 Aug 2022 11:44:43 +0000 Message-Id: <20220818114449.1408226-1-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The exact match and learner tables use a hash function for the lookup operation. This patch set makes the hash function configurable and removes some limitations. The hash function previously used by these table types had the following limitations: a) Not configurable: An internally hardcoded version was used; b) Mask-based: This prevents using most of the available hash functions, as they are not mask-based; c) Key size limited to 64 bytes or less. The new hash function is: a) Configurable; b) Not mask-based; c) Not limited to key sizes to less than or equal to 64 bytes. Also, since this flexibility has some performance cost, this patch set also introduces key comparison functions specialized for each key size value. Since the key size is fixed for each table, the key comparison function can be selected at initialization as opposed to using a generic function that can handle any key size. This strategy result in a performance improvement for the table lookup operation of around 5%. Depends-on: series-24117 ("pipeline: pipeline configuration and build improvements") Cristian Dumitrescu (6): table: add hash function prototype table: add key comparison functions table: configure the hash function for regular tables pipeline: configure the hash function for regular tables table: configure the hash function for learner tables pipeline: configure the hash function for learner tables lib/pipeline/rte_swx_ctl.c | 1 + lib/pipeline/rte_swx_ctl.h | 3 + lib/pipeline/rte_swx_pipeline.c | 22 ++ lib/pipeline/rte_swx_pipeline.h | 30 ++- lib/pipeline/rte_swx_pipeline_internal.h | 2 + lib/pipeline/rte_swx_pipeline_spec.c | 70 +++++- lib/pipeline/rte_swx_pipeline_spec.h | 2 + lib/table/meson.build | 2 + lib/table/rte_swx_hash_func.h | 39 ++++ lib/table/rte_swx_keycmp.c | 166 ++++++++++++++ lib/table/rte_swx_keycmp.h | 49 +++++ lib/table/rte_swx_table.h | 8 + lib/table/rte_swx_table_em.c | 266 ++++------------------- lib/table/rte_swx_table_learner.c | 220 +++---------------- lib/table/rte_swx_table_learner.h | 6 + 15 files changed, 450 insertions(+), 436 deletions(-) create mode 100644 lib/table/rte_swx_hash_func.h create mode 100644 lib/table/rte_swx_keycmp.c create mode 100644 lib/table/rte_swx_keycmp.h -- 2.34.1