linux/drivers/infiniband/hw
Chiara Meiohas 8d159eb211 RDMA/mlx5: Use IB set_netdev and get_netdev functions
The IB layer provides a common interface to store and get net
devices associated to an IB device port (ib_device_set_netdev()
and ib_device_get_netdev()).
Previously, mlx5_ib stored and managed the associated net devices
internally.

Replace internal net device management in mlx5_ib with
ib_device_set_netdev() when attaching/detaching  a net device and
ib_device_get_netdev() when retrieving the net device.

Export ib_device_get_netdev().

For mlx5 representors/PFs/VFs and lag creation we replace the netdev
assignments with the IB set/get netdev functions.

In active-backup mode lag the active slave net device is stored in the
lag itself. To assure the net device stored in a lag bond IB device is
the active slave we implement the following:
- mlx5_core: when modifying the slave of a bond we send the internal driver event
  MLX5_DRIVER_EVENT_ACTIVE_BACKUP_LAG_CHANGE_LOWERSTATE.
- mlx5_ib: when catching the event call ib_device_set_netdev()

This patch also ensures the correct IB events are sent in switchdev lag.

While at it, when in multiport eswitch mode, only a single IB device is
created for all ports. The said IB device will receive all netdev events
of its VFs once loaded, thus to avoid overwriting the mapping of PF IB
device to PF netdev, ignore NETDEV_REGISTER events if the ib device has
already been mapped to a netdev.

Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com>
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Link: https://patch.msgid.link/20240909173025.30422-6-michaelgur@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2024-09-13 08:27:40 +03:00
..
bnxt_re RDMA/bnxt_re: Fix the max WQE size for static WQE support 2024-09-09 21:17:09 +03:00
cxgb4 RDMA/cxgb4: Remove unused declarations 2024-08-28 15:24:35 +03:00
efa RDMA/efa: Add support for node guid 2024-08-23 11:52:45 -03:00
erdma RDMA/erdma: Return QP state in erdma_query_qp 2024-09-09 21:17:09 +03:00
hfi1 IB/hfi1: Constify struct flag_table 2024-07-15 10:24:21 -03:00
hns RDMA/hns: Fix restricted __le16 degrades to integer issue 2024-09-10 16:42:53 +03:00
irdma RDMA: Pass uverbs_attr_bundle as part of '.reg_user_mr_dmabuf' API 2024-08-11 11:12:50 +03:00
mana RDMA/mana_ib: use the correct page size for mapping user-mode doorbell page 2024-09-02 10:32:08 +03:00
mlx4 RDMA/mlx4: Simplify an alloc_ordered_workqueue() invocation 2024-08-23 11:37:49 -03:00
mlx5 RDMA/mlx5: Use IB set_netdev and get_netdev functions 2024-09-13 08:27:40 +03:00
mthca RDMA: Pass entire uverbs attr bundle to create cq function 2024-06-27 16:28:21 -03:00
ocrdma RDMA/ocrdma: Don't inline statistics functions 2024-07-11 13:25:11 +03:00
qedr RDMA: Pass entire uverbs attr bundle to create cq function 2024-06-27 16:28:21 -03:00
qib IB/qib: Remove unused declarations in header file 2024-09-10 16:41:03 +03:00
usnic IOMMU Updates for Linux v6.11 2024-07-19 09:59:58 -07:00
vmw_pvrdma RDMA: Pass entire uverbs attr bundle to create cq function 2024-06-27 16:28:21 -03:00
Makefile RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter 2022-11-11 11:40:09 +02:00