From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30062.outbound.protection.outlook.com [40.107.3.62]) by dpdk.org (Postfix) with ESMTP id E67AE322C; Mon, 22 Jan 2018 17:38:44 +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=ZoKqO9TRF8aM3oUESO7Obf3H20B7ZItW8OjwcX3L63M=; b=Wz89qI2NMNO/Fhf/npuaWRIXwH2YujRkH6yYlYhGFih7YpPhWQc4Hynl/kZSu95CdhO0SP1AMbqkA+H8bFy1qr2xMYLjfUbHKetiHBlkJlIaTLYEIVlqswgNE/fzUPU5aPiItyB8B0oxfEDxSAZ1YvKCtTijYYwscflpWid97QI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0502MB3802.eurprd05.prod.outlook.com (2603:10a6:7:86::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Mon, 22 Jan 2018 16:38:41 +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: Mon, 22 Jan 2018 16:38:17 +0000 Message-Id: <1516639103-27166-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516639103-27166-1-git-send-email-matan@mellanox.com> References: <1516483468-9048-1-git-send-email-matan@mellanox.com> <1516639103-27166-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR0102CA0058.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::35) To HE1PR0502MB3802.eurprd05.prod.outlook.com (2603:10a6:7:86::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8a05473-fea6-4718-2989-08d561b6995c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:HE1PR0502MB3802; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3802; 3:3Ur2bj3m8wXQgY+p83M6QkL70Fhzj1N1s42366o582iaZRzhLjvUWevddIVNmMnKm5JJ9SMJwdDqImhAm7KWxACDyXOlXvYZYNhblf76U80Jrn60V3ANgvLMfBkiv/82JCDFaAs8vZccJuOwnk0ntuCWsK1kDCzDOu3GFIUfq8az2HXVcBheaQwfVpg0Acsxwi7WIjsDyNJw2BGQeMj+7vOgNjwp8/iNyiewqTHxvqbug2lbIYsy1yCUclMR6BR+; 25:kcCjbAxlt0T2a5GUkvVb/XmNCgT3lwoN0uAeQ4cgNuGf8IU5QLhT8KlrFeD6ZIktOZUyNxM9+FRUnEnct/0gePllZtIZyPxXROS7WYh/P+wZT8GW9wIrHJ2DEBmWc+r1V+3RRVw6hPqBMv0kSqNpZgOBpUcoXAMcbKCOYdpDGjztYuhraFIX1lWTXFULgK4leVvTzxMbvDYMib0UWt4GVbbt/TULMXTZYkY4IMr9Mne8/TqE8nUu7/YQaO5BXDwQ9dfBSTnuAswv1O4f9ipnhMuBcKGkK7d3v1PwiMRYDiugyOtBo1o6HNjLjZFtkPJW9oeH1ctvrESpzp65C/Gl0A==; 31:YRB3wgmf/MHbgjcnis0kwX402vob8ECpyHhQWv9Op4JEQuuw5dopypgwake56FUfc2ygta2+T79xVpbAB9kMgECGgJmbLedgkc2i/ep4zMO8K3FuPbU3XkeWlP62YuHMr5K5P0J+x3ZliM2bPfpuPxoEyQ4jqKMiO0OG06cHRMSriRh7VzFOeoSaZwLxPqWWBveBQEQKwuUDAFcPp1JMUVhnMlgnZ3NLodIYFtZqwI0= X-MS-TrafficTypeDiagnostic: HE1PR0502MB3802: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3802; 20:H9vzCfaDjPT5pg36C3ETzXBV0ihOLZz2pXfZqd1wH4WR9fPYccF7ADgbnwo/gftLIOpC3KyXCiXdhNGHiZNSaD+zUk9i7isIkPUY7QPEeNqWkSgVWBAuZjqdzNQqFV0vagdukE1xL6eUGy29mHEV3a30MgtD1Vegda8kTxBSfHe4k+DgF0RkG57vRF7regi9ztuI4hU2LEdayP7dy6L7ju2xkzBlrJCP2cWdoCGmfhfgT8k9JcdqkycUnjyi5czXEutXShw2S83MibWYlhCXe0UjbUwRInIZEXq2O6fgVJrLurZ1fRWi+xq6HpRjEUuZEdvN4sJ/gP2fwzH5oJL4SEOdY2QNXemvhmtCX3w22qFlAyH3QGA+o+pMOi5+XdvywLVTEGQYnsHmavZl+7mrsVkLlwOWHTgujTMCF5QHZZhOt964LbjrfbFHHXKTwRpS+nEo17NtDxnV16sDUTsHaQknVG3e7G93gzF78Ob4zl5vdr02vnLFe/Oy+0wmkdf2; 4:F5hNQwcM0lEsorjHl1X/ogkJKDZ4xmcNAtSRyM8Z0G6a7F1iwUYvA+zmOQe/zQzmGQ30jXoa+9UFCkrDTuGN/UCM4w4jAp2+S+NDxpQlPCasFi91mhMC9ZpZaTeJhK7CoiDhMDQm27s36LSUfJ9vNNt+Dr6vv1v4e/Nk/qn470BFIaP2hYEqSpbkh8VWGIoSu9vwq1RFO3K/LLkgL11oaUQQF7SIi7w/6OqbXsyVZURqQJQlirqsDi7srmFWOrDCpC7h7bWyCZGHWUK7dbIS5guSuJwkptLi9aygl/3Mk/anp2zSattyW5ctwTHa31oC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(2400081)(944501161)(3002001)(10201501046)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:HE1PR0502MB3802; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0502MB3802; X-Forefront-PRVS: 0560A2214D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(366004)(396003)(376002)(39860400002)(199004)(189003)(5660300001)(53936002)(47776003)(8936002)(50226002)(2906002)(68736007)(4720700003)(55016002)(6666003)(2950100002)(69596002)(478600001)(76176011)(7696005)(316002)(52116002)(386003)(16586007)(36756003)(51416003)(59450400001)(6116002)(3846002)(16526018)(8676002)(81166006)(81156014)(66066001)(110136005)(48376002)(26005)(54906003)(86362001)(25786009)(106356001)(5890100001)(105586002)(50466002)(305945005)(4326008)(7736002)(97736004)(21086003)(33026002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3802; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; HE1PR0502MB3802; 23:JQuEsU7KGk0fb2JEf8WgBOvrMhmbZcd8ozK2S3P?= =?us-ascii?Q?R5OMv6DSuXfH9xIRAd3+IVXJ7xAU9YWzIvtS6sIPu3wEQQA7fzKUkFEtvL4j?= =?us-ascii?Q?taMoGv6sZ1dMGU6NmLe4EZLYQGtflBMvrEJ6H58MOzv1d/fQfDPtplPFoXqR?= =?us-ascii?Q?AwHWcxGcAVEkeY/eMAdKlQOuwb0z14HbjOOhabVRLt49Xk9Kqxk6NykdpdgA?= =?us-ascii?Q?oLI5fcn4Bk1lpsm4IkX+er8ePMc+4RIM95S53XR6POrcthclN7GbZJEyy/JD?= =?us-ascii?Q?Mh21Z9W+P2Qr1edcJk5vrqEM4Q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osticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 16:38:41.4720 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8a05473-fea6-4718-2989-08d561b6995c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3802 Subject: [dpdk-stable] [PATCH v5 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: Mon, 22 Jan 2018 16:38:45 -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 Acked-by: Thomas Monjalon Acked-by: Konstantin Ananyev --- 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 f285ba2..c469bd4 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -261,7 +261,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; @@ -309,6 +308,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