From d5be41beb7c44119730791d92782d8e77174d312 Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Sun, 7 Mar 2021 22:05:34 +0000 Subject: [PATCH] Fix dpdk/ldradix fib lookup algorithm preference calculation. The current preference number were copied from IPv4 code, assuming 500k routes to be the full-view. Adjust with the current reality (100k full-view). Reported by: Marek Zarychta MFC after: 3 days --- sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c | 4 ++-- sys/netinet6/in6_fib_algo.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c b/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c index 250e3e1bde4a..17d35c16346d 100644 --- a/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c +++ b/sys/contrib/dpdk_rte_lpm/dpdk_lpm6.c @@ -129,8 +129,8 @@ rte6_get_pref(const struct rib_rtable_info *rinfo) return (1); else if (rinfo->num_prefixes < 1000) return (rinfo->num_prefixes / 10); - else if (rinfo->num_prefixes < 500000) - return (100 + rinfo->num_prefixes / 3334); + else if (rinfo->num_prefixes < 100000) + return (100 + rinfo->num_prefixes / 667); else return (250); } diff --git a/sys/netinet6/in6_fib_algo.c b/sys/netinet6/in6_fib_algo.c index c9df9387af37..04d194273168 100644 --- a/sys/netinet6/in6_fib_algo.c +++ b/sys/netinet6/in6_fib_algo.c @@ -118,8 +118,8 @@ lradix6_get_pref(const struct rib_rtable_info *rinfo) if (rinfo->num_prefixes < 10) return (255); - else if (rinfo->num_prefixes < 100000) - return (255 - rinfo->num_prefixes / 394); + else if (rinfo->num_prefixes < 10000) + return (255 - rinfo->num_prefixes / 40); else return (1); }