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 18BBC43351 for ; Fri, 17 Nov 2023 11:24:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E6C5F40648; Fri, 17 Nov 2023 11:24:56 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 8EDEF40273; Fri, 17 Nov 2023 11:24:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700216694; x=1731752694; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=K/cBtjQxFglsx1VOyqwPETq4onMdkAo/NTk1FroVK5Q=; b=PEZeIpe/ufoFguHfakwreZcuKBFRRcmYHkI3QiK/vyB9OFYLde8/nF7M 4BHbfcIyC8xL/HE2WM4YgIXPWGSiHIfDUIBwTNEO9Jb2RXLcX1qGSXDsj vidd+XhoRng9L32raqDa03Xb8w8soDR/t9UreOIMIkBnyIrJS3FgSgbyJ p3+d0iINh0iBawOiosnMF1ByjlYGY+lMAp/wLGQkMMEpkOUmkGfEjxbXX iRM5AdWvB/26HxGXudrm89A2bg9y6D9dWEUmnvxlF0YUqmQFrIOIEbgri LliDZPFvYpI4WKAOOBY7DMfJ8emhaw8j8egAfTwln5rBeS0aLda+/jHpa Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="370630376" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="370630376" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2023 02:24:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="765594668" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="765594668" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Nov 2023 02:24:53 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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.34; Fri, 17 Nov 2023 02:24:52 -0800 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.34; Fri, 17 Nov 2023 02:24:52 -0800 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.34 via Frontend Transport; Fri, 17 Nov 2023 02:24:52 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.41) 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.34; Fri, 17 Nov 2023 02:24:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e/hvcpuC8kV8GfvmkOa27PNcA49eBV2685QhWwQaLtHeK7rdUTYlKQdfG8/z2DN++/QbcAbTJafPAY+v92Zac90P172UE5QtP3qj+uvffC50BzY3hxMCUUJpSFfJYP2K486qlTj7isjh/+g7KnMFpokoFOJJklNqs1I4l19mZ/nC1jjR4Hy556w6HvRjOaKO1bJMy3nIMPuJl67BzVxiquh0FAeqPXJOsRNMh34tred37kpSfwCwYy+fHL95p4XAYj/xnxlYj6kcvYulIo3FRrzsKU//RL2kjXI49StvR7JDAtU6PS4hXQ5pqxtqVHk7hWExiXStZifRoLB8wxdDqg== 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=U0mjOqTZ3Gc/oY7HT8+mm/7kpsfYXkVuaP0FtuMe6fQ=; b=atG5p5GCI+Lo09pRzvDQNuUk09yIDNBtbruD1eQu6UYY8kvmzLXxKPVSW71NPqAQl8PLubzv2xRILgA0wuTMd5LSHf1LdIdhRNS81RweVoC4wnHcOzkykz0CmeAsiS88OekW8IC2D0Wkv0iHkPCf6kF1XVhh3iNFhkGrjvrKaILfWg60eMtiP+sx2KvvmzCTX3/xmQXQy+Ok89OvsaxjiwEJ528Gk3p4na9hiLTaBGCgSOVk4boUfsLv9XHafaF1af+wjKvV4UCNnYHHt9a8wTmlmJ7HUrVGg8evxRjCUJurzt9GNkKT2Kp+g2KMltWqDh4UspGnaPd19OVhUtv5Kw== 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 SN7PR11MB7139.namprd11.prod.outlook.com (2603:10b6:806:2a2::14) by CH0PR11MB5706.namprd11.prod.outlook.com (2603:10b6:610:ed::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.23; Fri, 17 Nov 2023 10:24:41 +0000 Received: from SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::5216:6b58:10e7:9875]) by SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::5216:6b58:10e7:9875%7]) with mapi id 15.20.6977.032; Fri, 17 Nov 2023 10:24:41 +0000 From: "Ye, MingjinX" To: "dev@dpdk.org" , "Richardson, Bruce" CC: "Yang, Qiming" , "stable@dpdk.org" , "Xu, HailinX" Subject: RE: [PATCH v7] app/test: secondary process passes allow parameters Thread-Topic: [PATCH v7] app/test: secondary process passes allow parameters Thread-Index: AQHaFudYLADW4HhvDka1bDhMv9YDyLB+T69g Date: Fri, 17 Nov 2023 10:24:41 +0000 Message-ID: References: <20231113104222.85891-1-mingjinx.ye@intel.com> <20231114102815.409998-1-mingjinx.ye@intel.com> In-Reply-To: <20231114102815.409998-1-mingjinx.ye@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-traffictypediagnostic: SN7PR11MB7139:EE_|CH0PR11MB5706:EE_ x-ms-office365-filtering-correlation-id: ce73346a-b9fd-42ce-b25e-08dbe757694e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HEdqai69XC1JHeiWoXzKNvwX4NH71t3LbxgGHbtjWPVD8Uft4Wy4Besi0s3EYw3FBo6Xu8D3eklZyWCImg8TaZyeXbZFLGCR7+r5P6wJh637cbhYIeydmxLuG4iqYSVKepe+z9ZGUGpvzuIQcGqKZ+uq1p6isfJnjqRF9RpA7++/aYTNaJ8uuictirkZeiAWC2CP7mwtjdith41ruHFGFkQU/rJBOAqI3HlrC3iChtkTHu6XTRWGlntXf2pcjsEoYB9ITgxr2ZVHzaT7LjPbGNuEn4drdQ7J5M7zxfkDv3609Y1KBKLDEfEOMgGgB6ItMxwvENsTMEISN5vWSxY6OmdojY+ygTbFd/7TRpTyY2WVMFmNEqC2X8ve/jpljSqOg4/tPjF7kS8UX1MyTMjpXq1OUbeaHftPomkYS2Az8TnhV7OivPxGXSIwe/NGsUlgRGjR9BsuMI6UgGdzxCTNDDWeTB8OylXD5SXZgmeP9R6Vp7feXf+RTM25A7nrnWnDOcxfex3ZOP/9Fz7X2mrN39u8jIhpj2vynKq6vkd4DQII0dAyGiXkr2iqVTBunqU3vg9Ex6IMvsGzU7VfWgG8Sv8lW72OuN9dpVRIFTOcwL4RaehjhSDH0AVw9UmMj6ML x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR11MB7139.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(39860400002)(376002)(136003)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(122000001)(9686003)(71200400001)(86362001)(450100002)(2906002)(478600001)(33656002)(38070700009)(82960400001)(53546011)(5660300002)(6506007)(7696005)(41300700001)(26005)(316002)(6636002)(8936002)(8676002)(4326008)(52536014)(55016003)(76116006)(66946007)(38100700002)(83380400001)(110136005)(107886003)(64756008)(54906003)(66556008)(66446008)(66476007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?e+/wLso0T7R+BCnUukDcGOz6q6cNtmvDGf/s0uuQO+IdDXTmO2nvWyBjI/W7?= =?us-ascii?Q?ki3kqbhfvnenK4a4myvHUH3YTvCosLIgYX1P3SZpr9UFy8l2ppLe2TllbM3k?= =?us-ascii?Q?Y/XLFDgMsRBOKneO7WaYKBr3M6ijMWCCAeMTPMFMD+FgHfHu32Pd4yERO77G?= =?us-ascii?Q?3O6dAV10GN0AhF0ZXd10K1Bh/MGu0JDfOXConAJqg+UGAsjD3Id+PrXT+81w?= =?us-ascii?Q?weqehos0h2JOrBrcxMM8RKRm4n8EpukPrXsKuVAiAVN5L95/uy2MXFi8MmQf?= =?us-ascii?Q?t23yge7Omv0jvyycOanLktZVvMyttPvKMgMr5MAWeL0gKAk/Lpoo8CWDg3NJ?= =?us-ascii?Q?UjTdg7DREnsdJm7YiVBQ5Dv3OMhrIDLdNhVQPBDUXGRp+vXRpy73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vx8y51CvjLxPVkWxPu5I78dOLYoEvHjrU?= =?us-ascii?Q?p1R149p74Gh9bo5Za4TJIpq1ZGRziDHWQqCKMH9UBjmGXxbWG1ggfsEdpeJF?= =?us-ascii?Q?3gNDBEFiY/2nhnNG7Pp5N0tE+uVVAdhdd0NCfhc4fDmA0iqmbPL3m5Uyd7iy?= =?us-ascii?Q?cfUwLEDvrZrolem0XmA6sqlUj5cRiqvU0Ct8QE6ngmJRtmMMxeMwxq3p/tKe?= =?us-ascii?Q?vXNei3E9wNCCGF4Y/ikb1ohUYF877929Re30rvhoL92xVrxFARfYx24/1GLS?= =?us-ascii?Q?ogKuI3p+YD6MbPQPWNfDgd0ChFih8lqG8YtQLUKB?= 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: SN7PR11MB7139.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce73346a-b9fd-42ce-b25e-08dbe757694e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Nov 2023 10:24:41.7835 (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: 92YotJBJgl6FDzNjxpmjYmLLa/T4EMAHcugmxu5nDvtlNyJ78C7uQgylzOvczES3qXAVqU3Rd2nHhER7BGCRuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5706 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 Hi Richardson, can you please take a look at this patch. Thanks, Mingjin > -----Original Message----- > From: Ye, MingjinX > Sent: Tuesday, November 14, 2023 6:28 PM > To: dev@dpdk.org > Cc: Yang, Qiming ; Ye, MingjinX > ; stable@dpdk.org > Subject: [PATCH v7] app/test: secondary process passes allow parameters >=20 > In EAL related test cases, the allow parameters are not passed to the > secondary process, resulting in unexpected NICs being loaded. >=20 > This patch fixes this issue by appending the allow parameters to the > secondary process. >=20 > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org >=20 > Signed-off-by: Mingjin Ye > --- > v5: Optimized. > --- > v6: Optimized. > --- > v7: Fix CI errors. > --- > app/test/process.h | 46 > ++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 42 insertions(+), 4 deletions(-) >=20 > diff --git a/app/test/process.h b/app/test/process.h index > af7bc3e0de..06b2f8b192 100644 > --- a/app/test/process.h > +++ b/app/test/process.h > @@ -17,6 +17,7 @@ > #include >=20 > #include /* strlcpy */ > +#include >=20 > #ifdef RTE_EXEC_ENV_FREEBSD > #define self "curproc" > @@ -34,6 +35,34 @@ extern uint16_t flag_for_send_pkts; #endif #endif >=20 > +#define PREFIX_ALLOW "--allow=3D" > + > +static int > +add_parameter_allow(char **argv, int max_capacity) { > + struct rte_devargs *devargs; > + int count =3D 0; > + > + RTE_EAL_DEVARGS_FOREACH(NULL, devargs) { > + if (strlen(devargs->name) =3D=3D 0) > + continue; > + > + if (devargs->data =3D=3D NULL || strlen(devargs->data) =3D=3D 0) { > + if (asprintf(&argv[count], PREFIX_ALLOW"%s", > devargs->name) < 0) > + break; > + } else { > + if (asprintf(&argv[count], PREFIX_ALLOW"%s,%s", > + devargs->name, devargs->data) < 0) > + break; > + } > + > + if (++count =3D=3D max_capacity) > + break; > + } > + > + return count; > +} > + > /* > * launches a second copy of the test process using the given argv > parameters, > * which should include argv[0] as the process name. To identify in the = @@ - > 43,8 +72,10 @@ extern uint16_t flag_for_send_pkts; static inline int > process_dup(const char *const argv[], int numargs, const char *env_value)= { > - int num; > - char *argv_cpy[numargs + 1]; > + int num =3D 0; > + char **argv_cpy; > + int allow_num; > + int argv_num; > int i, status; > char path[32]; > #ifdef RTE_LIB_PDUMP > @@ -58,11 +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); > + argv_num =3D numargs + allow_num + 1; > + argv_cpy =3D calloc(argv_num, sizeof(char *)); > + if (!argv_cpy) > + rte_panic("Memory allocation failed\n"); > + > /* make a copy of the arguments to be passed to exec */ > for (i =3D 0; i < numargs; i++) > argv_cpy[i] =3D strdup(argv[i]); > - argv_cpy[i] =3D NULL; > - num =3D numargs; > + if (allow_num > 0) > + num =3D add_parameter_allow(&argv_cpy[i], > allow_num); > + num +=3D numargs; >=20 > #ifdef RTE_EXEC_ENV_LINUX > { > -- > 2.25.1