|
|
Log in / Subscribe / Register

RDMA/hns: Support RoCE bonding

From:  Junxian Huang <huangjunxian6-AT-hisilicon.com>
To:  <jgg-AT-ziepe.ca>, <leon-AT-kernel.org>
Subject:  [PATCH v2 for-next 0/8] RDMA/hns: Support RoCE bonding
Date:  Thu, 16 Oct 2025 21:20:15 +0800
Message-ID:  <20251016132023.3043538-1-huangjunxian6@hisilicon.com>
Cc:  <linux-rdma-AT-vger.kernel.org>, <linuxarm-AT-huawei.com>, <huangjunxian6-AT-hisilicon.com>, <tangchengchang-AT-huawei.com>
Archive-link:  Article

This series adds support for RoCE bonding. The bond mode is active
when multiple PF netdevs are enslaved to a bond master while all
following rules are met:
  * All the slaves are on the same card, i.e., they share the same
    bus number.
  * The bond mode are set to mode 1 (active-backup), 2 (XOR) or
    4 (802.3ad).
  * None of the slaves have generated a VF.

In bond mode, a bond ibdev "hns_bond_*" is registered instead of the
regular PF ibdev "hns_*". For RoCE traffic, HW chooses the same active
port as netdev bonding in mode 1, while in mode 2/4, the port selection
is determined by the hash algorithm.

v1 -> v2:
https://lore.kernel.org/linux-rdma/20250913090615.212720-...
* Hold the refcount when returning from hns_roce_get_hrdev_by_netdev()
  and get_upper_dev_from_ndev().
* Remove check_vf_support() as we've moved the check into FW now.

Junxian Huang (8):
  RDMA/hns: Add helpers to obtain netdev and bus_num from hr_dev
  RDMA/hns: Initialize bonding resources
  RDMA/hns: Add bonding event handler
  RDMA/hns: Add bonding cmds
  RDMA/hns: Implement bonding init/uninit process
  RDMA/hns: Add delayed work for bonding
  RDMA/hns: Support link state reporting for bond
  RDMA/hns: Support reset recovery for bond

 drivers/infiniband/hw/hns/Makefile          |    4 +-
 drivers/infiniband/hw/hns/hns_roce_ah.c     |    1 -
 drivers/infiniband/hw/hns/hns_roce_bond.c   | 1012 +++++++++++++++++++
 drivers/infiniband/hw/hns/hns_roce_bond.h   |   95 ++
 drivers/infiniband/hw/hns/hns_roce_device.h |   16 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c  |  143 ++-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.h  |   20 +
 drivers/infiniband/hw/hns/hns_roce_main.c   |  176 +++-
 drivers/infiniband/hw/hns/hns_roce_pd.c     |    1 -
 drivers/infiniband/hw/hns/hns_roce_qp.c     |    5 +-
 drivers/infiniband/hw/hns/hns_roce_srq.c    |    1 -
 11 files changed, 1422 insertions(+), 52 deletions(-)
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_bond.c
 create mode 100644 drivers/infiniband/hw/hns/hns_roce_bond.h

--
2.33.0




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds