From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0071.outbound.protection.outlook.com [104.47.2.71]) by dpdk.org (Postfix) with ESMTP id EB7BC271; Sat, 20 Jan 2018 22:24:43 +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=HNx/aB1y2iMl/AuJjwL05vAP/5bzbvEZ8TUsBYCBmJA=; b=YbKkvbRxUMWK4YNXkQs6mGqI5yp0SNM5mOWDRWKm3HclmhzzChoBmW9FmgXNgm4TOBr2fBmG2w1Am8eVrGW4OxsUiuxEGpcab1d8rhkiSl3eHux7fWvpbkVhiFbftrFe/T0goaTNTD80UqnCh4fKWMBm0ywgiu8f98342ZSBvVc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Sat, 20 Jan 2018 21:24: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: Sat, 20 Jan 2018 21:24:22 +0000 Message-Id: <1516483468-9048-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516483468-9048-1-git-send-email-matan@mellanox.com> References: <1516293317-30748-1-git-send-email-matan@mellanox.com> <1516483468-9048-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR0402CA0047.eurprd04.prod.outlook.com (2603:10a6:7:7c::36) To HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3d2344a6-a2b1-437d-f446-08d5604c38d9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:HE1PR0502MB3804; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 3:zYRPmRH6XmRw44FpuaPOYnLIZoFZxGDXJSdFEUzlKC74oI6slFzj4Lv0a5qWTzl+YqBRChCBRVYQgIavAi1ljT+hqa7eFyhku11nD3zkgbjtOR1h1PNXmGzWRsIw10tW0Q2hq4/bs5Eg3f8HT33+l+FuvRzgFTx3HtEnJqD8vUYX7oWzwhMHds/dAl3G9/+VbB47x3E5aXRig3SaNCuzeBNHi6D6t1/4JNOJQxdHIVbsUlBRRtDKHuuNcbbI4WIk; 25:S7Ga0omqX/nd7MLtfpQw7GO9NVMiG21Y2qOf1CeL91hRhwutpUZNTK18VcsQexqwUB6Y7C6D+B0kPle5c6UtsNu/SC7iznt/Xh1GDwMODD5So1qtI4drAv//dCYM+00pW9YYy9Zj3GUn0SqJOqQ4ezQqSCnUMg6LWUn9k2E9tdHQsoiXNYit1DKD/IXfXFdXan7Xerv/D2omLhI14gsnBnggBhKJUoHHGBkqAzymJ73mvkXjsOzpTz5e5kAfG2vJW8VEzt4toXRxq3QcFYdi+ARyOGPpgDNI0is0WQmyVhS+6vDepZMIfqfrSlcEfBZRfcPOiEtfGC0+qa7iWfOGSw==; 31:3M9168ZMTxfpM2/wbBmmOHFzbQ+3CGsL8WIcTHtSZKizGOfxVIoE9uDQQvhuwzm6DEFIwdF6jhUNJibza+6VV8SEvvsHSlGwW2jDeHQRFCu71NNvXhDgNiVX/8CSYOY0ZchRgjhuHeqSa8kpgM8F6384tPVo83D2rVkxlaTtc/LtQx7apRs/v84rRJK4jvomnRCqGAADknS4ZwpHJdQVyGyPPE0OZS6ik92cg8dWGoA= X-MS-TrafficTypeDiagnostic: HE1PR0502MB3804: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 20:6o93cmAL8pepMsv45OS8hYEeHzmiO7YlXz4e+G7k0GRgatK1w0Um+ZxWlm0x1+by4F27BR0njzra9sMqpyipmQInq3Hy9S7LIQyPcckqMz/SItpI8dFg7ic5Ip3M3DF3S7t/IulMmsQxmsxlaODqxMjxfo7vn3p8af/jXTS0wgPw8TyanP3RBsnugXDs7uaiMytwN3+5ctau4sPHOAjAr1nALvf+u+WH6em2NU1Es0YQ9bO/o87qo2gCojVA4Rrm3+paYyu6dRjxeh40Wa9psOz0LBx3EayjW6vKcdAc6jpJ2aqisFiF3yCyCMNDG/sdAJzC6677scvVJ/qNiGJDoYuPP5w6HJuKkdO7JXBvt0185gt2sT0Pfgm5FtZkLU2/wW2z8Esyxx8mjb0P0OGy3rn710jHmRTZp5ZwKeUuJLwkRiW7w5kyl6dzoQUpeLLcIQFZ6cZ21fbBseV1z3Zix0dZoSWBh0TT3nQGqtoptooHzdEma6M7+n6i8/lWGs0U; 4:5yv+Yr5CjZFcmxARriPS6m0ib9knDqonbjSvRX3pPrdapYePXmm3MUmIWVfMukwZg3auFO2MH26YuL/gKhp+bdhfpykjSfd2rgC8Gn9ZSgvzMudJX2/3kgM6851bjrIqGQxd+e/WquhfKa839OqmgskCoVATz21IzM64R+4IgVEyFwmuvLdbm2V9VTTTJibEQZBpsNRl5lZwwjgwtD/h79Y7/2yr5PYKZ7GyYVPvTiV6i8wn2W0YRsn81ubv3NzzRFKfgCVM5ZzQPBrse1dLDZEj5A/x2dy0/htg1TevxQ6IfvnXn8x2Zhn935Qko7jR X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3231023)(2400081)(944501161)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR0502MB3804; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0502MB3804; X-Forefront-PRVS: 0558D3C5AC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(376002)(366004)(346002)(199004)(189003)(97736004)(53936002)(26005)(8676002)(305945005)(66066001)(2950100002)(6666003)(69596002)(86362001)(55016002)(68736007)(50466002)(5890100001)(4720700003)(21086003)(48376002)(6116002)(50226002)(478600001)(25786009)(36756003)(2906002)(5660300001)(4326008)(47776003)(110136005)(52116002)(54906003)(33026002)(105586002)(8936002)(81166006)(386003)(7736002)(106356001)(316002)(59450400001)(81156014)(16526018)(7696005)(51416003)(76176011)(3846002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3804; 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; HE1PR0502MB3804; 23:R2ifrqQRjUiS0rqk/HJLi69NCErsmtzo4s1jJQI?= =?us-ascii?Q?uutg7BDxx1ENGeowAIcUBz5WEDnLP2ghUHNoUVAbVslvMeqdP1Bgb8Am8+X5?= =?us-ascii?Q?CcEtdnGQAcJJTmN7Vr8myCjPQ/MVVCk4EJFACyBF8BbM8ok53QEVwqClOBlM?= =?us-ascii?Q?kTMv4QAKR1zJpTUiC8sQV1+hyQAg0PWk4ZzsLwLfnDaGm21XCqRnPAbJybZk?= =?us-ascii?Q?kbmX8QDN4iKuT0bywxx/bihdux1+4PkVLEFH7oel4v6M8TsSM0EUVYtNqVuA?= =?us-ascii?Q?/c9doAt2LVsFuplzTJYtZSaDA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1gVWL1L+c7BvOF1Zw3WNmuxmxWK7pl1Ez2eO//LRP3MTd+mcPoyB2w?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 6:JJVH3lBFdYNCO4wmQGRDmOG3kpv6jXUwg4YXdIo9eanJe01XRLA8N6NDFV4ZnINXe+QNBx36647mgUNt/DcJajOaKfNvv3aCU2rTgcxV02KKhcHddR27kaqp0YZ8SONhlbS09nRYS68dC4ptNjUru+s7xoeEv5UBZy0dEhqC21MhHpJ5MkCaa7SBpxKKcks68yAYADWRSfsukzZPTKd9HOVPzNt3lPPKP9LbdjS1kKvz92V46Qh+gilq3AQc5OWniqz0je+mbXkoko+HzDhavSd55TUefZm1X3MOFbDq+hpFcsTIBTdEnHsSbjt6Lw+3xQe5sZKUyIbDefm2rcZTIh3A/cT6mAgCbxAC8wF3jg4=; 5:lpPxJbPS9ZAxm/potwnSmtwKI1Fdrd60S8v5EcJgivV4Ats57FQdt+vmoBKjD5x35+AG1y0BSk7+hBaJLpzwummuHf+al0Owxyn76Js7brULwYfpvF7mquv1hepT3AD1hLhorOxD+06GPU+l8b4p43hdwSgVED5dyg+Kmnd5KIM=; 24:3WC0zrxBhotdepml1xKli4ttcgah+dPNqO/y18Gug1VbJVB6a5kKxbMHL1y7y9aHopHgpX8hY2yCw7zrprG5vIWRwK/YyKMGfV8COrkXHHI=; 7:UOllqef7dN+NY4fI8kZVdCabmB4Dv9snh3Ug4zqUA9u5mMjbX+JLgPt5+Csn2WuU4cfDpttbogFin2W9K6P+gow1GYmnl4Aq9P50GcDz6zFsgAa2CCnttqOG7IFu39IE9ZDLJXj2k6KCX2QdPBN5ceZqO4IyKbyuUoeRHKUE/IMxWo/NWVZ5UhFfIlKYJg8z/ML6rU3kx7MIt17KqnVqf8b9RCTya0KlHcQ+tUzpGLhXAB55a8LV9KxKOQ3Hi05U SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2018 21:24:41.6944 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d2344a6-a2b1-437d-f446-08d5604c38d9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3804 Subject: [dpdk-stable] [PATCH v4 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: Sat, 20 Jan 2018 21:24:44 -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 c4ff1b0..23b7442 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