Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3311017pxf; Mon, 15 Mar 2021 06:55:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEfDkKABiT1f+75N3o4nLjehafYim6RWxryfvEXyvee+pOpk0F9w4y4ahjVw3MCXBuJBKj X-Received: by 2002:a17:906:d114:: with SMTP id b20mr22593199ejz.449.1615816526752; Mon, 15 Mar 2021 06:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615816526; cv=none; d=google.com; s=arc-20160816; b=RpPTWF5QEeCMBdQo9r5Xgg3BjW5lPNVZyjKRfUgewSxW2VEU6Vn84u7zejUWF9OkhY 3D0C1xXnXFf6Ll/TE7I9U8gTZxRq6K/TjmWAnSOr8NKJOPiiFAFJZW23RY+ScFJranmK 8m2e7jEruOgVsF9kVZcOeH2RpK2PrbDuhAFSYCwDiuU98aiImshmKWTr/M4HwmZmsSnJ qqz29LnAUkZWQVZQctuOoUE99dz/jcV5FdPo2HQsqNyPxIBCCpbeC3FOCoQR7QtSNxbt qNkIdZWp7KxCgBS5ggie/SM7X8xRLaaUIsxBUUw9midEmhlxyxQiQpm8puyOal4blK/k mebQ== 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=oMmhjHwOUBh9ABf1FqTe8m5Ia0w5QE7yw4RPKe75o1w=; b=JOMmR3KEkxOidRJRJg0b8UpX113ZrxHSG+bmpzgiU9dl39AQIupsr6fSfi8tLsjAg3 O7gWpsAzpDLjHE/8d7GRiMp0KC5hHPLKypznyhhdndSCiYFdYdl3CB/VpxdOzAoj291/ VBW4Frx/lnrlGFi2hemQPHpvDvQqWgDUD2DDYz10BcBA5cHr/JmkdWJBdg2XkgCsTKek K+VQ3WyErZA+8FoEYoETdU3g6bm5kA4ZnJ8mGpyX6WgfCiWK5hOpEmhYA6UzPGD27z1W sZkhO86Kli40h1pbnUMDgsnPtG5kC1JegVhZnrLUQy+SQTeOt+qz3/6+iKvJFMecGFHM pZmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="zvFzEFd/"; 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 g8si11101833ejr.82.2021.03.15.06.55.04; Mon, 15 Mar 2021 06:55:26 -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="zvFzEFd/"; 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 S231332AbhCONyE (ORCPT + 99 others); Mon, 15 Mar 2021 09:54:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:55748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbhCONxO (ORCPT ); Mon, 15 Mar 2021 09:53:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD33964E89; Mon, 15 Mar 2021 13:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816394; bh=/8R6R06lhlNFIZDBwF3ujdYr58JUCq8f0opCZTPs2JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zvFzEFd/kafs54uSrTGWLoyQgp9pR9bBScqJz0sAAxTqzBA5Mo+QDl2EmBVCKndDa fuFY8m36cj9rNmcUd7OJQ0dDs/uOCopD9f+3trvg8lPKXhiUNPYlDV9F+Zrk/4rvje Kjtj6+ibKvmxSYcqUO9aPG/6WSlv2V0LO17bnvzk= 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 4.9 14/78] net: lapbether: Remove netif_start_queue / netif_stop_queue Date: Mon, 15 Mar 2021 14:51:37 +0100 Message-Id: <20210315135212.534633267@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135212.060847074@linuxfoundation.org> References: <20210315135212.060847074@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 @@ -286,7 +286,6 @@ static int lapbeth_open(struct net_devic return -ENODEV; } - netif_start_queue(dev); return 0; } @@ -294,8 +293,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);