OSDN Git Service

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)
commitd672aec45fd4a1e060109fbce6739ef91c3bd135
tree0273856bd5b66a55f336a8f23b10180b62fa3516
parenta875a2ee2db8970dd93b8d287e35b8eba72f0a89
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