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 A0D5B42DE1; Thu, 6 Jul 2023 04:16:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E88D40144; Thu, 6 Jul 2023 04:16:45 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id E0525400D5; Thu, 6 Jul 2023 04:16:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688609804; x=1720145804; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Q0nTOqlYso2veWf6HaNgL61Ow+MqCpjOtVhro3RsFxI=; b=BKgFULZ+YErM8CY4KYNVuwwJR5xmPZAiYkRe9zq8+7VUuhi9k3cZRKlS lqcj87D+zWuCmp18920V5qZidABSKCHEaM2auDVWauYeB2cEQ9DV6JNyw 0Ku8cqsLVtzqTxofm9Mag6l7ODmU7zEsiVABVPmmMamBunuW9yuGiDhVW dNrdedH3MlrGt9W8jCvtdGj3yHBSdImEKoRqdogqDo94b1RVEIh8rP6SD wt02scTq4AQtj6OlMyZNEipQMlJxMC5y470zJ18FFQcFn2KEV1a4ubiHK XDgMsMhnWaISM1Z7nHp3UCVkiEdra43JREDNqF7VrAlP/t1fsSrjK1Do5 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="427169477" X-IronPort-AV: E=Sophos;i="6.01,184,1684825200"; d="scan'208";a="427169477" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2023 19:16:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="789365555" X-IronPort-AV: E=Sophos;i="6.01,184,1684825200"; d="scan'208";a="789365555" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga004.fm.intel.com with ESMTP; 05 Jul 2023 19:16:42 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul 2023 19:16:42 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul 2023 19:16:41 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 5 Jul 2023 19:16:41 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.45) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 5 Jul 2023 19:16:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UnIvhb577PZstnIpCpgr6Wjr7WM923QS7+44PCpUuxkpodgyWTxp9FYoxcOw2OsJ1Yw1Zn6Um5fcLR/40ThMnbXXPtyY178b1bLTRm7qQJk9/rB4ZnKF5yx6CsAe9sa9LjpzaDDlrDiKFGnfIxra5G9niLcVTGKgqtXxx8EDTy2iNFtsCVXpgCqz8wrqwiWC1lkFrkh9g+Znkk5CNfsSb+gt2+DqaGKy7kqFFQEitnWWEmRStoUT7n6Frh71YwTR+kBtvtupY7697lzUTwfuoCHVisQA4jIJN9juMFxX1/285YzHavfjegAxA+ggLO6mDXFaD5sTTVDa/WIEtJ/HQw== 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=2ZKBgDV429Avp1fHMnlCFEbeWySm9mWQBxVx+MqEQUU=; b=dat5HgLVQRDk+flDdIxX2CmVeQhGqPcgz+HReDLbuDbSXpRCm7qWo7FTZOgEai8QFo48FvNVJOHs+mMGnEe+EH0ls/VdKr54EFC/eQu56fKHnuGJFWc+bWrS+QMM4OzKB/wyBdhx41VU7nq5QAsRxy9qBRrF/26A3htaN/k132C4nOOylZKTXRUd23t5iNceenqm4TG5oCgz3btetWCBvVH2k+xC2C1pTgPVoSYmYzyIHt/vRURyNUgYi9PU+6cMek99jrxkgcSxCtiPsNfF20jmiMPbBmmX+tHqZHKn7VG0XwBTqqLdz1cEQJ95F6OVPBRxArFS2h6MINk4wZtV4A== 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 CH0PR11MB8086.namprd11.prod.outlook.com (2603:10b6:610:190::8) by SN7PR11MB6971.namprd11.prod.outlook.com (2603:10b6:806:2ab::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Thu, 6 Jul 2023 02:16:39 +0000 Received: from CH0PR11MB8086.namprd11.prod.outlook.com ([fe80::36f6:a680:ff57:ac7d]) by CH0PR11MB8086.namprd11.prod.outlook.com ([fe80::36f6:a680:ff57:ac7d%4]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023 02:16:38 +0000 From: "Yang, Qiming" To: "You, KaisenX" , "dev@dpdk.org" CC: "Zhou, YidingX" , "stable@dpdk.org" Subject: RE: [PATCH] child process synchronization NIC startup parameters Thread-Topic: [PATCH] child process synchronization NIC startup parameters Thread-Index: AQHZryQu6Dxv6wDRO0uOL4DVYdS7oK+sAPLQ Date: Thu, 6 Jul 2023 02:16:38 +0000 Message-ID: References: <20230705093515.3285574-1-kaisenx.you@intel.com> In-Reply-To: <20230705093515.3285574-1-kaisenx.you@intel.com> Accept-Language: en-US, zh-CN 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: CH0PR11MB8086:EE_|SN7PR11MB6971:EE_ x-ms-office365-filtering-correlation-id: b8907ddf-ffa0-4e67-c475-08db7dc707c3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SSpQ19YdQoQQOPB8w1ftQ1Z3B/qrK7CrNzRc3xin3Gt/ZmamB1jMIXKoct/Je6CrtXz8FIEZCTsbkIaEo0ln3KCBxlwsOGt0xH5HNl6+XlwxIfxuX3RCoI7JY3CsQ+15Je39fvBdHFNs5H0AACb9RQgxBqce6bQgGPzsJ4MMlopiHgaQAqSUHv2+Y0j7jLIcA9NE+Jmb8/aW++MgNi6mNY8EHdAnHPpKDZNhDzmI5qEKM5RO8BnPZ5hNp8GoVcPXv9E+hid7Mm1ghVlP/s98iIC1rtbYfQEtslKRmWRvOrZ3SOjOzg7baxbG9SKRnbp73abpir0a0isXG9Cx0Sx8Dy7zfC0+w7QdHndUfAv0g+Q++NVc9wwiAN1oPQdxOXEhjhs5LyaCttb9er/t/iTFecES49roNfP5zUyplpb7ih+13vRsAe6Cu+Vq099awudCWA52XDAFeG6wP2PzNSnr+p4JyUyfpQECBCJNmBIWf6DQODqCJeWJIeljn1W9PSqx0uW96b8CLlZsTyUycfi8v2qi1WNqP0hsqnsoC5E5e2nicrjzLEc0kumzQrw+WHU00OmVJ0mQl8L0KsUHXxQL0i/KhfOo+N4kvMh5zMilj3A= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR11MB8086.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(136003)(366004)(39860400002)(451199021)(9686003)(54906003)(26005)(186003)(53546011)(52536014)(86362001)(71200400001)(8676002)(33656002)(2906002)(8936002)(110136005)(7696005)(5660300002)(41300700001)(38100700002)(478600001)(38070700005)(450100002)(64756008)(6506007)(66556008)(55016003)(82960400001)(66946007)(4326008)(66446008)(76116006)(66476007)(122000001)(83380400001)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XsSjxzo/Io5IJjrePGr8ThW48cTPomwcmYEA4ICr2yoGSCPJKhiHJa8w/Tu6?= =?us-ascii?Q?TdxY99ndk4FR6xhqnEVVysVo0FPT0wm6qtea0PVMvMyXC0uQVC9zTOVPIzCw?= =?us-ascii?Q?vFBMhd2jtyImxB4/CuMeK+Re+uLz1Ilv/vbs30zyNSp+X6l32fP8ZyL8a9gC?= =?us-ascii?Q?rkyf5jXuBdulTn0/Dp/2k8POR3nESEoiPVjGrrBU+JNJadCf46VXohx8kwRi?= =?us-ascii?Q?3UymDRyf+19EB8D7HJmmqCnVNG0PF+CN6JxQajtsZXbrejTYoSqw+8lT+vdy?= =?us-ascii?Q?H2tSOg6vrX3k9WOTZD2f8SiojQBWN3jwcttKhT5lZ4VUCDrW59DzWvB5uxD0?= =?us-ascii?Q?02FwHykHxKpinXGyjKCkjgq5xCNth/P90pFsQ3jQ3qmkungBBnbEdOqESrd1?= =?us-ascii?Q?T8GCaFf/oveBftOZgeDQznR9zHjcPeWtBSeenny5sERZJXLQ0kJ63eKpA/9Z?= =?us-ascii?Q?/K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ziWmeA5mcjeb/Gkbk9G+?= =?us-ascii?Q?CwfR3Gu7+kwc7Losir+qZes56B6iW6RsvoyE9kLGawesrFGsPLpRb7ZULUvP?= =?us-ascii?Q?t/fZK2BzzyOsg5m247kUDp891vyI7EU18VN4xOieDFPuom1Zd7YKptfUtZUH?= =?us-ascii?Q?zEN6Q5WrWSGVW06nUX4cl0L6SWo0ceGud14RPEMb99XaeQcRL8vZbSzqk5Ii?= =?us-ascii?Q?bGOyEOJO6vnvM2/akhKWzmPnmmUksjUGebJhLmEr?= 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: CH0PR11MB8086.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8907ddf-ffa0-4e67-c475-08db7dc707c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2023 02:16:38.4978 (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: KkVHZCvm05lvgHzmrpJv8tQDQy5iXlhi2z6rmeZqZm5zAzF4M24lLl5LfB7PXBhqp52dHT1NVOXZi/l/VLb2kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6971 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 Hi, kaisen Your patch missed prefix app/test. > -----Original Message----- > From: You, KaisenX > Sent: Wednesday, July 5, 2023 5:35 PM > To: dev@dpdk.org > Cc: Yang, Qiming ; Zhou, YidingX > ; You, KaisenX ; > stable@dpdk.org > Subject: [PATCH] child process synchronization NIC startup parameters >=20 > In meson_test, because the child process does not synchronize the NIC > startup parameters of the parent process at startup, it uses all NICs bou= nd by > vfio as startup parameters by default, and an exception occurs in the > subsequent hugefile check, causing the test to fail. Synchronize the NIC > startup parameters of the parent process to the child process to solve th= is > problem. >=20 > Fixes: 786b29255c49 ("test: fix file prefix discovery") > Cc: stable@dpdk.org >=20 > Signed-off-by: Kaisen You > --- > app/test/process.h | 80 > ++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 77 insertions(+), 3 deletions(-) >=20 > diff --git a/app/test/process.h b/app/test/process.h index > 1f073b9c5c..c8a15e8989 100644 > --- a/app/test/process.h > +++ b/app/test/process.h > @@ -15,9 +15,11 @@ > #include /* strerror */ > #include /* readlink */ > #include > +#include >=20 > #include /* strlcpy */ >=20 > +#define MAX_EXTRA_ARGS 32 > #ifdef RTE_EXEC_ENV_FREEBSD > #define self "curproc" > #define exe "file" > @@ -34,6 +36,50 @@ extern uint16_t flag_for_send_pkts; #endif #endif >=20 > +/* get cmdline form PID. Read process info form /proc/$PID. */ static > +char *get_cmdline_from_pid(pid_t pid, char *buf, int len) { > + char filename[PATH_MAX]; > + char *name =3D NULL; > + int fd; > + int ret; > + > + if (pid < 1 || buf =3D=3D NULL || len < 0) { > + printf("%s: illegal param\n", __func__); > + return NULL; > + } > + > + snprintf(filename, PATH_MAX, "/proc/%d/cmdline", pid); > + memset(buf, 0, len); > + fd =3D open(filename, O_RDONLY); > + if (fd < 0) { > + perror("open:"); > + return NULL; > + } > + ret =3D read(fd, buf, len); > + close(fd); > + > + if (ret < 0) > + return NULL; > + > + if (buf[ret-1] =3D=3D '\n') > + buf[--ret] =3D 0; > + > + name =3D buf; > + while (ret) { > + if (((unsigned char)*name) < ' ') > + *name =3D ' '; > + name++; > + ret--; > + } > + *name =3D 0; > + > + if (buf[0]) > + return buf; > + > + return NULL; > +} > + > /* > * 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 = @@ - > 44,9 +90,15 @@ static inline int process_dup(const char *const argv[], i= nt > numargs, const char *env_value) { > int num; > - char *argv_cpy[numargs + 1]; > - int i, status; > + char *argv_cpy[MAX_EXTRA_ARGS]; > + int i, status, n, s, j; > char path[32]; > + char buf[1024]; > + char *token; > + char str_1[] =3D "-a"; > + char str_2[] =3D " "; > + char *argv_str[MAX_EXTRA_ARGS]; > + char *argv_copy[MAX_EXTRA_ARGS]; > #ifdef RTE_LIB_PDUMP > #ifdef RTE_NET_RING > pthread_t thread; > @@ -113,10 +165,32 @@ process_dup(const char *const argv[], int numargs, > const char *env_value) > closedir(dir); > } > #endif > + /* Add the -a parameter to the child process start parameter > */ > + get_cmdline_from_pid(getppid(), buf, 1024); > + token =3D strtok(buf, str_2); > + argv_str[0] =3D strdup(token); > + n =3D 0; > + j =3D 0; > + while (token !=3D NULL) { > + n =3D n + 1; > + argv_str[n] =3D strdup(token); > + token =3D strtok(NULL, str_2); > + } > + for (s =3D 0; s < n; s++) { > + if (strcmp(argv_str[s], str_1) =3D=3D 0 || > + strcmp(argv_str[s + 1], str_1) =3D=3D 0) { > + argv_copy[j] =3D strdup(argv_str[s + 1]); > + j++; > + } > + } > + for (s =3D 0; s < j; s++) > + argv_cpy[numargs + s] =3D strdup(argv_copy[s]); > + > printf("Running binary with argv[]:"); > - for (i =3D 0; i < num; i++) > + for (i =3D 0; i < num + j; i++) > printf("'%s' ", argv_cpy[i]); > printf("\n"); > + argv_cpy[numargs + j] =3D NULL; > fflush(stdout); >=20 > /* set the environment variable */ > -- > 2.25.1