mlxsw: spectrum_router: Move multipath hash configuration to a bitmap
authorIdo Schimmel <idosch@nvidia.com>
Wed, 19 May 2021 12:08:20 +0000 (15:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 May 2021 19:47:47 +0000 (12:47 -0700)
commit9d23d3eb6f4134f19947e6319b79ce1e440aba98
tree3f5aa52cfe9d855f80994f0667fa2b2e4bf75d00
parent7725c1c8f73260de2ef0d01ca23b64260fc66ffd
mlxsw: spectrum_router: Move multipath hash configuration to a bitmap

Currently, the multipath hash configuration is written directly to the
register payload. While this is OK for the two currently supported
policies, it is going to be hard to follow when more policies and more
packet fields are added.

Instead, set the required headers and fields in a bitmap and then dump
it to the register payload.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c