From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] net: sched: check netif_xmit_frozen_or_stopped() in sch_direct_xmit() Date: Tue, 29 May 2018 10:02:55 -0400 (EDT) Message-ID: <20180529.100255.625454563789387164.davem@davemloft.net> References: <20180525181144.224395-1-songliubraving@fb.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, kernel-team@fb.com, john.fastabend@gmail.com To: songliubraving@fb.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:55584 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934877AbeE2OC5 (ORCPT ); Tue, 29 May 2018 10:02:57 -0400 In-Reply-To: <20180525181144.224395-1-songliubraving@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Song Liu Date: Fri, 25 May 2018 11:11:44 -0700 > Summary: > > At the end of sch_direct_xmit(), we are in the else path of > !dev_xmit_complete(ret), which means ret == NETDEV_TX_OK. The following > condition will always fail and netif_xmit_frozen_or_stopped() is not > checked at all. > > if (ret && netif_xmit_frozen_or_stopped(txq)) > return false; > > In this patch, this condition is fixed as: > > if (netif_xmit_frozen_or_stopped(txq)) > return false; > > and further simplifies the code as: > > return !netif_xmit_frozen_or_stopped(txq); > > Fixes: 29b86cdac00a ("net: sched: remove remaining uses for qdisc_qlen in xmit path") > Cc: John Fastabend > Cc: David S. Miller > Signed-off-by: Song Liu I expect a new version of this patch which removes the test entirely.