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 A264841CE5; Mon, 20 Feb 2023 12:52:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2555343027; Mon, 20 Feb 2023 12:52:59 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 0218540395 for ; Mon, 20 Feb 2023 12:52:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676893977; x=1708429977; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=rM2v3wPcLnh0U+vrVQej8wh7MTLZdHIUJnujldYZ5Vs=; b=RHpiv9WchC2LJW0xm2Mk6WBnW3nGUV4U7a4KiUiqJu6N356XT+qilTgH jz7gXl3lVBeNgLTSjYPMK/lFVyb3jJTBNLQql2FGMkIwOPRlHK9GIFBHm eQABgNZziLHwTsBS76YEQOI5p89r2A9OHQdUuTEiiwZ6WEdXq8HNmeLp6 6n/96vHCkJoaxu+iXKOGfHMzosJnMOVDMPBV5KgW83VkZrSFG8cKYmLbQ QQQ7WMJjoLYBZ8iNRalVKSBnUep2/rgLose2/Wy4kf+2+j0GjStMHyWdD 67ez5sOWUN/8NHXGslUE4SiUhQDGrblizlJCmD5Nv3qBf/gIiIoSoMcq6 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10626"; a="359849123" X-IronPort-AV: E=Sophos;i="5.97,312,1669104000"; d="scan'208";a="359849123" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 03:52:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10626"; a="735102464" X-IronPort-AV: E=Sophos;i="5.97,312,1669104000"; d="scan'208";a="735102464" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga008.fm.intel.com with ESMTP; 20 Feb 2023 03:52:52 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 20 Feb 2023 03:52:52 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 20 Feb 2023 03:52:51 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 20 Feb 2023 03:52:51 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 20 Feb 2023 03:52:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvQvt6NmFhsa+NyZOCXrqaCl4L+xUOGZBxLajAXnCaVou1qXe614UKZjNdj4DtxPR4GKw/y82klAQQWP+y67kb6PisF3twzBVvhBs+OhcQl/ySXMcg/g7NQViXgqMB7V0FVvF+Y3nmEDtCB2wlZvHkJyGWsIU3+dhTd/ssotN2CtqYsSbUVXPyXyMZru58V3/DIItc9cXP3yTWKmJgA+k/x6pnFqKAegmTZ3Rka/LtkYDpHkbXJCZxYoUDktc5tluUwnr2Az7CLb78eHOAnphIY+4OUlicyQ2corjTbomyj3DPNT//JzAZYoRpgAPpufdzieFMDgbUd3Y1AExXYoPQ== 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=ryFbAimTaKG/GtL+U7cU9ZXAzAZHT5p8I16Jwnyj9+w=; b=gYjzK6LJchidAx2CKO1XeRqhl5K3TxQWRjrFRWoDh3vZ35MFZN2mxoLQI9c9XhHpz2tBdfzNZ3mu9bLFuBwN7T+/rjUNMW7IJeJJH3Txz4ms9I+1hvkeamQp4I2g+xTgUkivNRT5s16ueyDDspU4y9BCbVQp2JjfAz5Wev4RKcPyzLj+Xitp2q81gaYApY6TsfPl8NCSVCOVcHtM0d2Htf+371IrrUZs6yzYge0w8yez/r1rK5zvhS1W2F3eNh9lP51Nhce/943cTojuOFBt8gki9phrZrrLxmsFArG+UzYNaUHL8jrRMfR2OQJHrXU26PNgzp2arGid49sAtOlCcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DS0PR11MB7191.namprd11.prod.outlook.com (2603:10b6:8:139::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20; Mon, 20 Feb 2023 11:52:49 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def%9]) with mapi id 15.20.6111.013; Mon, 20 Feb 2023 11:52:49 +0000 Date: Mon, 20 Feb 2023 11:52:41 +0000 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: Thomas Monjalon , Chengwen Feng , Ruifeng Wang , , nd , , Dongdong Liu , Yisen Zhuang Subject: Re: [PATCH] net/hns3: support disable IOVA as PA mode Message-ID: References: <20230214071141.50155-1-fengchengwen@huawei.com> <7487991.nlapOpYt14@thomas> <98CBD80474FA8B44BF855DF32C47DC35D87754@smartserver.smartshare.dk> <1759668.5KxKD5qtyk@thomas> <98CBD80474FA8B44BF855DF32C47DC35D87757@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87757@smartserver.smartshare.dk> X-ClientProxiedBy: LO4P123CA0108.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:191::23) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DS0PR11MB7191:EE_ X-MS-Office365-Filtering-Correlation-Id: 578167d8-deaa-422b-41d2-08db1338fd6c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g7Zino9iTmJjjxDytZO11nkyHzpMjOZLJfvODU6jHy+ABzItjebm94wJqycU72+CSrFoWl0vk5S43sV0j/AyBP1R/TIH3BHDGJ86jvpF0T37VtQunDfe9TRlSA+HtsM66+JJ29JBpsHizi18W5/nM8QPDOsPO/Yc654amSgCZgiyQGWhoQ0FBoMkceWVvc9Ed+IwhiJ93YslFGvuKgHNYuJ/RdIftc8Zgt9aPrACEDlli+H/kMmzeUxAkYvRXG1HybE/n96hdTNGNZvH5bACfIBBskbHJkYDWoBU50MhIxqHO43obTNTE59yg+3LemHkPPAjv98nJBqVlhnl+Ol0rfS5ZhglawOxFCgqo/rvUnOgWh0jQ1/yw2o3jHSPeA69lTLZObg0eFAiYgodWAM6Q1f9+S1/lnVd0YR+SYblAzXMzWVhN0O2bw8Xcs+a0RhC5dCPDkmIvSLydL5dJS/se/KqfnlLv3wtOVtLNXY6U2k6nKOMYqGIoe8SIYup+7PAmEcC1oz+mQMNxbqm8Rli9EVSUea8Ymv2qk5uEMeNHv9To6v5QqHQd3l8YAZ0NcfW2N/E0manS5Qmwj4FhwC4jS9xev2WgwI0J6rb0iseP3Uj01A4kJZCaF/b/el1BK0oAhZMG3RaeeNTU4h8eyPZLOl905YAlaFs9nUqown72D0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(376002)(346002)(366004)(396003)(39860400002)(451199018)(83380400001)(82960400001)(2906002)(38100700002)(86362001)(66574015)(41300700001)(8936002)(44832011)(5660300002)(6916009)(4326008)(8676002)(66556008)(66476007)(66946007)(478600001)(966005)(6486002)(6666004)(6512007)(26005)(6506007)(186003)(316002)(54906003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?loM9ExTbxIqYjQiX1pGNyd1UhoI1JryJDzEKdn4uc7zs1sMvmCFiydtCrd?= =?iso-8859-1?Q?xHY/FsIrLmibBqby1XwA+VCG7QuLxGeC5D3iF9NNCrV1zGlJ8WtiD3gxsk?= =?iso-8859-1?Q?DGJ27xLTP8mMbhvf46Hmb0W0TnlbkRZaM8uuLKOeyhgE6qqRhiephyF3Ju?= =?iso-8859-1?Q?dtSKSmeutp1xse8juAsfegdpxUgohkRLMG+1PJkPbUrfwnzPJ2mYwnnciA?= =?iso-8859-1?Q?LhXEILhX8Kz33m/Ikjzg3Jwb8O8b4//kL+ZnaSt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nKSD5O0Fi+68BbuGMZQJIonEGsGMoGO+69pqNa0bAkRvTj4VHO0+64?= =?iso-8859-1?Q?AOreRdnZZw/TIaFGgVjpE4M2oHw3hUSMLnCkoHugb7gA8U2qblZOtHd1Hp?= =?iso-8859-1?Q?pr4zYnJUWBzFV/uhwtsCXpvaFZs5mUD2jH8HUd9Cuy9qhrODw8aTf8inL0?= =?iso-8859-1?Q?OVjyLZVOCgPTtY50DPLxwdV+xLeNyaZr8PPe2b876BuRAMoEKB7sc0Z77n?= =?iso-8859-1?Q?XTi5CsdAP9hEcG+Y+r8nOMNnepfmln/As5WiaPLdqg8BoOhygek/f+TAyQ?= =?iso-8859-1?Q?9RWI0bF8fesvxmVwWuLf3ylUF/ZmxMkww3cyyfckagFKBZOusC0Sx/Lgxi?= =?iso-8859-1?Q?5MqXIPbMZO710EJULk7ZQCM0a7/oLdsuRjq3ToMmHs9kxR6i/nkTuzgKKl?= =?iso-8859-1?Q?FygkruJwnQwMpb9CuJJOr16mvtJHnxP/cNZee/xgTRjC4jzeYM01K2V94D?= =?iso-8859-1?Q?LjOZUK7MPQm0diSF7BJCABuAT+OjuiQYOOsZzFNEJy8xmgV4Y0omsOTw?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 578167d8-deaa-422b-41d2-08db1338fd6c X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2023 11:52:49.7177 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cWvN6ZDl01TMcv5YhUwNMM7gOHBRmE6XcKtDoknFdSDA4qCVCNeu7MlM0jw26yXp48omjOwYWcRGRrQxYiIhQspDEEDgXjr7PzZJ4OX4i/E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7191 X-OriginatorOrg: intel.com 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, Feb 20, 2023 at 12:12:50PM +0100, Morten Brørup wrote: > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Monday, 20 February 2023 11.17 > > > > 20/02/2023 10:43, Morten Brørup: > > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > > Sent: Monday, 20 February 2023 08.45 > > > > > > > > 16/02/2023 09:36, Ruifeng Wang: > > > > > From: Chengwen Feng > > > > > > Subject: [PATCH] net/hns3: support disable IOVA as PA mode > > > > > > > > Could we change the title to "support IOVA as VA" ? > > > > > > The underlying problem is the meson configuration option name for > > this feature [1]: > > > > > > option('enable_iova_as_pa', type: 'boolean', value: true, > > description: > > > 'Support for IOVA as physical address. Disabling removes the > > buf_iova field of mbuf.') > > > > > > [1]: > > https://elixir.bootlin.com/dpdk/v22.11.1/source/meson_options.txt#L43 > > > > > > Formally, the patch provides the ability to set a boolean > > configuration value ("enable_iova_as_pa") to false, and thus the patch > > title is correct. > > > > > > Nonetheless, I agree that the title suggested by Thomas is an > > improvement. > > > > > > > > > Going back to the root cause, I think the configuration option should > > be an enum instead of a boolean, e.g. "iova_mode" with values "iova_pa" > > and "iova_va". > > > > We can enable both and have it decided at runtime. So I think the > > boolean is OK. > > I forgot that it could be changed at runtime. > > I'll share a few thoughts for consideration, but expect no further replies. Sorry about the noise. ;-) > > The documentation [2] says that IOVA as PA is always supported, and is the default mode. Support for IOVA as VA is optional. > > [2]: https://www.intel.com/content/www/us/en/developer/articles/technical/memory-in-dpdk-part-2-deep-dive-into-iova.html > > IOVA as VA can be selected at runtime, as you mention, or at build time. But selecting IOVA as VA (at runtime or build time) requires support by the underlying environment/hardware. > > If IOVA as PA is always supported (and is the default), the name of this meson configuration option could be improved. Its current name says "enable feature X", but if feature X is already supported by default, the name seems meaningless. If we want to keep it boolean, it could be inverted, e.g.: "iova_as_va_only" with default value "false". > > However, if modifying the meson configuration option (name and/or type) doesn't reduce the risk of confusion with the various IOVA modes, it's not worth the effort. > I agree that this option is confusing, and thinking about it, I agree that a pair of named option is probably better than just a true/false booleans. My current thinking is that a combo option is best - maybe named: "supported_iova_modes", with possible values ["va_and_pa", "va_only"] may be clearest. However, that would be a change in how things are currently configured. A alternative if we want to keep compatibility, is to expand or clarify the help text for the existing "enable_iova_as_pa" option. The current help text reads: "Support for IOVA as physical address. Disabling removes the buf_iova field of mbuf." We could expand that to e.g.: "Support the use of physical addresses for IO addresses, such as used by VFIO in no-iommu mode, or UIO-based drivers. When disabled, DPDK can only run with IOMMU support for address mappings, but will have more space available in the mbuf structure". Such an explanation is quite a bit longer, but I see meson does a decent job of wrapping the output of "meson configure" in latest versions. /Bruce