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

tc: remove unused redirect ttl

improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Florian Westphal <fw@strlen.de>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jamal Hadi Salim and committed by
David S. Miller
c19ae86a 4256af62

+2 -9
+2
include/uapi/linux/pkt_cls.h
··· 65 65 #define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS)) 66 66 #define CLR_TC_NCLS(v) ( v & ~TC_NCLS) 67 67 68 + #ifndef __KERNEL__ 68 69 #define S_TC_RTTL _TC_MAKE32(9) 69 70 #define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL) 70 71 #define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL) 71 72 #define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL) 72 73 #define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL)) 74 + #endif 73 75 74 76 #define S_TC_AT _TC_MAKE32(12) 75 77 #define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
-9
net/core/dev.c
··· 3531 3531 */ 3532 3532 static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq) 3533 3533 { 3534 - struct net_device *dev = skb->dev; 3535 - u32 ttl = G_TC_RTTL(skb->tc_verd); 3536 3534 int result = TC_ACT_OK; 3537 3535 struct Qdisc *q; 3538 3536 3539 - if (unlikely(MAX_RED_LOOP < ttl++)) { 3540 - net_warn_ratelimited("Redir loop detected Dropping packet (%d->%d)\n", 3541 - skb->skb_iif, dev->ifindex); 3542 - return TC_ACT_SHOT; 3543 - } 3544 - 3545 - skb->tc_verd = SET_TC_RTTL(skb->tc_verd, ttl); 3546 3537 skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_INGRESS); 3547 3538 3548 3539 q = rcu_dereference(rxq->qdisc);