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 A3E2645B08; Thu, 10 Oct 2024 19:38:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DFF54025D; Thu, 10 Oct 2024 19:38:13 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 4E8D340144 for ; Thu, 10 Oct 2024 19:38:12 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7e9ff6fb4c6so1493589a12.3 for ; Thu, 10 Oct 2024 10:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728581891; x=1729186691; 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=s4uo5ma7SReYF2HKvN0Uem7m4PvGdDPMCh5ZhRno8zw=; b=xs+MkE5/2xdukaep6lp74f7gJELwnGZNIMnF/+Yj5woHud9KpTbBNxnTkp0ORvg8tF tDUHrZExnIvn7/TWt+oJn92R99Nuv58K+3XdiMJ54OVzMhIuY2YYo5l2jXlfCKyHOjmt ivbHEto6/mNm99bNkSsuLFT4U8dCGeFgf3JjMBuyTWPfUigkOLrdcSbiMPFyJABoadiu FzKafloRlYFy0QbqWyWzxMEmkURiZPImW1FvPtSVJtnBYRbp9BfVgwUcRkB+BmM6hiGG MA0ev84G2Xu696sRqVcMTsiE7/BRLWXq1SweV0weeZlAuTyO+lMh/jDiRHKHD0sjxPdV y6Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728581891; x=1729186691; 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=s4uo5ma7SReYF2HKvN0Uem7m4PvGdDPMCh5ZhRno8zw=; b=IX3WdR7gBmW6Ykdftv93mdl4trUYOt0PylAT7EXQMkulToMz/MQSKjh6GiIja8xmDb rjmBF/6UuhHdP1+9Lv+NEKO6XE4RtIS5BhBZk2jDrOclL5qjx5SyBGWTliHSiM6LZOSQ rDb+pLDRZyyIzTJCKLXpscUya05Jf9EPcShzpOkYMFiO+Bv/hBpsI67BC0N3B+gUg+by az+QaJqgoOgbEhEqtUkQpvVVdEa3qzP72TSTuzS+1+MmTLWHyyiZgFApoTinASg9Ihzt dpu203+fo2Q9846L5jHWP21kYIhrdqFxTxYIzGUxjdoYRqx9tN8pkOBGKcYUsDl8c6V1 F2GQ== X-Forwarded-Encrypted: i=1; AJvYcCXcMvDXBz8UXVA6QJHBOjYa6midg21URWALe6iouzdTZSFKTtiUF/D870T+pRPo0i9OWxI=@dpdk.org X-Gm-Message-State: AOJu0YwrnBgIt7O8FW2WSDUNcZd50xY3SWKFKbzO/Nle5ZYmUuZbT7cO DYN3HTdMTMAlNVtSCGhSh4fvgp+dqAu/PNe5UX3xdw59U48dFfK72Vaf62YNxmo= X-Google-Smtp-Source: AGHT+IFHrxv+96YcxbY778qx32nJ003NfoHOsBiAWwPR7k3izYza662/hKiygHJcxC4i+6a+DZz2Bw== X-Received: by 2002:a17:903:22c8:b0:20b:4875:2c51 with SMTP id d9443c01a7336-20c6377c885mr109628745ad.27.1728581891379; Thu, 10 Oct 2024 10:38:11 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c212d40sm11823595ad.195.2024.10.10.10.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 10:38:11 -0700 (PDT) Date: Thu, 10 Oct 2024 10:38:09 -0700 From: Stephen Hemminger To: Niall Meade Cc: Thomas Monjalon , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin , dev@dpdk.org Subject: Re: [PATCH v2] hash: separate param checks in hash create func Message-ID: <20241010103809.22816915@hermes.local> In-Reply-To: <20241010164602.1794534-1-niall.meade@intel.com> References: <20240726145443.1058676-1-niall.meade@intel.com> <20241010164602.1794534-1-niall.meade@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 Thu, 10 Oct 2024 16:46:02 +0000 Niall Meade wrote: > diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c > index 577b5839d3..2569f7d977 100644 > --- a/lib/hash/rte_cuckoo_hash.c > +++ b/lib/hash/rte_cuckoo_hash.c > @@ -190,11 +190,17 @@ rte_hash_create(const struct rte_hash_parameters *params) > > /* Check for valid parameters */ > if ((params->entries > RTE_HASH_ENTRIES_MAX) || > - (params->entries < RTE_HASH_BUCKET_ENTRIES) || > - (params->name == NULL) || > - (params->key_len == 0)) { > + (params->entries < RTE_HASH_BUCKET_ENTRIES)) { > rte_errno = EINVAL; > - HASH_LOG(ERR, "%s has invalid parameters", __func__); > + HASH_LOG(ERR, "%s() entries (%u) must be in range [%d, %d] inclusive", > + __func__, params->entries, RTE_HASH_BUCKET_ENTRIES, > + RTE_HASH_ENTRIES_MAX); Need to indent function args here. > + return NULL; > + } Noticed this function is inconstitent about setting rte_errno. Not sure if it matters.