]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Add ability to query KVDL allocation size
authorIdo Schimmel <idosch@mellanox.com>
Sun, 22 Oct 2017 21:11:45 +0000 (23:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Oct 2017 04:23:06 +0000 (05:23 +0100)
commit96ea35d5efb23b2b7da6634cf401b6d61ac3d5bf
tree0273856bd5b66a55f336a8f23b10180b62fa3516
parent8c70e7c501f1ef5eea51d6dbaddf980a5e19a672
mlxsw: spectrum: Add ability to query KVDL allocation size

The current KVDL allocation API allows the user to specify the requested
number of entries, but the user has no way of knowing how many entries
were actually allocated.

This works because existing users (e.g., router) request the exact
number they end up using. With the introduction of large adjacency
groups, this will change, as the router will have the ability to choose
from several allocation sizes, where larger allocations provide higher
accuracy with respect to requested weights and better resilience against
nexthop failures.

One option is to have the router try several allocations of descending
size until one succeeds, but a better way is to simply allow it to query
the actual allocation size and then size its request accordingly.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c