]> git.ipfire.org Git - thirdparty/iproute2.git/commit
nexthop: Add support for nexthop buckets
authorIdo Schimmel <idosch@nvidia.com>
Wed, 17 Mar 2021 12:54:35 +0000 (13:54 +0100)
committerDavid Ahern <dsahern@kernel.org>
Fri, 19 Mar 2021 15:01:25 +0000 (15:01 +0000)
commit2be6d18b309b7d2a41336f4fd1c201f20b3a50e4
treeb217c64917076cb00b95901a6d710e4d069abbf7
parent91676718228b087b2742cd733cde43c5614b4c24
nexthop: Add support for nexthop buckets

Add ability to dump multiple nexthop buckets and get a specific one.
Example:

 # ip nexthop add id 10 group 1/2 type resilient buckets 8
 # ip nexthop
 id 1 via 192.0.2.2 dev dummy10 scope link
 id 2 via 192.0.2.19 dev dummy20 scope link
 id 10 group 1/2 type resilient buckets 8 idle_timer 120 unbalanced_timer 0 unbalanced_time 0
 # ip nexthop bucket
 id 10 index 0 idle_time 28.1 nhid 2
 id 10 index 1 idle_time 28.1 nhid 2
 id 10 index 2 idle_time 28.1 nhid 2
 id 10 index 3 idle_time 28.1 nhid 2
 id 10 index 4 idle_time 28.1 nhid 1
 id 10 index 5 idle_time 28.1 nhid 1
 id 10 index 6 idle_time 28.1 nhid 1
 id 10 index 7 idle_time 28.1 nhid 1
 # ip nexthop bucket show nhid 1
 id 10 index 4 idle_time 53.59 nhid 1
 id 10 index 5 idle_time 53.59 nhid 1
 id 10 index 6 idle_time 53.59 nhid 1
 id 10 index 7 idle_time 53.59 nhid 1
 # ip nexthop bucket get id 10 index 5
 id 10 index 5 idle_time 81 nhid 1
 # ip -j -p nexthop bucket get id 10 index 5
 [ {
         "id": 10,
         "bucket": {
             "index": 5,
             "idle_time": 104.89,
             "nhid": 1
         },
         "flags": [ ]
     } ]

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
include/libnetlink.h
ip/ip_common.h
ip/ipmonitor.c
ip/ipnexthop.c
lib/libnetlink.c
man/man8/ip-nexthop.8