From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 756EEA04DB; Thu, 15 Oct 2020 15:27:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6D9A71DA84; Thu, 15 Oct 2020 15:27:12 +0200 (CEST) Received: from us-smtp-delivery-181.mimecast.com (us-smtp-delivery-181.mimecast.com [63.128.21.181]) by dpdk.org (Postfix) with ESMTP id 413DE1D8FC for ; Thu, 15 Oct 2020 15:27:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1602768427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v3n7TjpKGM+OapZITGYZyETN2k+gwEubaN8/eSQ8gmA=; b=aHGl42XiUganeVaJgmP7kofs3X+59ZgIcMTrlDNB7GvGFvQkuC+jW4tNgLk8NeyA58TIvo W4ocgsh807X7bIqgwPVQ6GOhpqfFPkTG2OhA+nXRrinEmq5hBIGJzdYlpLs/Y29JdXo8eF 02DH+r4zdqwLbswLE3kRbp1sGNnp994= Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2052.outbound.protection.outlook.com [104.47.36.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-_5yVtxTrNAmWIQn8unbg5Q-1; Thu, 15 Oct 2020 09:26:56 -0400 Received: from DM6PR03MB3547.namprd03.prod.outlook.com (2603:10b6:5:aa::20) by DM6PR03MB3788.namprd03.prod.outlook.com (2603:10b6:5:50::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24; Thu, 15 Oct 2020 13:26:53 +0000 Received: from DM6PR03MB3547.namprd03.prod.outlook.com ([fe80::add3:5527:da14:45d4]) by DM6PR03MB3547.namprd03.prod.outlook.com ([fe80::add3:5527:da14:45d4%6]) with mapi id 15.20.3455.029; Thu, 15 Oct 2020 13:26:53 +0000 From: "Mohakud, Amiya Ranjan" To: dpdk-dev CC: "Mohakud, Amiya Ranjan" Thread-Topic: [dpdk-dev] eal: DPDK: 18.11.6 version rte_eal_init() function cleans the runtime directory in 5.4.35 kernel Thread-Index: Adai1oJhZlWAuakwR/6mnE9JbVqrnQAID/rw Date: Thu, 15 Oct 2020 13:26:53 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [136.185.141.131] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 99c33fd5-1c15-4e0b-f1f5-08d8710dfb58 x-ms-traffictypediagnostic: DM6PR03MB3788: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0 x-microsoft-antispam-message-info: Y1ajt3YnZXfDMgPjVufH/iRj8vVNIEHAttQQU8AVnUY9/VHF8TaTTrgkEjBX9xvj1NZpqh8P7FekN+6aA9xE3w+13buIRT5XeBBRqHjeh5Ny7oU66tl7otmVxsGjjLPnKOegOdyO1zv2SB1Osrtpmj7rL7/Wxvl1f30k3ZamIhKbk9B2YACxyeN7W8zGxUGpBSulXAFD4o7+STR5DFcYhyBh0aw3wlPV5vEYwVPgEPwx5pXC3D4sEiVyKUPIRngeUcOn5nMwkvKGFDe8sUH2gvr3tC8B/fTfZTkw86EJyHgMjbM6pWzVSPvyUwsBrOs/ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR03MB3547.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(346002)(136003)(396003)(376002)(9326002)(6916009)(316002)(71200400001)(55016002)(2940100002)(8676002)(5660300002)(186003)(64756008)(9686003)(66476007)(76116006)(66556008)(26005)(52536014)(2906002)(478600001)(66446008)(6506007)(86362001)(8936002)(83380400001)(107886003)(33656002)(7696005)(66946007)(4326008); DIR:OUT; SFP:1101 x-ms-exchange-antispam-messagedata: rmVZkofLbcLLg7jB3sACcZGcsuKMC4R8zDbKgfLKu4JTgtd8WAcjlGdRlha+aUm0peuYfp1/TR4pQHdUbLYulvJe5BGlkRP3L2nvYSkdW4SKXDCuH28d51T6ugOyIHBXqUNBtBKWwjDMzoAEVRc+W2fERPf6zJiqDsrK6oyXQAr1jfOpsiC32/x4dxtqap/1hyJGxqg5ChbOKaFHbcz4NFkMWDgs0XYV/TZbAtVXI5jlSYvAyDezQILX6FrpILA7+qVkASsoRh4ZCRiRWJN/6L/VajdOpyTCdlP4YoEV4p6rVNf/7qL8OAf3KHjmOV0M3pDCqqcq+OCz1FZZGxr7qL2++smaHGlqQ9Ot+8Y5stzYztBvv1e0T3Td4Ki781i24VytuJm9SncFg/iUwfx10F5ww4+fXh6+ZQXqN8/h0VJXeEonzrr7nq9eBkf8kqgIQs3iKjLlYdVMM+bfsAytZrOmGANQWfXI7GZqMVZtLjB2wS+Sr2/YQ6FkT67pM76cxgQ0WVF+ppcAMti0Wdqjvldpos37UravblDCHdrlzcvyY1QV/29rLiMVRhx3XdvEDbRGKnHmL+3L1vpvjfwjJ5VOyODGDDQMNy5EQ7UZelCsoSs9Sqwxz+vvHL9LfgIfNXJyH/cEtF0J6lMIENa2Hg== x-mc-unique: _5yVtxTrNAmWIQn8unbg5Q-1 x-originatororg: rbbn.com x-ms-exchange-crosstenant-authas: Internal x-ms-exchange-crosstenant-authsource: DM6PR03MB3547.namprd03.prod.outlook.com x-ms-exchange-crosstenant-network-message-id: 99c33fd5-1c15-4e0b-f1f5-08d8710dfb58 x-ms-exchange-crosstenant-originalarrivaltime: 15 Oct 2020 13:26:53.7099 (UTC) x-ms-exchange-crosstenant-fromentityheader: Hosted x-ms-exchange-crosstenant-id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 x-ms-exchange-crosstenant-mailboxtype: HOSTED x-ms-exchange-crosstenant-userprincipalname: nK458ajDett7i/gDVwiHOf2vEFDpw+JzahmnKw+WrfHLKFDxheq8f+eJ0la6mupgd5flcnFcNik3tC588G3Psw== x-ms-exchange-transport-crosstenantheadersstamped: DM6PR03MB3788 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA81A106 smtp.mailfrom=amohakud@rbbn.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: rbbn.com Content-Language: en-US Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] eal: DPDK: 18.11.6 version rte_eal_init() function cleans the runtime directory in 5.4.35 kernel 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi All, I'm facing one issue with DPDK-18.11.6 in EAL library. Please find the belo= w problem statement. Problem Statement: I have one DPDK application using DPDK version 18.11.6 which works fine in = 4.19 version kernel. The rte_eal_init() works fine and eal_clean_runtime_di= r() does not remove the files present in dpdk run time directory, /var/run/= dpdk/rte/. The same application when I am trying to run in 5.4.35 kernel, the rte_eal_= init() behavior is different. eal_clean_runtime_dir() cleans up dpdk run t= ime directory, as a result the secondary processes fail to come up. Basical= ly the flock system call succeeds , return value is 0 which goes and delete= s the files. And in 4.19 kernel the flcok system call fails. Note: This is the case with 5.3 kernel version . int eal_clean_runtime_dir(void) { DIR *dir; struct dirent *dirent; int dir_fd, fd, lck_result; static const char * const filters[] =3D { "fbarray_*", "mp_socket_*" }; /* open directory */ dir =3D opendir(runtime_dir); if (!dir) { RTE_LOG(ERR, EAL, "Unable to open runtime directory %s\n", runtime_dir); goto error; } dir_fd =3D dirfd(dir); /* lock the directory before doing anything, to avoid races */ if (flock(dir_fd, LOCK_EX) < 0) { RTE_LOG(ERR, EAL, "Unable to lock runtime directory %s\n", runtime_dir); goto error; } dirent =3D readdir(dir); if (!dirent) { RTE_LOG(ERR, EAL, "Unable to read runtime directory %s\n", runtime_dir); goto error; } while (dirent !=3D NULL) { unsigned int f_idx; bool skip =3D true; /* skip files that don't match the patterns */ for (f_idx =3D 0; f_idx < RTE_DIM(filters); f_idx++) { const char *filter =3D filters[f_idx]; if (fnmatch(filter, dirent->d_name, 0) =3D=3D 0) { skip =3D false; break; } } if (skip) { dirent =3D readdir(dir); continue; } /* try and lock the file */ fd =3D openat(dir_fd, dirent->d_name, O_RDONLY); /* skip to next file */ if (fd =3D=3D -1) { dirent =3D readdir(dir); continue; } /* non-blocking lock */ lck_result =3D flock(fd, LOCK_EX | LOCK_NB); /* if lock succeeds, remove the file */ if (lck_result !=3D -1) unlinkat(dir_fd, dirent->d_name, 0); close(fd); dirent =3D readdir(dir); } /* closedir closes dir_fd and drops the lock */ closedir(dir); return 0; error: if (dir) closedir(dir); RTE_LOG(ERR, EAL, "Error while clearing runtime dir: %s\n", strerror(errno)); return -1; } Could anybody please help me know, if there is any patch related to this or= any way to solve this issue? Thanks in advance. Regards Amiya