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 E50B443731; Mon, 18 Dec 2023 10:18:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9361C40276; Mon, 18 Dec 2023 10:18:34 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 206704026A for ; Mon, 18 Dec 2023 10:18:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702891113; x=1734427113; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=XPdRHboMP7HL6xX5gqF84GOyUAaFDiGb+03KbFQmtuk=; b=G0LaKhuONzbLfSAXEnVaGvTkyZkVIZaAoXDEDD3k9eu49f5dIzv0igud L+E4OZ4jdJ4ctnsS22Bi5353NIkybtgBExZ0JE50Wum5S3hqgQFFncjlr J+reCwwlBDwOqFoXaTbT11C+3YGGNJZP9fLLP10gHfhyq3LL5BUf0vThf kYY78OZ5aYa44ofCbOgqBWna+wdMKXTVOgrSv25vRtK2vYCA4AG+Hz+mT TnKIAYJlbSZDKnkEoZqnniNVU4N19pXowF+aHTdV0oTMjj3qJYBTiEJkJ +if7Qk5Fd4CX56EfHBOy5ybLIjrE2XLRK3cVp6iG07z04Y2+nw0FXFOLY A==; X-IronPort-AV: E=McAfee;i="6600,9927,10927"; a="459804273" X-IronPort-AV: E=Sophos;i="6.04,285,1695711600"; d="scan'208";a="459804273" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 01:18:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10927"; a="779029870" X-IronPort-AV: E=Sophos;i="6.04,285,1695711600"; d="scan'208";a="779029870" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 18 Dec 2023 01:18:31 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.35; Mon, 18 Dec 2023 01:18:31 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 18 Dec 2023 01:18:30 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.35 via Frontend Transport; Mon, 18 Dec 2023 01:18:30 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.40) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 18 Dec 2023 01:18:30 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fZiHkw+YjCpspgnZa1QOfwEagpD3TZPmYKHkeBY2QPXM9xHUIOI7Y51S6EpJWVjvr+Jne9kCdxwgx9kFw2J68eExKdz4coSgTgd99R1ArO0aAxxnK9QMxeZKbB13C868dF3Z0W1WNFsCMICYCjR7ys+1C0h5/m8OGckGfYMsRnZ8TxEEBF5BJhXVVOQbhWAZvYh7wmmJ7XZjy/NLf5/cPwjQVbgHSAizEtWJ3qkaFE9mgExpL4ulbMqSPKaASSs2GGi46euFZVitMZq7BIlK1TrcYScoMaebQjSRPx08jDxT0xPH8646t76/Lvnbaold2D6F9NK7Mh7WWPjHZou16g== 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=coO9inRIglkooxcDIeHDJ+Moni5TBEjpiq2qDKTZbtU=; b=ir/MawPnYydx2CYPs59AJ7U5ibhH7F8B7rxpKY32ZWbavSINQYv2KJCZ/4XesQLLVkphYu9BnOehBi8JBsXLsrwmrS55hDYDBaP9Yt0c12hAJ9mSJ7prKzUbNu8MYA0jOYOI3RGwIHq6HtT1HVNWtn0VsgbT7K7lHU9FcYbvz4Ud+vZMhYFKR4yYLewlgfjKwTJoiFuCAWI2X/dBJ6iRTG/qOm1mnQ6rOsa2aRD0jbt3ea29z44LtrjLd257EzheZyGJEFAmKHoIX8P1aVGWuOG5KH/NSwgfvDDd+0qC11MR01kOJoiLrr19ch2qzzHcusMTOoHOZSug6P+sPjib0w== 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 CY5PR11MB6512.namprd11.prod.outlook.com (2603:10b6:930:40::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 09:18:26 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4782:d54a:209d:cb49%7]) with mapi id 15.20.7091.034; Mon, 18 Dec 2023 09:18:26 +0000 Date: Mon, 18 Dec 2023 09:18:21 +0000 From: Bruce Richardson To: Stephen Hemminger CC: Euan Bourke , Subject: Re: [PATCH v4 0/8] add new command line argument parsing library Message-ID: References: <20231215172632.3102502-1-euan.bourke@intel.com> <20231215135321.5b734a2c@hermes.local> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231215135321.5b734a2c@hermes.local> X-ClientProxiedBy: DB8PR06CA0058.eurprd06.prod.outlook.com (2603:10a6:10:120::32) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CY5PR11MB6512:EE_ X-MS-Office365-Filtering-Correlation-Id: f91c638c-7e98-4c4c-2157-08dbffaa4a18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jd+iRmDsq1hm0g90bYshqHwfjDKDXQeNHi+2z0Mm/j24OyiTRCmpkqEN+21w5gk2lPaoRWNC+ezt5klEZ/gWtqhA6X8CT9590cNY3J5IHVvC1ax3d+MOj6cc87l8t4YycvYoxeMX91FfcqKcDQQ75KEYz+EZCeylWhXAgiD9scQKjd/tDb2ydlf2sI31Y9FHRVVZp9AcgZU493fslbMrGjGCVmes0Ghvp+zpHeHjug1I2QHz5T7Z+3/zmUbce7WLNwhc20FUfdZzPeY/Eq82TmJHteUqkJfiB8PUBZvSa1mEKeIewYXIO5kqBTpukwNTuNAAySNifR5LfalyFihDnPpEdax7AZ3j3MADxtw2mo/VO5kNyFqr5aBU8cpdWBxDsiMJOC5JBGBjOyMzwSm0wjlOsGFPSR/saYsHkxkxXzzx3MBZ5LRl1QNjv/xxvPuJJeR6CQIPwFA6RpG1MyzmNtAAoRBZ4HC1hQPQe4EC/0exrDFeXD6/RbiiXZfIKcsjP1GyZhOookbfdJCezj3ZDQzGmyoB3W4hCTuHmrlsGhEp8bdvd5ZQ3fJUOsdoxr6DfFGLKT9IjxrDbb4hdk/kYA== 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)(376002)(346002)(366004)(136003)(396003)(39860400002)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(83380400001)(26005)(6506007)(6512007)(44832011)(4326008)(5660300002)(41300700001)(2906002)(966005)(6666004)(6486002)(478600001)(316002)(8936002)(8676002)(66556008)(66476007)(6916009)(66946007)(86362001)(82960400001)(38100700002)(66899024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?l1+iJLLq/IhGizR97OPOe+HC33r3m8w6RFe+P4DKAXsokXFfdFWVS57rnYQU?= =?us-ascii?Q?KqVmSOzXr2KcojybLx3I3VoYoJ6Xu87qLp2jVHaKu071fcRwrhuG1vVlK8D9?= =?us-ascii?Q?1yqXWh5jprx9/9agSRVZvOdcYFDl1UD1PELna6E+C1t5P8CXdjMmJbUq7o//?= =?us-ascii?Q?Tyj9x5zDiBrk4z2j3QSJ9YCByT4mZCQL9yQKc6wzmaTVF4SGpdYZF8ZK6GDm?= =?us-ascii?Q?TfkJihCVfSsLl2VL5UBVreJGeez2xL/4wamulLNCTHQQ5cy83Ck/0xbiLr0p?= =?us-ascii?Q?qqC8pzhRbxg3z5+wKDrF1sUKHEtJzHHPENMnqQzzu/RsmgmBz5/p6u0qRy4d?= =?us-ascii?Q?Pctgf5A6yvDgNPJxOEI8YiC37C3dlfniInt8P+nNEdTYgCSeq9M1O1iVyuPf?= =?us-ascii?Q?vAnCWqFWRfjrEzUeGSLX80WXWsxB4MQ9ngtDLXXu7nsMzSFP37i7Z/+mz2Q0?= =?us-ascii?Q?W+ow2o0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3TRtJ/h4GIgu?= =?us-ascii?Q?0ln7gi9fNOTeo2zqPx7duRli5FdP/HNa5MAlSscyOviTsnkkOB9du736j/cy?= =?us-ascii?Q?fug24d0/ZgutTDwhsRewxeRhERaSz8oEAmcON5uV/PpnrEjjYDVp0vWrp+pv?= =?us-ascii?Q?v9WUDd9WvNUjHFoGjcKN1hgd4hjb5bVUCla1gRJbl3lS8L0s4JaOthYykJra?= =?us-ascii?Q?34CLl9VoA35Z8nCW/9uqePslskB5cO71oSR2UqNjEL5TsEvR/Nt0YhMCGGLI?= =?us-ascii?Q?kA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: f91c638c-7e98-4c4c-2157-08dbffaa4a18 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2023 09:18:25.7085 (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: n1FYvBIyDhN2XfZh62f4vAMlOwFkfB42yw37LI80RJLjrt2RHqmTuZizYJExEhvOxWSfX8F1mukmRrBtmE5Lp8A43sz1QOXAfnwSQR2IVaU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6512 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 Fri, Dec 15, 2023 at 01:53:21PM -0800, Stephen Hemminger wrote: > On Fri, 15 Dec 2023 17:26:24 +0000 > Euan Bourke wrote: > > > A recent thread on the mailing list[1] discussed corelist and coremask > > parsing and the idea of a new library dedicated to command line parsing > > was mentioned[2]. This patchset adds the library, along with the new > > APIs, and edits the existing EAL, DLB2 driver and some example > > application functions to use these APIs, rather than each implementing > > their own copies. > > > > The new APIs work similar to the existing functions in EAL, however > > instead of filling a core array like this: > > [1, -1, -1, 2, 3] (a non -1 refers to an 'active core' at that index) > > It fills it like this: > > [0, 3, 4] (with the value at each index being an 'active core'). > > > > The new APIs will also return the number of cores contained in the > > passed corelist/coremask, so in the above example, 3 would be returned. > > > > Also included in this patchest is a heuristic parser which searches > > for key markers in the core string, returning a enum value based off > > this search to indicate if a parameter is likely a coremask or a > > corelist. This heuristic function is also wrapped in a parser > > function allowing apps to handle both coremasks and corelists > > simultaneously. > > > > [1] https://mails.dpdk.org/archives/dev/2023-November/280957.html > > [2] https://mails.dpdk.org/archives/dev/2023-November/280966.html > > > > The code is ok, but the naming needs to change. > > To me the name argparse implies that library implements something > similar to Python argparse. But that isn't what this library does. > It seems limited to just cpu masks. Perhaps cpuparse would be better name > or make it part of a larger implementation of a full library > more like Python argparse. Yes, it is a limited set of functions, so the name is probably not ideal if that's what it's going to remaini (though what library ever stays un-expanded once started!). I think we need a general discussion on-list and probably in tech-board too about argument handling, since in the last couple of months there have been no less than 3 separate independent proposals around functionality for arguments. There has been: * This set, for extracting out functions for processing coremask and corelist arguments. Presumably other argument parsing types may look to be included in future e.g. device args, perhaps. * A set from me [1], looking to take the slightly opposite side of things, and make it easier for apps to initialize EAL with a custom argument set. So it can be thought of as an argument-list management library. * An "argparse" library from Chengwen [2] which does what you describe above and be a C implementation like the python argparse module. We need to decide how to manage all these three, if we want to take them all, and if they should all be merged into a single library, or some kept separate from others. /Bruce [1] http://patches.dpdk.org/project/dpdk/list/?series=30120 [2] http://patches.dpdk.org/project/dpdk/list/?series=30506