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 2F1B942DF1 for ; Fri, 7 Jul 2023 03:21:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22AB34301E; Fri, 7 Jul 2023 03:21:32 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 8026B40685; Fri, 7 Jul 2023 03:21:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688692888; x=1720228888; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zgfX+h4RXpoL4mWNXd2E48LvH1fmiOFRurTRRKAVzjo=; b=hs41mssWOBdN1jKXiAWxUlXVIzDPfEwz9dPdhYCHfKJ8owAA5ki4wnOf ias6cuyjR2SEg+BdQ5kv8obpgjPcjEsQ1KXywkXbZeMd9FJoDbWuYAWgZ 23HluGJAYqPfAMPdAcbSvF93oYosEFofXxEikiJ9JVN//UWC8UiNmpAdy 7SvR0dJJPt7XldkPAS9fH4lZ2WyVVLjE9SW8cR+6Prw1TP9hRM7Cqvb6a YroS8DSobNmg261Wg14Xs86LcLUh01MA4OiRKUop3b262sIk9seCTPBOh H6EFD3eC5LEYERQDuTFcqV335DZjwmibDG9QKFWGhf0po0l01UG6gHKgU A==; X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="363809201" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="363809201" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2023 18:21:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="749364491" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="749364491" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga008.jf.intel.com with ESMTP; 06 Jul 2023 18:21:08 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul 2023 18:21:06 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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; Thu, 6 Jul 2023 18:21:06 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 6 Jul 2023 18:21:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z6jbholf+/hemIpXD+O0hvuifQ4yKK27bHaCaaIi/QTxK+MqptTjhVvN4Uzjss8SkBU0Mf2lwzbijB8+ouLqk6L7vFoEV1SVrpfpIpWRKLdwd71Cbqj+jQxkL8AIJTEKkETgBtIyEBqUn1JKJX3TmQ31azfHM7U9+KJNxKyov6y9P9TxFh2yjn7VqMEQc8Ze1L3DvWB6OnJoRtjlFZHFBWeAfg2rDDf45HQoKhLc6ptPDoGoANlld5rYChKvnPayxH9kr9sU0zAo16NHdvTYSh/yFYTzXEcp70Srk5+Pld9B/IwdZxUdXHW6EH09cmT9vZbp2PTlGoUjoAXKuJP3nQ== 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=s6a+mE+3fGylM/PvGlzIIFbJTV4i+u5xwnwGj6542l0=; b=FS8AnT9pakbF4e/MvudOy8pPKYw4zNnviZ/Wn/3JOjJFj7RIuZrYt1+1fGmWiiOkjOu2b7HHN5wbQE1D0gs7xp4ToWJvO5hOk0SEemYNZR83whnHNnFT3MDGFnkTguojl9hqKroRyHD9JPIqGfAGmTOAdIMMrnQ3tt36Sf44YKYwD558rv37RuyKzv2xBd72wuOxbdjAc8IcYIW0+Kq3K3gE0PuYTmbOUOtb7X/moOKkB0DVlYaMzKfWNyPZa174cVyc+xZo23GwCOA5M+ssmiECS1nyDX1xq3EEueeUrageSdoLpUycH6nmEzHNRC3sRj43qSneBtdmVx/yUNSYQg== 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 SJ0PR11MB6765.namprd11.prod.outlook.com (2603:10b6:a03:47b::10) by CH0PR11MB5249.namprd11.prod.outlook.com (2603:10b6:610:e0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul 2023 01:21:04 +0000 Received: from SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::68f1:2dc0:d63c:a524]) by SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::68f1:2dc0:d63c:a524%4]) with mapi id 15.20.6544.024; Fri, 7 Jul 2023 01:21:04 +0000 From: "You, KaisenX" To: "Yang, Qiming" , "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: AQHZryQuwqMu7M2iC0GRUu0F7od9o6+sAYEAgAGCkhA= Date: Fri, 7 Jul 2023 01:21:03 +0000 Message-ID: References: <20230705093515.3285574-1-kaisenx.you@intel.com> In-Reply-To: Accept-Language: zh-CN, 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: SJ0PR11MB6765:EE_|CH0PR11MB5249:EE_ x-ms-office365-filtering-correlation-id: 07043f48-174b-408b-34e2-08db7e886e6c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Y5sZaWEG4hMr0DmgBqz70m1+1MncyfZ8rTC7X7QVE1VyhsX5fyIjGfLpuPZ3hzMDmTYXxVHl33C26JGv+MN0qqfBO5UkEvejVrEAghG34DCbzYKXA0nXBsn2RVG3aDXCIPcdFGeDxf8A8BVySP4LqOzZ4LgsT7IIbkU9XcWn0jkhbNnIcJ6f4naRscztttX2arfXoXjqG+wswd0RlcXqcdFb+2jxduc30gcDij6rHSI8hH1jZ1o0dahbAxYmsJfU/pQJUsRo4Qb2e7iDZKB7cr9G9fHdxg2Rt5Sl/Ln6xR4M/zv0lIIiOkv/Tci58u8UaZPJIge7t7WZFLDrz4/pJTMHjD5BkDBbA42wEtuwLuzA0/oRoSxtKFvO7RwaJqtEtjUBi01J1bn+H15KwNtUVL9lwR1vuvqgAR5SSPnYVDn6ZnntOdpmMI+ytKpY05bNV5Ee3JI2NcR3UrHBiMy4IoJhCqUq97D4GRKDkkHH6n4tGbCb95L6YN6YacU2XvhDY/NI3R2FtqjGpVSJAGB5kKfcgfJ4N80jGmdIFSYFhg70e3Xx0jFQxp/2+hhSGe45smjvkvBTHYAqDqFkHQHyhiPh+2udVpGDJ+6xhPvHfFw= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB6765.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(346002)(376002)(396003)(39860400002)(136003)(451199021)(76116006)(66946007)(450100002)(64756008)(66556008)(66476007)(66446008)(4326008)(122000001)(38100700002)(86362001)(186003)(38070700005)(26005)(53546011)(6506007)(82960400001)(83380400001)(33656002)(478600001)(9686003)(71200400001)(7696005)(55016003)(54906003)(110136005)(41300700001)(52536014)(5660300002)(8936002)(8676002)(2906002)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?V29hbFhqNzZSU0FPWlB3cnp2bHg2dlhoVUo4MHVmTE9FTVp5UlZhbVRG?= =?iso-2022-jp?B?TXdjYTIyWGE4YW16SXhPeFVLclB0TzB5eENWWWZUcE1kTVV6WHZHTFk4?= =?iso-2022-jp?B?V09XT1ltSHhqQml6YmF6MXJCNU9aZEZnazZ2YlZHSzNWTjdYZDRRaGZr?= =?iso-2022-jp?B?eUo1dlJNOXZjcmRHNUJIb2VZWWI1YTQxZDhlRXkwdnR3VDJSTmxFb25k?= =?iso-2022-jp?B?Rm9lZndva3M5ajdGa2xOVm5ZRTUwSm9hNkorQjB0R2xzVFBYVmNCUWR6?= =?iso-2022-jp?B?TzN3a0JOM0V6TUxWd3pZUkQvWXhOUmp0SzA0VGlMaWRwZnRYRHV0emxa?= =?iso-2022-jp?B?WnQ2ZnNWeno1TURwRUU0RmxnVFVXSlFBYWlEV3BudysxdlN3WFF5aW5h?= =?iso-2022-jp?B?enlJdlhzMWR3ZDBYRHhNZnVleHArUHh3MDhwQzd5M2FuUFBsYkZkeGNa?= =?iso-2022-jp?B?bW5UeDg0Nm9mMkVVTmJOZ1JoM3FFa2I5ejE2OTRYQitjNm5PWHVoSUsv?= =?iso-2022-jp?B?dzdxOGFGVVFwOU1XNjhXWUFhUzlhakRmeGgxejNReUJrSU1sZEJHZE5h?= =?iso-2022-jp?B?N2RlZXFNanZjQXNjd1VB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c3eDVQOU1WcWRna2tObUdyQzYxK29TQ3BCRlNXekZEYVJlaHIx?= =?iso-2022-jp?B?dDZ1eGlWNnQzZE1CYnNzQ09ZSkh2Y1M5ei9RZmdwbkdUWmRnNThPRXpj?= =?iso-2022-jp?B?YlFKZXhJYUxGRWRGdkhTVzIrc0ZWY25iSXhWTHROL2sxR3BVbzVOZTFr?= =?iso-2022-jp?B?czBXZTJTQVFFQThybGM4MkdVNUJ0eitNN25Ia2xJbk5lVU1DSldrejQ2?= =?iso-2022-jp?B?Z2xmd3hJUitkS04xd1h1QlQ5Rm5DRWczZHoxVUhRUk1yVFFmN3BQT1VS?= =?iso-2022-jp?B?SnRVNHpTN1BoZFdvNUJzN05yOFc5em9XbXovRVplaHhZZDJjMlhwbHR1?= =?iso-2022-jp?B?NUwzcHNjRjBjNWw0MXJ2ZFprVlg3cUN2ZW1EdkNwd2krNGFLN0xpMldh?= =?iso-2022-jp?B?NUJiZmxaZElSMVo4NjZlUTlkMlA1UnBqZStCMnJsTE5oamd4aEYrNnJM?= =?iso-2022-jp?B?QXpXbUprWEloZWpOaERDczBCT1ZBSWJCd2NrNHp1eVc3dHVaZUdEMHVz?= =?iso-2022-jp?B?aklPSGJrY1Y4OXFVdUYrcXFCdU9JL01rSHVITkgwN1lOK3VNcU1jOXdx?= =?iso-2022-jp?B?MERDVDNFbEpNaEt5blNmOFYvdlgzUWFFUG9FTmFmY1J2emlBL2ZOUGpt?= =?iso-2022-jp?B?eHlER2FnRitGZXp1TkxRTjNtZU1vR1g0aDBXcnl2Sm5XdVNNaVdTdFVV?= =?iso-2022-jp?B?TndrMmk0N3R6Tld3UUNsQzVzQWxBcW9ZYTBuVjUvUEpUNGdoUWNHSkhw?= =?iso-2022-jp?B?enluVw==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB6765.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07043f48-174b-408b-34e2-08db7e886e6c X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2023 01:21:03.6181 (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: H2A9pvMGM704y9/Hm+7q6ja7lSmgkr6xd1XrnUbdTMAj0EX943Df957GCoqnqircytjZvIOu92dG2tQjQtE9Zw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5249 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 > -----Original Message----- > From: Yang, Qiming > Sent: 2023=1B$BG/=1B(B7=1B$B7n=1B(B6=1B$BF|=1B(B 10:17 > To: You, KaisenX ; dev@dpdk.org > Cc: Zhou, YidingX ; stable@dpdk.org > Subject: RE: [PATCH] child process synchronization NIC startup parameters >=20 > Hi, kaisen > Your patch missed prefix app/test. Thank you for your reply, I will send v2 to fix this problem as soon as pos= sible. >=20 > > -----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 > > > > In meson_test, because the child process does not synchronize the NIC > > startup parameters of the parent process at startup, it uses all NICs > > bound 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 this problem. > > > > Fixes: 786b29255c49 ("test: fix file prefix discovery") > > Cc: stable@dpdk.org > > > > Signed-off-by: Kaisen You > > --- > > app/test/process.h | 80 > > ++++++++++++++++++++++++++++++++++++++++++++-- > > 1 file changed, 77 insertions(+), 3 deletions(-) > > > > 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 > > > > #include /* strlcpy */ > > > > +#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 > > > > +/* 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[], int 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); > > > > /* set the environment variable */ > > -- > > 2.25.1