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 02375425C9; Mon, 18 Sep 2023 04:29:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF357402B1; Mon, 18 Sep 2023 04:28:59 +0200 (CEST) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mails.dpdk.org (Postfix) with ESMTP id 6D7C24021F for ; Mon, 18 Sep 2023 04:28:58 +0200 (CEST) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-573e67cc6eeso3030132a12.2 for ; Sun, 17 Sep 2023 19:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1695004137; x=1695608937; 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=eNvBjB5YeCxtAot0+CKHYOPCIRfwNolr/IJFa1kwfb0=; b=apPwPl/S2U3OeSeyVSzzJmiDJUP3OhGFRyeWFqpUfhKEHHKRmOD/aj8kuGYE1QgFM0 66NZfaClBra2ri8R7PstIibw6bjJVwb7R/7MIMut9mGN220fcZ6xL6gAq/abdYX8MFcq msaBGZMQ/kd9AKutW7x0P+y0GYq6nZz1Q+Yr4TA4OLEDjD/i9cWR5b52xQd8ZYK4KaiK cLnbiejbQpyF7kqubMGTlj2aBPtcymhKCGzysXxjXc/vvo1Q/fFmZDPHmolFpTMpJkfv 4ahIOkvBHFBYSmQJKKUIVC9jUM5uJI3WTzLEGNNYWbnp9xuB+Wcw1y253PXLL7/SKL86 JRPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695004137; x=1695608937; 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=eNvBjB5YeCxtAot0+CKHYOPCIRfwNolr/IJFa1kwfb0=; b=oJRWxi/Od2pomQk7z6YGtV+I7R2/06sv1VqulH8yvNdaOhO040mo0XAGh9xGpHIvgF ZkbHVKTtIOf5D0FZYiYu+8+5HUcBwsVNLt6u/jFsJLs7HCPIpwTq0ZWhGQTRtGOjg2TL 9TrtpqzKhuyKZnpbN3MGD5v+/uGZL8q3Kn0ntQ9hXaP5UuPnBa1vbnvPpUp49zxXH3P9 PrkVCtnW0dt4Gfq5fW0LUL57kJxNxGkJeA1OWZLpDPOxrfPxC1Tx4Xzxk/8MH26ZEhIg P6SvFQquMJZPOtxXrwhNoLwQBIGlNhVnZICOwOQNqPKWMjhIp19YX7Lp5MohMFA8BrT4 zpcw== X-Gm-Message-State: AOJu0YzmbWxykSamV4slTtfI7Ji6omHFZzvWUxCsOJsDa7GSdiKuSkc2 AGMVlrV9zQZFBEa2ehQ5ao8NYw== X-Google-Smtp-Source: AGHT+IFZzPD+CYVrpZ9WF3i1znrofLGWlEMPhTJVFLnFqH8ye5L0KjnzBwxd1BTu5w0cEJJSazbu2w== X-Received: by 2002:a17:90a:bf0a:b0:274:99e7:217e with SMTP id c10-20020a17090abf0a00b0027499e7217emr5505263pjs.16.1695004137410; Sun, 17 Sep 2023 19:28:57 -0700 (PDT) Received: from hermes.local (204-195-112-131.wavecable.com. [204.195.112.131]) by smtp.gmail.com with ESMTPSA id x4-20020a17090a530400b0025023726fc4sm7884593pjh.26.2023.09.17.19.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 19:28:57 -0700 (PDT) Date: Sun, 17 Sep 2023 19:28:55 -0700 From: Stephen Hemminger To: Cc: , , Steven Song Subject: Re: [PATCH v5 04/32] net/sssnic: initialize hardware base Message-ID: <20230917192855.27ed7fe1@hermes.local> In-Reply-To: <20230904045658.238185-5-wanry@3snic.com> References: <20230904045658.238185-1-wanry@3snic.com> <20230904045658.238185-5-wanry@3snic.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 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.