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 8A2D7C4332F for ; Thu, 10 Nov 2022 14:53:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbiKJOxB (ORCPT ); Thu, 10 Nov 2022 09:53:01 -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 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