From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20085.outbound.protection.outlook.com [40.107.2.85]) by dpdk.org (Postfix) with ESMTP id 6E16858F6; Wed, 1 Aug 2018 10:01:31 +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=EEHoBcDvVaQ9fqeSZohpCDndT0nJZbsIWy5KFqKlG8Y=; b=xfjwcDT9YQhW2y5UqAEZdm1NtZepsAWpaH9B4K2KxG9o8A1uXeVgtEEpVlWk16mNx/OvbztaNlS26dcNdIARRLclHIKL6vt7JonhCHkbn3MBskeycIbWjDywzzHffD/8D1c/xT4g8vRS3siNl4HctD7rTsb5YFyJhVxX/J2+38Q= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4460.eurprd05.prod.outlook.com (52.134.109.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Wed, 1 Aug 2018 08:01:28 +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; Wed, 1 Aug 2018 08:01:28 +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/caSqhxPA Date: Wed, 1 Aug 2018 08:01:28 +0000 Message-ID: References: <1533076684-19078-1-git-send-email-ophirmu@mellanox.com> In-Reply-To: <1533076684-19078-1-git-send-email-ophirmu@mellanox.com> 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: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4460; 6:ZconAZRynmdbCpm+juOfmyGt2pljvoBJzPFkig7VJWNMDuNZcg97PBxudqqmVoHlLAmkrSLHDpmhsfyFCt0z3bLgx97Y2HBMlFF/My3eje5Qi13p3doJtftY2/A6r+3emvfnijdWKGhbC0XkyyJHmp6IeXzYOAnebfdcwz/hTqZg/fkrAnAQXPCr2UfGyZXHxdxIUUWT2pcbHeymYiHsJXZAzE2T+J99Jz5aBinJFhCJCvRaRfTl3UVor4QhInUHN01E+5cGx//l88ya68e231sAOG2NAOrl0sRoGvEPH8CtDTzrg2SjTNLMWfjXJpAUaCrMEEZ1wz5YT1eCr7X38gRwzgZgDorw7mdPyZDoQ62rxWrLqGCdYjA2wea1S7K6ETceGyj2sV335gz/0ZR0kpO3JFMIXTfq8+GDarmDYVpydUSXxmkJKmRP/oavcztT4uvRhchh4/EyAfq2R+l5Dw==; 5:+IIqQK0O7JgF1WDNnrHEX7PxeqZ5ICudosCRF0UlzfBkCERyVs54TNcVIPdhEtoCX5WCFWf2m7eTox/DLEztY1HYP10dcZ/zwd2QUZmE7o6EiHHcqC02Pi5OVBcM3hfqROmTiO01aGdIjmJEflOz819KsBn59JxztpeguEy2sMA=; 7:7pDrOIoRa5xLkWLkf6d5yzTv9g1z13FjHP2kgHfhgNNUjw/BXEWwrz+nWQgcZyhktVinT3ZoT9VzdEco2x2F6q1ENboTWFaro5MAGklhkbP5NZqkFeOvfRQu552mTvKyZiAtXyq43c0igOsD4V30YTUJvNIPGogyqRKEjPfLyInaAmPhXqLqNI1ydvMvcprAMMtk11Cy/jTsHd5wAA9y5Wg8jgGYx4ouJRm1oi1cfUlVBoCGy/beT/gHidVcQyLN x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: b166069f-4c6c-4f9d-341e-08d5f784fc94 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4460; x-ms-traffictypediagnostic: DB7PR05MB4460: 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)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4460; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4460; x-forefront-prvs: 0751474A44 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(39860400002)(346002)(396003)(189003)(199004)(33656002)(102836004)(4326008)(229853002)(25786009)(6246003)(5250100002)(316002)(3846002)(6436002)(9686003)(53936002)(2906002)(2501003)(110136005)(6116002)(55016002)(26005)(86362001)(105586002)(14454004)(7736002)(5660300001)(446003)(99286004)(478600001)(7696005)(106356001)(476003)(2900100001)(97736004)(74316002)(81156014)(81166006)(66066001)(14444005)(76176011)(54906003)(256004)(305945005)(8936002)(68736007)(11346002)(486006)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4460; 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: rBpXMW9T8jaNwbcQ7mY/cZXAuubt1qZoZszDg9sUL4ARP/yeRDJx4daV77tgr9ogHOBsV8nzDa8Ay6k3pK8YBvUV0sWDsltj4XcYQGWN6cvraF0doyH9RG3M+fhzf3dCbSIC09XudXMS1pmnwFUqgxNd7lbUsV6lIXo/hC2d7xMNCQ/0kXeSubVQT2kQHtyNnerz0bA7d8kiJxVa9zhAfY9fo966PDcE1nWeQbgMGr1gKgPpi25Es56IQQOTsz7T4sDTuNH6WGwOi4BOy1QkLq/K/Q7D0AEJMd6yG7DnSxj8Vo1VIt1wlGsc5ZM/HlQ7ORMkeOHLLOXbWL7ozvEnOoWS6YBLh3l5LQGqndjizbc= 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: b166069f-4c6c-4f9d-341e-08d5f784fc94 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Aug 2018 08:01:28.6416 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4460 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: Wed, 01 Aug 2018 08:01:33 -0000 Hi Ophir, Wednesday, August 1, 2018 1:38 AM, Ophir Munk: > Subject: [dpdk-dev] [PATCH v1] net/mlx5: fix secondary process resource > leakage >=20 > 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 be= fore > creating the new one in function mlx5_socket_init() >=20 > Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file > descriptor") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ophir Munk > --- > drivers/net/mlx5/mlx5_socket.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > 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; >=20 > /* > + * Close the last socket that was used to communicate > + * with the secondary process > + */ > + if (priv->primary_socket) > + mlx5_socket_uninit(dev); On the current code the primary socket is created on port start and removed= 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 remo= ves 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 i= s installed. =20 > + /* > * Initialise the socket to communicate with the secondary > * process. > */ > -- > 1.8.3.1