Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3509867pxf; Mon, 15 Mar 2021 11:07:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMX+8NDa9vuKK7astYFPaCsxCJlEmRiHzu+blHF3u7DQ+wpABdFQF75YdncSrpy3weaC5Z X-Received: by 2002:aa7:c398:: with SMTP id k24mr31336389edq.61.1615831656963; Mon, 15 Mar 2021 11:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831656; cv=none; d=google.com; s=arc-20160816; b=aW7xuIrhV/1p99D7w20kKAW5Hl8L2aMRdWNczaMieMAmVtmEefRFWR7C7zjCg/qBBA bvOl7QvVu5509gE/I5sh1pUsweYbfx9YqNJ+b1rwSrcvnZpVyzOl8s3y2DyqGxOlrQ0b N5aWpKdwtnNBw+1Cv5AoVoh7fMofrgkPuDHVdB6vdTiTuBW+JYLJmLKJtvMdaJ5QNqot 41bGx8q68Vu2gUTiIqVVo41tXQxdI3WhrzqmdljuRiPjGc2qz7H2K48e2gwi41Ih03VZ qjL6Ss9Fu/xHUofYyXS7z0yQ80oi+L/xUBhAUy8bn6dQ8BVLBJXEjsYMLedY9ynezXd/ rj3g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ff118/bRgGMIFzy9SxBk3ZisKTVWnmZEqxKpzs7WMtA=; b=MOUhGgvKe0iXptls+pKyCqebmiCmBm96TmAD9b0N6zxCEDt8e00/6rqS1T97Ct4Vgy wgDiUuFcqEtOjFsbHORj0xadDPKYWKc1pG0CIW3A9/4H1UY0DHorAtT6VIOidnAdvTA0 mo6O8Kj2hq0/HcblntUMIjaZJwd5y81fa0l9vf56YotfxrpZOXGfmcImzPqZzpUYO2Lg QTH4J5xepiGjVerbDVo50L9yoVIrYMARgH5X/YhXDBXn4YEPZ1PiURdrvY0i59C9yZEh XfMMasMB7/BbEkAeZs9YnV2wTvufacgx6VDAHidU3kgek+y3u7kSi4gGydoGh4PBsqDi 2cSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=skP56bEc; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b65si12547416edf.391.2021.03.15.11.07.11; Mon, 15 Mar 2021 11:07:36 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=skP56bEc; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234519AbhCOOIS (ORCPT + 99 others); Mon, 15 Mar 2021 10:08:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:37476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231992AbhCON6M (ORCPT ); Mon, 15 Mar 2021 09:58:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0292464F16; Mon, 15 Mar 2021 13:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816692; bh=/790nOz32xaX0xWdPUA7Nda3o6/xLtAllPmcVfB2N34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=skP56bEcomf33+cigT9DtJr7EROqxwqI+gxx5SjM3DtFYfE9zNaERfGZYWLL8QfNC iHXbPsqSoxmG9hQRewZfwvb6Rwxv7iB7yK0rLHpk3gEHmVl4W+lKgTxYOZq90SIe2S cVN/8j7G569swi3rXEHZGQFSEdOEPqP8ipR7ndjM= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xie He , Martin Schiller , "David S. Miller" Subject: [PATCH 5.11 067/306] net: lapbether: Remove netif_start_queue / netif_stop_queue Date: Mon, 15 Mar 2021 14:52:10 +0100 Message-Id: <20210315135509.913984853@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Xie He commit f7d9d4854519fdf4d45c70a4d953438cd88e7e58 upstream. For the devices in this driver, the default qdisc is "noqueue", because their "tx_queue_len" is 0. In function "__dev_queue_xmit" in "net/core/dev.c", devices with the "noqueue" qdisc are specially handled. Packets are transmitted without being queued after a "dev->flags & IFF_UP" check. However, it's possible that even if this check succeeds, "ops->ndo_stop" may still have already been called. This is because in "__dev_close_many", "ops->ndo_stop" is called before clearing the "IFF_UP" flag. If we call "netif_stop_queue" in "ops->ndo_stop", then it's possible in "__dev_queue_xmit", it sees the "IFF_UP" flag is present, and then it checks "netif_xmit_stopped" and finds that the queue is already stopped. In this case, it will complain that: "Virtual device ... asks to queue packet!" To prevent "__dev_queue_xmit" from generating this complaint, we should not call "netif_stop_queue" in "ops->ndo_stop". We also don't need to call "netif_start_queue" in "ops->ndo_open", because after a netdev is allocated and registered, the "__QUEUE_STATE_DRV_XOFF" flag is initially not set, so there is no need to call "netif_start_queue" to clear it. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xie He Acked-by: Martin Schiller Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/lapbether.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -292,7 +292,6 @@ static int lapbeth_open(struct net_devic return -ENODEV; } - netif_start_queue(dev); return 0; } @@ -300,8 +299,6 @@ static int lapbeth_close(struct net_devi { int err; - netif_stop_queue(dev); - if ((err = lapb_unregister(dev)) != LAPB_OK) pr_err("lapb_unregister error: %d\n", err);