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 2A0B7A04FD for ; Mon, 23 May 2022 08:53:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 070C740041; Mon, 23 May 2022 08:53:00 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id D3F8F40041; Mon, 23 May 2022 08:52:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653288779; x=1684824779; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=jGe5H628q3r7J/wSgUWIKX95ehTnEBB5cWGbnt0wPdI=; b=jsrI1IyeZP2KfubP624gRAyGu0AyRqvpNMKtsi8sqlpA6Pd1jPSgN5Zw uLMXGbtTCjhHugJev5mUr7GS/IwE7JQ0/KKbVeT+ct6teIBDO/euUvVN1 uFsmv+9vBZUtW2UGDmbXdds8A2AoFgNXqMm/wxFDMRGwDV6YKiIaFsIqb n8FAsc7iVYmsn72GleLmjITcVKRdx1vP+SC/NY34G1icK1Bwo7Lqikz1N CTFtfFR3Uk4uo/y49g+Gff9/yjSnxHf7E/PKSIWE+uH/Y7vXGzw8VrOh4 AhHt2zMBdcXxSFO7C18f/FgZI7qlC7q2vG1YL/br08WoK84dP264LJ30n g==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="336184392" X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="336184392" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2022 23:52:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,245,1647327600"; d="scan'208";a="716553100" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 22 May 2022 23:52:57 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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.2308.27; Sun, 22 May 2022 23:52:56 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 22 May 2022 23:52:56 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2308.27 via Frontend Transport; Sun, 22 May 2022 23:52:56 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) 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.2308.27; Sun, 22 May 2022 23:52:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LQCUqRUR8wuYd0i1g7wmq18NO2qIEKdMzDsTaIoK/gjjbbNqvd8h52XsW3aGtEOP3Wnj/Webu2MJMh48cnBw7v5/aZI3r36JvvW9nIQd3RpcbHTGJ+wEXSoMpCAPnjpNpOP6Dz+2G1oY87wKajmryD8sX4L6tBaJrqlas0RsZHRqxPgT/Ap2gQD6GpZqKXI6kpkcgWtfICz5LqdhwuY5gPoYLPS6FrJ52GjFc0A9og0rqWRbZmxkMJHrOnp07meCBZH1ArukZlyKmZvhgOuvjkusZShJAUM6lB9OWVRteiUjyvEq9pmL2TWxb2QXO4tVcRYLShs6NBePR3vBGeYDig== 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=HGmeh5Odt2lVGelbVvGV2tuh1IBsyB0kY3Qy3J6KqLk=; b=ZjqmflWBj+WMBCtcBiQ3NgUi1nZu7DUo7OQf2n7LTJ1iNGkEJkBt0sLP5Z1EthaPFJzM729pR8D1KkODRer6lvm6Ou2rFMtmNotSQWhX8Yf2xckc5d7ZobPI5vUexH7nQPW1CtMQJ4lq3wlLApr8m8S31JR6Ky5E3VEm4/V4a2o7HRYSYWmsMdt6iGH+vq65Te8wnIIegTAgEue2Z7oB+3X99dfGyooo/EvVGH4Rz/l7BUhfTZ+pZPkTbHQqn/E6VOE+TBViAwQvLx/vFV0TZdE3PoUMWhvUWpFptsnkgUY7mS3CkegVDakzPh7bvHZJJkV2sw6LlGLEjEZffPHS8g== 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 Received: from BN6PR11MB3923.namprd11.prod.outlook.com (2603:10b6:405:78::34) by MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22; Mon, 23 May 2022 06:52:54 +0000 Received: from BN6PR11MB3923.namprd11.prod.outlook.com ([fe80::b1b3:ed21:f4d4:ea7b]) by BN6PR11MB3923.namprd11.prod.outlook.com ([fe80::b1b3:ed21:f4d4:ea7b%4]) with mapi id 15.20.5273.022; Mon, 23 May 2022 06:52:54 +0000 From: "Li, WeiyuanX" To: "Richardson, Bruce" , "dev@dpdk.org" CC: "stable@dpdk.org" , Olivier Matz , Ray Kinsella Subject: RE: [PATCH v2 1/2] cmdline: add function to verify valid commands Thread-Topic: [PATCH v2 1/2] cmdline: add function to verify valid commands Thread-Index: AQHYbFwZTSkS1k7VUUKNd4NrQtJiv60sCXuQ Date: Mon, 23 May 2022 06:52:53 +0000 Message-ID: References: <20220520145631.137962-1-bruce.richardson@intel.com> <20220520151240.139566-1-bruce.richardson@intel.com> <20220520151240.139566-2-bruce.richardson@intel.com> In-Reply-To: <20220520151240.139566-2-bruce.richardson@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 81787580-33c5-4e9d-903d-08da3c88dc8c x-ms-traffictypediagnostic: MW4PR11MB5821:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +FkM/i78ndIlRDBSlTjjb2cpXS94MRv8Aj7apZzRDLKhpQAh2h390TUSoTOE/frEVEddiWeAyC3t9F/wmsnObd601lJUo5vjhs6Prd9U+q5wb35XviV1LSxOpBF7BSeYEwStd47c4JSPUbo3ZMycHjDkIdOtSpF65PPFouLCX8LfJ0rQ0mX7rwVmq4KOt1UWKQzXFZBY1+XK3Fi/RPon9Ai4iLE7/+FDG43dw/Sp1GY183rU0XWcRUoOWAKZou1yK0jVm501CIqn6pVrHRNSYC8OkB5tHe2Pl0eLPDI6X4EbMVa4GE/Wnmg9LUZNjcc0vGpwHYSaTmHImnc930dDpzdaK/zNozFju46xALcc29Ed2ebRMh0UuXxcvBcIskculfRheTFaQRkpzcseyv+eO5qo6ZevpsvNPLjYOBt+847dELk3A37yhgqmvIyS1ftEVhhdmJffuI/sUHPoc0QqHXoJEW4v3Gro5xS+q9Wh0KxIyLiW89p128k9kQ2BGAvGbeizHAUF3p41YVCJKfn7TPb6i5vIq9ZToHnPxWmB9aVCqm+9kUgUmXF5dspmpbIAbLeAnIc76f+MbNV5N8GitLVOAmhpQc1Cj+5nYb79tzlulYx2fs/qgt4NhL7Icvps2/TJdm8TDJWHOlHYXM30xZP5FtE6wn7JiFeA4EFTIsicigr6ti0axc2g5QS8IxLRFmzb6xXSx3NbNGwbqGKiDQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB3923.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(38070700005)(33656002)(508600001)(26005)(5660300002)(7696005)(6506007)(71200400001)(8936002)(2906002)(52536014)(38100700002)(15650500001)(53546011)(110136005)(316002)(82960400001)(66556008)(66446008)(8676002)(4326008)(55016003)(66946007)(76116006)(66476007)(86362001)(9686003)(122000001)(186003)(64756008)(83380400001)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3zgYPxq6d84nKh6OucxqAhxpOywkq4Fdfv73UXkFc1kazAVc78tx0AXDcX2g?= =?us-ascii?Q?Myk2qXUkrZJROd6kVQuIAQLvl50Umbs1gbez81Dx1a7W/zETtAEUQb4hsGIW?= =?us-ascii?Q?ALQJw8COLr53hu0q7N193+nMT6QZqEWk0ZTyvrjEiV70sx6R79BIPaXgW8I4?= =?us-ascii?Q?wxsBpD90wqhwjJx+AimUpuKmmmhldkkfNBzrGjjc0iSr+NGju2DP+pKPe9my?= =?us-ascii?Q?w6g68km6wmK1Wk2pSX18ch+hIopJaHFDb5XepodaVNNYfB/DeelZnkvYpvcm?= =?us-ascii?Q?lOHce3JcAeV8A1QehM3yCSWpNkhk5CCwBUOGsda6uQZanA04ayZhkqefZbOu?= =?us-ascii?Q?jhYX0sxZ2b72Z+V89WvTubiVLL6bNMki0KrBmLhMzdtzIB0jbIjTPtStt38v?= =?us-ascii?Q?AnPHOuhqT2vZU0A06q/tpTDnKTwg4TPIRSzUew0M/DiAov7IS5SQC3toD47E?= =?us-ascii?Q?UDxGc2NAPBZ0gS0USi1vH4BEnEqAJZbq91PzK1xMKJQ8EQYiZW2xbspaX65o?= =?us-ascii?Q?ld7hI6/c73Vx6tt6V0PTgntYzjruxqCBF0cBLFX8InU66BWEX6JxnNpWpWkn?= =?us-ascii?Q?kOBZLwDaEDC/zFRZmZtlswN87A4MhIYF8OecrnZ28RNlHmq05UT9dsvO8DKN?= =?us-ascii?Q?gPhw5kNhYem86VJParmBI41OljR7Fb8oEnnFwnn2V6GJpNgjpuhXK3kjNw0E?= =?us-ascii?Q?nWe8MQpBKPUaFUaE7CETdNxtqJq1fNma1TfmI3lIWe5sH8XUoh1wsC+h27hK?= =?us-ascii?Q?j1VjP6oRkGpSCt/MUsi7f4VJyWbDwkmyavTZu/sVTUn9wdCnA10+C2mzzUGf?= =?us-ascii?Q?gy9IkxrdxWiJahu0Qo3upZUTl2uW43fETWyc2LBbXj83QWFdZvFE8l/HV6lT?= =?us-ascii?Q?er06Md3x1aizfm5MWADmYHGy6aNswGHDKdSz9myxl39DAkkNAulMMFdfl6N5?= =?us-ascii?Q?PCVG79H47ypfVd4YB/pQGE6nkmAuk3viK2n59kzEVaSEDd4hRBufulwM1ZLo?= =?us-ascii?Q?jP6h00zsY5misnocA/8mJqtIaFNUHvsoB/GaQxjKSivVP7DSCT4ic5HYkOJn?= =?us-ascii?Q?dJX/xFR2gw8uKjcOWI5yADHvckf+6laSMj5WLcBnYLzcr0ehzd09Rq7vqt4C?= =?us-ascii?Q?BFsorTrUW9L7AgtZ9b6ngBj62+0D4J8AgiwHCJzfs+NyJ/q6pr3PWg7e5nSt?= =?us-ascii?Q?bWJK8rSrVOdPPbMoYSMWwx6bybvHw9wqbEFhJ0WHiwzfog598xG2meUzNJjB?= =?us-ascii?Q?L+iiluTemAQVSBgvhnF/l1m95vJaD/hZy5JGNmEECKJOk8lhVo2/xI96k/Fx?= =?us-ascii?Q?ul0zrhFtPP8FeW86h8G+lFyBwVhRJQ8/b/3Qy1OiH2ECLmvbc0zWEQkpR6Tf?= =?us-ascii?Q?+9T/nPSk/HX/cTg0fExhKK9VtCMoG1s9sYwkH4+HG2Djitnw6trojkAuE4+5?= =?us-ascii?Q?q5fAjt9JjGiRNY9sz7lqogQ/8D+XSdE13UlzX2OEcEXBdspydpvw8PH6zlLH?= =?us-ascii?Q?VoYO9+wxCieRDjHRJ2OocaCd6+cwPHkhvPICr8KS6/Y8I4u9J+bJ5LXwQwZV?= =?us-ascii?Q?WfC9v89OWYa8yjsmfQZzBZImxr5a2AjFdtNeI6VE9jR/dWHyYzEW3Lry2Jag?= =?us-ascii?Q?uZyDFy/gDDmmoLusF4DPMOMjuAU3wTIe27nTHGHv1vkY2j5pj3p5DTd5NiP+?= =?us-ascii?Q?cIP4bVogBweJ/Rtkc1fVfUEBGE5mFIe7BDewZf+ZWoCL79isFvhdH21l/09H?= =?us-ascii?Q?mCBltunKdw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB3923.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81787580-33c5-4e9d-903d-08da3c88dc8c X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2022 06:52:53.9296 (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: mYRlK/gqRJqQxCX9msw+9QAYs0Q3XVqyOdSCvb3Yf5KUAv2JaIm5W38BgNpOPWpRDFHMt6Xa9/mHT/uiLEf37A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB5821 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > -----Original Message----- > From: Richardson, Bruce > Sent: Friday, May 20, 2022 11:13 PM > To: dev@dpdk.org > Cc: stable@dpdk.org; Li, WeiyuanX ; Richardson, > Bruce ; Olivier Matz > ; Ray Kinsella > Subject: [PATCH v2 1/2] cmdline: add function to verify valid commands >=20 > The cmdline library cmdline_parse() function parses a command and > executes the action automatically too. The cmdline_valid_buffer function > also uses this function to validate commands, meaning that there is no > function to validate a command as ok without executing it. >=20 > To fix this omission, we extract the body of cmdline_parse into a new sta= tic > inline function with an extra parameter to indicate whether the action sh= ould > be performed or not. Then we create two wrappers around that - a > replacement for the existing cmdline_parse function where the extra > parameter is "true" to execute the command, and a new function > "cmdline_parse_check" which passes the parameter as "false" to perform > cmdline validation only. >=20 > Signed-off-by: Bruce Richardson > --- Tested-by: Weiyuan Li Regards, Li, Weiyuan