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 09C3AA09F3; Wed, 19 Oct 2022 23:00:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF30F42BFA; Wed, 19 Oct 2022 23:00:45 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2057.outbound.protection.outlook.com [40.107.93.57]) by mails.dpdk.org (Postfix) with ESMTP id CAD8B42BF7 for ; Wed, 19 Oct 2022 23:00:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RUnLKKXZZulqXUOjMbApxCde4pDjwILG9uAJ5MDlfHCWUv1SjtCIKwr5rIEbT6WlDvzTczZeO8rH7dmbyAE88ZrcECfjUfBcn1I6HWN1MfySvzzape7ShctJJkKY9t1n7ZCNYL/DxIv/2PUgh2w8qqd0R0m4U/lViu4/MnL6G/ODMSlHsWj1yAU37nBWxvUx5FPEx5WlN9/SvDIsgVFaaZGgA/u+x6FFpxZm0/K1bu6EZD5fKCLEUKJjwgtFNWjtW7KMnXKWIjg6DwhcZ5HEEzxx2ikqOvkdSn2fck4V3Go0knF51CAXbPsY3YZsv/4B7q8+H6S5CC5AIvAhycAGTA== 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=KjlTpG8dooSJCN2l3kUQL+AbCFBzcGJJfZ0DZ/4tGV4=; b=ZipD+i799WuyOIEPzcHIwu1+ulVPW4HLO3xZ0JHa+Zb0tmMqxIwtiyS57uuVsTh8D7kkfI6kGbBHsIxaQir9vYI/yHnJL62WcVVS2rOJVqv8YoxFAOb6wkwyWBXx4xKr6XEPgTDcbQ9oj1yAEOwEqbzZu7k5irg9sWmcsH5RtsJPkC/Ctf3BfXcjGnUx59tefUtbqXNeKkdOSyKMRciHIX/wHdI7xFBLa0ilLGX93mJbUo9/bNbCTU1YOjBJDykeMZ79xASb5j5H3THxlWZQBXjIJYSKGGZkaoK/JAPXbLkYxUBZOpSaziUO8PVzzo0MifOXIYgysiFl9SComzOADw== 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=KjlTpG8dooSJCN2l3kUQL+AbCFBzcGJJfZ0DZ/4tGV4=; b=FwLHjGrWRU4+f4XCzFTO4idj1rGicKpZU+vBOPuv02lGjO2aVjqOs4LZhHkX4IVwFCY+EHnouAMQ8uIYQKuW+V5sZQ1XEidJ/Wwr/xofT6+8FlN0Cq9w5yNFFEGfxT5QSGO7VR9fw+J6Tv56IAWmarsWJDSvyfKjVraZjKzD+rU= 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 DM4PR12MB5214.namprd12.prod.outlook.com (2603:10b6:5:395::22) 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 21:00:41 +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 21:00:41 +0000 Message-ID: <64c15da3-d053-395c-ec7f-2b9d8628089e@amd.com> Date: Wed, 19 Oct 2022 22:00:35 +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: "Li, Xiaoyun" , "Guo, Junfeng" , "Zhang, Qi Z" , "Wu, Jingjing" Cc: "ferruh.yigit@xilinx.com" , "dev@dpdk.org" , "awogbemila@google.com" , "Richardson, Bruce" , "Lin, Xueqin" , "Wang, Haiyue" References: <20220927073255.1803892-2-junfeng.guo@intel.com> <20221010101757.878317-1-junfeng.guo@intel.com> <20221010101757.878317-4-junfeng.guo@intel.com> <718a5294-822e-40ec-bbe7-0f650c428ad9@amd.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0645.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::16) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|DM4PR12MB5214:EE_ X-MS-Office365-Filtering-Correlation-Id: 98bca7b1-9245-4253-d604-08dab214fb94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6iCGUP2qB89XtC1JFRcxl5/4BLFkcXXpkyo31aIV342x0FtJzRy8Ymgss7+Xt7PhXtzYJGTzQMwS41zzKL56SjVfAsatIwADi9FB/pNXtPuXa0wYidicORBArOQioZ+hjfOim9WNUcwBt76LxuLVSsVqKjFY248ZT1er+7b/4PmQnZPWPAOlq5DJne7x27U7u9Q8c3mcl5+FP+nvrMAMpV/bwMsB1Uc6+ZLsBAXxd5VB+J+5bbQ5su8eTOLKqIeLfr8xl3gT27AfK3urug2i5p7+ZA/wP/hxMKzJx107Zw4kZxaZkDzsEnqOJa2nQr9odqFUB0PjzqO0VE3pouNUslbrE8E1yhrhkDuz064vAQGp9qSeI9KrACpadUmSIIlN4pMGEi0mp4IVJ5pQjZP5UNf5a/jTN5rxFY0J7qrwdtLDrRgL0F2mMaOmUDyQvuefFfIeeN6paVeAEL/mQsclMaVrQ8idqHkP4JGOPWIpPkK6NAWedWrZjv4eVgmbxaXN/eA7/PXkzeTp5YkzFTuWigFzhPY7PRvp+Daakx6X3arhEGTCvW8SayhPu7PJe3FQ6Xnje0oVXvQ30W3yMyendbRM3HxvfE00XoLHDgkiQQKG1RGNOqYcgVGmHoaRt3zAmJUbvpsExjU2mT2ZSAdDtDfQ20fU/wY3v8spleZcaBt/liA3sXEOmN4RAKK4EEvAGoJfOAVvbwjLLDWkWoGwYmFiOzpIPSu2wGaQVXX0cK8Qxbf8vBE+GQzZ/E5qHRAhCcKGFzQ5VhyPc232F5mnFu5EzJQnSBqwR4nCtM4//V4= 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)(376002)(136003)(39860400002)(396003)(366004)(346002)(451199015)(31686004)(36756003)(31696002)(86362001)(66476007)(66556008)(66946007)(41300700001)(38100700002)(83380400001)(2616005)(6506007)(186003)(53546011)(478600001)(6666004)(2906002)(5660300002)(316002)(54906003)(4326008)(6486002)(44832011)(8936002)(8676002)(6512007)(26005)(110136005)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NnZtRFBXR1dwbEdBam1wbUJRNEY1Mlp0aklYaU9yMDZEcGxBZ3o0NUJwd3Vr?= =?utf-8?B?czJVTUVwVVNkN0g5OTBXTDNhOWIzMnQ0L2hxRHV5b1ZwNm5qUzhGVXZKYUp4?= =?utf-8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eXp0N053VXdtUnpQVFZkUUxpODFtSXJ6YTN6?= =?utf-8?B?UkJxUkFjSnk5bkw2V2x1alJsMEM0cWZ5K2pCR0hXdjNXUysrQ054WXBudlhV?= =?utf-8?B?QkxEWGF1TGNhRjBTaU5ZL3RadDZ5RlNncjZVUmwvejZhRjc4K1NlMFZrNjJ0?= =?utf-8?B?S3lNLzNCTzAybTJ5SVVGR09OR0I5K2NtcDhiOWx6S0Y5QXpRWnd3VFViRGhy?= =?utf-8?Q?hl1pqeYOxV1eGT1TalZnwZXAJ?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98bca7b1-9245-4253-d604-08dab214fb94 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 21:00:41.8161 (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: 61LJ+TzLhkxgzPRauSa/RjfWflfYj58WnUDMU08P5cUabharqn8znfjdyTHrAahH X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5214 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/19/2022 4:59 PM, Li, Xiaoyun wrote: > > Hi > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Wednesday, October 19, 2022 14:46 >> To: Guo, Junfeng ; Zhang, Qi Z >> ; Wu, Jingjing >> Cc: ferruh.yigit@xilinx.com; dev@dpdk.org; Li, Xiaoyun >> ; awogbemila@google.com; Richardson, Bruce >> ; Lin, Xueqin ; Wang, >> Haiyue >> Subject: Re: [PATCH v5 3/8] net/gve: add support for device initialization >> >> 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"? > > Makes sense. There's no need to allocate a new memory. @Guo, Junfeng Can you update this? >> >> <...> >> >>> +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. > > This is needed for base code gve_adminq.c not for datapath. Most of the stuff in gve_priv is for gve_adminq.c. > The adminq will update this info which dpdk pmd will need later. Compiler will complain if these don't exsit. > You are right they are used by 'gve_adminq.c', so OK to keep them, if there are ones not used at this stage, can you add them whenever they are used, or remove them if not used at all. If all used/required, no change required. >> >> 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