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 A1EEC45589; Thu, 4 Jul 2024 14:02:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8ACEE42EC7; Thu, 4 Jul 2024 14:02:33 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by mails.dpdk.org (Postfix) with ESMTP id 8523F40280 for ; Thu, 4 Jul 2024 14:02:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720094552; x=1751630552; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=fQd51P2A5P+8iqviCMo6eUhAia8fJ1kwXeLKAiR6SdA=; b=CJ4qM2PidWVAl8JeSjaWlWEKWz4zmWsb2nNQkfyVnkz5ygYU/cuREU4y b+l1wgL3SBMttsaDD8TNMkyD6N04ZSyfI3LqqQkV7KGvkzy7lWv0YzX7M K1Ew8DqgHAvcswLqSLnqwQI2B1/GlgQhOT83JqODsuANpxW9Ox9rNMSFx Qpr2zKiSLM68qCmCbm8JjaCJSfNeRFnXZRitl15UxUaMRijHPTbVPK5fK HSA3xLkOhbcVe15NKLNkLDd/9zFWyaigcDxLLi946J67rdTfgH4t4kZsL tTNY2uTm4g6g15g5A+CI9OkUCxTzpgv1byfq+zTZ/D/OLu5Bd4svrr3jO A==; X-CSE-ConnectionGUID: Ea7DdhqVRoW9q0sjNDTTZw== X-CSE-MsgGUID: QKtRGImOQY2PwSET0+jKdg== X-IronPort-AV: E=McAfee;i="6700,10204,11122"; a="27974485" X-IronPort-AV: E=Sophos;i="6.09,183,1716274800"; d="scan'208";a="27974485" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 05:02:31 -0700 X-CSE-ConnectionGUID: 4dfq9eafRuuUdUejDQX+8Q== X-CSE-MsgGUID: 80lFI2OKTJWWxrpMt1gTYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,183,1716274800"; d="scan'208";a="77721664" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Jul 2024 05:02:30 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.39; Thu, 4 Jul 2024 05:02:29 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.39; Thu, 4 Jul 2024 05:02:29 -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.39 via Frontend Transport; Thu, 4 Jul 2024 05:02:29 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.45) 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.39; Thu, 4 Jul 2024 05:02:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X5wUGKKR4FBz7vr3oIV5rl5eWZFE38evry30n2CMvhjCgBqcQaFqDsPItsfjF6AcNKd/ia7jxVBbksxg3vZevsweJvlpmtwikI+ObPSVOpzD+h2158P/GAIKO1rstxzn1wQabN+3Jzl6oWwxa3DoES2LRwZEOlj5saU+Nr5+MizAtqFmhwWWVxbhMGrQMj1ZHqr0gpf8tsjZ5DuhOUlIMO+O+HACPGyEhEob/cHS/2n/D8KmJ/1JXZ8H6PM2qe6fw2l0KpRq+bUamr2L7mBcdjt9Bb4lwWzRqayh5MoLLGJ9fpIkdpp4e6jeV6YYg0U0GsAlHUpmzsnGyb5sATMt5Q== 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=TFeBz1GrDFmgWBFbv5tPjDbE1mgJ0Y6m5WfsSjF7+Bs=; b=UFSmYe0UDOLfNBN4d9n/wWOLnYSUpCigGhesR7/be4dSLofPxE5Z3HCptBPsf5USll8z+NPAdBDlMvC+cZ/hHBiMT7B4wLTKZ2Xs+verYHFpkJV5Z5ugURI2ZfSou8yPkUQy3/T0t21Kj3rGg1oQ1zwoiCLNALaMhnwPpBmMj0d/Dz518D1ejQp1m5+S6iUSrw3i6/dWmRh/3+b0H2cFsEMHj2sb7FnlOoHT79z68ejyWho503j6bYqrzhLMqFQWazLXynLt0wIWYzqsH9MSRZaVr5rQ5Y9fRlcGH08/PqXQyLea5KKkK1he8rfDYh0eM5/YYW1LI7U/DMTxhfcL+A== 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 MW6PR11MB8309.namprd11.prod.outlook.com (2603:10b6:303:24c::19) by SA2PR11MB5001.namprd11.prod.outlook.com (2603:10b6:806:118::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.34; Thu, 4 Jul 2024 12:02:26 +0000 Received: from MW6PR11MB8309.namprd11.prod.outlook.com ([fe80::ba43:b01f:aee0:10a8]) by MW6PR11MB8309.namprd11.prod.outlook.com ([fe80::ba43:b01f:aee0:10a8%5]) with mapi id 15.20.7741.017; Thu, 4 Jul 2024 12:02:26 +0000 From: "Stokes, Ian" To: "Ye, MingjinX" , "dev@dpdk.org" Subject: RE: [PATCH] test: fix option block Thread-Topic: [PATCH] test: fix option block Thread-Index: AQHadfcBzIeopgRym0qlyoy7kWzSsLHlXNKggABixLCAALYf4IAAsPXA Date: Thu, 4 Jul 2024 12:02:26 +0000 Message-ID: References: <20240314094626.1068059-1-mingjinx.ye@intel.com> In-Reply-To: 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-traffictypediagnostic: MW6PR11MB8309:EE_|SA2PR11MB5001:EE_ x-ms-office365-filtering-correlation-id: 069820f7-0f6e-4749-5dfa-08dc9c212bef x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?o4AEsEO1KvDwhAPLtRA6fh+4XKF7DC7GY7T96bkBDN12ciHUfqculVp2LTyr?= =?us-ascii?Q?sEgdMZHK4Z2RgHChj3TxGBopZWR03nKPdtaIs4azeaiXLryCYECIwQa3y7rL?= =?us-ascii?Q?zqIFTuvFw6t+X1FlWoTknGJXadTLMzFR5Y0XCRvNXX3wktSXtzZHZjjajmEQ?= =?us-ascii?Q?5B7dsVi2nKK2fAUd1yfQGogLLiAtK8fYDHhV0VVyLWZfikhc7mzD7mhgmgzx?= =?us-ascii?Q?SlLMxm+89yffZHhgs0ZaZEvqVa7vBzBNRvhWk/FtRYmk35Cu9QmEIv6U+8UQ?= =?us-ascii?Q?PJ1mCHReCS6AVDEjuSZfne8W23ETUGmdcVJS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sjJ/ov81UN1rXoOxz0pWLDZp/Iz2kqxjBHXM0I0m687?= =?us-ascii?Q?vK8E5J7cUz0NHHHDsgXVek0zmnBzhPTDqonLyK5LcEV3C22t4Th2UQ2GOq3F?= =?us-ascii?Q?PdOP4di4XiLFHlFdU4PPMOTjL7m1C1jrvDngrDdUVHtjSBCeIy0jq/OSxTd4?= =?us-ascii?Q?kDIvkY1YxzZAN1epf0Q3iqrG217rY2T8T10c99022yBs7K2LVA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW6PR11MB8309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Cnm7F9lbBQV6CFmYLPbEJ0mOpknOBCsooLjoKl9e5q8HcU8eK9qkDH0+X7jU?= =?us-ascii?Q?TwvicWJoK7NPqNCmSfGgXxXITYU79oES10Hb81Yw2G/XXEZj7lCta/dlIdw0?= =?us-ascii?Q?QmoPC7IXmBuNxHiwxzgbsofRZvAl7peKGrMlXFyLvjRjaUdAe5WcJklcjI8z?= =?us-ascii?Q?Z4nY/44cUAUV9or5TGGweGKAkG8YMLiOnlJg5+gL+squochA7JRchrG1RBLw?= =?us-ascii?Q?mAUGnQ1Hnd3GV/7wsonPJCsol9epqBpR+24WL8pGPcQ6K6GkJCuzdkTnu7Kl?= =?us-ascii?Q?ekJk6WkX2WHjUDxrw6ASzUGZEJubt4oPYytq0oGy9da7ojCqyzFdk0GxZbVx?= =?us-ascii?Q?Dt8nZyzXHrzfryD45cz9Nnip5A8Pc+vzHd+qZSzJfMznLui5pO3XpESI9P5M?= =?us-ascii?Q?wqCjBw/EsbeEmdqUtYgnxZI2Hf12SHJvCUvICV1mFbagS5Bd31vEZuDC1Phn?= =?us-ascii?Q?TaIiGEWQ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js//izm?= =?us-ascii?Q?9/lZmWlHO9hbgQMAVjcsHrV/DhxIGllXGwvlbUiMPYiLzYjmL9GvwaIl00HU?= =?us-ascii?Q?VDOr4wJ2kO2CC2Qj28QmdTY1gwdLWNZT7S6plmnXQ2ZTlfUB93bu9HKTARPF?= =?us-ascii?Q?geTFF4tUMEv/SZhB/aJi5uiYs7pdn7IbJB50fGA9waGDYhv8RvBhH41cvO2d?= =?us-ascii?Q?QBfrKRtPNgsVAhWwhSPIcKUdHTuGkOHPffvJyBYe?= 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: MW6PR11MB8309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 069820f7-0f6e-4749-5dfa-08dc9c212bef X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 12:02:26.4301 (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: KLkqs4MFYirNYZQ3s9TyXhdT6/R6U5rXLheUKX4+wqPiCYK1c3fekSzODW2ZrhUkYpbKKIgj7fdDMEk9PRWLPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5001 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 > > -----Original Message----- > > From: Stokes, Ian > > Sent: Wednesday, July 3, 2024 10:35 PM > > To: Ye, MingjinX ; dev@dpdk.org > > Subject: [PATCH] test: fix option block > > > > > > The options allow (-a) and block (-b) cannot be used at the same ti= me. > > > > Therefore, allow (-a) will not be added when block (-b) is present. > > > > > > > > Fixes: b3ce7891ad38 ("test: fix probing in secondary process") > > > > Cc: stable@dpdk.org > > > > > > > > Signed-off-by: Mingjin Ye > > > > Hi Mingjin, in general the patch looks ok to me. > > > > A general question of the behaviour of block and allow, is it always th= e case > > that the two are not allowed to be used side by side? > Both cannot be used at the same time. >=20 > > I had a look through the EAL documentation and didn't see and mention o= f > > this behaviour, but maybe I missed it? > The "eal_common_usage" function has a clear description, see below: > lib/eal/common/eal_common_options.c:2206 I understand that, but that is a comment in code, I think the behaviour is = worthy of being called out in documentation API too for usability factors. Thanks Ian > > > > Thanks > > ian > > > > --- > > > > app/test/process.h | 17 ++++++++++++++--- > > > > 1 file changed, 14 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/app/test/process.h b/app/test/process.h index > > > > 9fb2bf481c..388c7975cd 100644 > > > > --- a/app/test/process.h > > > > +++ b/app/test/process.h > > > > @@ -44,7 +44,7 @@ add_parameter_allow(char **argv, int > max_capacity) > > > > int count =3D 0; > > > > > > > > RTE_EAL_DEVARGS_FOREACH(NULL, devargs) { > > > > - if (strlen(devargs->name) =3D=3D 0) > > > > + if (strlen(devargs->name) =3D=3D 0 || devargs->type !=3D > > > > +RTE_DEVTYPE_ALLOWED) > > > > continue; > > > > > > > > if (devargs->data =3D=3D NULL || strlen(devargs->data) =3D=3D 0) > > { @@ > > > > -74,7 +74,7 @@ process_dup(const char *const argv[], int numargs, > > > > const char *env_value) { > > > > int num =3D 0; > > > > char **argv_cpy; > > > > - int allow_num; > > > > + int allow_num, block_num; > > > > int argv_num; > > > > int i, status; > > > > char path[32]; > > > > @@ -89,7 +89,18 @@ process_dup(const char *const argv[], int > > > > numargs, const char *env_value) > > > > if (pid < 0) > > > > return -1; > > > > else if (pid =3D=3D 0) { > > > > - allow_num =3D > > > > rte_devargs_type_count(RTE_DEVTYPE_ALLOWED); > > > > + allow_num =3D 0; > > > > + block_num =3D 0; > > > > + > > > > + /* If block (-b) is present, allow (-a) is not added. */ > > > > + for (i =3D 0; i < numargs; i++) { > > > > + if (strcmp(argv[i], "-b") =3D=3D 0 || > > > > + strcmp(argv[i], "-block") =3D=3D 0) > > > > + block_num++; > > > > + } > > > > + if (!block_num) > > > > + allow_num =3D > > > > rte_devargs_type_count(RTE_DEVTYPE_ALLOWED); > > > > + > > > > argv_num =3D numargs + allow_num + 1; > > > > argv_cpy =3D calloc(argv_num, sizeof(char *)); > > > > if (!argv_cpy) > > > > -- > > > > 2.25.1