From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 05BCA4CA2 for ; Wed, 28 Feb 2018 02:52:43 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2018 17:52:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,403,1515484800"; d="scan'208";a="31176646" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 27 Feb 2018 17:52:40 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Feb 2018 17:52:39 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Feb 2018 17:52:39 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Wed, 28 Feb 2018 09:52:37 +0800 From: "Tan, Jianfeng" To: "Burakov, Anatoly" , "dev@dpdk.org" Thread-Topic: [PATCH v3 5/5] eal: don't hardcode socket filter value in IPC Thread-Index: AQHTr9hAnXqoF5GIoEyERjhLCTZEjaO5DFDQ Date: Wed, 28 Feb 2018 01:52:38 +0000 Message-ID: References: <31f6d9ef676fb1eb0a664c06d62d66f32876dcb6.1519672713.git.anatoly.burakov@intel.com> <2f9a4da56e7f31f141db8cb2bb34d3c7fef97691.1519740527.git.anatoly.burakov@intel.com> In-Reply-To: <2f9a4da56e7f31f141db8cb2bb34d3c7fef97691.1519740527.git.anatoly.burakov@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 5/5] eal: don't hardcode socket filter value in IPC X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 01:52:45 -0000 Hi Anatoly, > -----Original Message----- > From: Burakov, Anatoly > Sent: Tuesday, February 27, 2018 10:36 PM > To: dev@dpdk.org > Cc: Tan, Jianfeng > Subject: [PATCH v3 5/5] eal: don't hardcode socket filter value in IPC >=20 > Currently, filter value is hardcoded and disconnected from actual > value returned by eal_mp_socket_path(). I can understand the hardcode is not good. But why it's not consistent with= the actual value returned from eal_mp_socket_path()? > Fix this to generate filter > value by deriving it from eal_mp_socket_path() instead. >=20 > Signed-off-by: Anatoly Burakov Anyway, I think your way looks good to me, so Acked-by: Jianfeng Tan Thanks, Jianfeng > --- >=20 > Notes: > v3: no changes >=20 > v2: no changes >=20 > lib/librte_eal/common/eal_common_proc.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/librte_eal/common/eal_common_proc.c > b/lib/librte_eal/common/eal_common_proc.c > index 7856a7b..4cf3aa6 100644 > --- a/lib/librte_eal/common/eal_common_proc.c > +++ b/lib/librte_eal/common/eal_common_proc.c > @@ -506,16 +506,17 @@ int > rte_mp_channel_init(void) > { > char thread_name[RTE_MAX_THREAD_NAME_LEN]; > - char *path; > + char path[PATH_MAX]; > int dir_fd; > pthread_t tid; >=20 > - snprintf(mp_filter, PATH_MAX, ".%s_unix_*", > - internal_config.hugefile_prefix); > + /* create filter path */ > + create_socket_path("*", path, sizeof(path)); > + snprintf(mp_filter, sizeof(mp_filter), "%s", basename(path)); >=20 > - path =3D strdup(eal_mp_socket_path()); > - snprintf(mp_dir_path, PATH_MAX, "%s", dirname(path)); > - free(path); > + /* path may have been modified, so recreate it */ > + create_socket_path("*", path, sizeof(path)); > + snprintf(mp_dir_path, sizeof(mp_dir_path), "%s", dirname(path)); >=20 > /* lock the directory */ > dir_fd =3D open(mp_dir_path, O_RDONLY); > -- > 2.7.4