]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: nexthop: add cache helpers
authorNikolay Aleksandrov <nikolay@nvidia.com>
Thu, 30 Sep 2021 11:38:41 +0000 (14:38 +0300)
committerDavid Ahern <dsahern@kernel.org>
Mon, 4 Oct 2021 00:24:41 +0000 (18:24 -0600)
commit60a97030328805101c469f05cad12c0b5b2b6a82
tree830c84c482607cc10727895cb532463778ae56b5
parent53d7c43bd385b2120b0dcb1d58b6384d10decf5b
ip: nexthop: add cache helpers

Add a static nexthop cache in a hash with 1024 buckets and helpers to
manage it (link, unlink, find, add nexthop, del nexthop). Adding new
nexthops is done by creating a new rtnl handle and using it to retrieve
the nexthop so the helper is safe to use while already reading a
response (i.e. using the global rth).

Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ipnexthop.c
ip/nh_common.h