From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0087.outbound.protection.outlook.com [104.47.1.87]) by dpdk.org (Postfix) with ESMTP id 8276D235; Sat, 9 Sep 2017 21:27:27 +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; bh=BEz9iYJYOpuPYX14Kgk2ro4aqc6LDzIttgNSavuUoWQ=; b=NP0kwVFOyepgdFssHaIZ89bGZgZq3fyGLJXX9Ic9gFwIUKGnBmokxZcq5ToEeKpiFiXmS5qQKk/P/u8AoZjyN5rOcaM7SqO44CbTIcEImNUB44XDygZsoInVy980ufUjbyWGPP2CAtIHlVV5/wgZEptgrGKq1W+49kiH6KC1yKc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR05MB1259.eurprd05.prod.outlook.com (2a01:111:e400:588a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Sat, 9 Sep 2017 19:27:23 +0000 From: Ophir Munk To: Gaetan Rivet Cc: Adrien Mazarguil , dev@dpdk.org, Thomas Monjalon , Olga Shern , stable@dpdk.org Date: Sat, 9 Sep 2017 19:27:11 +0000 Message-Id: <1504985231-21031-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR09CA0066.eurprd09.prod.outlook.com (2603:10a6:802:28::34) To HE1PR05MB1259.eurprd05.prod.outlook.com (2a01:111:e400:588a::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91c213ea-81d2-4e21-6fb8-08d4f7b8cd03 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR05MB1259; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 3:J9aghf3gYvbeV0XxBRIg8HrYG28v12ni9unNqhQxzH6ukkOHHzcXYysi8chSJySVYp3sI56heAm8hB+p3g7VmwnAu2TpTA4fgJnCA66lnvanwaDrCG9mvbDBPRmYUhMhDBImdP8CNlwROxkDww34FuarwqKmxjr6oAtL/XoIWuq6RH6agkX4NIsR2LqWv/i6z9cqJ/Uf3h8YmffydBhf9Tl7+Ddlev5nOrypkgw8yvZ4Ws0zV92HsGmzs6kDPJFD; 25:acFHQgfdP+S5+jj22WuP1ddfVEVk3vhuticjKuZ5aO3u3+3Sw+KRMBqrhrgZ3rinOXZCfC805Nl47NiT6DJczXQg+B7nseTAuEtNHh5a7CVHY77G3CALUBlR7bvV/fd92VJ9OdiVt8vWQi+Agz+qE5ij0oAdpkPLk+MnGZkgyWzSRfuHlitUX1jqQa5BNd3EmZK9vbLJUGotLxNJE7gkCzd/MqtsQolLFvcjJENWipnlG7HS1qtLKUNbsrnAAY7m2y4rr7L0EBwn5ifufeBw/gKJnIf498p1gwYxptdSoLmkAz1kL/FgQc3WU7emhRtEnHyVaK8jzUuV/PyUykeDLQ==; 31:mhOj8g+nWakBSEwAqBsU/Q9TPKkjcP4YnQD8hg04TuoenZUwYcxV2tb0e9Yppke7a3vju4BWVC18SK8dU7E75BLK8l08p8DLKXkWox50iTJaLQYUnvIvUGQ3xSn684dkB/8IpfaZNQjN+V5SJXMjUoiAKuuTOzi6MDaAHK0nXWo0tzCe4MNifTyXT3sGwg5EfxY4BRm2GjRKFWLmYWcto/MhvgWUDKQvGQKTiaJ7d+A= X-MS-TrafficTypeDiagnostic: HE1PR05MB1259: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 20:yfGavBz3c9SRo/JGva+I/V2BbGClTbnAhjgtcloWeIv0ZrScV03DCo/Mi3H6PMafg/ZW2bflN/NQ3U0g9AoFjHEHyNiDWVNbrQbVrLV9Ih6gGtm0WpCKM79yIUopO8n7H1QwlCEnt2PstLZulCMy/VtaHgCZ2hddI8FJzn273uXyz81d5/R/Q47z8TSebLqIR6TLD2vfsqcMiekfCm+n0oyCkRbmYpvL9iVMfpXGJC8VHRJIMDa1xbeRmhpXnQqd43uTDFQYCf0riF2huOkYACyf1rdFAz2llpKYHQDJZyegMhE40I1nQZWI5prYwXZ6LVB0PbhiaJh4B4+B4QIpiGWaZ4PsrQK3L6AAV8ZEAeBg6hlSHzjVyoBaYPoU90cAgv+0bKXtyKd2IHutv6FWRJsQ2XcFgzUZI5aEhb/0xzNsQryZfaifNt71QCiG9hHxtaMTz5M14rclp4eHKUtWB1U+Rb48T9iLbSnk6DJ/Ryivl1FFlBytIHOFAXE3eM6o; 4:0MqDTibIbPfPlTruqu4cRxEuxNyzOUfHZdmRlNWb4BHAO3MH3177kSPP9OnYAj5dNXGOiuMyMB9Mpfjc0WGeu5vHnq593a0zbHzQvtyDj3anUFEsKI+5gFMeXOUGjApxK7mwwkF556k+kUILrAWTTOR1bLiou1A3dtlObkGrewwy0nzsOXy1e2S9nUEN3oo6gJHedDcoVYyhIUGwh0Z0n71O6U3wGWAessxfIjIvwrMv40WEeQNcqN50HXbHzqLh X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR05MB1259; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR05MB1259; X-Forefront-PRVS: 0425A67DEF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(189002)(199003)(33646002)(66066001)(42186005)(25786009)(54906002)(4326008)(105586002)(5003940100001)(8676002)(55016002)(50466002)(69596002)(48376002)(47776003)(106356001)(81156014)(33026002)(81166006)(53936002)(478600001)(4720700003)(21086003)(6666003)(6916009)(50226002)(36756003)(189998001)(50986999)(86362001)(7736002)(101416001)(6116002)(110136004)(68736007)(97736004)(5660300001)(3846002)(2906002)(7350300001)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1259; 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; HE1PR05MB1259; 23:77qu3F0ux/LGpJ1hGffpLr+n0UZQ6OZUjha1amO+H?= =?us-ascii?Q?NcPCvi2tQ+nKL3WtS+wxQMKSB9l+nyjRFtyh77RaOv3pclm7Z9qwUnsweRYT?= =?us-ascii?Q?6a/zAFV2qfJi+ekEZO4H2poIpXQJe03gLx3WF6iSuhwsk6EbKvK3Sl9n4JMo?= =?us-ascii?Q?dmF4YMXleqoucP9ZYmIFjdU/vP8ImRNaAYCQy+UmsTqOV93JkWL/7Ts5pVOW?= =?us-ascii?Q?4UnHagjMtjSOdRjk47qV4kHt38f3dmhvzb7zuACGALVBBYfAetq6VndurXnK?= =?us-ascii?Q?qFBnaIkYp4kM0R2SjaQ8NW5YpeoXJnGVuJD9XaG/9ohn9aVYjwCvcbntJ5nD?= =?us-ascii?Q?40YCvIu6DMm7ZfXOsXz8X/x9MEe9aZ48vzT8aBqtbvD+APHwcgQ92T7D/GZ3?= =?us-ascii?Q?xwYNcKPEWAZgT/FWU2IrfVU5pdm8F+qGwsmU8D2AHoIIQBEXLoZbEMbNmz2D?= =?us-ascii?Q?cf3HEIotZPD+R3LSotZXFYwRHmQqqa/4ytPskbGirmZ8kOHKbouYr9LGZW/r?= =?us-ascii?Q?+OmKGczAQMrkIFtvnBFDFraohgizcdNEHxiGSmMsmLukNEy+VZkPTUQ2tEmZ?= =?us-ascii?Q?Xr43el3K8OeAwlu10do1TadJCSNQ4845+iqxBRm0LgQru3keXwgf0H0arv3H?= =?us-ascii?Q?rdTa+vdLMYM1Ld7crSKeA/cXwDemcip/s6vA+ig6aQDRSVTFzu1H59Zx+KtB?= =?us-ascii?Q?GeDSaTFMHg+mifNBYMawVX9GjIlVd5xejJhDThXlhCiLS3tSB0itQ8lb7fQD?= =?us-ascii?Q?k3uWGdATzuYexnQdohxQsjD1yamQ/GBmK2xMfIfwLXLHBMWSqxsbW/HFSHvg?= =?us-ascii?Q?VEO8hj1ftabqVQz3g2RVX/DspWf5B93mlEYWrWoDWUcfvmh27uZtIbVtux40?= =?us-ascii?Q?jKq09DGQSF2CFAk3NGPDLXOoHu7WI40XPS9VWpbec+9YKdlqjwiyGmNocfIA?= =?us-ascii?Q?IBVHOGQhaX3xTm7hBDydFviy4Hq4kEmRtcLl2bCiNLABGEwC6AGw30Lx1iEW?= =?us-ascii?Q?lTs7yydRP8ZQc6M4cxBgcAe/uUo3H8JVt0sWjjZpVYZLLObvOAmdhOF0Jr3n?= =?us-ascii?Q?ZqOOK6dx6AKUhscyboXxPk7mU6ea5zmAe19+Mql7jK6mHegYmMTTmtJV7jEr?= =?us-ascii?Q?3DwefJdrls=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 6:1+bX8+X45y4z1gvgIEOZYvOvpmpogBRJao13yt65jeRK5Gb8SJZ131e1yUY7SiWAY4hIOi69/YVSYjdouSEXzQMeDMkcg3l0PwugCjl9rTSTFG4RIcOSmcstQqZCyi3R+uoK9pRS6Go9FOG1QpHd4PUmXzteC+no4IJOh6ogD7OBVpIeuT5syW4tz/cxozHIo5jZgA71uy+J9YhkburOnGVEIrI6lnG7zR3sMnZJFfX5vAwxI4GGA8cOd0ueNIW5V7SsaNFvEwat/DSM3Ci8FiBGh3J0kyCqtkgpp1hE3Kctb7nk/Hur37ueDdPJNAdWH3hHo7yOeYiQsBd6i9dXUA==; 5:irfYiEiTQ0AREEaY5LLJQGohN5wpI8a8wPzoPSxUUN2vVgyPbaOYmjDJ13BR2/lP9EmTjniMQMxLVT26W0HFItogaWro1cm/pSt/7BBmQdKZkrdorJuBPnac3xU8WZsSyd6x1WU8oQgY9ytVDCRQOQ==; 24:2yG+dRLc65uGX7svfgB50lw7PWP5jrmmD7+/mRRkk8oOc4tmeIoKF46PWY8Hjv+SYzLbFoMuo/8B3WbMX2J7iOxIUpNjVNpOffCmmhIPlrs=; 7:/5AphlCYzXYl8+dTHaSMI+GOnhgUoMl1hVnsIovHM4IatlRMMLzjtB67a9JvK0CoiJllojrAW+p9ExF4nEtWAvilItB9wjEbTD1waB8y6p/bokHWN84kCmox4YvAXF6CXmOoB9d47caVaaIX0ZT+7MTsunJsG7Gk3G5okj6bc4GaPljAEHi8v+Aq8h1Zy+ie+4SxuRlzLpiNBQdNK9L1K86thj+tWV4QqSKuFgwvvbA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2017 19:27:23.9804 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1259 Subject: [dpdk-dev] [PATCH] net/failsafe: fix calling device during RMV events 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: Sat, 09 Sep 2017 19:27:27 -0000 This commit prevents control path operations from failing after a sub device has informed failsafe it has been removed. Before this commit if a device was removed and then a control path operations was initiated on failsafe - in some cases failsafe called the sub device operation instead of avoiding it. Such cases could lead to operations failures. This commit fixes failsafe criteria to determine when the device is removed such that it will avoid calling the sub device operations during that time and will only call them otherwise. Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") Cc: stable@dpdk.org Signed-off-by: Ophir Munk --- drivers/net/failsafe/failsafe_ether.c | 1 + drivers/net/failsafe/failsafe_ops.c | 52 +++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index a3a8cce..1def110 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -378,6 +378,7 @@ i); goto err_remove; } + sdev->remove = 0; } } /* diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index ff9ad15..314d53d 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -232,7 +232,6 @@ dev->data->dev_conf.intr_conf.lsc = 0; } DEBUG("Configuring sub-device %d", i); - sdev->remove = 0; ret = rte_eth_dev_configure(PORT_ID(sdev), dev->data->nb_rx_queues, dev->data->nb_tx_queues, @@ -311,6 +310,8 @@ int ret; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; DEBUG("Calling rte_eth_dev_set_link_up on sub_device %d", i); ret = rte_eth_dev_set_link_up(PORT_ID(sdev)); if (ret) { @@ -330,6 +331,8 @@ int ret; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; DEBUG("Calling rte_eth_dev_set_link_down on sub_device %d", i); ret = rte_eth_dev_set_link_down(PORT_ID(sdev)); if (ret) { @@ -517,8 +520,11 @@ struct sub_device *sdev; uint8_t i; - FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) + FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; rte_eth_promiscuous_enable(PORT_ID(sdev)); + } } static void @@ -527,8 +533,11 @@ struct sub_device *sdev; uint8_t i; - FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) + FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; rte_eth_promiscuous_disable(PORT_ID(sdev)); + } } static void @@ -537,8 +546,11 @@ struct sub_device *sdev; uint8_t i; - FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) + FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; rte_eth_allmulticast_enable(PORT_ID(sdev)); + } } static void @@ -547,8 +559,11 @@ struct sub_device *sdev; uint8_t i; - FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) + FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; rte_eth_allmulticast_disable(PORT_ID(sdev)); + } } static int @@ -560,6 +575,8 @@ int ret; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; DEBUG("Calling link_update on sub_device %d", i); ret = (SUBOPS(sdev, link_update))(ETH(sdev), wait_to_complete); if (ret && ret != -1) { @@ -597,8 +614,11 @@ struct sub_device *sdev; uint8_t i; - FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) + FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; rte_eth_stats_reset(PORT_ID(sdev)); + } } /** @@ -693,6 +713,8 @@ int ret; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; DEBUG("Calling rte_eth_dev_set_mtu on sub_device %d", i); ret = rte_eth_dev_set_mtu(PORT_ID(sdev), mtu); if (ret) { @@ -712,6 +734,8 @@ int ret; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; DEBUG("Calling rte_eth_dev_vlan_filter on sub_device %d", i); ret = rte_eth_dev_vlan_filter(PORT_ID(sdev), vlan_id, on); if (ret) { @@ -746,6 +770,8 @@ int ret; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; DEBUG("Calling rte_eth_dev_flow_ctrl_set on sub_device %d", i); ret = rte_eth_dev_flow_ctrl_set(PORT_ID(sdev), fc_conf); if (ret) { @@ -766,9 +792,12 @@ /* No check: already done within the rte_eth_dev_mac_addr_remove * call for the fail-safe device. */ - FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) + FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; rte_eth_dev_mac_addr_remove(PORT_ID(sdev), &dev->data->mac_addrs[index]); + } PRIV(dev)->mac_addr_pool[index] = 0; } @@ -784,6 +813,8 @@ RTE_ASSERT(index < FAILSAFE_MAX_ETHADDR); FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; ret = rte_eth_dev_mac_addr_add(PORT_ID(sdev), mac_addr, vmdq); if (ret) { ERROR("Operation rte_eth_dev_mac_addr_add failed for sub_device %" @@ -805,8 +836,11 @@ struct sub_device *sdev; uint8_t i; - FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) + FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; rte_eth_dev_default_mac_addr_set(PORT_ID(sdev), mac_addr); + } } static int @@ -825,6 +859,8 @@ return 0; } FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { + if (sdev->remove) + continue; DEBUG("Calling rte_eth_dev_filter_ctrl on sub_device %d", i); ret = rte_eth_dev_filter_ctrl(PORT_ID(sdev), type, op, arg); if (ret) { -- 1.8.3.1