netdevsim: Allow reporting activity on nexthop buckets
authorIdo Schimmel <idosch@nvidia.com>
Fri, 12 Mar 2021 16:50:20 +0000 (17:50 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Mar 2021 01:44:10 +0000 (17:44 -0800)
commitc6385c0b67c527b298111775bc89a7407ba1581e
tree838a91637e746367b5f96e4fb0ef5fbdb7fb3e9e
parentd8eaa4facacbb13425d4097bd066e28958a5716f
netdevsim: Allow reporting activity on nexthop buckets

A key component of the resilient hashing algorithm is the hash buckets'
activity. If a bucket is active, it will not be populated with a new
nexthop in order not to break existing flows. Therefore, in order to
easily and thoroughly test the algorithm, we need to be in full control
over the reported activity.

Add a debugfs interface that allows user space to have netdevsim report
a nexthop bucket within a resilient nexthop group as active. For
example:

 # echo 10 23 > /sys/kernel/debug/netdevsim/netdevsim10/fib/nexthop_bucket_activity

Will mark bucket 23 in nexthop group 10 as active.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/fib.c