Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3310918pxf; Mon, 15 Mar 2021 06:55:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiUby1MmWnWiZIo7OXcJDNDda9eC1jm0YRpZ6me6UqZTq/2I53k7bp82+YUOwFFJfdfSl1 X-Received: by 2002:a17:906:18a1:: with SMTP id c1mr7747862ejf.62.1615816518461; Mon, 15 Mar 2021 06:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615816518; cv=none; d=google.com; s=arc-20160816; b=XdqloMSuT2KxKNYYhWAKDOpUelM3w3o2EUzEf/qpInGP9liUrXnDfZogYUa2g0INRa 5EMav8iZYlkrR1M8YDhzeIxlFQCroTd5LyAzbJYe+p1MQPYdg3NUn8WM7/e82J25K5WS YAGZe+Sb8cQW0KfTYwUi/48KIGQeNZgke9Be+pELeNj3qklaQ0bTI7OaKU+GPFCVnGVr Cw1IpaPtNI6bGSRXkbYVHCNSz0rDS4t0umG8nvCvHtyHK6AqBN3Epy2KleE2YkXvqh1N xJ8qT4d1TYHpZp5EFUXHpv7YZvqzA/bRUnvzVQ0NDHX0LNAd0a2XEC5Xvg21kfHMUnmM Wknw== 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=QcQQMpLnsL+xeJJUC1KiJMH/kI2kGnyArD5LVxKUzl3DYuIkjc/M9E31Bt9hnfAzNz e+Bj9KQPlBpdkzWybyoNYoCJessEFF3Xtd6jS/cukOX9HAgZ3Pnq27D+iVeIJsFUNVVi kpffjMeT4Z35GVg0U6/RhdtxB/eZS1q4rvHMciS51pmLG1UxEM1Y+BCgUztxbbcjAKkX +4sC9YUb8rb91FIaXoCxsLSZ/5nvbRpiHjjwVIxFz+NrXRoek96+1vo/vvqXZAoSvsaj uHKLG/g1XuNQVspDkOmhrNVNg4RNM3fR3BVUFLn3zFGDu43CQAcZXcqVIYY8JYRwQyW6 w32A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="p/Fr6BDz"; 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 i25si10447886edt.491.2021.03.15.06.54.55; Mon, 15 Mar 2021 06:55:18 -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="p/Fr6BDz"; 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 S230497AbhCONxq (ORCPT + 99 others); Mon, 15 Mar 2021 09:53:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:55678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbhCONxI (ORCPT ); Mon, 15 Mar 2021 09:53:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 42CD464E89; Mon, 15 Mar 2021 13:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816387; bh=/8R6R06lhlNFIZDBwF3ujdYr58JUCq8f0opCZTPs2JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p/Fr6BDz3z27HdvVf0vV2bkpaL53u5AcdzJmJkYad+owd0WEbZ8VsIzO1FjuKEj2N 3ca7FFqHlTBYyNqMbVN9eWn1PgWwbUd8WwWWGFvCMxqTD2GEqoJEWSdXkShT7cW2JA qCCshKA91kena255vv3dP8zGakjr1xIfZBos3p30= 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.4 15/75] net: lapbether: Remove netif_start_queue / netif_stop_queue Date: Mon, 15 Mar 2021 14:51:29 +0100 Message-Id: <20210315135208.758191366@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135208.252034256@linuxfoundation.org> References: <20210315135208.252034256@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);