All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Gal Pressman <galpress@amazon.com>
Cc: <linux-rdma@vger.kernel.org>, Bob Pearson <rpearsonhpe@gmail.com>
Subject: Re: [PATCH 2/9] verbs: Add ibv_cmd_query_device_any()
Date: Wed, 18 Nov 2020 08:45:48 -0400	[thread overview]
Message-ID: <20201118124548.GY917484@nvidia.com> (raw)
In-Reply-To: <bdb30557-27fa-3ea4-39a9-4bdb136ff798@amazon.com>

On Wed, Nov 18, 2020 at 02:43:57PM +0200, Gal Pressman wrote:
> On 16/11/2020 22:23, Jason Gunthorpe wrote:

> > +int ibv_cmd_query_device_any(struct ibv_context *context,
> > +			     const struct ibv_query_device_ex_input *input,
> > +			     struct ibv_device_attr_ex *attr, size_t attr_size,
> > +			     struct ib_uverbs_ex_query_device_resp *resp,
> > +			     size_t *resp_size)
> > +{
> > +	struct ib_uverbs_ex_query_device_resp internal_resp;
> > +	size_t internal_resp_size;
> > +	int err;
> > +
> > +	if (input && input->comp_mask)
> > +		return EINVAL;
> > +	if (attr_size < sizeof(attr->orig_attr))
> > +		return EINVAL;
> > +
> > +	if (!resp) {
> > +		resp = &internal_resp;
> > +		internal_resp_size = sizeof(internal_resp);
> > +		resp_size = &internal_resp_size;
> > +	}
> > +	memset(attr, 0, attr_size);
> > +	memset(resp, 0, *resp_size);
> > +
> > +	if (attr_size > sizeof(attr->orig_attr)) {
> > +		struct ibv_query_device_ex cmd = {};
> > +
> > +		err = execute_cmd_write_ex(context,
> > +					   IB_USER_VERBS_EX_CMD_QUERY_DEVICE,
> > +					   &cmd, sizeof(cmd), resp, *resp_size);
> > +		if (err) {
> > +			if (err != EOPNOTSUPP)
> 
> Are you sure about that?
> I think older kernels return ENOSYS.

Oh, that is possibly true, we changed those at one point, I didn't
test that far back.

Jason

  reply	other threads:[~2020-11-18 12:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 20:23 [PATCH 0/9] Simplify query_device() in libibverbs Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 1/9] verbs: Simplify query_device_ex Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 2/9] verbs: Add ibv_cmd_query_device_any() Jason Gunthorpe
2020-11-18 12:43   ` Gal Pressman
2020-11-18 12:45     ` Jason Gunthorpe [this message]
2020-11-16 20:23 ` [PATCH 3/9] mlx5: Move context initialization out of mlx5_query_device_ex() Jason Gunthorpe
2020-11-17 17:24   ` Yishai Hadas
2020-11-17 19:08     ` Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 4/9] efa: Move the context intialization out of efa_query_device_ex() Jason Gunthorpe
2020-11-18  7:39   ` Gal Pressman
2020-11-18  8:07   ` Gal Pressman
2020-11-18 12:45   ` Gal Pressman
2020-11-18 20:59     ` Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 5/9] mlx4: Move the context intialization out of mlx4_query_device_ex() Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 6/9] providers: Remove normal query_device() from providers that have _ex Jason Gunthorpe
2020-11-18 12:47   ` Gal Pressman
2020-11-16 20:23 ` [PATCH 7/9] providers: Convert all providers to implement query_device_ex Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 8/9] verbs: Remove dead code Jason Gunthorpe
2020-11-18 12:46   ` Gal Pressman
2020-11-18 12:53     ` Jason Gunthorpe
2020-11-16 20:23 ` [PATCH 9/9] verbs: Delete query_device() internal support Jason Gunthorpe

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=20201118124548.GY917484@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=galpress@amazon.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearsonhpe@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.