From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A24BC433FE for ; Wed, 9 Nov 2022 18:20:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C55D6415F5; Wed, 9 Nov 2022 18:20:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C55D6415F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1668018043; bh=4YTn3gPA4yMcTG9Qrrr4BWWy0r7KGPMayZkVKZRJgdM=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=y2JIxGmatfQxEqAuKtQx3MJOaXSXetY+AgD81ou814nk4M/NaTXhzRGZhilx+f272 RepB6Oi1u8H3LtNmVedyGMMaf2O8PoscFbGMJlXxjFLpny+9O/orYsQi8C1uNeaJ8J ZgvHOh96hOuL3Il+mES2WZExeLw+Z1H/JX8hwHkhTQTC+178MPASbzS42V3oY9VcmB EzB8IpTUJP+zTE8fvNiQLmKamnwq4gJSy5f3NFC8QBVaBXD3GPUV2YIJlgNKWuoolC Aoa0p2mMT9m8a4RWRav6wCUhqi8KL8lr0K3YI0+qef5N7T2Fq+H53Z3BMtJm7XunuS djWeFunU3fzlQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AIMN6s_BZM0i; Wed, 9 Nov 2022 18:20:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id DA5B841600; Wed, 9 Nov 2022 18:20:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DA5B841600 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9CDAC1BF4D6 for ; Wed, 9 Nov 2022 18:20:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 831AB41600 for ; Wed, 9 Nov 2022 18:20:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 831AB41600 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J2jS7MtIQRhJ for ; Wed, 9 Nov 2022 18:20:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9DC15415F5 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9DC15415F5 for ; Wed, 9 Nov 2022 18:20:39 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D720AB80AE1; Wed, 9 Nov 2022 18:20:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF291C433C1; Wed, 9 Nov 2022 18:20:35 +0000 (UTC) Date: Wed, 9 Nov 2022 20:20:31 +0200 From: Leon Romanovsky To: Ivan Vecera Message-ID: References: <20221108102502.2147389-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221108102502.2147389-1-ivecera@redhat.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668018036; bh=lHGIXa/gzMZc3tKmxe07xLxCc5ENdiRStUxmf+RJ76E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aDq7gFkVLaBFz3piUo2ROtjM7vxyTK0VgBb5MXkNJgRAbmWlBmTQAiI41f+1Fq2qu hkBF5vneS+6G0CgV0oggBnfm/bAMNfaMfflzjPZ8cCLyMC+11/bbC0LaTWC8z9KShf KEvyGPmr1uvvOjajknE8coL4wgOAepw9wtS7ip9S9Ed8mf7iJ/Z8fkvVZbYim3DyHw /CjzIqaQe8NMx0OCe2GRwOsKL4SZ42DEtNbTPZSJ03z7K5ixHbjnvnlvVElMzKTUAE hQKRXQgFBEbHSRD6K2dYHJ/IssE5VQhMrtpOw/7P2lXAzoDqsuMLK67aCu4bO3UtAn f/7fnsVKFTauA== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=aDq7gFkV Subject: Re: [Intel-wired-lan] [PATCH net] iavf: Do not restart Tx queues after reset task failure X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: SlawomirX Laba , Eric Dumazet , netdev@vger.kernel.org, open list , Patryk Piotrowski , "moderated list:INTEL ETHERNET DRIVERS" , Jakub Kicinski , Paolo Abeni , "David S. Miller" , sassmann@redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, Nov 08, 2022 at 11:25:02AM +0100, Ivan Vecera wrote: > After commit aa626da947e9 ("iavf: Detach device during reset task") > the device is detached during reset task and re-attached at its end. > The problem occurs when reset task fails because Tx queues are > restarted during device re-attach and this leads later to a crash. <...> > + if (netif_running(netdev)) { > + /* Close device to ensure that Tx queues will not be started > + * during netif_device_attach() at the end of the reset task. > + */ > + rtnl_lock(); > + dev_close(netdev); > + rtnl_unlock(); > + } Sorry for my naive question, I see this pattern a lot (including RDMA), so curious. Everyone checks netif_running() outside of rtnl_lock, while dev_close() changes state bit __LINK_STATE_START. Shouldn't rtnl_lock() placed before netif_running()? Thanks > + > dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n"); > reset_finish: > rtnl_lock(); > -- > 2.37.4 > _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FB87C4332F for ; Wed, 9 Nov 2022 18:20:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbiKISUn (ORCPT ); Wed, 9 Nov 2022 13:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiKISUi (ORCPT ); Wed, 9 Nov 2022 13:20:38 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2F7324F17; Wed, 9 Nov 2022 10:20:37 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2CCF961C28; Wed, 9 Nov 2022 18:20:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF291C433C1; Wed, 9 Nov 2022 18:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668018036; bh=lHGIXa/gzMZc3tKmxe07xLxCc5ENdiRStUxmf+RJ76E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aDq7gFkVLaBFz3piUo2ROtjM7vxyTK0VgBb5MXkNJgRAbmWlBmTQAiI41f+1Fq2qu hkBF5vneS+6G0CgV0oggBnfm/bAMNfaMfflzjPZ8cCLyMC+11/bbC0LaTWC8z9KShf KEvyGPmr1uvvOjajknE8coL4wgOAepw9wtS7ip9S9Ed8mf7iJ/Z8fkvVZbYim3DyHw /CjzIqaQe8NMx0OCe2GRwOsKL4SZ42DEtNbTPZSJ03z7K5ixHbjnvnlvVElMzKTUAE hQKRXQgFBEbHSRD6K2dYHJ/IssE5VQhMrtpOw/7P2lXAzoDqsuMLK67aCu4bO3UtAn f/7fnsVKFTauA== Date: Wed, 9 Nov 2022 20:20:31 +0200 From: Leon Romanovsky To: Ivan Vecera Cc: netdev@vger.kernel.org, sassmann@redhat.com, Jacob Keller , Patryk Piotrowski , SlawomirX Laba , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "moderated list:INTEL ETHERNET DRIVERS" , open list Subject: Re: [PATCH net] iavf: Do not restart Tx queues after reset task failure Message-ID: References: <20221108102502.2147389-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221108102502.2147389-1-ivecera@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 08, 2022 at 11:25:02AM +0100, Ivan Vecera wrote: > After commit aa626da947e9 ("iavf: Detach device during reset task") > the device is detached during reset task and re-attached at its end. > The problem occurs when reset task fails because Tx queues are > restarted during device re-attach and this leads later to a crash. <...> > + if (netif_running(netdev)) { > + /* Close device to ensure that Tx queues will not be started > + * during netif_device_attach() at the end of the reset task. > + */ > + rtnl_lock(); > + dev_close(netdev); > + rtnl_unlock(); > + } Sorry for my naive question, I see this pattern a lot (including RDMA), so curious. Everyone checks netif_running() outside of rtnl_lock, while dev_close() changes state bit __LINK_STATE_START. Shouldn't rtnl_lock() placed before netif_running()? Thanks > + > dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n"); > reset_finish: > rtnl_lock(); > -- > 2.37.4 >