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 58937A0553; Thu, 20 Oct 2022 16:42:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A36342D82; Thu, 20 Oct 2022 16:42:29 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2061.outbound.protection.outlook.com [40.107.102.61]) by mails.dpdk.org (Postfix) with ESMTP id 7F9C442D76 for ; Thu, 20 Oct 2022 16:42:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HaTKRB0lpMmPI4o77tY3cZlfXkrFPe5CzO/xGomN8Rog406ePowMrDqRjUzsFHlIl9UjbTikSpqPsra7kGGudjt5Kpv5UgrmDQDlX8dk93ps5G2tRB0uDIn3G/2GsTebVOfAFEqRrEsGPi0Os2bHlkorJHVLH6H8jehPWvFLA+ClLr+1w5porodOMCYr6NodCfhGPTOjPwRt/H+raSt4Fj6NE7mIyetKNHxMaELHRMwugW0n20ooiO484VdstrLzAh48NsPnpfISQtr2nlzfvz0Nv4k+ei7U2QhlUtfALQsmPNr/40XD/ATbHf26AsAgvPgsifhyiifwdt5g5AVcJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4+4r8sxVT51lSIgg51N/x15jZAR49H1f8WpTpR7OwHE=; b=QNLhlnaCXviHqVUuiYXVzM+7YVHuI4dcXSpwG+f0it0W3/n0PDs3658XYaRjbFqkz2aTzTQhRgxXFyfnzHS3DtAw/vt59Ri+QwhGadOa63inrxIMF3JgAZ4wApUb1NmuEB6quVZPK0xxiqEMkvqjoV/rb9QcuBYPexE7+2jSsCbk7X6kxGs4qCyvsfXpwaQCQrAZr+kBwFwmgjpMp7zBM25IIyUIg4r6wH7gAzAKbZI6w9d5mJxwsfiIE0Kt4JjIhkZTAm1fGL0UWRZJs5umUHv8F+8atgIXYiCgatvhuQw12wHdtUcJ7VLaYhdN3JwJGlXw68/jmwHJV54j/l7emg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4+4r8sxVT51lSIgg51N/x15jZAR49H1f8WpTpR7OwHE=; b=sNyGeGF5x4/Jvy81cT/xi6gQ/HMgK0LU2zxQ9krUTNetxO4LBrOyNY94ldu0I6jEf+uCAsnChKUdyidOTumj/LhmUJcPvi9DhQyWu3NwYn8edz/QqVcyZ5ZpoetQ07tc3fdG00On5iHUGCD62bWZpS5goZ4QLR7I8ofGq94MHts= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) by MN0PR12MB6342.namprd12.prod.outlook.com (2603:10b6:208:3c1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.33; Thu, 20 Oct 2022 14:42:26 +0000 Received: from DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25]) by DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25%7]) with mapi id 15.20.5723.033; Thu, 20 Oct 2022 14:42:26 +0000 Message-ID: <1427101c-d584-f937-c8ac-1462e757216f@amd.com> Date: Thu, 20 Oct 2022 15:42:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v6 3/8] net/gve: add support for device initialization Content-Language: en-US To: Junfeng Guo , qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, hemant.agrawal@nxp.com, stephen@networkplumber.org, chenbo.xia@intel.com, helin.zhang@intel.com, Haiyue Wang References: <20221010101757.878317-2-junfeng.guo@intel.com> <20221020103656.1068036-1-junfeng.guo@intel.com> <20221020103656.1068036-4-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20221020103656.1068036-4-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0016.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::28) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|MN0PR12MB6342:EE_ X-MS-Office365-Filtering-Correlation-Id: a9a79309-2283-4cdf-7c45-08dab2a94dd4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4LqZQNzesKtx5Y/DKAlXYKV16ylf6FH2Zlha6XeEIjzqXDIhzV54vH4fLfbk0E+sJU65v5l8wq1Wq5GgeWkEsGokGMsN9z42PPjZeOCf7YPQs2mFv/mVTrhEw7+gs4XS0sfr3QDX65y9w07tvROgbYX/y4JNjXOzSJylqzCJVHwGdvP2ENOhbXETpEOf+ju3TPEcYAr6s3tdK1BeQ17AOT5DS2jXTpH7aa/ID44fy3CElUtBaO78jPFg7+0BsT34o17tr+lQELOtFQ3GxHt3VlVACxUFr/0M+Ai8Np7cD5BWuH1HUXS5WE1ygUiUhTUsYcEhIcM5pZmChz5yVawHLeLvq+TIwkskOfqD0LRSquKze+644DV1kEMTZutEe0H6gkrvkzDO6iAbShHsiv70lJgG2XNQGcPvSOzvmaxQDLAKHBcxPDIvmkgak0XB4z8qCqIuQuqwbJY3lqhhn4SNDfI4FcmR7G2u1ODLoyBgFkHmtSKDozKq3i/kyrWpy2zMPsbNF9rmlZfatiJSgvPxl220dGxxDZJnz5ts65E1Tlm81p4ZtweV9l2V/FCNXVw/mj7kKlrqngRFT36iVE9mUhFbCPOoJZj1N2DvUjrdMkjxZ+B2O/qssxDfhlA8iJHCS848j1JHYGx8a/707xN1N2EK6B0Kr7jjXxIfYqjwxvB4YnnX7M8463REev1ISZFt25ubGv9H89PlrItF3XdFbn229rFoZ9Yk8qgNXJvyIBHJuujR53+/KwUyABC6v9dHmcF/PCUjGDHzCgiTacbXZgVkr5wst1gSW+vJ4vmqm6g= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4297.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(376002)(136003)(366004)(39860400002)(451199015)(83380400001)(478600001)(6486002)(2616005)(38100700002)(26005)(86362001)(8936002)(316002)(44832011)(2906002)(6506007)(53546011)(186003)(7416002)(31686004)(31696002)(6512007)(66556008)(36756003)(5660300002)(41300700001)(66946007)(4326008)(66476007)(6666004)(8676002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OXlaTGlDeHNZVXJZMjlOZyt5LzBtemFweTFCR2pwZXZObk5IdEtNRER4dW9r?= =?utf-8?B?RnRHVmxOVzNPL3pHb09UVzRyNHFzQWw5WlhaNnNkRTV4ZjhSWkdyZHVxSk1w?= =?utf-8?B?SHpPREZhK0JiaEtCQXpPNmdib0wxUkl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UVs?= =?utf-8?B?YzEzQ0JuS25keFA0aWhlQmxvd3h3YjJNc1pjd0d4T3ZpZm9WdW5wQzQrcTdJ?= =?utf-8?B?ZWU4S3pRd0NmU3RiL0F5SGQ5MGJudERURXptNnNGWnlwd2JteXJBenpIRWpa?= =?utf-8?B?eUFYNUhWNkptb2pJeVNMVmlvV1ZhTUxXM0JIeXpRUUlLNjhhL2hSOTAvM2VB?= =?utf-8?Q?88MIEtRrwk4lxaf1rEj+IL3VO?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9a79309-2283-4cdf-7c45-08dab2a94dd4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 14:42:26.5409 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KqV4GTkooNqUnnTQk0Qw/zpQTpFGmvqwQsUjMN9b1XvbGL/agOZc4UyQqTvVIkz9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6342 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 10/20/2022 11:36 AM, Junfeng Guo wrote: > > Support device init and add following devops skeleton: > - dev_configure > - dev_start > - dev_stop > - dev_close > > Note that build system (including doc) is also added in this patch. > > Signed-off-by: Haiyue Wang > Signed-off-by: Xiaoyun Li > Signed-off-by: Junfeng Guo <...> > index 1c3daf141d..715013fa35 100644 > --- a/doc/guides/rel_notes/release_22_11.rst > +++ b/doc/guides/rel_notes/release_22_11.rst > @@ -140,6 +140,11 @@ New Features > > * Made compatible with libbpf v0.8.0 (when used with libxdp). > > +* **Added GVE net PMD** > + > + * Added the new ``gve`` net driver for Google Virtual Ethernet devices. > + * See the :doc:`../nics/gve` NIC guide for more details on this new driver. > + Can you please move it one more down, just above 'Intel', to sort it alphabetically based on Vendor name, in this case 'G' I guess. We are almost there :) <...> > +static int > +gve_dev_init(struct rte_eth_dev *eth_dev) > +{ > + struct gve_priv *priv = eth_dev->data->dev_private; > + int max_tx_queues, max_rx_queues; > + struct rte_pci_device *pci_dev; > + struct gve_registers *reg_bar; > + rte_be32_t *db_bar; > + int err; > + > + eth_dev->dev_ops = &gve_eth_dev_ops; > + > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + return 0; > + > + pci_dev = RTE_DEV_TO_PCI(eth_dev->device); > + > + reg_bar = pci_dev->mem_resource[GVE_REG_BAR].addr; > + if (!reg_bar) { > + PMD_DRV_LOG(ERR, "Failed to map pci bar!"); > + return -ENOMEM; > + } > + > + db_bar = pci_dev->mem_resource[GVE_DB_BAR].addr; > + if (!db_bar) { > + PMD_DRV_LOG(ERR, "Failed to map doorbell bar!"); > + return -ENOMEM; > + } > + > + gve_write_version(®_bar->driver_version); > + /* Get max queues to alloc etherdev */ > + max_tx_queues = ioread32be(®_bar->max_tx_queues); > + max_rx_queues = ioread32be(®_bar->max_rx_queues); > + > + priv->reg_bar0 = reg_bar; > + priv->db_bar2 = db_bar; > + priv->pci_dev = pci_dev; > + priv->state_flags = 0x0; > + > + priv->max_nb_txq = max_tx_queues; > + priv->max_nb_rxq = max_rx_queues; > + > + err = gve_init_priv(priv, false); > + if (err) > + return err; > + > + eth_dev->data->mac_addrs = rte_zmalloc("gve_mac", sizeof(struct rte_ether_addr), 0); > + if (!eth_dev->data->mac_addrs) { > + PMD_DRV_LOG(ERR, "Failed to allocate memory to store mac address"); > + return -ENOMEM; > + } > + rte_ether_addr_copy(&priv->dev_addr, eth_dev->data->mac_addrs); > + What is the value in 'priv->dev_addr'? Even allocating memory for 'eth_dev->data->mac_addrs' removed or not, as we discussed, independent from it, need to set a valid value to 'priv->dev_addr'. <...> > diff --git a/drivers/net/gve/version.map b/drivers/net/gve/version.map > new file mode 100644 > index 0000000000..c2e0723b4c > --- /dev/null > +++ b/drivers/net/gve/version.map > @@ -0,0 +1,3 @@ > +DPDK_22 { DPDK_23 In case it is not clear, since this comment skipped in previous a few versions, the ABI version should be 'DPDK_23', so the content of this file should be; DPDK_23 { local: *; };