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 540B642C4D; Wed, 7 Jun 2023 14:08:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F16840A84; Wed, 7 Jun 2023 14:08:52 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 4546140698 for ; Wed, 7 Jun 2023 14:08:50 +0200 (CEST) Received: from [192.168.1.126] (unknown [188.242.181.57]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id A476E5E; Wed, 7 Jun 2023 15:08:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru A476E5E DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1686139729; bh=KhvD+0gYu41rF2flf7g9VkY66dVtF/CoO2P7E/boTdU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=C6lcfIdfzZBPBJpusbfgZJlI9uWpyj/XAwYCAtzaSG95MAQ7a9OjbS6qADY/MxCOt C3gNraalfQBhTdmAVZCZ5d3QyJIAwBQVGG9hwIerJb+gBjVh5D5GIqu12+/W1ksNjd s0wd7XOn/ZcH+jlKjvCjZ6Uja7DhiHooEMlfOIsI= Message-ID: <14a1bc07-db25-25c9-0d4f-a60a02894275@oktetlabs.ru> Date: Wed, 7 Jun 2023 15:08:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3 10/34] net/sfc: attach to HW table API Content-Language: en-US To: Ivan Malov , dev@dpdk.org Cc: Ferruh Yigit , Denis Pryazhennikov , Andy Moreton References: <20230601195538.8265-1-ivan.malov@arknetworks.am> <20230604232523.6746-1-ivan.malov@arknetworks.am> <20230604232523.6746-11-ivan.malov@arknetworks.am> From: Andrew Rybchenko In-Reply-To: <20230604232523.6746-11-ivan.malov@arknetworks.am> Content-Type: text/plain; charset=UTF-8; format=flowed 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 6/5/23 02:24, Ivan Malov wrote: > From: Denis Pryazhennikov > > The patch adds APIs to initialise, manipulate and finalise > HW tables API-specific context in NIC control structure. > The context itself will be used to store HW tables-related info, > like table descriptors and field descriptors. > > Signed-off-by: Denis Pryazhennikov > Reviewed-by: Ivan Malov > Reviewed-by: Andy Moreton [snip] > +int > +sfc_tbl_meta_cache_ctor(struct rte_hash **ref_cache) > +{ > + size_t cache_size = RTE_MAX((unsigned int)SFC_TBL_META_CACHE_SIZE_MIN, > + efx_table_supported_num_get()); > + struct rte_hash *cache = NULL; > + const struct rte_hash_parameters hash_params = { > + .name = "meta_hash_table", > + .hash_func = rte_jhash, > + .entries = cache_size, > + .socket_id = rte_socket_id(), > + .key_len = sizeof(efx_table_id_t), > + }; > + > + cache = rte_hash_create(&hash_params); > + if (!cache) Compare vs NULL as DPDK coding style says > + return -ENOMEM; > + > + *ref_cache = cache; > + > + return 0; > +}