Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp939598rwb; Thu, 10 Nov 2022 09:08:32 -0800 (PST) X-Google-Smtp-Source: AMsMyM7iwD6M+1by+YCj7K5HR2vp0mg0omkZITt72NCVqAARdpwGEzY2reEHYcqgp31E83adociS X-Received: by 2002:a17:902:ec8e:b0:17c:9a37:72fb with SMTP id x14-20020a170902ec8e00b0017c9a3772fbmr1507127plg.82.1668100112310; Thu, 10 Nov 2022 09:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668100112; cv=none; d=google.com; s=arc-20160816; b=JwvjPzamo8mm9SUfFQ6Aa9FmMBhqWouSxQn++3U1EOVSAZOFYk/5skmxtOZAYSJiwC 3VfUjYtJP2zBeNt2Z6EHbbpcEB3CUTUXzNpImGNnAxSSoq0hwgJilsSoYBfSQUpQWkUx sEJNdcHEMEbtTreeWPG9k86arNOdM800+jjxLbG6Q1cL6b6Pd7xeUkVHwUSuw6lhmQhG GN5XFh1awRG2w0Lb2V9npvL7/QoV1KQkpxyzx6jrCGwSPCRFdWcbRQJLiVczWlkaucQE 83DBKg5J/AGTFg7frpKbnP2qH4pJEYrjjgTkgXQDNbUBgbCJhAG/u6N0ictBIPaSEnEm PmTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=omYoFDdizbothqM1y6x7ltgbHGFmerjPUiCe70Zk9cs=; b=HUmzsfQGUFeU/onCmScABQPDjpV2VhSrnCmRRJt3xiILtVTvAa3+CUK93ImFyG3sA1 drKMKwM2p3EnYpMVG2WJCYTSbS86nQ3b1WuIetpu618WOavwC0Nx0NJjLTlEMlkxvhPH dxZ7T1rbRHmw9F/llewTlgHSJp8m7U2TJNeFfKCICPSq1OVBt8fMhE6ULkO63TAm7f++ 4ZxOL3io2A2Z4W+FbVPbq6NwGoSxykqCejllzq848q1dXony8ccwF/Gzlte66CoY72Gm GlC2d992KviUkVel8r42+GDaTNeyL+w2zPOyRerunsQdTM5XAIGt+Qs6aWL/qAPMGDMw wa6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h2sTpGQS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np2-20020a17090b4c4200b00217cdc4b09csi5278210pjb.3.2022.11.10.09.08.12; Thu, 10 Nov 2022 09:08:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h2sTpGQS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230493AbiKJOw7 (ORCPT + 92 others); Thu, 10 Nov 2022 09:52:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbiKJOwx (ORCPT ); Thu, 10 Nov 2022 09:52:53 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6313326C8 for ; Thu, 10 Nov 2022 06:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668091914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=omYoFDdizbothqM1y6x7ltgbHGFmerjPUiCe70Zk9cs=; b=h2sTpGQSNBuaPPdKiEUZtq7kb+gdyMBGd0mtV0q+K8zsy9tXlSA9ABmz63OA3zKbv7UngB IoYTwWzY/ApqUkmzONY1DtfkA2mb9Oxio1+51aHuvDwGWvquMb7JNUzXxVrbreEfIWroha LhRtE9NIx6L3t9NTqZgRhDL9UjT6CLs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-fovA9puiPdCfkCA7I0Rovg-1; Thu, 10 Nov 2022 09:51:51 -0500 X-MC-Unique: fovA9puiPdCfkCA7I0Rovg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2ACFC381078F; Thu, 10 Nov 2022 14:51:51 +0000 (UTC) Received: from p1.luc.cera.cz (ovpn-193-136.brq.redhat.com [10.40.193.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15BAE2166B29; Thu, 10 Nov 2022 14:51:47 +0000 (UTC) Date: Thu, 10 Nov 2022 15:51:47 +0100 From: Ivan Vecera To: "Keller, Jacob E" Cc: Leon Romanovsky , "netdev@vger.kernel.org" , "sassmann@redhat.com" , "Piotrowski, Patryk" , SlawomirX Laba , "Brandeburg, Jesse" , "Nguyen, Anthony L" , "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: <20221110155147.1a2c57f6@p1.luc.cera.cz> In-Reply-To: References: <20221108102502.2147389-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Nov 2022 20:11:55 +0000 "Keller, Jacob E" wrote: > > 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()? > > Yes I think you're right. A ton of people check it without the lock but I think thats not strictly safe. Is dev_close safe to call when netif_running is false? Why not just remove the check and always call dev_close then. > > Thanks, > Jake Check for a bit value (like netif_runnning()) is much cheaper than unconditionally taking global lock like RTNL. Ivan