From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10072.outbound.protection.outlook.com [40.107.1.72]) by dpdk.org (Postfix) with ESMTP id BADCF1B362; Thu, 18 Jan 2018 17:35:34 +0100 (CET) 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; bh=zAfa0zAA6GD9y2LNT0RoaiDU6zchGZXK1PaJYG1S0PI=; b=G8WpR83C99ZxdgMECLYjPqBi6gb6dANuNOUJSXMcekwZQ2u0uLSThKZeKT5AbOWMAO2sunidB4piDo4Kbzy3IsYxI6ekKbBpNAfXDh5G7a6kE99nf4q1uRo6eay0j7at4OT/EN1AGF6WWP7YI894nOUFaL8NOFsh+R2IGvt8qGg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0502MB3806.eurprd05.prod.outlook.com (2603:10a6:803:12::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Thu, 18 Jan 2018 16:35:32 +0000 From: Matan Azrad To: Thomas Monjalon , Gaetan Rivet , Jingjing Wu Cc: dev@dpdk.org, Neil Horman , Bruce Richardson , Konstantin Ananyev , stable@dpdk.org Date: Thu, 18 Jan 2018 16:35:11 +0000 Message-Id: <1516293317-30748-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516293317-30748-1-git-send-email-matan@mellanox.com> References: <1515318351-4756-1-git-send-email-matan@mellanox.com> <1516293317-30748-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0802CA0021.eurprd08.prod.outlook.com (2603:10a6:800:aa::31) To VI1PR0502MB3806.eurprd05.prod.outlook.com (2603:10a6:803:12::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f5b21d5-837f-4138-c469-08d55e917f06 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:VI1PR0502MB3806; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3806; 3:N+CQRW7wLbTjKQKs7SEvBWOxCysH0IcX7eE4UknI1bJCS2SBj0QXjHIE1AxgpsRGj6j6HtB6bHd/zK9zdzWgl8q/u7DmqO+G/CCybH+iM1VM1qBA2vj/m/Jaw0b61inSJ4Z7Kpc38GJUO5Kz06a9I+2g32Hpv6nyEIPjnodwtQsSWdSTEwxV0uFCg3gCvtx1I13N8LnV6paCnVgZqbJgGyThQsuo1xof3P6dxwlS3ydYwffEiUZRlPqLRZzY2+cF; 25:ItetxredkwEkI2b9XhI78cReXEqU1ICtFjsKmqO6waLgM9vm0rdFyvY43PMfKWo/E0WVqvg7sn4wN5uuHbJsvBrb3azZi04es2CBHMbjuGGUottkFMuhF12FFjWEf5qOVAN9+ADgqCPUh8JF56VBM4A5dk3aO7bA3h1Kf07d2GU14iPHGxbRpY0Oj40LpWhC9Szv516PPm5PCsFTlzSGw7Qte1eD7qzRQfymNRkYwtrS9rKvwycou5vvSYHYKXFvpZs3Lx4G28QYk0Yh9USrUBRB5KcSSmZvAZNYlZJEgTJoKF/XB7jO7Cf+2Ntciaa677w5oy4BtUQjGvvB2W1YTA==; 31:4lZ98nhgGcmvdXlF9fwsR2bpQJYYLFlS1lz/yTGVE9AHZl3NSiurno/8we5GEZajR0K7BUEkc7OceqijFQsYZvvYps2rT2YznH3Apt8veC3O56paeTOSOGIybRwfP77lAPzxsgeYsdzXrpXLDCf2Rt72J5K5FYE733dgAegN0VuwOVbuIVhf+nlPzRX28njxd6bboef8VwGflBk18rHpCTLSiFmxWJoGhguURR53L4E= X-MS-TrafficTypeDiagnostic: VI1PR0502MB3806: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3806; 20:JvBpyEu1gBMWcoYPP3/P+ca4DhWW8i6km6o7Z2bDoTM1np/lRzCV8mC3Jw14Cf9HdcaYB7Z7t5SrSp6TlVkbiMzRH07rGf3THgaQiWOcMXEfy+Oz1HeLzYz+dry8vohJ90TnUcWRUtnEZu4+y15p2Uz30nbpNRr8lIiQW/xQ/VRaKPMfU/XQVxO0ja7PWPKBXqrL7I332LH7kghKcKnXDckeKcajJROIU6OHG2d/d070fQ7SOTW6w2fQRqLnbFDbRVOzlCWCmnnicMdVrE8AxKhFxxylUlZccpJZ/Lx7BpNkMEKk6OdoBde0ZyM87x0dmVmpRowabSAJxCpLIeu+IASqRQiTqxkYFTJv+yQ0BFbDlOBpGoDIExhG8fMvhP6BYmdlZc2naNJ0vKhlTD4KB5+CGxMtVHw3GQsdtA6oHu3xfVnf9kZcjL6OhgZHsZ2KAV82fnyNm6iiezgRV18W9b9Z6vPaFjhDsgJwpBKCqdA5fwoiT1Ds3Da/ONt32shN; 4:dJ5mj37x46tj+ndaVsS1atlxFmgDgAg8v1i9IqsRZjqVEM3Mbgmiyidb7OuXaJWTT0vJzf0PzlYxVFbEfT45uV8h4bCIBzYCTIu5YDbtNNezGaJ7yvHpTSfCez5TfBsJZ1vLQX09xn0FcqLurSLkduM9Ic8tJFVvBKd4pffZjj15khxZXkSwXHaNXYlqof8xq3YcKE48Daw/7Rpj71qHtrj3W5C98+KxFv6C4jZlMJ3PL3LO9uFbvjb7Q5x2bu4byIjrKzQSIsGmH+rNosmlhg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231023)(2400064)(944501161)(6055026)(6041268)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:VI1PR0502MB3806; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR0502MB3806; X-Forefront-PRVS: 05568D1FF7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(376002)(39380400002)(366004)(189003)(199004)(2950100002)(47776003)(4720700003)(478600001)(21086003)(50466002)(86362001)(106356001)(5890100001)(7736002)(16586007)(76176011)(305945005)(59450400001)(36756003)(3846002)(25786009)(386003)(52116002)(55016002)(7696005)(4326008)(97736004)(33026002)(51416003)(54906003)(53936002)(68736007)(16526018)(6116002)(316002)(105586002)(110136005)(5660300001)(2906002)(6666003)(66066001)(50226002)(81156014)(81166006)(48376002)(69596002)(8676002)(26005)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0502MB3806; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0502MB3806; 23:D5I9WCf+oKNq6GsCnRndovZw7+Nsllg0o7h6PSH?= =?us-ascii?Q?1uAv2BNQq4GQjJYbgCMBGgyVeh5fTNaJsxXfHY9YHlWpe9JVXiMB+Q3ZXIz3?= =?us-ascii?Q?NRgvPhKGMqhoc3gy8nkk0G+qf1XVQNXXRO7K8AejWwOvGHuFA7LznLRMt6r5?= =?us-ascii?Q?mY3s0iJddi0a/G0SEEj5+xGcwZtQLDmAKl0D9/aAf2HZ2spjjZJ4ugNoOK7Q?= =?us-ascii?Q?qCtsuaAAcgRA+Z/7Uuw8xC4menXjc2RZpCukkVnGyQZ5LnjA/mLDGSsZEEDS?= =?us-ascii?Q?kKGRfXHhB6U4la/rz5On6kGxcijQjZsTjenlfVuyklQVrWTMlw5euhVQuH9U?= =?us-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v6hqbv6/J6GdA?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3806; 6:D3Y1KYxIgEhZZI71wNJ8bQCE0TdbM3qlhnXUIFT/ZTMqD1VQKjP2ltGMKEhet7UHGVAmGQjueI3m5ImkbMqBRNfAz1kMnFBSdsew2bJUDEU6u2OhGCjQv1RhV09Cu9Qgh1qagwP+PDhzKf8BZPtYxU/PJk0C+y9HjJbNGnQRktgVTkxzzEIP2l/NQP/frSUE2krJn6gyBeotG8Z/+4qQjwHDIiLLaI1ctKf03obU/V5FqozsdTr+Jhjlikj1mcI7lQpouRgkDmCnGeN3h8BMA0Z7IHjg2ZqkTBOvheRbq+AO4H8kQJOAhMhvKyei9VmQVXjcC0XbgpEq1Z6gxW78efv7QrpANQkgYBqKWCp3nBk=; 5:FDhMlDSt5ZaEX/Mc4ikHjJ7INHIeJMhc27CGK7nJq14ztI61XPqOZ1gzXLESuEOzkaA85CXs6kXeeJoCu3FOMj9WObAqLE6a1UUrZxN/3X0K28LJgINe5scJf2AO3tGiof8fU75Xz5Zhb8M/yiE0ZijGV/cltcLH14+MHc3CpsQ=; 24:rShreZWdYImx0KYvK4HuPQI260yj0qNGm+dpMgw1+of2SEr6EsXoCvmrYw0Sltu87OZjZQJqaoAp0mic2Etu7D9MM3qcPkrZuCGpvYQEMTs=; 7:kR6P3qs6zIbKRh4eVXmo8hBh1n46I68c/To4Ovkla71PN2tBvd3dPOX16jR2yrTiF9wmy0DBOH73c7Ph8va9rshy7Gl0KE0mBWvJfNmkMfVGOIennMs2uYdxeqxlP3fxdkt2vI1hH/Ul8JLIKGMqHAwTTwavVBjZGtF3QZztAWz5gt0RaAAvWWtBgr1LSiPHMciN9prXBOeXZOeUeDMRU7ix6pLmNgBOZH6enP0v7arPWnmnpwlW1w+bvxcwQoO/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 16:35:32.8774 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f5b21d5-837f-4138-c469-08d55e917f06 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB3806 Subject: [dpdk-stable] [PATCH v3 1/7] ethdev: fix port data reset timing X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 16:35:35 -0000 rte_eth_dev_data structure is allocated per ethdev port and can be used to get a data of the port internally. rte_eth_dev_attach_secondary tries to find the port identifier using rte_eth_dev_data name field comparison and may get an identifier of invalid port in case of this port was released by the primary process because the port release API doesn't reset the port data. So, it will be better to reset the port data in release time instead of allocation time. Move the port data reset to the port release API. Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model") Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- lib/librte_ether/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 7044159..156231c 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -204,7 +204,6 @@ struct rte_eth_dev * return NULL; } - memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); eth_dev = eth_dev_get(port_id); snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name); eth_dev->data->port_id = port_id; @@ -252,6 +251,7 @@ struct rte_eth_dev * if (eth_dev == NULL) return -EINVAL; + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); eth_dev->state = RTE_ETH_DEV_UNUSED; _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL); -- 1.8.3.1