net/sched: cls_api: increase max_reclassify_loop
authorDavide Caratti <dcaratti@redhat.com>
Wed, 19 May 2021 13:17:21 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 May 2021 20:10:24 +0000 (13:10 -0700)
modern userspace applications, like OVN, can configure the TC datapath to
"recirculate" packets several times. If more than 4 "recirculation" rules
are configured, packets can be dropped by __tcf_classify().
Changing the maximum number of reclassifications (from 4 to 16) should be
sufficient to prevent drops in most use cases, and guard against loops at
the same time.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c

index 40fbea6..75e3a28 100644 (file)
@@ -1531,7 +1531,7 @@ static inline int __tcf_classify(struct sk_buff *skb,
                                 u32 *last_executed_chain)
 {
 #ifdef CONFIG_NET_CLS_ACT
-       const int max_reclassify_loop = 4;
+       const int max_reclassify_loop = 16;
        const struct tcf_proto *first_tp;
        int limit = 0;