From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10089.outbound.protection.outlook.com [40.107.1.89]) by dpdk.org (Postfix) with ESMTP id C10A51B80A; Thu, 8 Feb 2018 17:34:31 +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=hW3qRv22BVQOTg0XGF2MEMyJQK4DI3usj8g+pLuMXfw=; b=r1Iwg5UMDn4AvzYWXtcka2peLv3CJ4ff1pkgrAsjhYPZceEMJfATiPObdBY6jqbSJf2gZmBGnmuJ9Owtbpj1kFGL0fMOOaMFFd0AgkzQ8VvMJ1mIUEASzYYyqUlJYBu6zfOvLwUH0D9mAlH6Ih8xqNKb0BaMNx+Iso0DFH9XYug= 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.464.11; Thu, 8 Feb 2018 16:34:29 +0000 From: Matan Azrad To: Gaetan Rivet Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 8 Feb 2018 16:34:11 +0000 Message-Id: <1518107653-15466-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518107653-15466-1-git-send-email-matan@mellanox.com> References: <1518092427-4333-1-git-send-email-matan@mellanox.com> <1518107653-15466-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR0102CA0023.eurprd01.prod.exchangelabs.com (2603:10a6:7:14::36) 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: d0a13ba1-f8a5-4a00-bc9b-08d56f11d3fb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:DB6PR0501MB2664; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2664; 3:aSHLY7D2PFmUOffs1TZUGUrzeHHjPJKWLl3WPNB6MuPWe28/7j9JzskivMewWvg4J6/MTm/F584owN0nkL0GMJPBWsBJJmJLRjxy1A1OXyzppJNYo5RVEtLgvRQxqnVhXaJY8tzGt0zGqCfiqFR4OOf2i/oCfWuz67Ol5HtE/+2uDef7kUQLtu7fwxTA02P0P7bQ8L+HxmAvUjmmN7cq8oacypsqgqiiXTlE+cVaNBzMMIRA8594LQ9Bvyk/oXc0; 25:C4HTBTtlQg/XAIy+H9AQOXf8OVUnNn+q4Zmprnu5yzVcLo2bRYvVIwK6baLQodksLVlYmW9sZdM4O4fBRgMli70yuUWDQjPOMRygv60gbCaMNi+KfBGrDHMFvZbkU1t8Y7WICIjagI14Qbv3qo+5lTLaW6OIbHnV7QY4+7rWrRJowrUTbG8sykWSqqI9kYM0xg8qifW9Nu6UyljD/cyUD+r076p3GgMxPP1/NN2F03Nb9Cj7RUPhRNSixGaSIfXjuBeVqOoulgjseEzDMqjuh0dCrLUNTIkea9EXcB3Siq2J0rKc/ETW7xANVnCQo+blhW/UFKV8A1gb7nhJHNSLVQ==; 31:m7usGu9prkTXxQreuDB7lK4DHd8hhSGv1c4p89OclitoUcMn+hvLsdIKCrD2Gj/26newORNh1D1mz37ezyCgFG7Ekzk5yh5GDRVs9gqyW1XaRYmjV5Z3z+gjwn/mhFKRAduV9OXQeSPn1wbRLXzsGev8h0ztF8W1qQSTtug9aVfRMki27cA1yBoP3jdBBaHAE1J1SNxZpFghtWzg8Fk4rKVz37b3mQung6JGL/hLp5U= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2664: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2664; 20:DH2I9hu4uozvLwz1kdXPvXl/2VS35SqNpJEZ6G9Yf2awEaRin4DdSOFVTf78zkaLMUEmHTJCQb/oUgEx1wu8MoWXGpf1b0gpeusOspeOR+gNRZncZZd0iBagdZoMpQyT3QrGKQgrYHPydsJ7ym3LpUv5mo6muGEOtVRrRDrEx9Pvz7MJAyky9c1An2LkmogcJcxFhxx6TqTNgEURpiIMacPOeDsU8BBHJCOnYDpdMBzT54pxgSwqp9qFD44D9CT/OSpfst+wKX/6HAnFGHYGYJ3Y91SX8Zy8cpSOELerqTsVm1StdFBHFhjJYczxmSlh/dIBWGEqoO2pPGVwZ/eP/ffwtqSZr7/liUAWZJITP98EyNJJVEyqd2R91zkFXxs/QgQG8KtoUADNue+itbqYD/D/tm8CJFEr4U3juKkLpwrgmr+9NazLi6W+qcw9V0QDOQ0m7NsV8/RhymQcGtklTEsjcKjceoFlZn/nvj1P6O9SPM6WxICAB57mtXTvtjV4; 4:I7h2XI4LvPW53uAVBt5nZalbOapanlcR45aPdMPGNyPoGNM9r7k3f0GFIjfS9Z48WyXLFOAARcm2q7QWbTQGowe1OKOcws3aztt5Zifzq1NlC83ipem6+PHljmyzdZqFtZ+hYiRDSAh6Kdhbd1C8YGvoodsZ496x2/a3E5CiikvH/TDf8K/bHqmNZDMzvXJoj/bqW07UimXRqYsvyJl42yzMkQ2mScTy3dYfPdgI8y0s1Kw/zTSGpv0snFsznKbfEPv8SIaubZv242RQqLqkPA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3231101)(2400082)(944501161)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041288)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0501MB2664; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2664; X-Forefront-PRVS: 0577AD41D6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(39380400002)(376002)(346002)(39860400002)(189003)(199004)(316002)(6916009)(2950100002)(105586002)(3846002)(6116002)(4720700003)(6666003)(478600001)(25786009)(47776003)(5660300001)(2906002)(106356001)(16526019)(16586007)(66066001)(186003)(33026002)(8676002)(81156014)(50226002)(21086003)(86362001)(36756003)(69596002)(26005)(8936002)(50466002)(48376002)(386003)(305945005)(81166006)(97736004)(55016002)(51416003)(52116002)(53936002)(68736007)(7736002)(7696005)(59450400001)(76176011)(4326008); 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:UxmjR+aDBVF3CtVhqM0Pihd1Zb5/jjFLUf+Ry6m?= =?us-ascii?Q?WWZVR6G+ifAmVSdO1jaxabZMt038f9hy7yJmsli8D+AaBcGlIjDz/J7BbMu2?= =?us-ascii?Q?lfbMX8sXwvjEqERNald3eALNgCvA1COeiLno8GJeo1ZqbfdVWAoMkkqtHvr1?= =?us-ascii?Q?NW74YCaSJIhXhfSf7gDbp9zR4eiksRv+cbZH11KNA82n/X5LpDJyBue+LPW2?= =?us-ascii?Q?iubuISYePHpjmoVl/TRkUUXOv3ROC39Fekeh3uWSoF1P/r3FkgcdVyw9Z54e?= =?us-ascii?Q?1tRTMWsTaeWeIsE0KQ5Y4eL4rI3U0/vZ1R9X6Frqp4OFdWgZ560DqSpubUO3?= =?us-ascii?Q?fA1W48rJDQKWAxqenGaegJMNAE190UAp0Ffn28U02KS9NS2lZmouSw5x9BCu?= =?us-ascii?Q?fbyZuy9zhz2lJGv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nAViBnVSqUUkHJ55LjSJXighFsvCwKzgMCftFMb3UYChDd8930kcHQz09nOE76JWFhbersHGh7vYWpNYF/t9+DiNDzWaB9+wrq2bdhAQU9nc1QugXofqDDeRQ+RFq98Lvhw6xe2JYeMq7r7+BMiqnVIA4YL3URaaSvd/te0mXAB9MIzp9hsGGT2mqcY+9YGyZve3HMNCrxov3hfWOTyiByknpPCdPqMW7dR8FFE1YVO0zTBpB01W7+LLwBUOJigWFL/igs0w9JqwTn3RIHnRnyi3GdimMJWLq9WgfowyFH520r4Au/iIArOUzSHfCeoVsbDlOwMYI=; 5:qqE1pxoDz0rEi76VS4tJWbE3eIUw3oToI5/vHc0sB5Vph29HyFKNUC4JC+QfndBo3IsZUaQ8Jdvs6L10lRvMy97J3lMokDY2lJu5F+WqfeUYPgn+fe2V5xrUl75+PMx2D5lvqDjnH/9ywuNvzDPRwbqCuZYYLrThxbBpmpIbUMU=; 24:4MJoLqKb5rwCDRrYJSq9ne6HIBl+VhuoeVx/WUXwHwF1aFkCwJLyRXf2ctnWS2Ybqsis5VhL5MdHIaToXt2US7wCHGrBhxfHVRrFohyOu8I=; 7:SrjqRGvPdAYz9dGjkj7awTwVQQTuvZ5EnwZdpnhwLmPzhlGzrLgsVfbrVBPlUZKw7hiCLPVTtcHuS1WhPnjlfCQR1a6+HoWkDOFnkwkpLKVAdVHqpF8p5zLKvDkrHn3H3/drPqcFAwAKFcP4TwfL5NpKSbOhjT/aN4bKwBRbsCyNoHueS72JJzRFzwbirIxidYyKpwOZ9jzzn0pUEQQ0Q/IRvtSgoV55rv8J52tnA0T07uZgI1ykkkh64wi/aHyT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2018 16:34:29.5816 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0a13ba1-f8a5-4a00-bc9b-08d56f11d3fb 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 v5 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: Thu, 08 Feb 2018 16:34:32 -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 @@ { 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.8.3.1