]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit778efa70deb3a3494b71d1e53259675ebf3253a9
tree1070fa41491f754cd3e28ac996b97efa77b51106
parentc290beeb5382836888560475a6d97561b6ba886e
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