From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0054.outbound.protection.outlook.com [104.47.2.54]) by dpdk.org (Postfix) with ESMTP id 7CE931B2F6; Sun, 11 Feb 2018 18:27:50 +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=Tz9AKkaCWR0nkzDHOOrBPkM9+8/BRSesdD92q3DWX2g=; b=UxQfcfBdywmyQ0XfJx7GjHFpIIafoZ7absEI04AxkWvj7y4yEKj971wAbLtpRs3NMV9XCK6uXYd3Ho2vmHdYleepfU/acFS0DRAvVBtBqCl1bPIJKjX5gFyJtqQwtAnSo5yEi7u7KvV2vMqnScWX/Rei1G/UPXl3oRGYMr/2iXM= 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; Sun, 11 Feb 2018 17:27:48 +0000 From: Matan Azrad To: Gaetan Rivet Cc: dev@dpdk.org, stable@dpdk.org Date: Sun, 11 Feb 2018 17:27:34 +0000 Message-Id: <1518370054-12578-1-git-send-email-matan@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: VI1PR0102CA0005.eurprd01.prod.exchangelabs.com (2603:10a6:802::18) 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: cdc19ad4-eece-4f83-bed5-08d57174c5cd 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:UUW0Q1B7S5JebFm7JTMOoS0v8aPvbWMK6KH4iEOT1FCANglDxeihPn/pPB22LeYVBA+dBwom0Gp2LJicjcdaqrlbAoW9owadQtSNV5VFg3AxUHU9NTjJrW9UGLVrR32KarnV0leAPp+coanm7G3McE98MLJRlCEXjdfQXh8pp54WlmtDB01V5R6zv5A0MwJChD/z9t56UahsoGGw9r74swn49TzuR/fkTl1m/i6fxM2roVstlHZTxb/7OJea97cz; 25:6G+tEFoN8OXqUSpKLf6Dxk9wY1FHnoUAbLC7YcKkqAU6q2OyGCQaHp+LAhuFlHxM856sO9GqRx759yE4DOvS4hfNJpdzYPFSRUgq0VWzzBlaagtgFkunX+pEy0k4eB/mMAiJMOjwxfb7Oodk5Ph36sWv8UUzcLyUQJsoVA2YwAqZuW3wtNjT4oe8v48DOp2Nm3RzkgVqm7o5tChwh4kse2mROQEhWK3uDiql4887rpruauEa5jNDNUid4HHiAIuhomkBtKnkYmspRH7+o/emoLGSKPZV2fvvX22+p+7Uv/LiRmCovg34thQKda6+1asOIDICQ7DS1cs/OyMd0k5z7g==; 31:dYhVq4f449v0dJ5EZu4ansVhZoCFvaxevtU5mgNuLHRcWcWlH6uj/xaU6R9kmFX3SPnRHpecUOSaH7lW7wGldQw7U/8NrBqreb3Oe17ZR4c5o8gPoRnLLOvt7mr57lQyK5JNzFjqmmvlVwAydjM/rzD86xnCZ2XGs0UKyGAz41TnNF9V534laaDwiCmEivB10r0RtsKS5ZhU/fPZVc+WJIAAzJZMfkVqtfZXzbFwS/Q= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2666: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 20:HRS1yiaeh0jRM4idaVJFIV5NKa9W7bqnX76eWNj7/bDAhb5BDXrdcV5daLtuE1ES3P0y7El4JcqxDTESNgjv60IuTl94hYo3GNl7Xn6nM/qklr3Wo8h2cUzebZvbNa+5L11MwFVJkUkG7/Vu9AYW82BXDqJvDKDQDLB5y5i6ul64SqjS31cDcwI7w5GYMLAaykBWAKiCLOHO16sJg7fD8qoAScTdPZks1Bk5XgwtfTSOtrRIapZXWp6z9keB4IT6E+ynhEyad/Ru8P9fXicKsYQsoGLCKHCH49u0xT8rwi5jjAhqJU1OhLjrol66Ge0RScU6TAliy1aW7LWJI2vYm1gLvnS9lGBb3qYgbwpLWoqMipqk84R/DghUm4OBhFWTcgjWsM2xVjYDXj2xNZ2CsXiGlsGPbFMWHjf00ozGR4456tC7FtwCCXbYZA9XJc+chuE7FHEsx5bh4t4sl6nxhcJMoAISMR6LV6kJRKrB/ruemRGG2y884FLN5DJpkJQW; 4:yLszQ7dIiqKHX1WEleuSy3M450M5EXWMDwPQnAZobiAmC0M0dcjtVmTbged4fvfqXb7vN2ccxi0XdVM/LxrAIUbSFXbVtimBQi0KObpSFZ8fHiD6rasDzjCA5wb1EEcKbEgSIdyd0KN1pdGEgerogOYs/QpPtNKFKTrG9fl7w7vudjSkl4Xo+Lgr81uQ+sYjhnJRBfONNVPLIeE1lNpDP+AXWjlZbbdRzXuWOo9efXynECaiyOgsyMfcV4CC9p0phxqWbl6ShL9ZiBoAa02QRg== 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)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:HE1PR0501MB2666; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2666; X-Forefront-PRVS: 058043A388 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(366004)(346002)(396003)(376002)(189003)(199004)(26005)(68736007)(25786009)(69596002)(97736004)(53936002)(16586007)(5660300001)(48376002)(50226002)(105586002)(47776003)(59450400001)(66066001)(81166006)(106356001)(386003)(316002)(8676002)(21086003)(7736002)(55016002)(52116002)(7696005)(51416003)(2906002)(81156014)(6666003)(3846002)(6916009)(4720700003)(1857600001)(36756003)(6116002)(86362001)(186003)(16526019)(305945005)(33026002)(478600001)(4326008)(50466002)(8936002); 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:Rb5NL1ykmsPHPynOJeUHccdkurqu2/B9zkK0Y5w?= =?us-ascii?Q?MwD5YTX4rTvNBFMbrM7Sfc9e11TG46dgvUBjA3M1S2esX7Ecvg1qXYxiRoHs?= =?us-ascii?Q?KK+dyRqgm9fy8/57JL8Lh7nfyFf07Pyc3BC/bw7S0qkYLYSFtOVU9RjH2h1c?= =?us-ascii?Q?vHII4rfxjZUkA0Vr7fpScu9mqzNV3ETqmGAPnWb38V71PJyYawew9tWOHJHe?= =?us-ascii?Q?pJOpUfYkDbzpreAJg21/g9kp3Cez9YBd7KbgtWccsfIaP5YLf2QvihH29GR/?= =?us-ascii?Q?yo6z45ojpaHOBRT49OONyqYb5zfP1CBgPC2dMxWdLTX6AgoYD5Df+Q91aO9g?= =?us-ascii?Q?eNlNEf89kPq728RpIN4/oEI+KKA3k69tl1a+OLefCW/yk5jK6fLY17M4BXyG?= =?us-ascii?Q?XU4FhbjKat5rSGlfgPOSa22RDu55wHXxzbbfunGdb8wPkgXeNhRhaDZiakEr?= =?us-ascii?Q?Lh8R/4FTxpIT+sXD0xGYyifMwEd3izO52K0aBvBS9wffzXMOKm+bReT7lOjs?= =?us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QZyE1Px5BCEvU4ML152/l8z65PWESVrRuW92GhZ/0S7CsLydlJ0/K3364370Pu01Owp9G0HxqPZ95N6YweL7mxfsi7ZUffglvQULW3WPD8mLYH7Z/FBlXPgewMB4Kqgns3nCFyGFTqUzCSfIKRN8en30saM0ZbaNs=; 5:2wxvY6aNRfW0f4orUyUrGyG6Cizfnh7rqydsJtUduhGi8Wu/AycIfPKZ+hu6xJqbgmZN7aPxocrnXnBwJylbYDzYe2Qvut7VUQcB6STmYq3PKrUE38Q9IcWinKeFSbxftl8f/NIi9A/kxAGODL3y41kTwtJguJn77K2opF1IfDs=; 24:b99iU9HVg78x2tTFSqlKJDf76+AAjRCdeeGGkykvMrIObbDqNIvO3I9zhFZ3ZExackSleSqVgBmQUSkn+R+oi4MJPZ6Su9EyR6NlM91nz3U=; 7:sDdRWVy7PJC73sSckHBMZ6g2O3VAaoGsbrJSMWq1QugTkvNWYt4v1JG+p4f42k7CT7lAHCQgrr5VSSozjZgzs/IsOeUMH+4XDnHBsAhHFJll3B32viCu3I4u0edM1GGDaFl99kdBEHIChf23psTymQYM7wDLsAfuijn+/Pjbt1gkbGkN44qBMvdvH0qNfm4zg1/BOBRhLHSykdSrdYnmW6vIB287c2oGUOtOLKGU+0mxDmeKG3wMGmlihPsXFj2o SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2018 17:27:48.4346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cdc19ad4-eece-4f83-bed5-08d57174c5cd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2666 Subject: [dpdk-stable] [PATCH] net/failsafe: fix reconfiguration X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Feb 2018 17:27:50 -0000 Fail-safe PMD manages the states of its sub-devices gradually: DEV_UNDEFINED, DEV_PARSED, DEV_PROBED, DEV_ACTIVE, DEV_STARTED. When the sub-device arguments successfully was parsed, the state is raised from DEV_UNDEFINED to DEV_PARSED. When the sub-device successfully was probed, the state is raised from DEV_PARSED to DEV_PROBED. When the sub-device successfully was configured by rte_eth_dev_configure(), the state is raised from DEV_PROBED to DEV_ACTIVE. When the sub-device successfully was started by rte_eth_dev_start(), the state is raised from DEV_ACTIVE to DEV_STARTED. When the sub-device successfully was stopped by rte_eth_dev_stop(), the state is degraded from DEV_STARTED to DEV_ACTIVE. When the sub-device successfully was closed by rte_eth_dev_close(), the state is degraded from DEV_ACTIVE to DEV_PROBED. When the sub-device successfully was removed by rte_eal_hotplug_remove(), the state is degraded from DEV_PROBED to DEV_UNDEFINED. Fail-safe dev_configure() operation calls to its sub-devices dev_configure() operation, but only for sub-devices which are in DEV_PROBED state, means that sub-devices which are in DEV_ACTIVE state because the application triggered dev_stop() operation cannot be reconfigured again by dev_configure() operation which is really problematic when application wants to reconfigure its ports. Actually, the application may get success report when some of the sub-devices are not in the wanted configuration. The current behavior of fail-safe dev_configure() is correct only for the first time dev_configure() is triggered by the application or for sub-device synchronization in plug-in event, but it ignores the option for reconfiguration from application side. Allow calling to sub-devices dev_configure() operations also in DEV_ACTIVE state when the call was triggered by the application. Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- Based on previous series, "fix hotplug races". drivers/net/failsafe/failsafe_ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index fe64c68..057e435 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -110,7 +110,8 @@ int lsc_interrupt = 0; int lsc_enabled; - if (sdev->state != DEV_PROBED) + if (sdev->state != DEV_PROBED && + !(PRIV(dev)->alarm_lock == 0 && sdev->state == DEV_ACTIVE)) continue; rmv_interrupt = ETH(sdev)->data->dev_flags & -- 1.8.3.1