浏览代码

net-tc: make MAX_RECLASSIFY_LOOP local

This field is no longer kept in tc_verd. Remove it from the global
definition of that struct.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Willem de Bruijn 8 年之前
父节点
当前提交
d6264071ce
共有 2 个文件被更改,包括 2 次插入6 次删除
  1. 0 5
      include/uapi/linux/pkt_cls.h
  2. 2 1
      net/sched/sch_api.c

+ 0 - 5
include/uapi/linux/pkt_cls.h

@@ -17,9 +17,6 @@
 
 
 /* verdict bit breakdown 
 /* verdict bit breakdown 
  *
  *
-bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded
-assume loop
-
 bit 6,7: Where this packet was last seen 
 bit 6,7: Where this packet was last seen 
 0: Above the transmit example at the socket level
 0: Above the transmit example at the socket level
 1: on the Ingress
 1: on the Ingress
@@ -48,8 +45,6 @@ bit 8: when set --> Request not to classify on ingress.
 #define G_TC_AT(x)       _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
 #define G_TC_AT(x)       _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
 #define V_TC_AT(x)       _TC_MAKEVALUE(x,S_TC_AT)
 #define V_TC_AT(x)       _TC_MAKEVALUE(x,S_TC_AT)
 #define SET_TC_AT(v,n)   ((V_TC_AT(n)) | (v & ~M_TC_AT))
 #define SET_TC_AT(v,n)   ((V_TC_AT(n)) | (v & ~M_TC_AT))
-
-#define MAX_REC_LOOP 4
 #endif
 #endif
 
 
 /* Action attributes */
 /* Action attributes */

+ 2 - 1
net/sched/sch_api.c

@@ -1861,6 +1861,7 @@ int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
 {
 {
 	__be16 protocol = tc_skb_protocol(skb);
 	__be16 protocol = tc_skb_protocol(skb);
 #ifdef CONFIG_NET_CLS_ACT
 #ifdef CONFIG_NET_CLS_ACT
+	const int max_reclassify_loop = 4;
 	const struct tcf_proto *old_tp = tp;
 	const struct tcf_proto *old_tp = tp;
 	int limit = 0;
 	int limit = 0;
 
 
@@ -1885,7 +1886,7 @@ reclassify:
 	return TC_ACT_UNSPEC; /* signal: continue lookup */
 	return TC_ACT_UNSPEC; /* signal: continue lookup */
 #ifdef CONFIG_NET_CLS_ACT
 #ifdef CONFIG_NET_CLS_ACT
 reset:
 reset:
-	if (unlikely(limit++ >= MAX_REC_LOOP)) {
+	if (unlikely(limit++ >= max_reclassify_loop)) {
 		net_notice_ratelimited("%s: reclassify loop, rule prio %u, protocol %02x\n",
 		net_notice_ratelimited("%s: reclassify loop, rule prio %u, protocol %02x\n",
 				       tp->q->ops->id, tp->prio & 0xffff,
 				       tp->q->ops->id, tp->prio & 0xffff,
 				       ntohs(tp->protocol));
 				       ntohs(tp->protocol));