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 6A46643270; Thu, 2 Nov 2023 17:59:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A15740282; Thu, 2 Nov 2023 17:59:06 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 9060E40262; Thu, 2 Nov 2023 17:59:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698944344; x=1730480344; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=7ClRXq/9KpG6PyPWWO4FUDZfjCv9/BZ69zCwF86hUHg=; b=chQux/iC8g3WoPr7QsJDuVfX0ztcAnuyZLwzFTn83lCS0dGTcoHCbZ4q 0lO2x2qjuPK2A5vmL5daVQeFmsugOhlUnQuqM0bh9xEFu9jKURXDtyP3i hQ+Wl/BvZLPTnSUWge/cAFOgdO9K/9p1uVMbbyo8dByWww03omZdrW4DJ NuQlPpDMeJsiDyh6vXhQcU4Jo8znUewNwXN91D7A67nRKiyOhHbopJWp+ O6RdQq+VdWuJa52FbQ/DsNRa6Yk7jYtKq8RP40/irmREQEWzoubDkk4i9 fLMxglmm2bqSuv0sxvrFVLVBEusifzGaKyeEJboM8pVskR3mVPknvP9QD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="387639389" X-IronPort-AV: E=Sophos;i="6.03,272,1694761200"; d="scan'208";a="387639389" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2023 09:59:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10882"; a="831742804" X-IronPort-AV: E=Sophos;i="6.03,272,1694761200"; d="scan'208";a="831742804" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 02 Nov 2023 09:59:03 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.34; Thu, 2 Nov 2023 09:59:02 -0700 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.34; Thu, 2 Nov 2023 09:59:02 -0700 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.34 via Frontend Transport; Thu, 2 Nov 2023 09:59:02 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) 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.34; Thu, 2 Nov 2023 09:59:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GLYglOg2KtjZHSvf2N/EW9GS+161qelS1QgrImC2EpKANGIb8X080z8/SMGuwtks+SlWsBe5So0PjCUNYSwdlETYOOTGSrwsB2eOjoq40GN9+plk0/dLmT2QgHkLuYCRVb9dm6NqfMuV3esTq+Bq80pwmWKY4HdB3aYdUjN9qiphGPYbIU2eIsejprC8CrLH5BZ17obJSB7cOVUv0Gm9MDwtKNq3Mic0w8KXLSN24w9zpBttvViIlmmNF7XmLUolx+/HO5BIsA49ZMrZIG+2c/Niux+Y/OrolD052emHTKFa6+R6XQH7vGm5mI9cmwaFhyrUvjy6AbQ9kurm66RO0w== 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=uaEcg0SsVilDwlwjYmyJhv6uhx5NUartFbnuWiII8is=; b=Ulolx/Wou7Fof9oZoDInWK5bbSN1sHaqrOHK779vn67ZfD+I7VIj9PqF0NffGZmW2MjuTw/4c4nn5je4wnRAWOYnz7TuYlPlMNnJZztAckhyPGB7iFI+ximo9MprAnwutn7Gy1/qWdjG/6pkqeaVir1YHSMUvmNDodEolSvzp7TwukY3QjFPCAU0dWftutAU0krNQGWMGePBLgzKp80/Tl0qzsap27KFGLhBiHUYtDnRacWwYCY7OyI0j7+BThQtqk+O7v4Wz9e08O8nV2POay85npiOuv4WU/XKI1bzpRBEJDIf7MhZKs6cU5Crcvi0L1DbIEDieHrVD5yJd0hycQ== 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 DM8PR11MB5671.namprd11.prod.outlook.com (2603:10b6:8:3c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Thu, 2 Nov 2023 16:59:00 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d70b:11a0:d28f:ec44]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::d70b:11a0:d28f:ec44%6]) with mapi id 15.20.6954.019; Thu, 2 Nov 2023 16:59:00 +0000 Date: Thu, 2 Nov 2023 16:58:52 +0000 From: Bruce Richardson To: Thomas Monjalon CC: , , Euan Bourke Subject: Re: Updating examples which use coremask parameters Message-ID: References: <4175883.1IzOArtZ34@thomas> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4175883.1IzOArtZ34@thomas> X-ClientProxiedBy: DUZPR01CA0060.eurprd01.prod.exchangelabs.com (2603:10a6:10:469::18) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DM8PR11MB5671:EE_ X-MS-Office365-Filtering-Correlation-Id: fb2e62e4-7602-44db-5311-08dbdbc50247 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yeD8XbGrh7g7jkhkCwTizoJwxqGTH65ujoOlOYqtt4RmWxIu/V9VlUIpU0n+8c3PgMNz4mCYFmngwVo74MKn33HEJodYA6jBHH4gnOkIC2h1/YtpCOdlBiah95HjwCl5sxEAAQ7af3qXa+Et9keLLNPvtGhjG6Osy3DZbY8LCoW3JWn50aOWKuXgFqIoVGQAQcakGYs5EOsXGR7ic0Lqvs8bc15SUYIgGwMuvHROxrBSq5mYg7vSK4gkPtJG/i1AeY/Ud8U+1EoEre174Ndw0NnISyhSYpURjp3Pxsw2fXiOIMwM36asKMYrtPRagc7N954LE0HDenLDpqQDC5MfWhuaZe8H5CNuzD+OrCH/UTOJiIBzzMWdp04uepDvybmCU74H4+FMCkobHjPV9b2V57LSzpetRMFCKYZRHmlGcvzjlSqKrAm7GTb9sxpIuytDALU+b5DB1/n2N3F34Itk+TM6Zlex70ILPjbtKvQOFUduvAnRaFpFcJgK27PAs2DEeGJ7InjZlNXCWe/0vSYvNM0YAZ2CFVJuIfaQi0F8uaWR+bqNYOEKXgv4CTfCkQpc 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:(13230031)(39860400002)(346002)(366004)(376002)(396003)(136003)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(66899024)(26005)(107886003)(38100700002)(6916009)(316002)(66476007)(66946007)(66556008)(5660300002)(8936002)(4326008)(8676002)(6666004)(44832011)(6512007)(2906002)(6486002)(478600001)(41300700001)(6506007)(86362001)(82960400001)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jdGWmXhSM2W0YHjZV2xcMX8Z1k68EorKdVjCndaK2ni2o1mqDxtNNGJG8xgc?= =?us-ascii?Q?w+dypRKDMC52IcrWUGArSMDs/6hIWFJgzKBL/fqDJ4Ba21qXdxLlU4PaEnIh?= =?us-ascii?Q?wHJiZuZEa96PZnIf2slzPxRcve7y2CFGx1X80bk8FF5a9/Y/pDvhyU44nYcW?= =?us-ascii?Q?2NDrcXst/8+uwh90QAFZC2zIEZybuEXm7OPvi5+6Ba0leRoxQJz1p/WZjyMO?= =?us-ascii?Q?nMmCMDW5DGfRFeSnIoAcjun5oQ+b3yyMBX6jPbD8fMvDpPCXod7vN9EttDng?= =?us-ascii?Q?F6B0NKsbhxB+yQDAnE1biOFWfs1vWyPgl1WvRnYXr3UjeIf7/Qppinpalmum?= =?us-ascii?Q?jrxdifnCKdlVmlwGA/DYImY1uy69UUSRDfSF+F5hYY1rKEXown5OH+6v6bdZ?= =?us-ascii?Q?f6qmnoCeu3gIT6PH8+zi+Rotz3gMk0GCV5EnaeYbP4Opbkbvg5reDcY1J9o0?= =?us-ascii?Q?UJD+y0421d2cgodFtb4XXvzKGU+d+4DljzuiOiQDwTrx4qiy74a+ZPW0vT9a?= =?us-ascii?Q?E8E1bt9q9yunabUkL+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= =?us-ascii?Q?xLY68uCVGZbCZSLewOE7euJsQkm22rPCPtVwMxqA4fAwmY782csP0WSDlYwV?= =?us-ascii?Q?qPwW/XySEbXFSLS8P9v3Rt1yhwW6Y7UJE4HUo4EBfLchjyqcSy9d7MZq2stt?= =?us-ascii?Q?3UvzUmuKTf7IKBvGyvZXmx43960z3xi2ucX/KjBB6MzDY3fLrOLDriiYUJdi?= =?us-ascii?Q?dA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: fb2e62e4-7602-44db-5311-08dbdbc50247 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 16:59:00.0076 (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: ldfljb7rTNZ0KV06d3O6JHBhbpKgvnFEi9fpwMIeUO9GMlKJ4OE7FK4wLIHOpZoSotjSZlbc+fPjvsP7/TSnzAJIQeoMKdjvjiaRIODKUzI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5671 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 Thu, Nov 02, 2023 at 05:28:42PM +0100, Thomas Monjalon wrote: > 02/11/2023 15:56, Bruce Richardson: > > Hi all, > > > > looking to start a discussion and get some input here. > > > > There are a number of our examples in DPDK which still track core usage via > > a 64-bit bitmask, and, as such, cannot run on cores between 64 and > > RTE_MAX_LCORE. Two examples I have recently come across with this issue are > > "eventdev_pipeline" and "qos_sched", but I am sure there are others. The > > former is a good example (or bad example depending on your viewpoint) of > > this as it takes multiple coremask parameters - for RX cores, for TX cores, > > for worker cores and optionally for scheduler cores. > > > > Now, the simple solution to this is to just expand the 64-bit bitmask to > > 128 bit or more, but I think that is just making things harder for the > > user, since dealing with long bitmasks is very awkward and unwieldy. Better > > instead to convert all examples using coremasks to using core lists > > instead. > > > > First step should be to take our EAL corelist processing code and refactor > > it into a function that can be made public, so that it can be used by all > > apps for parsing core lists. Simple enough! > > OK to add some command line parsing helpers. > It should probably be the start of a new library for command line. > Funnily enough, separate to this I had already been working on an "rte_args" library to have some functions for working on argc/argv parameters. I'm planning on pushing out an RFC for 24.03 fairly shortly. However, pulling in functions for arg parsing is a different set of functionality to what I had in mind, so we may yet get two libraries out of this. [Merging may be tricky due to issues around circular dependencies with EAL. My arg management library is designed to "sit on top of" EAL, while any lib offering e.g. coremask, corelist parsing functions would need to "sit beneath" EAL, so EAL can re-use it's functions]. Let's postpone the details of both these to when we get some RFCs out though. > > The next part I'm looking for input on is - how do we switch the apps from > > coremasks to core lists? Some options: > > > > 1. Add in new commandline parameters for each app to work with core lists. > > This is what we did in the past with EAL, by adding -l as a replacement > > for -c. The advantage is that we maintain backward compatibility, but the > > downside is that it becomes hard to find new suitable letter options for > > the core lists. Taking eventdev_pipeline again, we would need "new" > > options for "-r", "-t", "-w" and "-s" parameters. Using the capitalized > > versions of these would be a simple alternative, but "-W" is already used > > as an app parameter so we can't do that. > > > > 2. Just break backward compatibility and switch the apps to taking > > core lists instead of masks. Advantage is that it gives us the cleanest > > solution, but the downside is that and testing done using these examples, > > or any users who may have run them in the past, get different behaviour. > > We don't need to offer backward compatibility in examples. > So this option is acceptable. > Glad to hear it. Makes life simpler. > > 3. An interesting further alternative is to allow apps to take both > > coremasks and corelists and use heuristics to determine which is which. > > For example, anything starting with "0x" is a mask, anything containing > > "-" or "," is a list. There would be ambiguous values such as e.g. 2, > > which could be either, but we can always find ways to disambiguate > > these, e.g. allow trailing commas in lists, so that "0x2" is the > > coremask, and "2," is the corelist. [Could be other alternatives]. This > > largely keeps backward compatibility and also allows use of corelists. > > The option 3 can be interesting as well. > Yep. If we start offering a library of arg-parsing functions, one of those could be a function using heuristics to identify core-mask, core-list or ambiguous values. Then each app can decide what to do in the latter case. Since we don't care about backward compatibility, the examples can just parse ambiguous values as core-list. User could then still use coremasks by prefixing them with "0x". /Bruce