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>
MFC after:	3 days
This commit is contained in:
Alexander V. Chernikov 2021-03-07 22:05:34 +00:00
parent 748be78e60
commit d5be41beb7
2 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);
}