History

tc: remove unused redirect ttl

improves ingress+u32 performance from 22.4 Mpps to 22.9 Mpps

Jamal Hadi Salim committed 11 years ago

Commit c19ae861 parent 4256af62 files · +2 −9Browse files

Unified · Split

2 files
  1. include/uapi/linux/pkt_cls.h +2 −0
  2. net/core/dev.c +0 −9
include/uapi/linux/pkt_cls.h+2−0
@@ -65,11 +65,13 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance · 64 unmodified lines
6565 #define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
6666 #define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
6767
68+#ifndef __KERNEL__
6869 #define S_TC_RTTL _TC_MAKE32(9)
6970 #define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
7071 #define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
7172 #define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
7273 #define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
74+#endif
7375
7476 #define S_TC_AT _TC_MAKE32(12)
7577 #define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
net/core/dev.c+0−9
@@ -3531,18 +3531,9 @@ EXPORT_SYMBOL_GPL(br_fdb_test_addr_hook); · 3530 unmodified lines
35313531 */
35323532 static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
35333533 {
3534− struct net_device *dev = skb->dev;
3535− u32 ttl = G_TC_RTTL(skb->tc_verd);
35363534 int result = TC_ACT_OK;
35373535 struct Qdisc *q;
35383536
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);
35463537 skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_INGRESS);
35473538
35483539 q = rcu_dereference(rxq->qdisc);