Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp778717pxf; Thu, 11 Mar 2021 14:57:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwT6Ql9MJdVlQaPq+rtXPClsu1UTOx2Hi0pksUYQt01Yet6/VcvT83LCCr/tuMhGFLxCyhI X-Received: by 2002:a17:906:bfcc:: with SMTP id us12mr5534996ejb.266.1615503428005; Thu, 11 Mar 2021 14:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615503428; cv=none; d=google.com; s=arc-20160816; b=xbgkthT10cklU3FMdkxgFYzBYCnD0tJtNu102VtWO9hMlPh4NbVgnS8kmxN8byr0KC k5YkT/RCVVbHVPoPOJQDaq5oy5W2mMVNeIBK95vciLVya5M9bqWrfOkfWZbNOt40SNx8 5LuKl17kY80ZNb7t0ZcHMtQsck5c4CoW+ngGlsXe9dJty0RNkVyGz9cd2GoEgX/MnAUU Bquc17s0cKoVoH/ihy0USD/Vay/GDg/CdD/7djeqHKf5jgy3z4STows70aGimVyk+DEm odbima7zk8kBmmoUJPBibXax9iS903Hh0HL+RESEpfShCrddnoyIa/LZHI6C+G2n0+yA nL5Q== 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=nCcqwn2TX2rHw0yedesXwtr8x5K3LCqeosvu0T363Lg=; b=mdBhHHk6AR9hWax2ZzhxoCYTCWC8Rs0Lu1Srdu5X6d6kq5CnV6munNl3aYkoSOP2q4 2j+PShYNZKw3UzYMtvNm+GZnMvWQTydNtQuKJKcX3p7ImWOIg+hNfVR+kZ1sgCDzPKWm kFUikul00n/ELjayY97jSyIY8f1jhrXT6VfOgT/uz6A6AKn/D/USDLgxPcBIvKkIODyx Bfqu4c4Y16F+MzxgUiQGoDbJXA2vNAhnZ4awkv3iX1GJZZ9PsNIan3rXdJmWJ0wPpbnG ztypnb3krWR/ANB1UrV8ZwOa8oHZNlb1NxLnJa6RMpK/dmZS7b9VOkPpL3H/lPfUGvfH QQUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gzFd5WjU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si2684067edv.12.2021.03.11.14.56.45; Thu, 11 Mar 2021 14:57:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gzFd5WjU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbhCKWxD (ORCPT + 99 others); Thu, 11 Mar 2021 17:53:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:43492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbhCKWwc (ORCPT ); Thu, 11 Mar 2021 17:52:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B375464F88; Thu, 11 Mar 2021 22:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615503152; bh=4QgAP0kdRp+SvY/5gfVIOzzcM8Q+PCJdBWaJ2ssOVig=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gzFd5WjUEeVa2WCswkfsMUpVVPomdYorr/uhTZmrtvrgkDArbOefq95A2kVkl15zV PxZma4wyVTPlWpp39UJJlwEUD6ccGvO++nM6sxs/ZALSDJpeN8NcnCcshqXkC/7/SD FPyovlg887Tr443uPWOYN6xoHGhFLhTeBZcyQZsybyzbihDMlcCjLd4pddvY4AWBwr pxCcgs9n3omYa5ZCWNzdN6xDypLqgTdd4oJyPfVjVU408oUgcieJPShI/AaECZoIVD rJO0tBEI5ib35G3z8pBnx/yJB7CDCJD00DFo96XqQrnh70w/fDNhOSYAlQ0r43v5Lu VkM0h6aIF3mtg== Date: Thu, 11 Mar 2021 14:52:30 -0800 From: Jakub Kicinski To: Xie He Cc: Martin Schiller , "David S. Miller" , Linux X25 , Linux Kernel Network Developers , LKML Subject: Re: [PATCH net] net: lapbether: Prevent racing when checking whether the netif is running Message-ID: <20210311145230.5f368151@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210311072311.2969-1-xie.he.0141@gmail.com> <20210311124309.5ee0ef02@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Mar 2021 13:12:25 -0800 Xie He wrote: > On Thu, Mar 11, 2021 at 12:43 PM Jakub Kicinski wrote: > > > > Is this a theoretical issues or do you see a path where it triggers? > > > > Who are the callers sending frames to a device which went down? > > This is a theoretical issue. I didn't see this issue in practice. > > When "__dev_queue_xmit" and "sch_direct_xmit" call > "dev_hard_start_xmit", there appears to be no locking mechanism > preventing the netif from going down while "dev_hard_start_xmit" is > doing its work. Normally driver's ndo_stop() calls netif_tx_disable() which takes TX locks, so unless your driver is lockless (LLTX) there should be no xmit calls after that point.