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 9D41042B6F; Mon, 22 May 2023 10:52:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73B47410DD; Mon, 22 May 2023 10:52:25 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2074.outbound.protection.outlook.com [40.107.223.74]) by mails.dpdk.org (Postfix) with ESMTP id 5179E410DD for ; Mon, 22 May 2023 10:52:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q07l60xwUQaEaDBS1Pex4eXv7hFyEs/2dD7c0cLt4BlQYnImTHgYqWoAQIqnxwFj4zsV2i5YnGoxbIwd/HcBS18DDmS4zwrkN0EAFDw1sAIl4p81e0fS8RCWIWr+UFia1TlY9585PnP4CdDCehIXD4CXIAsnJmZtP5NoC2HxEsOaDrikGVsE+Uf2Izu92A1rqCntTp+0/1nOeo4Fp2yuPjlhC//kpX0MBsxjerv9IHBHzjKPq2N/HshdxAzEsqdNbkCHKjrQKJhBppOu/6jMwE9IVdZW4b4xPrpki6M8FtcBf1fMd+eCi49RJEFRlFEDMca+MLdQuL2CAh1akdzJWg== 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=qWpNQUyy5CnYe9fF1oeAFlmYuaZL1ked22i4b/st+Zk=; b=KLE9KBd5gU/yC8T2S/14gOn5cycDRZ+Y63eI62F6kTfscZung8Bhd1wetavJhQf0vmML7GS+Gp6jIgj7fLMRwnZQOjCNMSxCU5WTMLGW01ZVSUskaUXFkw2jWvvzEsiGjHCrl30dWMviJUuw4lE6D4I8QeoRc7eYu000nqRbdEI6VbYRzpGM5fUj0rCEdGrQO7x4KMcni4SEgrE3PoYOsB+Cr/pQ6alHjKD8z1Uyf2GAAeIkQESRcuBdyLOaOSmFjSeOz0R4lcvBRXMIE8JEqw++57juuMah9eyO/NLMT4xp6WXjvK2UhA5+80y/o9wHapoD7OkMZxySmLZb4grRvw== 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=qWpNQUyy5CnYe9fF1oeAFlmYuaZL1ked22i4b/st+Zk=; b=i0aIkcSJl7JBPABPB4Ti+wCZMjhn4k6su3h0bpNvycztBFp7yD6hk+J2PmBVFfcv8GoW40F+lhFpm2M9Htr1A8mmWHworVGbTgUTwOztBH7D+bCh/kfPRsYKO31zS/wbMKQ5aYeYnHa5LeFbaAM56QjVbl+cp+qNgeglOiJZJ/A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CYYPR12MB8853.namprd12.prod.outlook.com (2603:10b6:930:cb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 08:52:21 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a%4]) with mapi id 15.20.6411.028; Mon, 22 May 2023 08:52:21 +0000 Message-ID: <820618d8-460f-b415-2c34-6be67f6d7c72@amd.com> Date: Mon, 22 May 2023 09:52:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [v4] net/gve: check driver compatibility Content-Language: en-US To: Rushil Gupta , qi.z.zhang@intel.com, jingjing.wu@intel.com Cc: junfeng.guo@intel.com, joshwash@google.com, dev@dpdk.org, Jeroen de Borst References: <20230519072600.1444309-1-rushilg@google.com> <20230519204618.1507956-1-rushilg@google.com> From: Ferruh Yigit In-Reply-To: <20230519204618.1507956-1-rushilg@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P123CA0027.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:313::19) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CYYPR12MB8853:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ad98011-a12e-4591-32b6-08db5aa1dada X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZIUpIdyMnSkDWqN6uBIuGFDPaPGIpDSxAItjOGUgJQA9JQjECUZN3QYkcYFnMm0dMVZbe0woJCwBOR2VPTu3H3eLBUIajCe20175jEcObNcG9blQPRRxAgyXFdr0AbdmXE8a0cltXX8fAnycGQOHnRq/tyM5/4EoJjDkqUfroOAzo1sAbZ4GMLsaroGO9jQe6qLnmlZcFdETK9TY1vkmzrvQZNEl4K4ZDVZFnSc8+QIFzAQFPLwWJebnXKdHXiDMqICQpqVGfA2pz0BLzI5B7zotihzMPjUDQNCodZEg6KtHkCdyLCVFrormhjDGovg0xKJ7dTsh2mOxOIxxNEDS9mdmdRa9xq6fqeM9ltvOBejQF+/J5Vj6fuEkjRgZmkvlMa0XJGW8eW9d+iBP2ViGfT7u9iNlCilWzr06L+PXl6SVr+TxApRynitWnmt21PoKuDFSzUsBdXcIaDSTVvc18u19cnDkeEEFN7QkrXys8S8M1n89Izi/uFGiCLnL4/EgZNxV612w1aSWsYJ8Hl+76ONzunVJi48NaOAPSL39kDZkklZVCwR62Z9vvoYX3krj69GEq8oUB+8DFYEuOfaWFbnnzBcIv6ZTvEr85kMW3EMkkA/Q6cWnmBGzLHLB/yrc5mIWRZguuHn2hhrH5joGFw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(346002)(376002)(366004)(39860400002)(136003)(451199021)(38100700002)(8676002)(8936002)(5660300002)(53546011)(6512007)(6506007)(26005)(186003)(2906002)(2616005)(36756003)(83380400001)(31696002)(44832011)(86362001)(316002)(31686004)(6666004)(478600001)(4326008)(66556008)(66476007)(66946007)(41300700001)(6486002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UmtGcHEzUi9hUXBrR3FNOFNXYkdja2ZXaS9XZzh5TE5BUHhQSG9SMUVFNFoy?= =?utf-8?B?b2w3R3JuektrSGpmNWRkU1dMcU5nNUlWTFh1UkU1M1FpVjN5aTZsYWhueGV5?= =?utf-8?B?MG03Ylo3UGdDM3h0N2VHc2sxWklTZUphNVQ5QnNFcnJLRFJaZURGcHEzY3Jh?= =?utf-8?B?UmVtSFFUb29kWC9zMllaQjMyQTZFQVJzQ3ZZUTVSanRqSzZRcTl0UllEYjlm?= =?utf-8?B?OHduNzJZMWVLYnlVdXZVRlNNL0dSTnp0bU9abkp5YTN3dHpvSWQxS2JjdGZB?= =?utf-8?B?Mmd2U1U3S0tCaHlZTVNFMjZRNWxKNk14TEorRndYaWlOYnZPcXFXM1BwSWE1?= =?utf-8?B?aVJ2MWVrOE1PY0paNXdKQkp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Tenant-Network-Message-Id: 3ad98011-a12e-4591-32b6-08db5aa1dada X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 08:52:21.4187 (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: g1mcqjdToesW+2nNMxX9ASdYllYd6WqOlVS+l6IKnqCIR3Ti2NToJDeWK+rvnvqM X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8853 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 5/19/2023 9:46 PM, Rushil Gupta wrote: > +static int > +gve_verify_driver_compatibility(struct gve_priv *priv) > +{ > + const struct rte_memzone *driver_info_mem; > + struct gve_driver_info *driver_info; > + int err; > + > + driver_info_mem = rte_memzone_reserve_aligned("verify_driver_compatibility", > + sizeof(struct gve_driver_info), > + rte_socket_id(), > + RTE_MEMZONE_IOVA_CONTIG, PAGE_SIZE); > + > + if (driver_info_mem == NULL) { > + PMD_DRV_LOG(ERR, > + "Could not alloc memzone for driver compatibility"); > + return -ENOMEM; > + } > + driver_info = (struct gve_driver_info *)driver_info_mem->addr; > + > + *driver_info = (struct gve_driver_info) { > + .os_type = 5, /* DPDK */ > + .driver_major = GVE_VERSION_MAJOR, > + .driver_minor = GVE_VERSION_MINOR, > + .driver_sub = GVE_VERSION_SUB, > + .os_version_major = cpu_to_be32(DPDK_VERSION_MAJOR), > + .os_version_minor = cpu_to_be32(DPDK_VERSION_MINOR), > + .os_version_sub = cpu_to_be32(DPDK_VERSION_SUB), > + .driver_capability_flags = { > + cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS1), > + cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS2), > + cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS3), > + cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS4), > + }, > + }; > + > + populate_driver_version_strings((char *)driver_info->os_version_str1, > + (char *)driver_info->os_version_str2); > + > + err = gve_adminq_verify_driver_compatibility(priv, > + sizeof(struct gve_driver_info), (dma_addr_t)driver_info); Back to previous discussion, other commands pass physical address to the admin command, but this pass virtual address. To follow the same semantic, shouldn't above be 'driver_info_mem.iova'? I asked before but not able to get an answer, what is the memory type requirement for device? Why virtual address obtained via 'calloc()' is not working, but virtual address from hugepages are working?