mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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 <zarychtam at plan-b.pwste.edu.pl>
(cherry picked from commit d5be41beb7)
This commit is contained in:
parent
5b64694c8a
commit
8a25d3f6ce
2 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue