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 7032C45D79; Fri, 22 Nov 2024 02:35:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06E1243252; Fri, 22 Nov 2024 02:35:15 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 1145742FA3 for ; Fri, 22 Nov 2024 02:35:13 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XvczG5gQ5z69d9; Fri, 22 Nov 2024 09:32:26 +0800 (CST) Received: from kwepemk500009.china.huawei.com (unknown [7.202.194.94]) by mail.maildlp.com (Postfix) with ESMTPS id E5C8618007C; Fri, 22 Nov 2024 09:35:10 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by kwepemk500009.china.huawei.com (7.202.194.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 22 Nov 2024 09:35:10 +0800 Message-ID: Date: Fri, 22 Nov 2024 09:35:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v12 05/21] hash: remove use of VLAs for Windows built code To: Andre Muezerie , CC: Konstantin Ananyev References: <1713397319-26135-1-git-send-email-roretzla@linux.microsoft.com> <1732225298-10322-1-git-send-email-andremue@linux.microsoft.com> <1732225298-10322-6-git-send-email-andremue@linux.microsoft.com> Content-Language: en-US From: fengchengwen In-Reply-To: <1732225298-10322-6-git-send-email-andremue@linux.microsoft.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemk500009.china.huawei.com (7.202.194.94) 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 Acked-by: Chengwen Feng On 2024/11/22 5:41, Andre Muezerie wrote: > From: Konstantin Ananyev > > 1) ./lib/hash/rte_cuckoo_hash.c:2362:9 > : warning: ISO C90 forbids variable length array ‘positions’ > 2) ../lib/hash/rte_cuckoo_hash.c:2478:9 > : warning: ISO C90 forbids variable length array ‘positions’ > > Both rte_hash_lookup_bulk_data() and > rte_hash_lookup_with_hash_bulk_data() expect > @num_keys <= RTE_HASH_LOOKUP_BULK_MAX. > So, for both cases it should be safe to replace VLA with fixed size > array. > > Signed-off-by: Konstantin Ananyev > Reviewed-by: Bruce Richardson > Acked-by: Vladimir Medvedkin > --- > lib/hash/rte_cuckoo_hash.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c > index 9575e8aa0c..fc93182efe 100644 > --- a/lib/hash/rte_cuckoo_hash.c > +++ b/lib/hash/rte_cuckoo_hash.c > @@ -2418,7 +2418,7 @@ rte_hash_lookup_bulk_data(const struct rte_hash *h, const void **keys, > (num_keys > RTE_HASH_LOOKUP_BULK_MAX) || > (hit_mask == NULL)), -EINVAL); > > - int32_t positions[num_keys]; > + int32_t positions[RTE_HASH_LOOKUP_BULK_MAX]; > > __rte_hash_lookup_bulk(h, keys, num_keys, positions, hit_mask, data); > > @@ -2534,7 +2534,7 @@ rte_hash_lookup_with_hash_bulk_data(const struct rte_hash *h, > (num_keys > RTE_HASH_LOOKUP_BULK_MAX) || > (hit_mask == NULL)), -EINVAL); > > - int32_t positions[num_keys]; > + int32_t positions[RTE_HASH_LOOKUP_BULK_MAX]; > > __rte_hash_lookup_with_hash_bulk(h, keys, sig, num_keys, > positions, hit_mask, data);