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 15E28425CA; Mon, 18 Sep 2023 06:47:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6F88402D3; Mon, 18 Sep 2023 06:47:46 +0200 (CEST) Received: from VLXDG1SPAM1.ramaxel.com (email.ramaxel.com [221.4.138.186]) by mails.dpdk.org (Postfix) with ESMTP id 3983B40263 for ; Mon, 18 Sep 2023 06:47:44 +0200 (CEST) Received: from V12DG1MBS03.ramaxel.local ([172.26.18.33]) by VLXDG1SPAM1.ramaxel.com with ESMTP id 38I4lVGW095246; Mon, 18 Sep 2023 12:47:31 +0800 (GMT-8) (envelope-from wanry@3snic.com) Received: from [10.64.136.151] (10.64.136.151) by V12DG1MBS03.ramaxel.local (172.26.18.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.17; Mon, 18 Sep 2023 12:47:30 +0800 Message-ID: <23772331-dfa5-495f-8d17-b897faa1259f@3snic.com> Date: Mon, 18 Sep 2023 12:47:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 04/32] net/sssnic: initialize hardware base To: Stephen Hemminger CC: , , Steven Song References: <20230904045658.238185-1-wanry@3snic.com> <20230904045658.238185-5-wanry@3snic.com> <20230917192855.27ed7fe1@hermes.local> From: Renyong Wan In-Reply-To: <20230917192855.27ed7fe1@hermes.local> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.64.136.151] X-ClientProxiedBy: V12DG1MBS03.ramaxel.local (172.26.18.33) To V12DG1MBS03.ramaxel.local (172.26.18.33) X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: VLXDG1SPAM1.ramaxel.com 38I4lVGW095246 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 Hello Stephen, hw struct is just used in control plane, I think it has little impact on performance, howerver I am going to take your advice and fix it in next version of patches. Thanks. On 2023/9/18 10:28, Stephen Hemminger wrote: > On Mon, 4 Sep 2023 12:56:30 +0800 > wrote: > >> static int >> sssnic_ethdev_init(struct rte_eth_dev *ethdev) >> { >> - RTE_SET_USED(ethdev); >> + int ret; >> + struct sssnic_hw *hw; >> + struct sssnic_netdev *netdev; >> + struct rte_pci_device *pci_dev; >> + >> PMD_INIT_FUNC_TRACE(); >> >> - return -EINVAL; >> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) >> + return 0; >> + >> + netdev = SSSNIC_ETHDEV_PRIVATE(ethdev); >> + pci_dev = RTE_ETH_DEV_TO_PCI(ethdev); >> + hw = rte_zmalloc("sssnic_hw", sizeof(struct sssnic_hw), 0); > For performance you might want to use rte_zmalloc_socket() to make sure > the hw structure is on the same NUMA node as PCI device. > -- Regards, Renyong Wan