]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Add bytes to cells helper
authorIdo Schimmel <idosch@mellanox.com>
Wed, 6 Apr 2016 15:10:02 +0000 (17:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Apr 2016 21:24:16 +0000 (17:24 -0400)
commit3010aa5012e8de14a82a6facd3ff7bd5606b4cb3
tree39924730f4708f6508e427060f1b0baefc360ab5
parent1010dd254b1dddcc7b3b5cadc9cd614c043adf21
mlxsw: spectrum: Add bytes to cells helper

Buffers in the switch store packets in units called buffer cells. Add a
helper to convert from bytes to cells, so that the actual number of
cells required (result is round up) is returned.

Also, drop the SB (shared buffer) acronym from the BYTES_PER_CELL macro,
as this unit is also used in the ports' buffers and not only the
switch's shared buffer.

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_buffers.c