From mboxrd@z Thu Jan 1 00:00:00 1970 From: Song Liu Subject: [PATCH v2 net-next] net: remove bypassed check in sch_direct_xmit() Date: Tue, 29 May 2018 10:03:21 -0700 Message-ID: <20180529170321.1817618-1-songliubraving@fb.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , Song Liu , , John Fastabend , Alexei Starovoitov , "David S . Miller" To: Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:13062 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965010AbeE2RDk (ORCPT ); Tue, 29 May 2018 13:03:40 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4TGtgmR030094 for ; Tue, 29 May 2018 10:03:40 -0700 Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2j989x0g0p-6 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 29 May 2018 10:03:40 -0700 Sender: netdev-owner@vger.kernel.org List-ID: Checking netif_xmit_frozen_or_stopped() at the end of sch_direct_xmit() is being bypassed. This is because "ret" from sch_direct_xmit() will be either NETDEV_TX_OK or NETDEV_TX_BUSY, and only ret == NETDEV_TX_OK == 0 will reach the condition: if (ret && netif_xmit_frozen_or_stopped(txq)) return false; This patch cleans up the code by removing the whole condition. For more discussion about this, please refer to https://marc.info/?t=152727195700008 Signed-off-by: Song Liu Cc: John Fastabend Cc: Alexei Starovoitov Cc: David S. Miller --- net/sched/sch_generic.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 760ab1b..69078c8 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -346,9 +346,6 @@ bool sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, return false; } - if (ret && netif_xmit_frozen_or_stopped(txq)) - return false; - return true; } -- 2.9.5