net/mlx5e: Add bond_metadata and its slave entries
authorVu Pham <vuhuong@mellanox.com>
Fri, 28 Feb 2020 22:28:27 +0000 (14:28 -0800)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 28 May 2020 01:13:49 +0000 (18:13 -0700)
commitd97555e1452943264295cd3c1f066474bc3660dd
treee8b890fd016e6f0030f5837404b8170f3f655b82
parentd34eb2fcd00472323d9e26ee0aec498c2c6f5b6f
net/mlx5e: Add bond_metadata and its slave entries

Adding bond_metadata and its slave entries to represent a lag device
and its slaves VF representors. Bond_metadata structure includes a
unique metadata shared by slaves VF respresentors, and a list of slaves
representors slave entries.

On enslaving event, create a bond_metadata structure representing
the upper lag device of this slave representor if it has not been
created yet. Create and add entry for the slave representor to the
slaves list.

On unslaving event, free the slave entry of the slave representor.
On the last unslave event, free the bond_metadata structure and its
resources.

Introduce APIs to create and remove bond_metadata and its resources,
enslave and unslave VF representor slave entries.

Signed-off-by: Vu Pham <vuhuong@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.h