mlxsw: core: Parse TLVs' offsets of incoming EMADs
authorShalom Toledo <shalomt@mellanox.com>
Tue, 12 Nov 2019 06:48:24 +0000 (08:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Nov 2019 18:54:02 +0000 (10:54 -0800)
commit5aa4165c60aaade3aebe0c5278111781142a5636
tree1070fa41491f754cd3e28ac996b97efa77b51106
parentb2ef81dcdf3835bd55e5f97ff30131bb327be7fa
mlxsw: core: Parse TLVs' offsets of incoming EMADs

Until now the code assumes a fixed structure which makes it difficult to
support EMADs with and without new TLVs.

Make it more generic by parsing the TLVs when the EMADs are received and
store the offset to the different TLVs in the control block. Using these
offsets to extract information from the EMADs without relying on a specific
structure.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c