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 6791843E57 for ; Sat, 13 Apr 2024 14:56:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61C4640294; Sat, 13 Apr 2024 14:56:01 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) by mails.dpdk.org (Postfix) with ESMTP id 6D151400D6 for ; Sat, 13 Apr 2024 14:56:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5oTAuG7zHtLb/uubI96BpkEYnaw9aJbrgllpds9Q3iiJuNmEjGm9ZeebMsYMPB11tMlmcvov/wFqXwcfvc29KbctFo6oUId+xhTx4Lyhp/Rc15yEoM+KyImfw/1Z/Qewj90Lvr680UVSj5v9cz17fKug6JrWvT1R7Ei12zEqdOgVc+4YusrEQbv1fruHn8faFVuMTVnzKsrxGQVGIqPWl8UBjUk5b4ZnioIoLr5DBpvKVkWb5nVaJf32rgkClo0zvWZa5etZMBiqgnJS2F07Yw6eJgWR715k5/r24c4e98taetMPXKik2kvok1Ybp0w/YTTuO5ftg/z4W0Jp7b0BA== 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=jye9R2FjsYjs7k4PVIdVpY7ubwZvGGIJ8pU6kgtRTdg=; b=OwCF2R1gZP6fGBop7kA4FYmK27QmyoFWB42VLIGqrOQKf9cVGMYMjC8/KInk7ah35luYk1rN0tpF2HaKKi5pMhX0HnF0GjmDPgGVHSTUiXcQ/e5zl9YQs+FmqqykBa3nPKGOpgT2lR0MGIVBuKbFikIr2ghgTBZe5iC2npcmu7FagXHBOmdovBAM7fS2vAa0Entd9Yl3MGpsPWNdU4QW+3aqgi9QfjLaHXzvooTm0QIlwP3C6Ao5ScLAFepMEzFIc1afk/3d4kBzBrFpP3lRRrOkfMuno/wDd/6RSuYZzRefyTc1NPpmwLg7tVf0n953RPKoffQ4ybGJr/8Py66nqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jye9R2FjsYjs7k4PVIdVpY7ubwZvGGIJ8pU6kgtRTdg=; b=XVaHnAbm6ShCayZBnAufdxbyR0i/+HKdxyzKFynjJ/LgQikht3ozGokmcdBzqLWafEXHMskCcuaozIynlaIHOrdrohRAycFozn2KmO+dmWvZswccmT+b3pNTArNL0zSXmmtKMMrt1+WEc8yrn+yctLnNqrsAjc35ihW4J5puZtX7xkayXyaxTRZtqWB2zNy7RbsO74TGi6SgIg+SgHZPIWcMlWqordurR6lMQ9CHI78aP/2iTK1FkyBgp3TjWRdFVKlw628bJ8magKqO2FGkB/i3LWkgedE8SOwad4NmGArquiia1uonPKg2mC14t69t1hkomCmJ8J3XYnFg89lXqQ== Received: from SJ0PR05CA0135.namprd05.prod.outlook.com (2603:10b6:a03:33d::20) by MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Sat, 13 Apr 2024 12:55:57 +0000 Received: from SJ1PEPF00001CDD.namprd05.prod.outlook.com (2603:10b6:a03:33d:cafe::76) by SJ0PR05CA0135.outlook.office365.com (2603:10b6:a03:33d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.12 via Frontend Transport; Sat, 13 Apr 2024 12:55:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00001CDD.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:55:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 13 Apr 2024 05:55:49 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Sat, 13 Apr 2024 05:55:47 -0700 From: Xueming Li To: Mingjin Ye CC: Zhimin Huang , Bruce Richardson , dpdk stable Subject: patch 'test: fix probing in secondary process' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:49:03 +0800 Message-ID: <20240413125005.725659-63-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDD:EE_|MN2PR12MB4192:EE_ X-MS-Office365-Filtering-Correlation-Id: ccdee8db-2d3c-4315-1646-08dc5bb91024 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JcQWHVy0Qp0hLgRbvDC+vwGbMq81u4yR6PyTLlxywCs69kML4sOAzctNy5n307KoXewTFXvX7yhb5foOtYY9X9oFk0fi4zwLj0wxH3KF16l43D31+S8BznkBUjhxn7J/DGHOLuxk02T8xWYRrF0VZHZB1tvYj3D/hN6LZn6YRz2iRJLceId+yvs+xEu6VLWFNfvY0pxvrp9hU/80LMOjos4L9Rpr6FRyRKIlwz3XKRHmb4Oerld9K5DkV8H2MCW0nkN0DtrLW8jrvPPjDzkHz+RZuzFhJDLJ0VS0ABrlRlIc7UidU31IWoFOcl0V1Y+Vi5dyzQh38asYKPaC6u3zdJAfRJzaSZDiLG2+HrgFO94PkxkuEPTtI5qWyqNGbRxTAX6zz1oAe3TiAu5rZV+Xh+iOYa5l5/tgFSHXaIiJuiqwr0QAjEdT2Gk/75+iI+p45Fb6z5txKYiSU1VUnYkYkOpMUDJdDSgEhcXnOEAwKRT1mseEzfcY7v/0Pp/2R07bcmPuZBBIVA7jejLBb2HGXMqcrBd60qqZPcaz/sh34dTjtqgrAp8+eR1iXZm3PdNaTBR/HPRHy1Yd0i9+wqUbGRwDdY9pGEqMnsJPL6OT5yXZmauMQbq64GE+tgMttizLpAPfywRUAgIs1kZWBNLVC4lCTpxjrdoSkKL54mgQoYsw4QLqg/Y+L2NyKJZEl7lwgQ40BCO7iVefe7lgtG02scyEt7L6f2Ob4Ul51ntR65ZL95RVr9df+hYzdK0Vd325 X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(1800799015)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:55:57.7333 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ccdee8db-2d3c-4315-1646-08dc5bb91024 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CDD.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4192 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, FYI, your patch has been queued to stable release 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ef4c8a57f320f01061b399b62e9dac7836dea83b Thanks. Xueming Li --- >From ef4c8a57f320f01061b399b62e9dac7836dea83b Mon Sep 17 00:00:00 2001 From: Mingjin Ye Date: Tue, 14 Nov 2023 10:28:15 +0000 Subject: [PATCH] test: fix probing in secondary process Cc: Xueming Li [ upstream commit b3ce7891ad386310abab56352053a46ba06ca72f ] In EAL related test cases, the allow parameters are not passed to the secondary process, resulting in unexpected NICs being loaded. This patch fixes this issue by appending the allow parameters to the secondary process. Fixes: af75078fece3 ("first public release") Signed-off-by: Mingjin Ye Tested-by: Zhimin Huang Acked-by: Bruce Richardson --- app/test/process.h | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/app/test/process.h b/app/test/process.h index c576c42349..9fb2bf481c 100644 --- a/app/test/process.h +++ b/app/test/process.h @@ -17,6 +17,7 @@ #include #include /* strlcpy */ +#include #ifdef RTE_EXEC_ENV_FREEBSD #define self "curproc" @@ -34,6 +35,34 @@ extern uint16_t flag_for_send_pkts; #endif #endif +#define PREFIX_ALLOW "--allow=" + +static int +add_parameter_allow(char **argv, int max_capacity) +{ + struct rte_devargs *devargs; + int count = 0; + + RTE_EAL_DEVARGS_FOREACH(NULL, devargs) { + if (strlen(devargs->name) == 0) + continue; + + if (devargs->data == NULL || strlen(devargs->data) == 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 == 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 = 0; + char **argv_cpy; + int allow_num; + int argv_num; int i, status; char path[32]; #ifdef RTE_LIB_PDUMP @@ -58,14 +89,21 @@ process_dup(const char *const argv[], int numargs, const char *env_value) if (pid < 0) return -1; else if (pid == 0) { + allow_num = rte_devargs_type_count(RTE_DEVTYPE_ALLOWED); + argv_num = numargs + allow_num + 1; + argv_cpy = 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 = 0; i < numargs; i++) { argv_cpy[i] = strdup(argv[i]); if (argv_cpy[i] == NULL) rte_panic("Error dup args\n"); } - argv_cpy[i] = NULL; - num = numargs; + if (allow_num > 0) + num = add_parameter_allow(&argv_cpy[i], allow_num); + num += numargs; #ifdef RTE_EXEC_ENV_LINUX { -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:07.000578116 +0800 +++ 0063-test-fix-probing-in-secondary-process.patch 2024-04-13 20:43:05.017753905 +0800 @@ -1 +1 @@ -From b3ce7891ad386310abab56352053a46ba06ca72f Mon Sep 17 00:00:00 2001 +From ef4c8a57f320f01061b399b62e9dac7836dea83b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b3ce7891ad386310abab56352053a46ba06ca72f ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org