From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0081.outbound.protection.outlook.com [104.47.1.81]) by dpdk.org (Postfix) with ESMTP id 1EC831B2E5; Mon, 12 Feb 2018 21:52:02 +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=/kc4voP6j35mQuIhbZeEv3vQQqAwBEse8x+vUTmyNsE=; b=pHq9D/35I5Fk0xYeIhb0hdC9nJ5dx57pOk8pnk4mZLiVIV9wjRz5CVg7cEaotALWfC7w/2OYkf4YyaTAv5vwqmyfyhC8R0igBMIjjTAAM72++nzs0Yo+1fs4nllrWHHioJC1zM9GLatf97z4TlX/waSItC4h9lsiZ7ophmhgvZw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR0501MB2664.eurprd05.prod.outlook.com (2603:10a6:4:80::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Mon, 12 Feb 2018 20:51:59 +0000 From: Matan Azrad To: Gaetan Rivet Cc: dev@dpdk.org, stable@dpdk.org Date: Mon, 12 Feb 2018 20:51:40 +0000 Message-Id: <1518468702-16719-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.9.5 In-Reply-To: <1518468702-16719-1-git-send-email-matan@mellanox.com> References: <1518369872-12324-1-git-send-email-matan@mellanox.com> <1518468702-16719-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1P191CA0004.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::14) To DB6PR0501MB2664.eurprd05.prod.outlook.com (2603:10a6:4:80::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c5ada4fb-de1a-4c99-ddf8-08d5725a76b2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DB6PR0501MB2664; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2664; 3:KmFJ7XoUZQb28oKNb5vUVjFJczeGtiahmXki8NBnTJtr7oDBtuouzeDFNJuPtlvrDCLGOTUVWxIWTy1Adqvo3xp7KSM+zAGgcagu/e6gb51wslCwkab15S8zzLMzCS0jdtYFXuOCBW7WzlHzo3oq3llR704tgoQpusr+4mQEF+w/T3xwYdLho+DF99RUWEMmxfWVSPuwb85GTIfRegASbjDrxURN89eGhzUjVZ22dmiNeCBvQxm/ELKmQ6cCYk8Y; 25:BnIntToB5mYGH7mjREIpSgp5rnouWeWB8FYzInwH+gyNg6QUXEuhmd2FfQU4r4gm8Ru4PcoW0zmz8ZoxEhE9iJb084simcB0bAYSF+rlUq10Yhp5+Jis/wwt8vo086+QpuZVj3uPh4PVVrJWUSwlr5oTl/JI66EaaEBbfJPhq8GzXnzkyeSfViXtL5sZC11LI3Ss/HhUu7RKiNA2zN0+5Vy3usUmOZMYuSjGhc/5yYishyJsQAsjA/MNl3WgbztNme+QZ5xJktt+G1wa+bLXE6JQIK1gVn2hCekDN92v7ZBmNnYfKPrN5DF3Lr8VHimQ5GFrOUQ0+jPgtE7fW7igoQ==; 31:7yR3Ll2XVD51jZG4NGTT4L/ABIOTtHS0G3ybQlTsisY2wOhwtO9ONz5FCbin2+Ew3Nky50lFXSrqbvgLjZrVKr80mym43FtgQB2tiMm5Oail36TK1H4fJyRXqrjyhBNllQt+sZjg//nA4es0Ru3po3bC6E/iAv1fdNwvQBVUK4YmoSbbZHzXMpsrZeh+UDDODhVmCFj15tkX8J5l1JtN8sH4JEVdyW7z7eqCUQWJYhc= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2664: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2664; 20:3hrjn969XtNV33JKDa0/BS+Pgx6szGNOAoPLo6ax2FO7OCch8BGTl1u+a/1X1/0Q8sajzKQvc9plXC+YzBcB6tdYe7p66DGXl5HJ/GcOuUzeJXWjwgGW1FfNpOlpI72UkKcrAoJZhlUtSJ1LP5C2SYJcBjfzIdAwGfn0eKqXCwe1TY6e3asmiu4Lhp+TJmxGA3vQy+TLBGmTXoEO+oHuqAlzJ8f6C5fnhb4Ud+ouSaroxfa78oBO4MrT4/kuo3O+bqWq/8y7x0QifKvnrVdNvAV+5GpiYVYEQ0v8WiY1EPf8hLpCI1np8ULcMc1Vl8RlbyAIskzEzO2/w7xas48+65tv6x/28saMaFWxUHNKSn4uZflC+DXZVpkv68VzBEddOY2E0pCbqVgIFBzjCBEJXe3f/jiMxXlD9WQaVosoJTc0hAKUQ7W6ZkFAVMcyF5g4ZmeqyDjHYg8wZQCAy8I9wvIU9m0hXNJF7NmAZEyXm1LY6Wm93F66vWImy1Skhgt6; 4:kv1UcyHGTL6X0fvh4r8kslHGi0jJkMpIrNzhMEl617w5marwALbgMgcpYvrI87qcKhikWdI98SD0N2wpiTxDCJeOVk9h1fVLbglstN3YA0qfajIM57utA41QaPf86OybInIcXChpWEWnD952Ot/X4SjDmVOFU34tBbAoRvk4Ti/GF/0KPSMnhJWqrF/QYtY+Z5DduVvbzWd9kB95xO9tvmS9V6jpHbexZ0NKG6zJYn56S2zoZDj9bPvDahq9VSYYkLxF460YatMef0e5GglD+w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231101)(944501161)(6055026)(6041288)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0501MB2664; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2664; X-Forefront-PRVS: 0581B5AB35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(39380400002)(366004)(376002)(189003)(199004)(478600001)(8936002)(6666003)(81166006)(81156014)(50226002)(76176011)(68736007)(6916009)(69596002)(8676002)(2950100002)(305945005)(7736002)(33026002)(316002)(36756003)(21086003)(16586007)(48376002)(105586002)(26005)(55016002)(25786009)(4326008)(186003)(53936002)(97736004)(66066001)(16526019)(106356001)(47776003)(52116002)(51416003)(5660300001)(59450400001)(7696005)(2906002)(386003)(86362001)(6116002)(50466002)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2664; 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; DB6PR0501MB2664; 23:q08fCdLdOVvOYXwYvSkcEReI9y13yJ9EoWJiM4I?= =?us-ascii?Q?394IMJyeVlYRrL6AnKq0AM5QhA8aiOyhLIW0+foEHxNvtHTmhzE7uyQSqHmo?= =?us-ascii?Q?LMCNs/97heUWaQsJH64/PQEUX5NcNeBib8P/2xtwgkNSy0kjETgHf6Z0bE8E?= =?us-ascii?Q?NhQpYfuh2vC2kbOYZc0oXrnH+baKlM0nVevkuYUZG72oqjNIRwK7WAwU5kK1?= =?us-ascii?Q?RfgJKe99wHCjJDn7f6SwmcMp3hjMnK/1uwSmTUA3/cT0caY1L4QQlrpfM+fD?= =?us-ascii?Q?3iMSsWYgn3tSPMek8YDav28MwmYBLwsUYAD6xqiuxf/lQ3kGJ1KD/pGbHiQa?= =?us-ascii?Q?8iXtoyTGhgg41y6llciyDn6SuJXNN8/F/eddcM5srrVb6flgiBA6J5ap++JT?= =?us-ascii?Q?8bnD2DI3acFx/GFOFV2wmTpV4kt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zqp5kKvO8Sorifm6G4oeI3USyPvDVPQB/JC9kCTe6BDc+37JemGJtx0hNZcfOHGacBSPNWUspo01QnE/dMBRJHhb2IbvQ7/pQYUHUDmxhOnHLVox3YTCk1lymi3QLsPRMExBQtaI2stg6+C5fewEoyY5GyISb0d/FxGmzJ/6G0QJD5c/Uxu7L3tRIE5UaQGWx+9Q/DdWYkdcBsKVtaJvSfG14u7PcVyw+35+ENF53BtVuDd8pWCwJ3WJRtj+qIquJnD2nShI09kJmjDwnecxDjFzMkukWs=; 5:8++qGt7Rx1JReGWtk1a3fuQfMA/1lN42sEmiCHSr/aRONLOUpErm2D59N8wF9pHDD6eTu6x2S6fAfg7ayWxt5G2YsB4A8F98hEpgiaDx4F2Pe7sEL/OzUvfDXGZTJIn+pq5M7X6u5MvlEg7+w+pqKHqoqMzT6s9FnfCXH9McdyM=; 24:9awxNAC3+8m1upaUMe/QlBxpnt4UJ7hcepSXrZP7BsWkefLQnAwEYVhwOMzWzmiVuoSEct88ral/VyO2Ujf738XDxwAmeMhlqcnfEthAQU0=; 7:AZ2um+LvZ5vF3fZ7tAWfV40kPOjiieN1IUxUsSmzwhum7E3kpKq1fIUKHxCFlsSNeydj3m4kqciCslNQXkDnifg8TyIrj72MDbXbGzD0xHfhKPoMdeOXQ+K8ahohjHsbzWXpUF/eE1TdkCDgS0VR26eG76O+/HsshJV/KBdMts/lxxu0vD/8Ed8CXULl4dhVuQGiCMc+ix4UcQKpTsWF9RFOCXk5P1qYGxGvodf+uIBvRZfFcjAI3P1eZB9dCe2X SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2018 20:51:59.7318 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5ada4fb-de1a-4c99-ddf8-08d5725a76b2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2664 Subject: [dpdk-dev] [PATCH v7 1/3] net/failsafe: fix hotplug alarm cancel 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: Mon, 12 Feb 2018 20:52:02 -0000 The hot-plug alarm mechanism of fail-safe PMD is responsible for handling removed devices during a plug-out event and to restore them back to activity following a plug-in event. Fail-safe sets a flag called "pending_alarm" to validate that only one alarm callback is pending at any time. While this flag is required to avoid simultaneous initiations of the alarm thread - it should not be considered during alarm thread cancellation. So, when failsafe_hotplug_alarm_cancel() was called while the alarm callback was being executed the alarm mechanism was not stopped. Skip checking the "pending_alarm" flag to allow alarm thread cancellation all the times. Fixes: ebea83f899d8 ("net/failsafe: add plug-in support") Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- drivers/net/failsafe/failsafe.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 2665a39..7b2cdbb 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -85,16 +85,14 @@ failsafe_hotplug_alarm_cancel(struct rte_eth_dev *dev) { int ret = 0; - if (PRIV(dev)->pending_alarm) { - rte_errno = 0; - rte_eal_alarm_cancel(fs_hotplug_alarm, dev); - if (rte_errno) { - ERROR("rte_eal_alarm_cancel failed (errno: %s)", - strerror(rte_errno)); - ret = -rte_errno; - } else { - PRIV(dev)->pending_alarm = 0; - } + rte_errno = 0; + rte_eal_alarm_cancel(fs_hotplug_alarm, dev); + if (rte_errno) { + ERROR("rte_eal_alarm_cancel failed (errno: %s)", + strerror(rte_errno)); + ret = -rte_errno; + } else { + PRIV(dev)->pending_alarm = 0; } return ret; } -- 1.9.5