Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched: remove NET_XMIT_POLICED

sch_atm returns this when TC_ACT_SHOT classification occurs.

But all other schedulers that use tc_classify
(htb, hfsc, drr, fq_codel ...) return NET_XMIT_SUCCESS | __BYPASS
in this case so just do that in atm.

BATMAN uses it as an intermediate return value to signal
forwarding vs. buffering, but it did not return POLICED to
callers outside of BATMAN.

Reviewed-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Florian Westphal and committed by
David S. Miller
99860208 eb37c563

+4 -8
-1
include/linux/netdevice.h
··· 90 90 #define NET_XMIT_SUCCESS 0x00 91 91 #define NET_XMIT_DROP 0x01 /* skb dropped */ 92 92 #define NET_XMIT_CN 0x02 /* congestion notification */ 93 - #define NET_XMIT_POLICED 0x03 /* skb is shot by police */ 94 93 #define NET_XMIT_MASK 0x0f /* qdisc flags in net/sch_generic.h */ 95 94 96 95 /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
+1 -1
net/batman-adv/routing.c
··· 653 653 len + ETH_HLEN); 654 654 655 655 ret = NET_RX_SUCCESS; 656 - } else if (res == NET_XMIT_POLICED) { 656 + } else if (res == -EINPROGRESS) { 657 657 /* skb was buffered and consumed */ 658 658 ret = NET_RX_SUCCESS; 659 659 }
+2 -2
net/batman-adv/send.c
··· 156 156 * attempted. 157 157 * 158 158 * Return: NET_XMIT_SUCCESS on success, NET_XMIT_DROP on failure, or 159 - * NET_XMIT_POLICED if the skb is buffered for later transmit. 159 + * -EINPROGRESS if the skb is buffered for later transmit. 160 160 */ 161 161 int batadv_send_skb_to_orig(struct sk_buff *skb, 162 162 struct batadv_orig_node *orig_node, ··· 188 188 * network coding fails, then send the packet as usual. 189 189 */ 190 190 if (recv_if && batadv_nc_skb_forward(skb, neigh_node)) { 191 - ret = NET_XMIT_POLICED; 191 + ret = -EINPROGRESS; 192 192 } else { 193 193 batadv_send_unicast_skb(skb, neigh_node); 194 194 ret = NET_XMIT_SUCCESS;
-1
net/core/pktgen.c
··· 3463 3463 break; 3464 3464 case NET_XMIT_DROP: 3465 3465 case NET_XMIT_CN: 3466 - case NET_XMIT_POLICED: 3467 3466 /* skb has been consumed */ 3468 3467 pkt_dev->errors++; 3469 3468 break;
-2
net/sched/sch_api.c
··· 95 95 Expected action: do not backoff, but wait until queue will clear. 96 96 NET_XMIT_CN - probably this packet enqueued, but another one dropped. 97 97 Expected action: backoff or ignore 98 - NET_XMIT_POLICED - dropped by police. 99 - Expected action: backoff or error to real-time apps. 100 98 101 99 Auxiliary routines: 102 100
+1 -1
net/sched/sch_atm.c
··· 363 363 struct atm_flow_data *flow; 364 364 struct tcf_result res; 365 365 int result; 366 - int ret = NET_XMIT_POLICED; 366 + int ret = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; 367 367 368 368 pr_debug("atm_tc_enqueue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p); 369 369 result = TC_POLICE_OK; /* be nice to gcc */