From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70089.outbound.protection.outlook.com [40.107.7.89]) by dpdk.org (Postfix) with ESMTP id 585DC8D88; Thu, 2 Aug 2018 12:40:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K5WvDcTo4y1LoYC2nQHgwJcCm98KgEQYIAPbVgl7IAE=; b=LISD790ofk29d5ma6qa5Na2UGD8RS3nLX/tXLz8pzX/TdKxwE0EHPSQJGaw8ezz4EQA1UjuFlXaB6cIT9/pYfkdR0rOYprK15apJrdsfcpow8npzWtcAzt3cmEhMO3U+EKeuLsX4fis6oSL8mTtJZ+UemiRhFQL1KF1t10Td99I= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4954.eurprd05.prod.outlook.com (20.176.235.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.16; Thu, 2 Aug 2018 10:40:30 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3%4]) with mapi id 15.20.1017.010; Thu, 2 Aug 2018 10:40:30 +0000 From: Shahaf Shuler To: Ophir Munk , "dev@dpdk.org" CC: Thomas Monjalon , Olga Shern , Ophir Munk , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v1] net/mlx5: fix secondary process resource leakage Thread-Index: AQHUKR8vU8+cv8RVmU6OpzVzKB9/caSqhxPAgAHAGoA= Date: Thu, 2 Aug 2018 10:40:30 +0000 Message-ID: References: <1533076684-19078-1-git-send-email-ophirmu@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4954; 6:tHevpFu/TVrNNveJQxoEVrNl1c+U2eLfQMY+rQdLsJICA5RJILSZ//YOwpjVlV/niHImGvuWuduWftfMtpY8j/2TbAKcTTkKOANAGNwOjIsZSIMf/MPpaUUrqoSAh/LwG5wDwFGt4lSKQWcyyG5/a3N5WpbODhmgJTQL/zGAFuqR4u98DmaUYF6mZGjyqFBpaJDzPjWY7FSAawJ3SBrw1MSv9spjH9NwSh8Md/VNN2PGu6bCEoeYvW1+O2fztAjhAQBCAhVvkFS9NLZFB/24yach0nozSGQ0ExVNyOXgyG5CXTu2p47CsbLivLcOmu452DSDEVd3dzYhRGpF6QNfZcxc/E1wQsuO0LGa6x1aXvd0i6ocx/UJtoP4UjWwmj8hs2HlpuHCzoXv23esUrdhc+JQz9yx856/XnHtI3knDdYQVXD3NyT/Yq2RvTEo1MxYMXPAB2VIQPzlEFezlpAz0g==; 5:o0R3IEiEquZhJcrFlxoS2XVfu4fABbiw/yTuFzfqezaGyD/vUHIgcstylIyA5armOS7vwSgX1HCw9/Ulqp98mFkcRM7onZpetmNJx9w+J0OWvcoDVTybEmnbn/Tl/oP2zbEHla4+6U7uRHxVM5RULo6XAnJgD6KugrcSnIIrEZA=; 7:wg0swmqTXlbwFov2Tx6QakcbZLM3uDSa2zKYH5fxIsAtNEYeV2nDFcik61LYlrUXL2VyAIc+EHFhYQ7ROfaYZtIa3DNhkD0T4dG7F5lMWhMyAOlyEBiZ1WSNx+ldK0mw7B0cDtV9sxYfMgmoh4U/1fT3MU61If9LjiHDV1feQlHAtMkgkxK3Z8LhmBGptcj494qdNkhrZjX5IDvG82NDdc7vg/RWu0oY7Vq8m9e74Ie1AABXQwZj0PPIXKGSbYdY x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 6779b0d5-e2c6-4462-3036-08d5f8645e82 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4954; x-ms-traffictypediagnostic: DB7PR05MB4954: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4954; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4954; x-forefront-prvs: 07521929C1 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(346002)(376002)(136003)(396003)(189003)(199004)(74316002)(25786009)(99286004)(81166006)(316002)(26005)(53936002)(446003)(305945005)(9686003)(55016002)(476003)(33656002)(102836004)(81156014)(68736007)(8936002)(110136005)(11346002)(14454004)(7736002)(486006)(478600001)(105586002)(3846002)(106356001)(229853002)(6116002)(5250100002)(14444005)(76176011)(2906002)(7696005)(256004)(6506007)(54906003)(2501003)(4326008)(6246003)(66066001)(6436002)(86362001)(97736004)(5660300001)(2900100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4954; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: uV1jgJX0dYkhWJ4kjhcAsn1H6LEqiYNGjhtN40DOp7gl11rP0eMAtMP24Xth+FSyUVvvMTMvNG7M4fmfC19NNnS9W1dDlkBipEQW7IBB7ghfN9Kmld+9Iv7Fp/OA7NpJYXkKlvAlESZdXVHuKphfTx3R5c9kH5QYYRHwtwONDuWxYPlnpMQDurS4jpi5fQFRAYaxdrrJiBiOK0eqrk03kt2Fmqa11Od8R5W1J2O/ykNUIu7HwMG7XS79BxXFOksYgrSK13iI2eRh/s53F+wy0Vui3/kKDMmL5sI5y1hhLZaBnlYLGVFzJDlP6bTA+elJASdRsak6p0AoeTEQdx7JMPmNH9+pRiNqvxbbMUp8NdA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6779b0d5-e2c6-4462-3036-08d5f8645e82 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2018 10:40:30.7450 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4954 Subject: Re: [dpdk-dev] [PATCH v1] net/mlx5: fix secondary process resource leakage 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: Thu, 02 Aug 2018 10:40:32 -0000 Wednesday, August 1, 2018 11:01 AM, Shahaf Shuler: > Subject: RE: [dpdk-dev] [PATCH v1] net/mlx5: fix secondary process resour= ce > leakage >=20 > Hi Ophir, >=20 > Wednesday, August 1, 2018 1:38 AM, Ophir Munk: > > Subject: [dpdk-dev] [PATCH v1] net/mlx5: fix secondary process > > resource leakage > > > > When running testpmd with an mlx5 device and then executing at testpmd > > prompt in a raw: "port start all" followed by "port stop all" > > a new file named /var/tmp/net_mlx5_ is created as a result > > of creating a new unix domain socket (used for communication between > > the primary and secondary processes). > > When the new unix socket file is created the old unix socket file > > should have been removed. This commit fixes it by closing the old unix > > socket just before creating the new one in function mlx5_socket_init() > > > > Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file > > descriptor") > > Cc: stable@dpdk.org > > > > Signed-off-by: Ophir Munk > > --- > > drivers/net/mlx5/mlx5_socket.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/net/mlx5/mlx5_socket.c > > b/drivers/net/mlx5/mlx5_socket.c index 99297d5..a3a5229 100644 > > --- a/drivers/net/mlx5/mlx5_socket.c > > +++ b/drivers/net/mlx5/mlx5_socket.c > > @@ -36,6 +36,12 @@ > > int flags; > > > > /* > > + * Close the last socket that was used to communicate > > + * with the secondary process > > + */ > > + if (priv->primary_socket) > > + mlx5_socket_uninit(dev); >=20 > On the current code the primary socket is created on port start and remov= ed > on port close (this is the bug you address). > Wouldn't it be better to just create it on probe? > This way the primary sets up its socket when the ethdev is created and > removes it when it is destroyed. The handling of the socket event still > happen only when the primary ports start because only then the interrupt > handler is installed. After internal discussion w/ Ophir we decided to take this patch as is cons= idering we are very late on this release and this fix has a low risk to bre= ak something else. We need to address this one on the next release in a better way.=20 Applied to next-net-mlx, thanks.=20 >=20 > > + /* > > * Initialise the socket to communicate with the secondary > > * process. > > */ > > -- > > 1.8.3.1