diff options
| author | Ido Schimmel <idosch@mellanox.com> | 2016-11-28 18:01:24 +0100 | 
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-11-29 20:48:51 -0500 | 
| commit | 87259f18778cce3fe3b141c5f56a3e64e5ffa5a9 (patch) | |
| tree | 18085939866be74ed128acd7ba8682ef01267385 /lib/string_helpers.c | |
| parent | f414b48e92d2b91654e31b96c9cf387eed1ed54f (diff) | |
mlxsw: spectrum_buffers: Limit size of pools
The shared buffer pools are containers whose size is used to calculate
the maximum usage for packets from / to a specific port / {port, PG/TC},
when dynamic threshold is employed.
While it's perfectly fine for the sum of the pools to exceed the maximum
size of the shared buffer, a single pool cannot.
Add a check when the pool size is set and forbid sizes larger than the
maximum size of the shared buffer.
Without the patch:
$ devlink sb pool set pci/0000:03:00.0 pool 0 size 999999999 thtype
dynamic
// No error is returned
With the patch:
$ devlink sb pool set pci/0000:03:00.0 pool 0 size 999999999 thtype
dynamic
devlink answers: Invalid argument
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>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions
