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 3D305A0586; Wed, 19 Oct 2022 15:46:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F983427F3; Wed, 19 Oct 2022 15:46:28 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2078.outbound.protection.outlook.com [40.107.243.78]) by mails.dpdk.org (Postfix) with ESMTP id 5F2F7410D1 for ; Wed, 19 Oct 2022 15:46:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kqMCkcA8Ja+Fc3Q4ANonvR0iPCayNOi2+wz0ddp/z/jz9O6IVZYxaeSW1i8aiN7Yo9c0oNKSEU405/wmatNnekDbf9F4LZrbs/BYZJWxW9ixDqIJI4AjCHteg6sWKbH9AsbRBgLoZQX0M/Q3swzKjpdZJXaEnLq24mu+LgqYjM7mPOQ0x21zDSBMOv4S0e+OjvqQXuqzc2jBJZ2eH6zTjZiVrkKRHE6XUvHavvzSFDzWl5uEglGCaZZP/d9y8Z9VBP2q5jGyHAtKY5Uh2VMyLVHNKBfX4U2XR71LcCQKsimyj1cU40314ZiiaguAvfZ+8rn03Q4zXl7vLhVFlGcHZg== 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=Pda2FJE97NujrUNHaOhvTi2f42oBAFupx54PxzYIX6I=; b=LjXoIUdQtpug+ho+Ay7JMtKdxygc18QBwtCwOq2//w2a/Vy6PVtoMJCSZkB3yZA+i5BWixW9zP+MqBF9eaoTe14PzOs3SKB5b6S8a7X/4u3yNGCM93ZVopvzTooau4fqaZpwZ4Zypm4rOMRJjW3o9W5HRjlscITaI5Em8WHN67GLcMHv57IBr803/WRg5s4nN8a6mLKZhHpS5Zbkpyn4VkH/MY/zifvY1BDVRBUAMrw+Ohra+tNN4BMK9uvkI5XLgrmcGBHyBym9iDEMVUMsYUMWFpqp4zGvE6Dj4SpWC0YJsWQEvAbfR1Hld83kV3EqndTtSNvRTzz6K04m2YePJQ== 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=Pda2FJE97NujrUNHaOhvTi2f42oBAFupx54PxzYIX6I=; b=SddxBOvNLC7EWzkS1XaCY/Es1B73euVBEQ9cKCURGEBMovwrXsZYbWgjqrxmCwRTqdp/L9LADjLjy+xsXbZiZyQJU8GBZ/rIEJSaK0CBs8jrHc1yT/GjVAL3l0sB6ArPvSMpQ7OCbPwU3hioDBQjXiT5nrZmaIxbvec9aAr2UT8= 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 DM6PR12MB4401.namprd12.prod.outlook.com (2603:10b6:5:2a9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Wed, 19 Oct 2022 13:46:25 +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; Wed, 19 Oct 2022 13:46:25 +0000 Message-ID: <718a5294-822e-40ec-bbe7-0f650c428ad9@amd.com> Date: Wed, 19 Oct 2022 14:46:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v5 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 Cc: ferruh.yigit@xilinx.com, dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, xueqin.lin@intel.com, Haiyue Wang References: <20220927073255.1803892-2-junfeng.guo@intel.com> <20221010101757.878317-1-junfeng.guo@intel.com> <20221010101757.878317-4-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20221010101757.878317-4-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P265CA0006.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:339::15) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|DM6PR12MB4401:EE_ X-MS-Office365-Filtering-Correlation-Id: 280ef51b-86f5-4f34-95aa-08dab1d84fcc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c4gkB+4CLtuQQEDsLi9sjxWBxoHUQn92c2h9qhCkPBOXAX5lK59EfykMbRBsMtctITCj3fwKLZyTAqNoXnAkOBoOLHlqp+x7xrzXOa3jw42ajl4i87iKwvZfs4LP7wfp/qzwtymO+n/XRgXLBLzWJFHHtwk140KiKAfmQzec5EuKMWNuI3txgv7X1RDMYtzAEu63MbFQg29QTfI4D1+ebUt/SLuywYid0yuYYq5luAcPvNBmkUwlP1gAKI4jgFlW9jwKLYEzw5aFgT8zhEUIvfKd4NTvpL2lYitIBRz7W3W5BbCwqyTeFoCxW5M7pFlI7Xm4tVYKl7DIXr7oAklqLxenZRXm2GDSjbxsJSoZsxqzC/a2/9ha0UaGlu9WkQJBFB6CcNCQ59bIBdvHPUXhO5H2CUCr9QQ+3S3Laxgc4jyZvBPaRqII2e5IuXLv1Lnx+NuCXtpAeSidgBRJQZxzKATX2XbRAnuXgZcjuCZuYrWV4wMSsDafVYMnoZYFMjjTZbGO/e9xgfWYvscytdprjc4zAqssngKs2Ru0Ec/8m63i5m57Jo2ezq3LKHciMrOoBYP4GAb+IKkCyCFMi/go9lgp2lWXzE135YoAyXRW5gyH8giHU86Ey4/oMYiFM+NcytduLD41ZHoP4IxrBhsG6km6rt5uNEMtV4GpPb41dDVvgx61PwbXAf6ps2XjP/dgmFTnukkVT0o07xPMM/cr6YYr053AG+3c+Pdss9lxfG1Cg59pKzpUKzkXcYr6DLZnNNrzjvr9lTlCusnHJxziB2nXmyQPcFHxDrKMZi6tza0= 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)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199015)(44832011)(5660300002)(53546011)(6506007)(8676002)(6666004)(66946007)(66556008)(66476007)(36756003)(4326008)(8936002)(316002)(6512007)(26005)(41300700001)(38100700002)(2616005)(186003)(2906002)(31696002)(86362001)(83380400001)(478600001)(31686004)(6486002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VXY5QUtXT3RTY2MyYkE3UWFuOFNkZ2dSOVdzVlg1MG5rNktjRHZwcTZjNlpw?= =?utf-8?B?OTd4blk2R0pCaEljd1BQb1NCOGFNV0E2c0x3a0lBUC8xLzMyT3JXVG05YWdu?= =?utf-8?B?VFl4a3NJN3VXaERqVUF3S0E3clc2ZWVQTS9PbURaT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JeEhi?= =?utf-8?B?T09vYU1YaVl1b1pKbDBiRmppcklwU0h4ZFQ0ZTJLUElydVRwY1gwUWZmVUxn?= =?utf-8?B?YmpFcHRTNzlFSkNnZW5DZkR2ZlJpYmliNFVQVnhuSzM2SFhlVlR4cWVXNEN0?= =?utf-8?B?WmdYUHNabk05eEJXYm9BSERtVG5wSG9SMWxybnEzSXNBSmF2dWloV295UEJx?= =?utf-8?Q?dR7RNkLRxqFhL4FLhZTqFsfoA?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 280ef51b-86f5-4f34-95aa-08dab1d84fcc X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 13:46:25.4188 (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: v1MhNn0IOTYK2tlrINklcObaqjcgAyF0yCrqFiFHzQDJyf37sekEnJRvx3J3Qlnm X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4401 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/10/2022 11:17 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 <...> > diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst > index fbb575255f..c1162ea1a4 100644 > --- a/doc/guides/rel_notes/release_22_11.rst > +++ b/doc/guides/rel_notes/release_22_11.rst > @@ -200,6 +200,11 @@ New Features > into single event containing ``rte_event_vector`` > whose event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``. > > +* **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 the block amaong the other ethdev drivers, as alphabetically sorted? <...> > +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); > + Is anything assinged to 'priv->dev_addr' to copy? Also since there is a 'priv->dev_addr' field, why not use it directly, instead of allocating memory for 'eth_dev->data->mac_addrs'? I mean why not "eth_dev->data->mac_addrs = &priv->dev_addr"? <...> > +struct gve_priv { > + struct gve_irq_db *irq_dbs; /* array of num_ntfy_blks */ > + const struct rte_memzone *irq_dbs_mz; > + uint32_t mgmt_msix_idx; > + rte_be32_t *cnt_array; /* array of num_event_counters */ > + const struct rte_memzone *cnt_array_mz; > + > + uint16_t num_event_counters; > + uint16_t tx_desc_cnt; /* txq size */ > + uint16_t rx_desc_cnt; /* rxq size */ > + uint16_t tx_pages_per_qpl; /* tx buffer length */ > + uint16_t rx_data_slot_cnt; /* rx buffer length */ These fields are not used in this patch, I guess some will be used in datapath patch. Can you please only add fields that is used in the patch? This way it will be clear in which functionality that field is used and enable to detect not used fields. We are accepting batch updates for base code, but this is dpdk related code, lets only add things that are used when they are used. Same for all data structures. <...> > 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