mlxsw: spectrum_buffers: Remove assumption about pool order
authorIdo Schimmel <idosch@mellanox.com>
Mon, 22 Apr 2019 12:08:50 +0000 (12:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Apr 2019 05:09:32 +0000 (22:09 -0700)
commit857f138f04a7bf7749c540293ea9b6091a491de7
treeff7f99281f33bca561c3ba4e604a05f3654fc71b
parentf1aaeacdae2bc5e8ef7343674b6cb34d516a8110
mlxsw: spectrum_buffers: Remove assumption about pool order

The code currently assumes that ingress pools have lower indices than
egress pools. This makes it impossible to add more ingress pools
without breaking user configuration that relies on a certain pool index
to correspond to an egress pool.

Remove such assumptions from the code, so that more ingress pools could
be added by subsequent patches.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c