The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Snehal Sanghvi <snsanghvi@linux.microsoft.com>
Cc: kotaranov@microsoft.com, snsanghvi@microsoft.com, jgg@ziepe.ca,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/mana_ib: support enhanced connection establishment
Date: Tue, 24 Nov 2026 14:45:19 +0200	[thread overview]
Message-ID: <20261124124519.GQ14811@unreal> (raw)
In-Reply-To: <20261120010851.616472-1-snsanghvi@linux.microsoft.com>

On Thu, Nov 19, 2026 at 05:08:51PM -0800, Snehal Sanghvi wrote:
> From: Snehal Sanghvi <snsanghvi@microsoft.com>
> 
> 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@microsoft.com>
> Signed-off-by: Snehal Sanghvi <snsanghvi@microsoft.com>
> ---
> 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

      reply	other threads:[~2026-11-24 12:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  1:08 [PATCH rdma-next] RDMA/mana_ib: support enhanced connection establishment Snehal Sanghvi
2026-11-24 12:45 ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124124519.GQ14811@unreal \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kotaranov@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=snsanghvi@linux.microsoft.com \
    --cc=snsanghvi@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox