Re: [PATCH rdma-next] RDMA/mana_ib: support enhanced connection establishment
From: Leon Romanovsky
Date: Tue Nov 24 2026 - 07:45:33 EST
On Thu, Nov 19, 2026 at 05:08:51PM -0800, Snehal Sanghvi wrote:
> From: Snehal Sanghvi <snsanghvi@xxxxxxxxxxxxx>
>
> Expose ECE when the firmware supports it. Return the firmware ECE offer
> for RC and UC QPs, and use the RNIC set-state V4 layout for every modify
> so that user ECE options reach the firmware and its current options are
> returned; 0 means no update, and option bits are interpreted by the
> firmware. Without firmware support, requests keep their legacy layout.
>
> Reviewed-by: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
> Signed-off-by: Snehal Sanghvi <snsanghvi@xxxxxxxxxxxxx>
> ---
> Matching rdma-core userspace implementation:
> https://github.com/linux-rdma/rdma-core/pull/1866
>
> drivers/infiniband/hw/mana/main.c | 12 +++++++--
> drivers/infiniband/hw/mana/mana_ib.h | 20 ++++++++++++---
> drivers/infiniband/hw/mana/qp.c | 38 ++++++++++++++++++++--------
> include/uapi/rdma/mana-abi.h | 15 +++++++++--
> 4 files changed, 67 insertions(+), 18 deletions(-)
<...>
>
> @@ -996,18 +996,33 @@ static int mana_ib_gd_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
> struct mana_ib_qp *qp = container_of(ibqp, struct mana_ib_qp, ibqp);
> struct mana_rnic_set_qp_state_resp resp = {};
> struct mana_rnic_set_qp_state_req req = {};
> + struct mana_ib_modify_qp_resp uresp = {};
> + struct mana_ib_modify_qp ucmd = {};
> struct gdma_context *gc = mdev_to_gc(mdev);
> struct mana_port_context *mpc;
> struct net_device *ndev;
> + bool ece = mana_ib_ece_supported(mdev);
> int err;
>
> - err = ib_no_udata_io(udata);
> - if (err)
> - return err;
> + if (udata && udata->inlen) {
> + err = ib_copy_validate_udata_in_cm(udata, ucmd, ece_options, 0);
> + if (err)
> + return err;
This is not the correct way to extend udata support, it breaks backward
compatibility. Before this change, users could provide udata with four zero
bytes of provider input and no provider output:
struct ib_uverbs_attr uhw_in = {
.attr_id = UVERBS_ATTR_UHW_IN,
.len = 4,
.data = 0,
};
Now, ib_copy_validate_udata_in_cm(..., ece_options, 0) requires eight bytes
and returns -EINVAL if fewer are provided.
Thanks