Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3324049pxf; Mon, 15 Mar 2021 07:09:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqapkB7/4Qj/PPozhP/0RIpw4JFlVwmU2eMBmMBgfCZ/42uiEptSUzEkysde4PKfbVYqyL X-Received: by 2002:a17:906:7c57:: with SMTP id g23mr23187501ejp.195.1615817351396; Mon, 15 Mar 2021 07:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817351; cv=none; d=google.com; s=arc-20160816; b=LLhGRquHJ5Wb7aZ6zdE48Izrr5smcLcGscPA3eTYWQaoi414eGTH3JxMXjK1TutMXA +UNC5Ng6uO8q5UDE0GJBEy61UAwwhN/Ac2VjCM4qx9ZQd2pT66fnegrRunh5NU1GuLe/ 55YcfaXLEkH4FArRim8yqMx2Kyd0K+UrPPEgtL6O8ZHcxri2BZoaqBy5RsaGvYeOMYVJ J7PHu537tUNHdwSjlS8ix/1/CWqDYh94isHNraFN2zL7pcO1lcwTV/IKTXE8p3kf6sX8 7+gSw7rDJBdyS5Zn1Tx7bAP6/JEpUwx7EWh33roEsf2rp+qfyXnN41xNTm4WFaeQWOzG Aayg== 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=jAQbeO8HpwQ/3pb0IgvMs7TF+QxKuH+izNPUIfZPJR4=; b=DUA4YqrnB1IB9/2OgXuJQ1xslCkdFbQIZLIukIiAF+stOsS+lV+H5q5NQ+Q5cezeCm QqRg1MfgLloANcnB1AXqymrzWLuRMtz2Ry20ZFSHs93lBEkxB45q9oSeLo9Ex7OkaC9X j0ShwBCoeeXHLMGv/nni1rJJ7YWPafzek968nSifk7huEhMR7Ucz/tysInNX50FtCZ4v f76Lp5KGnZnPwe6A7L8CAjNcEt+X013pBRXaO7GJQBA8DPfIQxA9FaLtx40rs90CZ8oT JZHIF7AeGw+C2610O8aj1hgeTVXlEDqH1wtvnsa2rwGvLLvCvvhryFl3XaLYyhljqi1D 7YIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FHGVo9L9; 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 u14si10937642edx.551.2021.03.15.07.08.47; Mon, 15 Mar 2021 07:09:11 -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=FHGVo9L9; 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 S234966AbhCOOGr (ORCPT + 99 others); Mon, 15 Mar 2021 10:06:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:35764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232095AbhCON5q (ORCPT ); Mon, 15 Mar 2021 09:57:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9878764F26; Mon, 15 Mar 2021 13:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816665; bh=MYT5fajR3Hw2J9wLkjq1CiCcmSKoOGtNHViFqyTJo78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FHGVo9L9YIUTnb3g+QpTCh1y6ockW0acFQ7N5H7ahCwqHZ1E4niq57vU0s3L3XFaC HQyZwBvPTk3oY7VV4+dtPqM1N1YfSQOTx+miPdHfgk8bF5jdJzRjY5HfBqXfk20Yab /yjsrz26JKfjuJ+WiNtoozDZzsCoQoPutWG5KmD8= 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.4 034/168] net: lapbether: Remove netif_start_queue / netif_stop_queue Date: Mon, 15 Mar 2021 14:54:26 +0100 Message-Id: <20210315135551.467026489@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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 @@ -283,7 +283,6 @@ static int lapbeth_open(struct net_devic return -ENODEV; } - netif_start_queue(dev); return 0; } @@ -291,8 +290,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);