From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0056.outbound.protection.outlook.com [104.47.2.56]) by dpdk.org (Postfix) with ESMTP id A4E911B338; Sun, 11 Feb 2018 18:24:57 +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=qzHc4n3QKB/2nD8FBxGSrdrFnhvPMPC9CwK1M1Ng3oS3yLPyW2ZPWAQXVvD1iE0+J+bWHbnRXkHucv9BCF5W/O0CyYJkPSlTCHWEE/I93KTmbVe+1yDwLfscp1p2jMlcrJ+4X/4sOfMJiJMKaSfBwZ0pyNuyqxoIwPL6MdBkRBk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM4PR0501MB2657.eurprd05.prod.outlook.com (2603:10a6:200:59::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Sun, 11 Feb 2018 17:24:55 +0000 From: Matan Azrad To: Gaetan Rivet Cc: dev@dpdk.org, stable@dpdk.org Date: Sun, 11 Feb 2018 17:24:30 +0000 Message-Id: <1518369872-12324-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518369872-12324-1-git-send-email-matan@mellanox.com> References: <1518107653-15466-1-git-send-email-matan@mellanox.com> <1518369872-12324-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0501CA0022.eurprd05.prod.outlook.com (2603:10a6:800:92::32) To AM4PR0501MB2657.eurprd05.prod.outlook.com (2603:10a6:200:59::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9abe8667-b8d9-4e7b-cab5-08d571745ef6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2657; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2657; 3:U+Y4mjmUTQgLzS8zd0fX+yJKGrU2qSMfTkU2a5d972BNNzpaEeGKZeVnOo8x7zNKUMXjQKMytWa77u+LOE6avJIfOS1ohOIVF7HHz2rlyWD+g3zTCQpsnBuifCttr6boY0r+ZVBAzuj80a/kku0ZQiP7pNRBiY/qa3eawRqA6sAocDsZuIbPC7uybWzyAOtGgeXNLpzKd8rJQY5wVoCiA+RFrop7TCgPY0oMWpGrJkpaarm+p19SnM0qEdns46pu; 25:46uSYO64M0I6kkmW9SSbmSy0TOvwB4evmAaCgde3rn6UdNubHItpqSruPvf6HK6OTIFP4BcwNR35X/9gku47jNMqLL8jfQwEc73kz7ZuItuUp9FwyCHDR74AtMVm7i8nELuT96J7E1uiYxq6jYryWfWeDZXpUGyMwce1ecvWXhjnaN2SlP/u9gjW2hA6EnDhCxrMLHjD8KUU5gK1g8YBdtBPKXr3sQojwABGtPC6qzq/rVlnzUBCqHctemXNoDLoVMWsUt+8PJRyy7VVU8SkqG3nBuZrzlSCRa/rBnKCQ0lpvFEkXsghgIZi6E0xLZ9BkqvR4eNGWT3dVgVKQXs9JQ==; 31:7PXXimG3X8M5bkdHVZ+CXdqfAi5Rm4yEGe3dINszTPqZ7EA7p6qruzvPWRxYqyHctllhhCtEhsD8/EbCECwtg+yXyaJ/RtaMuJPkAgySbHSBaA6ud0Xfs71vom4TEudNuz4Fg7KKSFW2RzR8a3a00MMjh6rjuStznhFMbHeHzqWRKu68C6JLmYDXZmbMHFGWIwivXXVCQNnkdm/X6z6pQWI45O3u6gjNZP5c0FbcZZE= X-MS-TrafficTypeDiagnostic: AM4PR0501MB2657: X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2657; 20:Xp+6Sy6d4iC2IU3yKSYqTuiJzi6ELAYsFNKv1l4z9pXD19qqn5umReHWjYXIj4otRkJUsw4twT/J6MDqMZPnoFVAbPPIdqfxYrBTxbMIPB/zKokusasJPWtCx4KoMSxrH9FEJAnkk7XXizs5hH81BO35Ln7Q2R9tfnLM+2399VQDHalV1SWkk5C6oicjxARGyrXoHNEcC3YizsqJdNw/Y3SxNmus2SpZLR53pImh3WNV8jwmj1NuKuVDpplKqOy281gKtm/XmViRKSzZ77abEe/lzpsgACzvmW+g1fwDqYQsrzB42onRK8R91lS8kUn2XSgcE2f4TqmDraGkf0IYJWLDrOSbP/fvyPwjRg/dauL+1vLrgu8SKhGPJL8QooCiDcbuJTu1kCEGVDBiOQkPKpTH7Gh7DyAb0vIXVqC9IZjW+z4oylcSyRI0LU4uZrEpkBOAaAdNNDxt9/uTSC+EQbLi4CxwurEtY8ckvHV7+we+3Hz/T63GhjMgv/bECVXE; 4:fDhLFPnMDqN1axFEyYTZxEnWkeNJbLK1vvcaPs4rgEEhkC/aMtLjoeAWGerFGY0J8TadLrGWN1VtvYUhF7iiPaAXKIp7rTpmx2C40iJz2cA6kIdrC/kW1VpFnwi0pL1L2Iw6j2+a4+AVqQ3DCc/frJg3KC7rls/D+XzFyEJbVPV1OqSSEn+oirjIZCMCVh/rmpRsIANHpYkPc7dB8ZF2BzBnwmdQHrpkS5pmmjuyzXpturaXTuIIBlGD6WtFk3dTTJQL6vZd+ul7yMZGvtBH0A== 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)(93006095)(93001095)(10201501046)(3231101)(2400082)(944501161)(3002001)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:AM4PR0501MB2657; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2657; X-Forefront-PRVS: 058043A388 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(39380400002)(39860400002)(366004)(189003)(199004)(50466002)(5660300001)(16526019)(81156014)(8676002)(4326008)(16586007)(186003)(69596002)(81166006)(26005)(76176011)(33026002)(48376002)(105586002)(53936002)(21086003)(386003)(25786009)(2906002)(4720700003)(6666003)(97736004)(106356001)(68736007)(51416003)(6116002)(316002)(2950100002)(478600001)(305945005)(55016002)(47776003)(36756003)(7736002)(86362001)(52116002)(8936002)(50226002)(7696005)(66066001)(59450400001)(6916009)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2657; 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; AM4PR0501MB2657; 23:mDjcZWe3kGxnLKCJgZURku1qJlBQpgtGp+2rm0Y?= =?us-ascii?Q?UBBv+ks1xM+vXwvf1qbrTIHWVyRjTZ3isZ1bRFLI43kKFt7fHu88z7vh5VSp?= =?us-ascii?Q?KHE7Gzcw2US2yAnEOwY4Uh3Cyrkd/I8ezNf+F6oZL3ar1QARApQj+USDecQh?= =?us-ascii?Q?cFcLeY5V5eRridqeAujQdkEkzjpEAtdguTqVT3Sn14lkRY8vhQweLLWq82fE?= =?us-ascii?Q?RDvNhjchyDReNbTiUo5YTW9X6QrOLKF9vRnqQKRSsErpJg5KI6cRULjgnszY?= =?us-ascii?Q?FnLLY4OtYP4/Pfq9uwo9/jFYklBedgMBdzP1A4HKn6cLqk5QotOOvfNMOsAO?= =?us-ascii?Q?EWfvKGIkPDkxx3jfYcl/HjFQs3mKEQgCoRuRrcA3w3I7VX0fpqCVHz3AAM5i?= =?us-ascii?Q?3uGVjx9itcxIB0tlZUwav60vGHpUvWKntwAgZCDSoLnG8ObPFZmf53QI/Dzc?= =?us-ascii?Q?4IaOoziKelxoXbxu+o8cVzIDZXKyUtpIsZFR3wQOgh6rNWbwDMpfyMEUWCmh?= =?us-ascii?Q?1aihDhJhLCoKmbXuq7iDvUjvJbFIvBOmG2247xuQzUBPLFsIpR2lxEkfF3BS?= =?us-ascii?Q?kSLE7/q6tqu+xgtn81rvomOnlgbHCt24BBBZwxXuLDzn0ravTisrdMgoHNNI?= =?us-ascii?Q?rY55VEdaVt4LbIrFBTBUBwIY6I5VN4sxCqLIF9JA0Uy0vq7/PC/NA6uJEt8i?= =?us-ascii?Q?wvYnMMgml2UDJHg1STjRuTEJIorxar7XOTp5riqvGcczmgW9wwFG90RxF0rB?= =?us-ascii?Q?sD/g5eOSzfZwTpwL8ImBMou3MJ1r/PvNntBDAOTAnUU0hF34dQ1ZqjRsla5c?= =?us-ascii?Q?lsJ3cnuPO1YHD5YN+ig4soqhDf696pEfEHbCb2UzM8ZnobFn400KNhcqv/Jf?= =?us-ascii?Q?8X5Wi/89wWbFDWvQqfZe/hVTzjL4GYJcKwlRUn0+s+1wJmMm1faeyNhJ6tEe?= =?us-ascii?Q?H9G3zzUrWOWWNzLZiNDceKBBpY8iPDcMZVxIniRVb42rKBKB7vEWg2PhPyMu?= =?us-ascii?Q?lmORqjvy/AXPYeVQG1LiY23uAh6M5jpKzKKxo7zdtOf6zCVDMR/ct9X3j9TV?= =?us-ascii?Q?+28yMdrC862VNoYTcmrld3Sb71Uc+fz2EYLOY7DMuhjg45l2w3yxykKYux4v?= =?us-ascii?Q?g34mgQtk4afNy1ao8/ZNSslsyQ+fxdwgexMqBTgnFA3tLpN2BMStbysK1idZ?= =?us-ascii?Q?P04NMULeH2tV4RogLxZBoGorFkXe4lb1ARJnV?= X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2657; 6:2s4c63HKROTwT+5hz5TgMjF+xfbT+pHQWvfHMgu3T/sVCcRc2A2tVOFL/dvUV9UNtE0ZFKC9SGT4petvEkmgzNe9cVhsdTUG5KP/ciyj/woH+i7A56yBSqWMJ31tT/gRg9VGNPVVff/mhVdA8OyH9YnVWesf5+m1Jh22PA9YE+U7jkAyqHds4t7956u8PIlHhYoKBOSii57tgtiXR/k27NLAF5lXiomqu7LSJVDrRNrPV2gDk2kpeCmR5IyN0vNHnm1KyGTxzo87v8MZRUh/igDgWxiImK5RDzwi5wXYtwq84a0eNPXpykMrOm7VXAnqSjyjo6p3xWPKfD126u/KxXIf3LIX0Pd9501Oy7gkptY=; 5:0aphRwLi+CUpVjvCkPp+7PIWYeeqcKubsyciJExIvjubE/NBGi4FR3/15qQtEYrQjnApzI6xJlGYtUd6noFiNCZMlAPpC4gan2DMerIvKQH0B7yQWaEK1xIpbm2Ufep+9GHVyPSuM1bL6D6KPUs2O1daU8IojqC7zUz16mSeMtQ=; 24:kcmq54LBCjSZagjI65RGGPiUP0H1NqFH/Qsna0HQ2kM/zGb4yyQEyB9DQyQO0St6G0woJI7YYiFiOdj1JzjkE5rWXVLKANRpDeu7Rr9NJtA=; 7:72jCPVX+VgI7/BUzaOoP+URnbIWbV8Pq/qGUtpBOVmdyFuARhogS8O2wYnAG5D7kqBIx3a7a3HtbhAqRRhiU3Z4LPLbotjByQ8HMJJHtjyjJHxzOeo5PB2yGwf/6zwVtrYycnWzViDJ5drnL5bQ/IRdEmeGGZOStJCvJxzBYX9hKdG2l/643VQESKulbdAHwxkU9egrO/mkcOVll/QCuuVjxJNfJJJWdy6IyGQMPwSVgtSPI/qFrPWjxkD9b4w5G SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2018 17:24:55.9295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9abe8667-b8d9-4e7b-cab5-08d571745ef6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2657 Subject: [dpdk-dev] [PATCH v6 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: Sun, 11 Feb 2018 17:24:57 -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