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 08C4143702; Fri, 15 Dec 2023 22:53:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B73BE402C7; Fri, 15 Dec 2023 22:53:25 +0100 (CET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id 6666B40262 for ; Fri, 15 Dec 2023 22:53:24 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so955352a12.1 for ; Fri, 15 Dec 2023 13:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1702677203; x=1703282003; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=5WhEktSMZekFW6C9uQ8qbuiZu9V0kQYugUZ8XPRkyU4=; b=HbIXU0z74dOgWf981pwOZg8L7G9AfzzWS7OiEtjBEM6nQ9O173Ivf5AhOoNkV0UcCd Ad+bThBjOBf4Om3m4/IE4TtBwaAVmXMNpU1oDp0Ql6tzm+09C0sK7xDEQItK6eM2bCjQ /HNwi/BBwDToE515WowXZQGMPChe4DyK0kddBqku0uhygliClJsChcQMsoZjOJEh3x5q N3D1wWSg3Vf10ySYq9ImIKtA8TkMhbQNSNd9Xaku/wWaxbJEEV5hIr+MfNEWCWEQWsLt zB5MMY4URX3Oro4XF8cAJNDl2WFZgkiifVFEuIswnT6gpi+bo8GgQDzglS8sMt/ojPiv a/HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702677203; x=1703282003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5WhEktSMZekFW6C9uQ8qbuiZu9V0kQYugUZ8XPRkyU4=; b=Xa8tOnZzXabhOCu8TirffkrWRYyZaB1Kge2tis/5gT1O7IgPK52zTQOZI5EdcgerG9 3F0wY2nx/VxXrljbRvbVXH8g0jqviYj3GPSbUqk0gDsA572Y+t3bcwupRvZdDi0TAkwe JZ/M8QZSUJGLoVTbnYJAwqZ4300mh8iNoMH33KedHv5ox+NWKU1faPid8vdwfJFhtQI2 0MVxjEAXI7C8LEq8diFxo5opMGXeXxcCI8Dy7SLOsgRoduk4Vjp1YSq23H8EcoSZWHZt Zd9JAlf0PrCnuZB7EFDADrRDMMChm+XPdvWjiubDB+muPmihgkve63tQiFcRKPdvc5HA YIyA== X-Gm-Message-State: AOJu0YxxH92LGIFBiGQh6WXRBUyuL3TRWs2IvRJtAHnl8qDXwgn+tGLm AzS8HD5jL2n5CS3Scrjonw3OvZrAHimTAXxxfzk= X-Google-Smtp-Source: AGHT+IFe3GttulFkV7z44Njo04UBY+6IvPtXvZB6XwmFTRnOVKv7zOSAsKLHdKdqWmDJoPWArV7Wiw== X-Received: by 2002:a05:6a20:244d:b0:187:eea9:73c5 with SMTP id t13-20020a056a20244d00b00187eea973c5mr15354555pzc.3.1702677203271; Fri, 15 Dec 2023 13:53:23 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id m15-20020a17090a2c0f00b0028b43d3250csm333429pjd.43.2023.12.15.13.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 13:53:23 -0800 (PST) Date: Fri, 15 Dec 2023 13:53:21 -0800 From: Stephen Hemminger To: Euan Bourke Cc: dev@dpdk.org Subject: Re: [PATCH v4 0/8] add new command line argument parsing library Message-ID: <20231215135321.5b734a2c@hermes.local> In-Reply-To: <20231215172632.3102502-1-euan.bourke@intel.com> References: <20231215172632.3102502-1-euan.bourke@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 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.