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 D0C4443E95; Wed, 17 Apr 2024 20:12:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB05D40A76; Wed, 17 Apr 2024 20:12:26 +0200 (CEST) Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) by mails.dpdk.org (Postfix) with ESMTP id D31E4402B5 for ; Wed, 17 Apr 2024 20:12:25 +0200 (CEST) Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-22efc6b8dc5so53034fac.0 for ; Wed, 17 Apr 2024 11:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713377545; x=1713982345; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=IiqnJQsKmnR13NhNGBTzsXcJtIz1vTPEvXEiBIRGqxs=; b=XBvD4Y3unoWKNnMUrS86w2wLNlhus5e7sz60q4gQPnrbE1s2Sv6RDALe8v9vECDqbZ I2dBZfLDVhsPYBOwlYWdktp6/KzF0OvK5LyaGlzQmRViAI95HqsVaVMRa7xNZrKGn4JT duiMqdPkvVq9ysYjUfzH7Vdd50UdBY2xbJqhNCFJAAbFWamvEypzvvGV50pgwBIibbyF Wbe7XCXAzkGz65fX3/ZhtyBp5GKqgyntXRI1eHyDYJjy/KJOJlcCv0YrtBRmh1VaLvNh +WBozB0lUNNDm8670umJu0RYdMKsXfmau0O/9TZzDk2//CPVMd73T17lxZV5NZi4c8AD 5HIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713377545; x=1713982345; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IiqnJQsKmnR13NhNGBTzsXcJtIz1vTPEvXEiBIRGqxs=; b=Th9z4UW8KpXzQJGE5iMrXUGT0eO+Qz6IFv0wi/bAteSOp/F3LLKYur1u+5MGNmOF/m 0xlHTQ52VMB5agX4k8Sx3xOVVhCtcpWZ4RcP/1/efWm71f2PxTS1NHKEuzXpAU9oXMkC EQwP5EIZleE8ZXKx+k0UO02iDvNtRUA8CvSR0/N+LqBsFQj6nY6ShdIzP1P39RtfnCY8 ww+GQ3ms5igfSSoIdfwPRiH0cCEBvqAWXTYFun2sYpU6o6BBP4j6zdwgPMHMkadmC5th 8Tf88phZKYRs4rgj2Lx8pSDc9631qJ5sd2AhLnEsccX3CRxcTFUB+M5UDSy7mzeuKpqw b7vA== X-Forwarded-Encrypted: i=1; AJvYcCUWAeTgDEU48q7WJLrS1/Q1dTkLbqUS06nnH2UhoJQ32Ic1MANS3Gv4ixJQlEBkM7jcMSkC85nvi/+TuXs= X-Gm-Message-State: AOJu0YyXHZVEz+JhPZzAvniFMf1Ky1Cc6VE+aWT+KlEajp0S+Uo285NK tjwVgKgA+VxasH9T2C+NI57g5prThQv+I61eI5iz5jCmcy+eNqv+FjOOPFrkLiM= X-Google-Smtp-Source: AGHT+IHf/gUS0xDwr6g8lneLXvV0P/tpVg6K0H3jbNIQzmzF0ICnzuN0ouaGMvTy6/EDKVBkPNRjhg== X-Received: by 2002:a05:6870:4592:b0:22e:a2fc:afaf with SMTP id y18-20020a056870459200b0022ea2fcafafmr334185oao.49.1713377544971; Wed, 17 Apr 2024 11:12:24 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id l129-20020a632587000000b005dc8702f0a9sm9536406pgl.1.2024.04.17.11.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 11:12:24 -0700 (PDT) Date: Wed, 17 Apr 2024 11:12:22 -0700 From: Stephen Hemminger To: Yoan Picchi Cc: Thomas Monjalon , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin , dev@dpdk.org, nd@arm.com, Ruifeng Wang , Nathan Brown Subject: Re: [PATCH v8 1/4] hash: pack the hitmask for hash in bulk lookup Message-ID: <20240417111222.05152a78@hermes.local> In-Reply-To: <20240417160807.1249480-2-yoan.picchi@arm.com> References: <20231020165159.1649282-1-yoan.picchi@arm.com> <20240417160807.1249480-1-yoan.picchi@arm.com> <20240417160807.1249480-2-yoan.picchi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Wed, 17 Apr 2024 16:08:04 +0000 Yoan Picchi wrote: > diff --git a/lib/hash/arch/common/compare_signatures.h b/lib/hash/arch/common/compare_signatures.h > new file mode 100644 > index 0000000000..59157d31e1 > --- /dev/null > +++ b/lib/hash/arch/common/compare_signatures.h > @@ -0,0 +1,38 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2010-2016 Intel Corporation > + * Copyright(c) 2018-2024 Arm Limited > + */ > + > +/* > + * The generic version could use either a dense or sparsely packed hitmask buffer, > + * but the dense one is slightly faster. > + */ > + > +#include > +#include > +#include > +#include "rte_cuckoo_hash.h" > + > +#define DENSE_HASH_BULK_LOOKUP 1 > + > +static inline void > +compare_signatures_dense(uint16_t *hitmask_buffer, > + const uint16_t *prim_bucket_sigs, > + const uint16_t *sec_bucket_sigs, > + uint16_t sig, > + enum rte_hash_sig_compare_function sig_cmp_fn) > +{ > + (void) sig_cmp_fn; Please use __rte_unused attribute for this. > + > + static_assert(sizeof(*hitmask_buffer) >= 2 * (RTE_HASH_BUCKET_ENTRIES / 8), > + "The hitmask must be exactly wide enough to accept the whole hitmask if it is dense"); The message should be indented like multi-line function args. If possible shorten the message. > + > + /* For match mask every bits indicates the match */ > + for (unsigned int i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) { > + *hitmask_buffer |= > + ((sig == prim_bucket_sigs[i]) << i); Don't really need () around the whole expression here. > + *hitmask_buffer |= > + ((sig == sec_bucket_sigs[i]) << i) << RTE_HASH_BUCKET_ENTRIES; > + } > + > +}