diff mbox series

[v2,net-next] net: remove bypassed check in sch_direct_xmit()

Message ID 20180529170321.1817618-1-songliubraving@fb.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [v2,net-next] net: remove bypassed check in sch_direct_xmit() | expand

Commit Message

Song Liu May 29, 2018, 5:03 p.m. UTC
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 <songliubraving@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
---
 net/sched/sch_generic.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

David Miller May 31, 2018, 5:26 p.m. UTC | #1
From: Song Liu <songliubraving@fb.com>
Date: Tue, 29 May 2018 10:03:21 -0700

> 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 <songliubraving@fb.com>

Applied, thanks.
diff mbox series

Patch

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;
 }