]> git.ipfire.org Git - thirdparty/linux.git/commit
RDMA/hns: Add bonding event handler
authorJunxian Huang <huangjunxian6@hisilicon.com>
Wed, 12 Nov 2025 09:35:05 +0000 (17:35 +0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 24 Nov 2025 07:58:29 +0000 (02:58 -0500)
commitd31d410b38e61f89b978d4e1364040537339f559
tree959de2b98b42bcd7dfb9c2d5cc943a38073c14ab
parentb37ad2e290fc52e575572b04803a4f93f584df6c
RDMA/hns: Add bonding event handler

Register netdev notifier for two bonding events NETDEV_CHANGEUPPER
and NETDEV_CHANGELOWERSTATE.

In NETDEV_CHANGEUPPER event handler, check some rules about the HW
constraints when trying to link a new slave to the masteri, and
store some bonding information from the notifier. In unlinking case,
simply check the number of the rest slaves to decide whether the
bond is still supported.

In NETDEV_CHANGELOWERSTATE event handler, not much is done. It
simply sets the bond state when the bond is ready, which will be
used later.

Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20251112093510.3696363-4-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_bond.c
drivers/infiniband/hw/hns/hns_roce_bond.h