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 13EF041CEC; Mon, 20 Feb 2023 15:12:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E6AC24305E; Mon, 20 Feb 2023 15:12:58 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 4AF5D40395 for ; Mon, 20 Feb 2023 15:12: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=1676902376; x=1708438376; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=TrelLe957RTVK6VyyfenIjTB8r1anQpnqDRjfwq40E4=; b=ACvShGRVxoGAwIIU6wMFA1kwrUjWeaEVPKraJ3LrZlLUAdVk6erzM5Ah HX+5UwF4BN1EE5Beainl7SbHuDhkzQiXDlYFnFeVLo/fvaKmaMD7vqVi8 cXrc8ui+Okq9cGWi8PXFN7BUiraxNN66aO7JA6lJ7la7oIUG2TiElbLGA MddfJLHAHsq/XhUPps4BAwoGLhIWiAWUs2fUjaa+rd2U51wQutDQ4WcpC 8PyycHZWne9CB2O0fMoa7yYb4V6w8vHZrSvE4+Y3qozJb0TYepvE0hm4j zkhU6xR6iFMVJGtwoE9ibYgchHSuei8D5KwvaLNjfZnLdmCBq4rnFWuqc Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="330121942" X-IronPort-AV: E=Sophos;i="5.97,312,1669104000"; d="scan'208";a="330121942" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 06:12:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="814152761" X-IronPort-AV: E=Sophos;i="5.97,312,1669104000"; d="scan'208";a="814152761" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 20 Feb 2023 06:12:54 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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 06:12:53 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) 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 06:12:53 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 06:12:53 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.46) by edgegateway.intel.com (134.134.137.103) 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 06:12:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8TrOsrWnZOs+SjHcrR159v92foymzbZyIsPZoku6A5WJuop87VRiuTmXEUjpDHhlZmD0r00TTPfvQYzCo24yUaLbfutYLXrWFqtFZOTHrg2AT9Bf9zPa/u+X0Raq2JiP3gnPwGJYM++CudGaMyA1Lrj1x5zW2jfuMfsfS/FoIr0IL37XG8q0aRBTdg/ulPQJ+jAiMQgjAFU1GJdRuTktBkgk4e2rRImpSuYITa2guBxkg3gBkn7CiZ+oTzMNpuXhEJjmT0C+d+hXOGAwbdkaJr1M/iE+iEThu87GxiTxJW0lZCsmQsZ8+WhR4m7DN7DEKQsKBbG2IVrctynWDw8Rw== 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=51InMcimJWVNFWdt1I2/R0jcTOAU6zXCH5lOUEguLsc=; b=JEKez/W976XHSyi7VIAAs6aO/Lx+gRluDXEelcuVQ2gxyWSXbw7JL3CuIDn3me94rhB8bPEk9wByNtGU0KukaVxu3IhDh6Ht/VC1erW0vFJTVKra5DqC6hWpwyc0UVKPhkwaDFGVZmhn2M5RAZMFWSgbVjjnt14p8nomjok7rqMeQYYAwRnbNjvJH3PlTFI2n4UfGw0grr3aVYP9V0PmlP0Nvp4LD16K82VdzGujCOS+SMLmlLAunDboTnf3KtF0ljcmO3bGsw4voHGCGq5jKoPr6giIdGhS5k1h0zi/FRScwjgwGUdAK2498YWcOBubLPnwmlxAXxtj+y+gsHxYqQ== 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 CY8PR11MB7105.namprd11.prod.outlook.com (2603:10b6:930:53::6) 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 14:12:51 +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 14:12:51 +0000 Date: Mon, 20 Feb 2023 14:12:44 +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> <98CBD80474FA8B44BF855DF32C47DC35D8775C@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D8775C@smartserver.smartshare.dk> X-ClientProxiedBy: LO4P302CA0020.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c1::9) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CY8PR11MB7105:EE_ X-MS-Office365-Filtering-Correlation-Id: 30f87bcc-766c-4274-b34c-08db134c8d2b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jJRd0USdddJnBb8WaKKAcleGpfgCw/pQ+JXAtmfSTxKphzxgdKN6j1f9QeCkV5L3uJg8oSPkA190EUFDNy+ct+9BPxCf1+Z4r68/gCMrrqkh3HDKm2yp5jbXL8oUiLy3wTYaRvpKe0GwHtf7QarL6Kv4ga6sea45PLZqKibi8+SCoGRS5XtR0w/zlTXac6L0JPuhtEoM3eZbyXhzy7iGgTwOdnLn9sk7dfv2RfDGW8I22Qd7Qncnd8R74hAU+bcswscdDtRIgXAyYP5nQuJSwym/+Igqd60kkz1Z7qxVItXlCZNpry1IMfNsVLJ21Y9LwH67Y8YRTFEobsG/K885J969/1IQlMnERhNr0DcIzVpkbvyWKA2t7iwalyuX5TqqTx3fXlkxvyt10qUxAY9/7cV0kesUeHUb4+ZzIEbr677YJhpGjQUbEk71Di8lwwbpQjKBDVu0G/DPrHPXQXPdSMFb+mQybiZ9KPwGoqn3m83goyc604c2UEcXMzduHPao0EFlQBy3+m6ZUZLLlXa1v5JjOZ0G650q51WBx8vNdjcm/6M6Zgalt0ty3rY62KKeATht7cSvE8Mo6IQV+aCvnTuPcrnLYL8mKHYZRGXT9lr8lUraTTx4TRQKoo3DLhLdgc9p6gaG6PRJ+HnCG9+8QuFp+kxWfJp4DY+jAlPNI3c= 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)(366004)(136003)(346002)(396003)(39860400002)(376002)(451199018)(83380400001)(82960400001)(2906002)(38100700002)(86362001)(66574015)(41300700001)(8936002)(44832011)(5660300002)(4326008)(6916009)(8676002)(66476007)(66556008)(66946007)(478600001)(966005)(6486002)(6506007)(6512007)(6666004)(26005)(186003)(316002)(54906003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?YQFAt5PNZNYpJD0sQsPLTEhg15hBrqfuYggwrno4Xp37FaEqXoZewW7BOT?= =?iso-8859-1?Q?cTPTiNd+io7wMqFQAI9W2X+INjaaUls+FkragKzpToJNL1zRI8FqC3jdw8?= =?iso-8859-1?Q?VhQ5VXc1e0mK9Wn+BBO5pyuKDvjr9TQP4Gb85EYyGTuHaEldJL5rodZee0?= =?iso-8859-1?Q?w3qwL5tdncFfetQHA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= =?iso-8859-1?Q?PF/IP3LbcjdYHdFd2J5EXpeuJhaC5Aa6BUv7kB3h3GUMQ6N9kTobiLlpb7?= =?iso-8859-1?Q?l2gBGo7ealwuapazjOb6vF/2y7TidCqdIhE7i5dkIlOPcUX00sROTaPAko?= =?iso-8859-1?Q?gbS57gVpoF72Y3ZBbpybrHHB4aqGV4I5vhD5/5seX7Qd8fDzhJNBdwr06U?= =?iso-8859-1?Q?KpJUk2A5VxSLWh4OJDtYsJrgB/8BY9jiWTYH4V5wSGq4T+0/+fbnrdxw3w?= =?iso-8859-1?Q?xPKAIwkJDqKLJNDMBGieqdzEkUHubED6Xx4O4VLKs1eUO4gBOlzmCcI8dP?= =?iso-8859-1?Q?NtPhHwNSbeooBSg6kXXfUMnhyLt2fzi4tFzlgCi4o5+TNxAxB5vWQLctsT?= =?iso-8859-1?Q?9VbWhpb841sZS0fUccpYCv0ilcmy3lpRXni7F1BvNSEjPL5eZu/Kfjp0pp?= =?iso-8859-1?Q?zPRjTJF4XEFRTduv5+Z2Psl9Kgcuo45uZCAAlJUIwLZbnDxzGUpo3ISh5z?= =?iso-8859-1?Q?eTM61h9s5+Riu1XNLVEE1TjTKcj/kguE3lHVr33xsMt9/TTdZuy7mIMCcf?= =?iso-8859-1?Q?UYeFwOVdguIj2IOWw85dGEXZGADfhoOZrDZGfAKaZVG32zn3B0sb0xqQ?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 30f87bcc-766c-4274-b34c-08db134c8d2b X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2023 14:12:51.3544 (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: GClzpAPFqtL3OEcyq57lFReLQgt12zMUKaSaGhoNQobPOO3G1mxuTsNx96xxTvvMADexx4JkMR07r9qDQtq/6gwCGjxrbV3ogMNPSC5+NKA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7105 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:47:13PM +0100, Morten Brørup wrote: > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > > 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. > > It's not that simple. There's a difference between runtime IOVA as VA mode and build time IOVA as VA mode. > > E.g. this hns3 patch adds support for build time IOVA_AS_VA mode. > Ok, that is another way of looking at it, though to me I still view that mode as dropping support for PA rather than doing anything with VA mode. However, no problem putting in an extra build-time define for RTE_IOVA_AS_VA_ONLY or similar. /Bruce