From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50043.outbound.protection.outlook.com [40.107.5.43]) by dpdk.org (Postfix) with ESMTP id B87B21B7B0; Thu, 8 Feb 2018 13:20:51 +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=gz5zw5sbl3b687rxOyErMuv5EQydCQtb3hEnjIt5GPOCVNdDiAy6wokXV8KnzKS5Q74KA7tUEgQpCmlcIW7HpLjJwZv85B7dToDl+DGyPXhkI9nzZwA/2YTy3Fu0KqSiyr88oHOAH6osB5SJYUvLHKpOxELtMQBrm9jDxG0o4zY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0501MB2666.eurprd05.prod.outlook.com (2603:10a6:3:cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Thu, 8 Feb 2018 12:20:49 +0000 From: Matan Azrad To: Gaetan Rivet Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 8 Feb 2018 12:20:26 +0000 Message-Id: <1518092427-4333-2-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518092427-4333-1-git-send-email-matan@mellanox.com> References: <1507243328-11287-1-git-send-email-ophirmu@mellanox.com> <1518092427-4333-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: DB3PR0202CA0026.eurprd02.prod.outlook.com (2603:10a6:8:1::39) To HE1PR0501MB2666.eurprd05.prod.outlook.com (2603:10a6:3:cb::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: db666c3b-34f3-4e3f-295f-08d56eee6431 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0501MB2666; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 3:1d3vfDv21BxMLqiRHC/A8CkEhiXybpqG54krIPsibTWJf5qqmEd+cq7bwCr6ztcDLr37k2YKI9+ddBCtjpuYnSpJgw59pf4tNTnOQ4ePy+squ+l7fcnFk5CftqkBIdrYqqjesh0OEQlpmQTVvOp76Z+rkQsnN2PcFjnPhTp4VIVGlmun2sbSFN2qVtwljau744uaPUPxjQJECgNIh0LLBZZeh/UkCDlWLrwOID6Nf//lpThqyJEOt3s3FPUYwnvG; 25:9jaIKsTopUJJyy/ETwvOAuRqk1mJ03rvSYb5eOOBjbHmsjlQYeEmSHF354mCAWvH9tDayEVSIzvqZG87YfgVmq8D+lqqFL9inbC23bAfrW24c1E3gm+RgeKklsnPumnfdMpaQtHClATi1vw+CgdjKX2LkanPrLmV721YxlbEb5016JKsGKDV0oyGP/DnjAGMGoAw6PR1JAkE9+bLow/jfr2suuyYljrNZsGpDw7YmwvqvMZH+M2qfCYbf04bPOE1QFMObGuO2tIqYlXatpriGUpiCg3fY5XPAcy3rsApZuZAQDUMX8bIolJkyHmjs/UFNGCFiwkEz2UhPM9RFzhNQg==; 31:sEWM1BkOkIRPLlEgH6R7G5B7M3DLBRnl4bTEWU6DDur3ydBBh4btX0nPMJWvt4ayHQ4Z02nDmAE3j/Hww8KNHRX7a1hflXwckXAtwh+A01YWjEx05gZrqp1Sch+WXl7EQdIqnP3xtfC5Cuitwuvpfnjltd4GPcH4syyfpTGGYRiv9qY+WjmQcPUQK1BCG9Zt8ATUtKMvBD3w0Fs3xd2AmMfxgHXWdsLSdfq+S5V2We0= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2666: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 20:Eooelabr1iLiBuya/X96aCit+IDt2kV5VT/hr76lDcqPORKJlkLA/gi3if3B0jI7tIzG/VgFw93iWRW3AQ32UsLTrn09ikBxXNPISWfvIB5kKr03mfWEJPqQlZdHxfnX4aXlxRPqUjkerFTxnlbYt/iEvVNug7m2fuzdHMymZEnsUU/cMiSrJQzXsLTnYtWRnwF84vkh1qNUog4BnEk3J2ZeVnbI1Gw/8Sk6/9HxVeuI+zxyqF8xuzfEPoLs1e2baueAFR+42PQCgHYGLYtVhS0AXezSaghMpxLBdpaGt6gKI8l8CjyY9tJjDMpryZ1TvIcFBCktO7V5E1sXPgLOPlbuteocqHK6nG4d6Yj3b6qlTxDwxmjwYeqp5R5zai4lgyAcg73jIt0Pzw5zfMa6oQg0T2KJIGnEZCw1p1Xn9S8HCtfMixuZAvD9yKizuxsn7jcmrD1vdS7qFh+FCEEkovPPa+dKzwfYR6bfQMbxdVaHhU68BChh26QHm4/lUqmk; 4:g9LZvHhI8q44pJOfcr94AfZv4mcD0Uu04XzNbCJq6DRh08XrZsdz76+qvGYThiYwND5IWTkcjtXTcVnGdFoR1qq23oBcCBokjIDEOIpn5GrQJtUksWl7K/w1lDZvtF+7TFCBxxq7vxWyMw+GeRE5/aZy1HeDnUqB4r+ThgUSn8V4I5QkTtKNAJ3m9+We7QPEwl/vVASDYcU0892YGxdI17dED2AHjbyCXmpd2cTHIV9BcMkR/5Tz96rSxlSIc00gC1WioMuMHAtZFUfiRlWM+A== 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)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:HE1PR0501MB2666; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2666; X-Forefront-PRVS: 0577AD41D6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(396003)(346002)(366004)(189003)(199004)(66066001)(16586007)(53936002)(47776003)(68736007)(5660300001)(59450400001)(105586002)(50226002)(106356001)(316002)(86362001)(69596002)(21086003)(97736004)(81156014)(8676002)(26005)(386003)(81166006)(52116002)(51416003)(6916009)(7696005)(2950100002)(76176011)(2906002)(4720700003)(8936002)(3846002)(36756003)(6116002)(6666003)(186003)(16526019)(33026002)(7736002)(25786009)(48376002)(55016002)(4326008)(478600001)(305945005)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2666; 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; HE1PR0501MB2666; 23:hRIN3PHKXbWVEiZBhetny5PeMikjHNjup2Bpjgo?= =?us-ascii?Q?fJRZNUBjZCytu+LbuynCfiHZm4YpNNXIr2PXbLSQ8k+FSOfvS/fXcFJG2BEd?= =?us-ascii?Q?SfzqsTxK4R43QDqpFOmmSvYCl+tH1cCQPETLZOB1TyzUdMRsyDiFDANAZn1Z?= =?us-ascii?Q?bZK5XBSI38aHq2dBGFO0TnnYQTecTgh549ySCkiqquZbyTErjXmwoFAD4p8T?= =?us-ascii?Q?eobiFIzfK1VWfa+eXg6tOemq23qt9GbJ0vZq++q19fOQf7AbMskHBJbt51Zb?= =?us-ascii?Q?Go98k8htZvW8vf2FPh2+ivnML2kgVrNbvV1sgPzo5/T39mmve9mfeInZlMX8?= =?us-ascii?Q?LarjQb8twubzYGGDi4xKvF3bdSM1ZJO6uosvMTBhwcupnH2qcKA1Z0QWJufO?= =?us-ascii?Q?tsmKx43nauYrAst5wCTl+tsuZFGAafxo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Iw3JRjLz+J+JSXVnbb5OD1bIGK1LnoxbsoMs4719aT5IPvP2h7bReu2SWa3hPsf7S5khKk9nqJjGUHn5KHvrb49h2Hei02pMzzIYTWtMRqQ0UuIwvGoafwj5d/9hsCv4AfMcPaa/0HrGYaFSjxabFAAonr9nb8gpyIR7kjDRS552xS1A0N8KPC36evi1TzfDY4+653d3RkltIe2+5x12D+xkYxOdYIx9Ukm8dZbOJ99cdyuyVSoSLl/wGlW32LVe6NKC1M+VhMo9saTx36/7C3HXYNJQEuOxneJnEMvE08=; 5:brIgarcl4JlHYaZSRpRmsO+KaFBzRkKUQLpMAjz2iYhyF+Jdi4zV6hNPszHXDqIqOCEKFwkT8M3bf5i0rmwb3f8PwyQFL9ISFCQ6J3kznueZ/srCfSW5XJ2vm3Ppx1naAgM54fDl7ogEKxbrXzudnrwrPqf5ZykPvvXu/OSmDaI=; 24:RL8OniGMy+IIC0EXAscKFctNZxOr1uLo2v0HBvtQEK7PG1Xf+rqA7ndeQc5uZyZHcrUvAOOd3TLW7uV5iRv68OozZePURDeqiq34bun9T9I=; 7:OH3Ds7+il9rG8O/hb6GhFQBGKYh+yhdy5HUmW9FsZuDJ05/PV6wNvmVhaABS/CEYhZyUqLGLWyl6fQnR9oOdalYJfNe3iQOzjmplNNh43NaOiFe5AVZSFPJNWiH90u9gZsTJ8AwhWAf3bvodVdC5v5fzfU2gHnbaq0N/unrr6F47ye8SrUEaVe611qgkXr7D43JpwE7k6P9HbZ7dVjcxtlRBDoZYT6hYV84a/5OE9HKNIQBape+rmsy3l4fZ8e69 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2018 12:20:49.6883 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db666c3b-34f3-4e3f-295f-08d56eee6431 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2666 Subject: [dpdk-dev] [PATCH v4 1/2] 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 12:20:52 -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