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 2F8E445B44; Wed, 16 Oct 2024 00:29:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0860040144; Wed, 16 Oct 2024 00:29:51 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id BCED0400D7 for ; Wed, 16 Oct 2024 00:29:48 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71e5b2814f6so2464960b3a.2 for ; Tue, 15 Oct 2024 15:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729031387; x=1729636187; 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=Ueb68O7TjaYuZmjLaUvm/UYWSbgLWn6M5pLoWneP6BI=; b=ytwcNxUEhCdtdZSaCatA+IlAiSHGrysajNkOZFhmxMBG+vanM+QFVqR4NKrD2PyNWn LKVsAV8W8Q2Pbu94wXcZgwCRmVG80ZAwYJru7WJ++a6vNk7DwBOZZGOppSHHqS2Kgj7i 75JQwmK7CUoBOUdnNXd7mrT17ENjJ7DU5bMF7cG17d1iSGjZ6zstJ7NL9/sJBmaBibDj 69PDjdJrRYI0J7o6xwymnGt49fYT/SC5q5lXd6VVp92WR+LRvBegMW3ptR6I8tMExuTb 6uD6I4DbrXT6TlYmcfxxbYc3Rw7V549mCIzI2XOufXr0A5Ny4HJwfCiLui6A/o+zUzvr jJfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729031387; x=1729636187; 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=Ueb68O7TjaYuZmjLaUvm/UYWSbgLWn6M5pLoWneP6BI=; b=lDrpaDYLY6i1o/A7wK2D6K211QuO07F18bixuK6h5GCwG30u4fd5GeanxjxNE4xDxX dxSVWYOoHaG4V8CDe2na81B4jbhl3hzbzA3Ka7lGO0xaeuXOoqDXsos1fwTQWAChvVtg SyxxViRakwHvYi124+Io7SJUkyLlElHnN9NJ9F4yozL5M0Kl9w+UNVUZOxE2IfzIX17H qKyPryDFK7gUSr/1YQiz8DuHazLqjZnYWHZjm7q+aljXIDAxcqUnKH/MqE9oe5m6S4mc 8VAVAPygdyXmMB++w0NNzz5WyJ/dYLsWM32IukYlcoadjo+dR1tjlaCMD/xV4irg+Dq4 MHng== X-Gm-Message-State: AOJu0Yzt5E7Tlc+uU6YTFiYwpjtoWFMZjPjDFJCI/c7i0o0Wu1s7Rovf XMi0AZ02X5COCcV500lvqcLvqlMJ/1IvQrCy4C64ZXjLeT9MXfAqi55yBc0DjZw= X-Google-Smtp-Source: AGHT+IH/uCQQF4mRdHXsC3X7ODCvQ36iNuNreyhGejoUf72apnc3WzDwWLj9qee1+7hqLhnW4XYzfA== X-Received: by 2002:a05:6a00:1797:b0:71e:7c25:8217 with SMTP id d2e1a72fcca58-71e7c2591demr3389357b3a.25.1729031387655; Tue, 15 Oct 2024 15:29:47 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e774a29e0sm1838699b3a.126.2024.10.15.15.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 15:29:47 -0700 (PDT) Date: Tue, 15 Oct 2024 15:29:45 -0700 From: Stephen Hemminger To: Vladimir Medvedkin Cc: dev@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson Subject: Re: [PATCH v3 2/4] hash: add dynamic polynomial calculation Message-ID: <20241015152945.530926a1@hermes.local> In-Reply-To: <20241011181703.236985-3-vladimir.medvedkin@intel.com> References: <20241010123331.749004-1-vladimir.medvedkin@intel.com> <20241011181703.236985-1-vladimir.medvedkin@intel.com> <20241011181703.236985-3-vladimir.medvedkin@intel.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 Fri, 11 Oct 2024 18:17:00 +0000 Vladimir Medvedkin wrote: > + > +uint32_t > +rte_thash_get_rand_poly(uint32_t poly_degree) > +{ > + uint32_t ret_poly; > + > + if (poly_degree > 32) > + return 0; > + > + do > + ret_poly = __thash_get_rand_poly(poly_degree); > + while (thash_test_poly_order(ret_poly, poly_degree)); Unbounded loop adds some risk, should there be an upper limit on retries. > + > + return ret_poly; > +} > diff --git a/lib/hash/version.map b/lib/hash/version.map > index 4f13f1d5aa..7ce6ab1121 100644 > --- a/lib/hash/version.map > +++ b/lib/hash/version.map > @@ -61,4 +61,5 @@ INTERNAL { > > rte_thash_gfni_stub; > rte_thash_gfni_bulk_stub; > + rte_thash_get_rand_poly; Why does this function need to be moved to its own file? Only used in one place in rte_thash.c.