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)
commit1a1984490f5c123ee62394bc435a2c09db15cc18
tree39924730f4708f6508e427060f1b0baefc360ab5
parentdd6cb0f9fdb31c4bf89e482031cd098bf5f706d4
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