linux/drivers/net/netdevsim
Amit Cohen 9e635a21ca netdevsim: fib: Convert the current occupancy to an atomic variable
When route is added/deleted, the appropriate counter is increased/decreased
to maintain number of routes.

User can limit the number of routes and then according to the appropriate
counter, adding more routes than the limitation is forbidden.

Currently, there is one lock which protects hashtable, list and accounting.

Handling the counters will be performed from both atomic context and
non-atomic context, while the hashtable and the list will be used only from
non-atomic context and therefore will be protected by a separate lock.

Protect accounting by using an atomic variable, so lock is not needed.

v2:
* Use atomic64_sub() in nsim_nexthop_account()'s error path

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-02-02 17:45:58 -08:00
..
bpf.c netdevsim: Add debugfs toggle to reject BPF programs in verifier 2020-12-09 16:27:42 +01:00
bus.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dev.c devlink: move flash end and begin to core devlink 2020-11-19 21:41:02 -08:00
ethtool.c netdevsim: support ethtool ring and coalesce settings 2020-11-20 12:51:54 -08:00
fib.c netdevsim: fib: Convert the current occupancy to an atomic variable 2021-02-02 17:45:58 -08:00
health.c netdevsim: set .owner to THIS_MODULE 2020-11-17 14:08:59 -08:00
ipsec.c net: netdevsim: Use scnprintf() for avoiding potential buffer overflow 2020-03-15 17:06:22 -07:00
Makefile netdevsim: add pause frame stats 2020-09-15 13:26:28 -07:00
netdev.c net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
netdevsim.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
udp_tunnels.c netdevsim: set .owner to THIS_MODULE 2020-11-17 14:08:59 -08:00