Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3324610pxf; Mon, 15 Mar 2021 07:09:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNvHDsOcr1+O8DSU+8F0MAAesZB4QaOIERIs4J7Df9on0fApUKsRDQy4SwHGFaA7Wxogq0 X-Received: by 2002:a17:906:f10c:: with SMTP id gv12mr23897018ejb.53.1615817391626; Mon, 15 Mar 2021 07:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817391; cv=none; d=google.com; s=arc-20160816; b=TUceKFX25mODmdiKCoeHOxGi8RktmkiLpivojNjPq4x+Vn8xTxrRsghC2FnX82yXUo ZByp8i3MBJrkW9rj7h44vYkOHqtbSg0qc3LNd7Np33/GgkYwiLCFH6rrkx4tMOpbXyWX OZeL1ftci972NAcceH+bNvl9S3uf+6ye9flXuJQH7kczgoSOhu7gmq/jKvtDVWx2js2/ vhM11Ae3RbjPNLTvTIhQesMIiH45BoDGLNKcr3rYR5Tq843iEjyT9F5f1XFBhCzVkM7C /n0AR+YgDk7nlmET91j/zNYE6A6kfOQqEKlVv0hctgl9zuQ+USXYQ6u+kGj9v9OJ2ho8 04Yw== 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=eXbMeyVvwaJqMnXzf49hsvj2LXgvmWXCPbhoN6YJXXQazHGuMUHA/AHrSzHDmX3KUW +bO7IC4rxzCVhIQWUNDEBGf25x2qFsCHTeOxHPb5oByN93QCzEKMR51Q3py/lklhmrjv lIQtHtq87euCoXDZnBCxY5GZU2rkcrWztx/1cIS9CBRWNes6P/hHdbqK+afyxOT1SPa0 qUDF1TRDA1n+mXxWmecePksbbu0ZkR6KonSp6e4IfRQUcsLLewxh/b0SNpiVJrVPXbdw nD8ffuF/hshZoJU7gd5KSgVh1vGlPFiejrZN/YDY8SgPED20P5K00gESKX9eaH5ZAg/L /riQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=u4vqY1h+; 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 q9si10715200edd.324.2021.03.15.07.09.28; Mon, 15 Mar 2021 07:09:51 -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=u4vqY1h+; 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 S235551AbhCOOHw (ORCPT + 99 others); Mon, 15 Mar 2021 10:07:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:36622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbhCON6J (ORCPT ); Mon, 15 Mar 2021 09:58:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0AEA264EF8; Mon, 15 Mar 2021 13:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816688; bh=MYT5fajR3Hw2J9wLkjq1CiCcmSKoOGtNHViFqyTJo78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u4vqY1h+94DRd5rUbyb4IFoW4NGcR973QWtyw2b7chIgNP5cm9TYTxMFgepeoD9+g vxUYGMhCddWpVJt5ZAaK3nWmYB/uqDpDUGYo0mmfRRN6aN3AckpjnaRbzf5IhDG/34 SrZjCwa0DSXvf4BDQkDd265BTr9JCXFzOZ3XtCrU= 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.10 056/290] net: lapbether: Remove netif_start_queue / netif_stop_queue Date: Mon, 15 Mar 2021 14:52:29 +0100 Message-Id: <20210315135543.826235082@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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);