Message ID | 1502893168-61001-1-git-send-email-matan@mellanox.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Ferruh Yigit |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 9327D915D; Wed, 16 Aug 2017 16:19:59 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0082.outbound.protection.outlook.com [104.47.1.82]) by dpdk.org (Postfix) with ESMTP id C4D9C9131; Wed, 16 Aug 2017 16:19:58 +0200 (CEST) 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=jms4fm822Zy4LFIEXqeIwVweJNpdPRlBOXm3i45DBgU=; b=J4VkPLNe+5+yKoxCDrxDsbVZmseXuDgh4ApKsTPvEpKO7QuRQ7TPgrp/yh4YW8P9bN0spWcdota0p/dNn98gXOKQj5RgJKl9mywoY7Xvie7/EnZFl4dAk97nXYGIX5mJldfw2+oS003KhgeLHYNAqnyWw2RVa+WdWlAkXqS0D9s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0502MB3055.eurprd05.prod.outlook.com (2603:10a6:800:b4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1341.21; Wed, 16 Aug 2017 14:19:56 +0000 From: Matan Azrad <matan@mellanox.com> To: Gaetan Rivet <gaetan.rivet@6wind.com> Cc: dev@dpdk.org, stable@dpdk.org Date: Wed, 16 Aug 2017 17:19:28 +0300 Message-Id: <1502893168-61001-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20170816125151.GM8124@bidouze.vm.6wind.com> References: <20170816125151.GM8124@bidouze.vm.6wind.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0701CA0027.eurprd07.prod.outlook.com (2603:10a6:800:90::13) To VI1PR0502MB3055.eurprd05.prod.outlook.com (2603:10a6:800:b4::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3ade0d1-d416-42fd-f9d4-08d4e4b1df6b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR0502MB3055; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3055; 3:/B99QYQKAHmNaPKk23O/0NoXe2fdGNvcIrp3m3jIWTe6m89qA2i4NK39E4TiiNX+1dvPByzwhTXkjZezGK6uKyjz8Qkdw1Hl3eyRG/OzIUfMkN3vrJ45X25A2dALUVn09ZFeBjRWLBEZCB+AgEq0YbP75HhpHpm1SnuZEIt2lucc1x8s8QXMWxE+7qXZgc5eSm/ARtsgOhPWS9U+naXfnu4nGlR3/+PKQQPbfpbGx7aMOXrFcZhfxAJQSK/jKGI2; 25:3/VDoDLVeszW/QIsWeVjII1A3uGiicR5XTh85YT6TUm13wekvgn0dwjyn3tfX4+dmpSBQRADFw44asqRGcuz6PVx8OxGs/+zW+Ct5hIN9X63J+ORn8xcb4H/TtZJzFsvbaEsFfYclH84mpZEIjFfNEqxUNbcDdxc4LpbH5dsfHRmv/nKx6pqqhtGGi/HUYN/nIhg6OgPQ9wrump1HjpqGAPoZ9jDve5u/HPOcXKpMLWLMkIb6drEQqNZjZwQh7OtZpn3JoD3Qb+ZRggtC/OIJmSD3uuMWL/qW9bLDNZ0m9djVrDvWXRu/wfv7wmPdRpYGBvDQ9kKwrdTqYddgArrfA==; 31:af79NHMKGk1iEnCFFrUys5OBMhOV7J3Boj3DqHjkq/8ixriri+Lfn/s498sn0uFadvm5W3ccgh26B9rLeafQZoaIrRomPYChg/v9bBpCXaOdeoKotWeaQXq0/NMvZ5h05NT7ZcHr+85KuRddrih6ARORv8ka3i5tWLEEVttI8VLzL18et6InoR9RHO0SP2dTCKujXDXXmjZAPyezZvLvCX5lSimFHh8vW1kg76vsBY4= X-MS-TrafficTypeDiagnostic: VI1PR0502MB3055: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0502MB3055; 20:8SOFU+2RwewEuiGx2/se2hK3mp0sbF/2HxMN+/VOr9MRJ1G/o9Kx2Na29ijQ/u0clOrN7LAsHPmb2AZ3+9rYecoNx+ChuzLWU2XFoyYDrsH/PL5T1lvOfeGnry86delbbzXcUjIttcdeYNY5KMxRa6eRVBoBHmwcUtWB2ZIgq6qFlsPutP9mawzItyBeiEWJR/einuNmw65IFL/AeY/DZzJqEbkCNM84Vj29ypK2HnK1k7KbfP1r+TDVHHr5UsJmPnfqrlEfHq9walammKpnuEt3dzRDmfrqCoTRoDSRlkefOO/ndQEe/yNkX+KF0WT2PdsBtXrXQEH4jlbHHlLXHtzPHJEpUaDYJjmJY6gUHN8Patk1x1jCBSmeO14NnehfLYTlpgAqhcdA3+ialri8EB9tVG9V0OCX16BKmdpukf3GI2+qohRsURqPlcv7pMqsujiMnzUo7lgR7fTDcXOTK/3b7RfWNYC0T9+oAnXlkyVWkPtsop1GRXqrqrXdJgtZ; 4:WzMkIx28Nh8FB3TsGAAUIqnGuphTo3XZ+FwxumJvqW43HSaFqvP6Igr0jispsEwQpP6KEBIOkUX5HQ27VBk30mqxXQ0LnKEmVeOTdFBKIrIyqEBXals+Igiidh49lRBDYS98NhrJMsJxOH3ZaOEg9vpq6yayD+UFCplTe9NqNBqYQEM73asYNE8pw4iJBsvXVUremT9UPUtJNBpQa/A5F9hn+8uIYD9tNGsmi1P7xz/tMaLmdriKhdAUHv0cniPW X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: <VI1PR0502MB30552FCE12AC99F8B1936F42D2820@VI1PR0502MB3055.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0502MB3055; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0502MB3055; X-Forefront-PRVS: 0401647B7F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(189002)(199003)(55016002)(42186005)(4326008)(7736002)(6666003)(5660300001)(6916009)(2950100002)(7350300001)(2906002)(48376002)(25786009)(50466002)(76176999)(69596002)(50986999)(101416001)(106356001)(305945005)(50226002)(47776003)(68736007)(33026002)(6116002)(81166006)(81156014)(8676002)(3846002)(97736004)(21086003)(105586002)(66066001)(189998001)(36756003)(478600001)(5003940100001)(53936002)(33646002)(110136004)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0502MB3055; 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; VI1PR0502MB3055; 23:TAVnl9faWlkfSRCqr7baRCOZ/2gLZwvpkZ7c1zJ?= WFa9EFuSC6mcy9S3rIopWA2eIfOSvbG/v8LogwNbzVhPrkFmK4vcv3ku9HaVzf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B3055; 6:37Yzj0om8riXwvZ3SXg5lUOTdg/bZpJccsjKpWwQFo2iAZskxPXLf9Bk5OlLyCfUhkSPZVkVSlJ9B0AA9alZUpI3zedNFwhgtPHOjrSocBu251cpkf0SbhsxKoIxpqbPm+0NFzOWeAZVGpCnAjDpxbQCLFoZiywn3hJ4zXJufNlV6nhDB1BJYcJkQt9iYLtCpZHdZugykmVzLJcjxY6baOqowKGI5Qg3NYMs49WJUybFGpuD6vlYnqtmJxB5QR31pHOnpWHM2I5+tszLYCtp9PsSkYaqI8XcWi6WSd4RUCzwkmKBujOFfB3At6qPQ609F3012AEfTKQHk4cTxSl/Lg==; 5:vRhuA2ZJn6ZqWsfkNah/JbJEW5lGLHC5jReDXiCZLFjUiZvyTULOMeKqnocgmwU1puNF5rbY08t2OZ5KcZrwS6vjTkkGI+TlNcIWj7bpqvL6WwLPKBEuQYrEWzvZBXTwIRUiyfFBc8d+JIIwZL4KEg==; 24:hQsr2dUAfFHxxK/j8GPNd3WBV1HInorS0j5/2J+ZWjm/eoHTJud17PYefg1Ry13XWeFVRkqlX379miVsd6Of1nGkF/lQWz/7/HLUYh9bFng=; 7:KVDwPBw5pFYh+1nFJgWo16CzmuHPtFsEy7r5Moh8vPXzwPhHJ1L7PkzbLbwBetn+oANJeR9Co4HCalg5K3p8ngAkOkfCalpWnY50SiUANSdPOuL8hoJCL2kNy3d+nIGscETvNTiHrR9VV0yIvocNEkpwDPv5K/xv8yCL3C+6AuoQPijeJXTjTOz8EKIuxrwIN6Yy+HlDIMY2YmWg2LMcjAU6QeujoCJe1xW+yQQI5jE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2017 14:19:56.9041 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB3055 Subject: [dpdk-dev] [PATCH v2] net/failsafe: fix tx sub device deactivating X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Matan Azrad
Aug. 16, 2017, 2:19 p.m. UTC
The corrupted code couldn't recognize that all sub devices were not ready for tx traffic when failsafe PMD was trying to switch device because of an unreachable condition using. Hence, the current tx sub device variable was not updated correctly. The fix removed the unreachable branch and added new one in the right place respecting the original intent. Fixes: ebea83f899d8 ("net/failsafe: add plug-in support") Fixes: 598fb8aec6f6 ("net/failsafe: support device removal") Cc: stable@dpdk.org Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> --- drivers/net/failsafe/failsafe_private.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Comments
On Wed, Aug 16, 2017 at 05:19:28PM +0300, Matan Azrad wrote: > The corrupted code couldn't recognize that all sub devices > were not ready for tx traffic when failsafe PMD was trying > to switch device because of an unreachable condition using. > > Hence, the current tx sub device variable was not updated > correctly. > > The fix removed the unreachable branch and added new one > in the right place respecting the original intent. > > Fixes: ebea83f899d8 ("net/failsafe: add plug-in support") > Fixes: 598fb8aec6f6 ("net/failsafe: support device removal") > Cc: stable@dpdk.org > > Signed-off-by: Matan Azrad <matan@mellanox.com> > Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> > --- > drivers/net/failsafe/failsafe_private.h | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h > index 0361cf4..ef646db 100644 > --- a/drivers/net/failsafe/failsafe_private.h > +++ b/drivers/net/failsafe/failsafe_private.h > @@ -334,7 +334,7 @@ fs_switch_dev(struct rte_eth_dev *dev, > } else if ((txd && txd->state < req_state) || > txd == NULL || > txd == banned) { > - struct sub_device *sdev; > + struct sub_device *sdev = NULL; Good catch, actually this makes me think that the FOREACH_SUBDEV_STATE macro is not following the usual tailq API (which sets the iterator to NULL upon terminating). This can throw-off the unsuspecting writer. I will fix this soon™. In the meantime, sdev should be initialized to NULL. > uint8_t i; > > /* Using acceptable device */ > @@ -346,9 +346,10 @@ fs_switch_dev(struct rte_eth_dev *dev, > PRIV(dev)->subs_tx = i; > break; > } > - } else if (txd && txd->state < req_state) { > - DEBUG("No device ready, deactivating tx_dev"); > - PRIV(dev)->subs_tx = PRIV(dev)->subs_tail; > + if (i >= PRIV(dev)->subs_tail || sdev == NULL) { > + DEBUG("No device ready, deactivating tx_dev"); > + PRIV(dev)->subs_tx = PRIV(dev)->subs_tail; > + } > } else { > return; > } > -- > 2.7.4 >
Hi > -----Original Message----- > From: Gaëtan Rivet [mailto:gaetan.rivet@6wind.com] > Sent: Wednesday, August 16, 2017 5:39 PM > To: Matan Azrad <matan@mellanox.com> > Cc: dev@dpdk.org; stable@dpdk.org > Subject: Re: [PATCH v2] net/failsafe: fix tx sub device deactivating > > On Wed, Aug 16, 2017 at 05:19:28PM +0300, Matan Azrad wrote: > > The corrupted code couldn't recognize that all sub devices were not > > ready for tx traffic when failsafe PMD was trying to switch device > > because of an unreachable condition using. > > > > Hence, the current tx sub device variable was not updated correctly. > > > > The fix removed the unreachable branch and added new one in the right > > place respecting the original intent. > > > > Fixes: ebea83f899d8 ("net/failsafe: add plug-in support") > > Fixes: 598fb8aec6f6 ("net/failsafe: support device removal") > > Cc: stable@dpdk.org > > > > Signed-off-by: Matan Azrad <matan@mellanox.com> > > Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> > > --- > > drivers/net/failsafe/failsafe_private.h | 9 +++++---- > > 1 file changed, 5 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/failsafe/failsafe_private.h > > b/drivers/net/failsafe/failsafe_private.h > > index 0361cf4..ef646db 100644 > > --- a/drivers/net/failsafe/failsafe_private.h > > +++ b/drivers/net/failsafe/failsafe_private.h > > @@ -334,7 +334,7 @@ fs_switch_dev(struct rte_eth_dev *dev, > > } else if ((txd && txd->state < req_state) || > > txd == NULL || > > txd == banned) { > > - struct sub_device *sdev; > > + struct sub_device *sdev = NULL; > > Good catch, actually this makes me think that the FOREACH_SUBDEV_STATE > macro is not following the usual tailq API (which sets the iterator to NULL > upon terminating). This can throw-off the unsuspecting writer. I think you right. Else, you should go all over this macro using and initiate sdev to NULL. > > I will fix this soon™. In the meantime, sdev should be initialized to NULL. Great > > > uint8_t i; > > > > /* Using acceptable device */ > > @@ -346,9 +346,10 @@ fs_switch_dev(struct rte_eth_dev *dev, > > PRIV(dev)->subs_tx = i; > > break; > > } > > - } else if (txd && txd->state < req_state) { > > - DEBUG("No device ready, deactivating tx_dev"); > > - PRIV(dev)->subs_tx = PRIV(dev)->subs_tail; > > + if (i >= PRIV(dev)->subs_tail || sdev == NULL) { > > + DEBUG("No device ready, deactivating tx_dev"); > > + PRIV(dev)->subs_tx = PRIV(dev)->subs_tail; > > + } > > } else { > > return; > > } > > -- > > 2.7.4 > > > > -- > Gaëtan Rivet > 6WIND
On 8/16/2017 3:19 PM, Matan Azrad wrote: > The corrupted code couldn't recognize that all sub devices > were not ready for tx traffic when failsafe PMD was trying > to switch device because of an unreachable condition using. > > Hence, the current tx sub device variable was not updated > correctly. > > The fix removed the unreachable branch and added new one > in the right place respecting the original intent. > > Fixes: ebea83f899d8 ("net/failsafe: add plug-in support") > Fixes: 598fb8aec6f6 ("net/failsafe: support device removal") > Cc: stable@dpdk.org > > Signed-off-by: Matan Azrad <matan@mellanox.com> > Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> Applied to dpdk-next-net/master, thanks.
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 0361cf4..ef646db 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -334,7 +334,7 @@ fs_switch_dev(struct rte_eth_dev *dev, } else if ((txd && txd->state < req_state) || txd == NULL || txd == banned) { - struct sub_device *sdev; + struct sub_device *sdev = NULL; uint8_t i; /* Using acceptable device */ @@ -346,9 +346,10 @@ fs_switch_dev(struct rte_eth_dev *dev, PRIV(dev)->subs_tx = i; break; } - } else if (txd && txd->state < req_state) { - DEBUG("No device ready, deactivating tx_dev"); - PRIV(dev)->subs_tx = PRIV(dev)->subs_tail; + if (i >= PRIV(dev)->subs_tail || sdev == NULL) { + DEBUG("No device ready, deactivating tx_dev"); + PRIV(dev)->subs_tx = PRIV(dev)->subs_tail; + } } else { return; }