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 9EC6545587; Thu, 4 Jul 2024 10:09:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8EAEB4025C; Thu, 4 Jul 2024 10:09:22 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mails.dpdk.org (Postfix) with ESMTP id 12FF940156 for ; Thu, 4 Jul 2024 10:09:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720080561; x=1751616561; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=QIIQi0HAcxYOIVbS8etB4KcNpl/E4ju9hwXxQgRwWWo=; b=BpgoCdF0tSS64Og23vuqF8+lEYxwt+wkxDnLMSYjRcjiKRKNBmuu5/mS NSJT6HNCgfHM0VHf6zzg6dm4QtHjGk9E+fl1ThLOuowwWm9ycLSdAz1sV A1ccf1qeotU1BO4gK8oqS4TtwDl8z0p5JErkrPDPyQBuxo2qE1eZsDTA2 VLedTtxrZx/TG6tn7hozhYhc8Z70/7+tRAI2e8qRLZNyrBASmQfgMfEgO NcBSZ/RE4G8lTGZIIereczCI2EdWDhAa9oCAc0aHFYgf3L6MdpzxAR78+ uOwVwOJX+1OsXe55A/i+Vet58hgRfDZvYEea6sXcqPDGYu3ir58Ic4/bX w==; X-CSE-ConnectionGUID: HDil3tOKT3imbvWQ/EVXJQ== X-CSE-MsgGUID: BQvUUUMLSOuToY1bzTXNgg== X-IronPort-AV: E=McAfee;i="6700,10204,11122"; a="34883940" X-IronPort-AV: E=Sophos;i="6.09,183,1716274800"; d="scan'208";a="34883940" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 01:09:20 -0700 X-CSE-ConnectionGUID: oZHfRDRJSfKnAiKcz8AXhw== X-CSE-MsgGUID: y5Ffrm5GS5ucq+o5bcqu0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,183,1716274800"; d="scan'208";a="84063073" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Jul 2024 01:09:19 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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 01:09:18 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) 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 01:09:18 -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 01:09:18 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) 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 01:09:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cq9RrPtDfRLZbJkaKO9+5DxDitmMO4fUKusZFo2PDeNrrnOZLEGLQiXD+2WZIia3omf91Qw6FPPrM4wRhopyzISxF+RbBrWE7pyMP2Rbe3T83ITXk5MHGjZJI5GECWGbyPCna+TROh8wtbcMmEgnrRhL1Ba0LAt7gCLglasU4y0hdF9Kmwvqb43pRm36+HU0fh7xHuipF0YewcSDB683xyMYbXlM5SEBGp9+flAuKe7mlaIRFKK1cB/TZ/gTkwY8Mpin0u35KCtN7TfY+dApVnmLxQX0XIiB55GF/wPRDWUOXucjUXMJlxWIQ+I5ULmdHH+6BcWigsJugahQz3kf+A== 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=3O86dXt9CbtDyq3eN5KMLb8tlHSY6wT5ENArp2kDeRM=; b=c0BHGknx8PUlWPVeiAdnmrUUxugfJutwOyAvh3OM8uwsY4+heYQJWvrCYUGEgO9p2B3h8HHi7jYDEV1AATGZWw4MDQhi57lM5No5RsElBp58vLarCSlXJlbxL/P9sDnZ5F9iKpD1ecdM0tqRXOy1/yZ/UnQugQrKMYLSc5C8/8fUPJHaIBiR4fx1D86qJ/Q96JQtXaZB+Ln0kcPyOb4sE562+rJydY58a6JpJ8W0Kja1MQmPlrAynQV2z9DBpaE3MjvdzW2lSw0FbzShhgq/HCxsw39URcZGncn7eki6YriXpoEhaymo25HSy7rC1TCyjZeTDPLErmDm4pp1uxKbWQ== 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 LV3PR11MB8601.namprd11.prod.outlook.com (2603:10b6:408:1b8::8) by PH7PR11MB8478.namprd11.prod.outlook.com (2603:10b6:510:308::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.23; Thu, 4 Jul 2024 08:09:15 +0000 Received: from LV3PR11MB8601.namprd11.prod.outlook.com ([fe80::7878:b054:82bf:b5b]) by LV3PR11MB8601.namprd11.prod.outlook.com ([fe80::7878:b054:82bf:b5b%3]) with mapi id 15.20.7741.027; Thu, 4 Jul 2024 08:09:15 +0000 From: "Ye, MingjinX" To: "Stokes, Ian" , "dev@dpdk.org" Subject: RE: [PATCH] test: fix option block Thread-Topic: [PATCH] test: fix option block Thread-Index: AQHadfcBzIeopgRym0qlyoy7kWzSsLHlXNKggABixLCAALYf4A== Date: Thu, 4 Jul 2024 08:09:15 +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: LV3PR11MB8601:EE_|PH7PR11MB8478:EE_ x-ms-office365-filtering-correlation-id: 32164165-8482-471b-03fa-08dc9c009899 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?pHBXJUCuXCOWJSnwxMUz0JSDsFOGYuvDDtXSRdm3HPRuuqCnf0xd2kSnTbD6?= =?us-ascii?Q?F7D4aaspieW4VZJIJPeWM9gYu+Rv21uLSw2yEetoEI20upP40ncXjb4gl8Bs?= =?us-ascii?Q?n1F6q7KHFanhBRBbB1ZoFX5TZhmLip0dA9+VDRkn1B7nMxNwr9UpFJkh6zNc?= =?us-ascii?Q?469G2hdVgHWWiu6hPFLEnx1tXr6N61Ef67yOCxkctXAkccoi55xaR0cVdmzu?= =?us-ascii?Q?r+4Zj5IH0xrvV8fx5OXxyotmS53sNymKPUSs5C4KIkuqdaqsxKGlN+PbIfq9?= =?us-ascii?Q?/XJIksl6Er4ryC35ZrFu5OeTtROinx4HU1bfzJefOENcXZOkTqi2q2LE1jF7?= =?us-ascii?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AOAKQZvXuxWauQ?= =?us-ascii?Q?m58LWWQj6ik9q0ye3QTKsayb58f4ZL4BaMEW1hhy6S8fEZLBX5bgzLXElyNk?= =?us-ascii?Q?2yP69IB3okkIwfj2aQuD05nQizakaIijg+hNer/cvtDX6P3n3DMixme3rRqp?= =?us-ascii?Q?xuUnmt7cC155HBGOICuOkWkR+v52UgL1o417DnzoEK1ltRmSNQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LV3PR11MB8601.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Ktlx6SYvdPkk2mV2FFF3JhKwNj6pQB25zdnGVDpClMo/V/CnZiq2jK9Z20ar?= =?us-ascii?Q?Hbn6VNc5o90foYOdEeX06pB0SPd6jBozeXPviXdt1rUIYVT4V7D+1JE2G1nL?= =?us-ascii?Q?FyH9WmBeKqkLAhros9QObiIvbIqMuhLRClFeU76RaF5ZkUNpCG982M6kdT1D?= =?us-ascii?Q?Pvn5/A+iiZyshevQMxuMiLqgUquC7qc+zQoA04UY0m4NcMCYAKXHYK4hCed5?= =?us-ascii?Q?w21z2KXabDH6SFAKgPMWn4OzAW84Uo+/PofZj/sK/YljbNU5+IQz47PjVysl?= =?us-ascii?Q?JhKXIyArh+5Xeo/HaiOvlV2XIWW411+Eay8zUG2Sx9PFA6c338oUtvCLkvKK?= =?us-ascii?Q?+/4uUKGFJTC7i/VbTL9L1hYqxc+dqaOoL276RulnuUD5KJSRBs07SiP7zva1?= =?us-ascii?Q?3Ni3qrcjTruxlPWFjDyvElbs/kjc+j2/5t5K3Cy0Fzj34u5IYibkdqYO7s/7?= =?us-ascii?Q?ERN/QCJfE3lk3mWhmqvUoGZhjbo9w8IHBQyBy61RVABcsdT4upV0g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coTPW7c6ZTvEbRLG+6VnOOFc4MheiPmbat9ehSIzr+HUuZWi8?= =?us-ascii?Q?1WMLYCM73p4M9/q2zdf6lRJViWSY1k/HWi6wDEssartOMkzP/HtZW4X7ANZL?= =?us-ascii?Q?9OmADsvn89Xev9wnz1MzzL/acyMcq6z2jHUelvr/RsCcqApRIPWD+yHmA7UK?= =?us-ascii?Q?dCXnONyRPZ3pmOb9bawPyBPcREc37HGv8X62uuvA?= 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: LV3PR11MB8601.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32164165-8482-471b-03fa-08dc9c009899 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2024 08:09:15.3558 (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: JdR5VPFQWZQj6dpmLZEYGpshBHZ6IkZobFpVcYSTiaRcY7gbG5paN3r5MDNQF+mtuhdcojnbBVcGblLJbgFAbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB8478 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 >=20 > > > The options allow (-a) and block (-b) cannot be used at the same time= . > > > 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 >=20 > Hi Mingjin, in general the patch looks ok to me. >=20 > A general question of the behaviour of block and allow, is it always the = case > that the two are not allowed to be used side by side? Both cannot be used at the same time. > I had a look through the EAL documentation and didn't see and mention of > 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 >=20 > 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