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 0520741CE5; Mon, 20 Feb 2023 13:23:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB1794302F; Mon, 20 Feb 2023 13:23:38 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 33DEC40395 for ; Mon, 20 Feb 2023 13:23:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676895817; x=1708431817; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=7/cE534irsylzrkhPuZ57zRmQpgUDwKaW3bfljEBbqY=; b=ImViQdQd8BerxD2WF0XaEV067cL5kUfIXSaYXn+i7ui1Ee8WF28LwSvU aCa/JszIf80a2dG9WBSo5qzl1IbzkzL+dYTTMNZPZ4GW9mXuELyZq30PM d0bq3JfLoR/ysOQ1ZXPUfO97RDgdO5R5FrzIb9iS5GpYaZ+Kk+cQrioWW YjUzvULP5o2KSXRuJHnnnNrpLBsfHAkwKSdEBlLFyPLln5yCEo574moHk EDrVtY29oMGP3j1ZhD55DP/zheITP9uVJP3M4r39O+aymIOHTcOpzPvoM hKGUz/LVI3dssobKYu+/Z/XcXXr6BdXiYjPaPpGkFZjWGtxNxvNo/QSa3 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10626"; a="316106726" X-IronPort-AV: E=Sophos;i="5.97,312,1669104000"; d="scan'208";a="316106726" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 04:23:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10626"; a="735114107" X-IronPort-AV: E=Sophos;i="5.97,312,1669104000"; d="scan'208";a="735114107" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga008.fm.intel.com with ESMTP; 20 Feb 2023 04:23:27 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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 04:23:27 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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 04:23:26 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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 04:23:26 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (192.55.55.71) 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 04:23:25 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZzYakOrRYLY6ZVnPrF3Y/f+eg5XItpuAZkrFRuMNfxtqYhnicL2H4aTjjQw6ADao9wdze0RuTgBMhY8RVbswlkOdg1rBykXigK0KgECYZZdaaUzevTOx5+8USDao2rUVeN9tk6QJp1cB6BFeO0WXlBn8lcAZjjm1Gf1c8o7jkcOcovwuiF3h2TQNnKU2DqVGsiY6nLlrfcLmNH2NPT10RdhdrWtG129tn+QUcfLE4VfcnCvwkgWqoeJBtQ8ZcohZbqAyJNRMu6cxJfdDhq6GHCj/PibulR5rbw8chSg4D+9cNumwgTp4XNR7r5ATcM6UnqN+Do9QGufWX8Q943ftg== 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=Ew+IHS+z1z/Os2XfEJGl+AVK92ZRI+7iKchE59yWouw=; b=VeoqhNLkwfqGSNOMJRD7r6/y+/R9Jbqm0pj6AwScNoM2GCs2Ra/K0tURxX57VUAdWyU6XBmMuXWxDzrb/slXXw45w8KgS+TYPdTY7E6wIjrkijnr/EYn8H+3i6VrWwk3GGbEDOfK6rFjSmTBuksFEBth0XfNjRlN19UI4mgAjgtTelq9s4ev8BzTmi5QFssPHd0OM7GOOPJe9wgSDXuWEuTYJa7BDd0hrQcojZuY9DdSJxPyvnKa/uDRx8aB7x7MQy4ZK86Ywf6NLxuA5HH8Vf8eKWhPYyv5NzHaCHXWzAHd+iFbIf0nE3kXwvxRhuTPWRto7uv1cRi/vZV6vGmYTw== 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 SN7PR11MB7044.namprd11.prod.outlook.com (2603:10b6:806:29b::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 12:23:23 +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 12:23:23 +0000 Date: Mon, 20 Feb 2023 12:23:15 +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> <98CBD80474FA8B44BF855DF32C47DC35D8775B@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D8775B@smartserver.smartshare.dk> X-ClientProxiedBy: LO2P265CA0114.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::30) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SN7PR11MB7044:EE_ X-MS-Office365-Filtering-Correlation-Id: e28f79b2-2e5b-40dc-9bab-08db133d423c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rq5/OBarQf0eFKtiEEn3fBNqmYQ8tekXoy7RGJjz8llk8NZ8dgKQGLtzF263FX04oYGoVuPNVAS3ptjaYsZAGrJBeXEY0iEzK0Ivb+MqCg/Wp7yQBNNtndHvlc+EBaa3HCBLhH4SUnthD5FYUE7ckDwH5YqeH6fPRMYeXYpdkGNYnj2D7XazEVIV6IYuP6PZ1O4tx6W4eDXDc8ltwH25l/h5h88U+rjxAfdqkJIvNnWSTOMCQqKZGXEXwdfS3Ub2pm2aXMoV1o6uyOuxM/1l8tQ7GNj+co8HrlZ3R4gAqolUaz7sJbWkBZi3TuxoUXpWkbAEXjdzMLcEKTLWHi0iq5Yd6P7Bi/qcM6PzwybwTwCuppKmLhMrHyFNnB9p7p+aijO8kjPxqm6rn9SQAOFyhYTJJTc1bnQi0wiBK02qk9+242z6HPur5N5YqaYMIz4YeMdSLF9ntn9wtoEXcMAnYcMxcfxWb3AataX5ijvrHSAsLmXF8JdzXgZoLlzzrolqJB298q+BsUzpf4NiElAcScCVCUUq8UsFRIYOU5nM6K3SrsacIJxQ0X6l/1YA1HeYfyXzrbCYdl2xNR3l2/BsoE6BaoBeqAN2fN4kKT/6kgq7fmN043/p2qPOLQeQk8QsmIwMiKWurcsoJ1w9bAVI7s0tPiw5fhHoQZLzox4B/cc= 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)(346002)(39860400002)(376002)(136003)(396003)(366004)(451199018)(2906002)(186003)(5660300002)(26005)(6666004)(44832011)(66574015)(6512007)(6506007)(86362001)(66476007)(66556008)(4326008)(6916009)(66946007)(54906003)(41300700001)(38100700002)(8676002)(6486002)(316002)(966005)(83380400001)(478600001)(8936002)(82960400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?YTaZ4yjU4VLjuEJC8gOez/iTO6tPYE0WrnPFTqihjMyawtmTLWkOC0VgA+?= =?iso-8859-1?Q?NmPn7D5POvnVaGPHz/1GVTBF5D4jeshjELlfF8K2poHzAl6vqcrGPlUUCE?= =?iso-8859-1?Q?AOIB5tXzIsrMFZdOz60uzuyYvaa09/6ubm/nAd0OYwt3nMhsN91dGTG894?= =?iso-8859-1?Q?g+DK+T3Zmm86xPEIuQocOpoIEpU308dFU+JO4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BlZSU/oJSO3TsRxDSdoSP/YWwsPmaNqNfULqCUiXwb?= =?iso-8859-1?Q?TgK8OgTJ4D2cnr+cnBsxVxZe2hBsuogOTLvky+lLNmIRPt8lZnwX8zeP97?= =?iso-8859-1?Q?PJTv4vHezivbxDwYpVhFrPmRA7LHOoSWWLpIITdvsK6llPKytHIE26jGwT?= =?iso-8859-1?Q?FX+/jIhIxt53JDiwO3lwAnqW1b9m005p8Ty4WGvvS2BWYorfzyqTEhd0AI?= =?iso-8859-1?Q?2b82tJPXfYNRXHQsxiU6vLjNuQWsMyk4Yqz3VbacpKK4bgDLwtifh29oRJ?= =?iso-8859-1?Q?ZE542uF7sDkimcWQXbyLyYeD7UITsI+UaPI3OJzvn8uzqtNjt0NZ94Jydw?= =?iso-8859-1?Q?gYTyREnvJifJ31RPJZzad+AmmD852KIg9hOmrEwSVCbnPWhBSeIdFTDnwV?= =?iso-8859-1?Q?CdNNMeIeNSuyNCFNEEwGUwPGzQQ94crMjAb/yp7X9iOs56nGcjqIebnnBM?= =?iso-8859-1?Q?42jvqOxVeUvISpRLVw5iZpZ6WFyZZAa7nqERWclmWIzjfAl5AdjgEUqPaz?= =?iso-8859-1?Q?4V0AeL88BVsSbuM4WscdCeYZodt58iZtPCKIW2zpbVBCJSeTirtSi96w?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: e28f79b2-2e5b-40dc-9bab-08db133d423c X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2023 12:23:23.1553 (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: Ag7i4YYsaZ2vUVm0rMlA0sIFGl9k+nf5CAKViX4EMFzKYV7KZmyXm17cR9dcsMZpeSlz/LiSXWmh9kumt8XXc3FSS5oA9GQyhgNyH7Y1hyY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7044 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 01:04:02PM +0100, Morten Brørup wrote: > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > Sent: Monday, 20 February 2023 12.53 > > > > 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/me > > mory-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 > > Updating the description of the meson configuration option would be an improvement. > > But I'm thinking more about the ripple effect into the resulting #define's, and the code using those. It would be nice getting this cleaned up. Which is why I compare the IOVA mode to CPU Endianness, as an example of a Boolean value represented by multiple #define's for code readability purposes. > > But I suppose such a change has too widely reaching side effects, regarding backwards compatibility. Actually, I think the current internal define is pretty ok right now. RTE_IOVA_AS_PA would probably be better as "RTE_SUPPORT_IOVA_AS_PA", but I don't think the lack of the alternative value "RTE_SUPPORT_IOVA_AS_VA" is an issue since a DPDK build always supports that - it's only at runtime it may not be supported e.g. if no IOMMU is present. /Bruce