From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
Sagi Grimberg
<sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
Anna Schumaker
<Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>,
santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org,
Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH rdma-next 1/6] IB/core: Save the device attributes on the device structure
Date: Fri, 18 Dec 2015 10:08:41 +0200 [thread overview]
Message-ID: <5673BF09.7050200@mellanox.com> (raw)
In-Reply-To: <20151217174138.GB26015-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On 12/17/2015 7:41 PM, Jason Gunthorpe wrote:
> On Thu, Dec 17, 2015 at 03:44:19PM +0200, Sagi Grimberg wrote:
>>> + ret = ib_query_device(device, &device->attrs);
>>> + if (ret) {
>>> + printk(KERN_WARNING "Couldn't query the device attributes\n");
>>> + goto out;
>>> + }
>>> +
>> I thought we're all for removing the call altogether aren't we?
>>
>> I'd say just call device->query_device() instead.
> Christoph's patch even got rid of device->query_device(),
Wrong.
UDATA is a mechanism added by the founders of the RDMA stack to allow
for LL HW
driver pass data to LL HW user space library piggy backed on uverbs
commands.
For example, mlx4 uses that to path details of the HW clock which are
needed for libmlx4.
Christoph noted that and didn't remove the query_device entry from mlx4, he
also madethis somehow inelegant change to uverbs_cmd.c:
@@ -3624,26 +3607,29 @@ int ib_uverbs_ex_query_device(struct
ib_uverbs_file *file,
if (ucore->outlen < resp.response_length)
return -ENOSPC;
- memset(&attr, 0, sizeof(attr));
-
- err = ib_dev->query_device(ib_dev, &attr, uhw);
- if (err)
- return err;
+ if (ib_dev->query_device) {
+ int err = ib_dev->query_device(ib_dev, uhw);
+ if (err)
+ return err;
+ } else {
+ if (uhw->inlen || uhw->outlen)
+ return -EINVAL;
+ }
> which, IHMO, I prefer to see over this.
It would be wrong to disallow LL drivers to pass data back and forth to/from
their user space sister libraries, this is part of a 10Y old kernel UAPI.
> It re-enforces that these values are constants and drivers cannot change them on the fly.
yes, we should be looking on how to constify things, but incrementally.
I don't see why block this cleanup now as of this point.
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-12-18 8:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 13:18 [PATCH rdma-next 0/6] dev attr cleanup (less is more) Or Gerlitz
[not found] ` <1450358340-19361-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-17 13:18 ` [PATCH rdma-next 1/6] IB/core: Save the device attributes on the device structure Or Gerlitz
[not found] ` <1450358340-19361-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-17 13:44 ` Sagi Grimberg
[not found] ` <5672BC33.9050606-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-17 17:41 ` Jason Gunthorpe
[not found] ` <20151217174138.GB26015-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-12-17 18:31 ` Bart Van Assche
[not found] ` <5672FF78.40401-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-12-18 5:16 ` ira.weiny
[not found] ` <20151218051632.GE13023-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-18 9:01 ` Or Gerlitz
[not found] ` <CAJ3xEMiUnmybdSb9v_WWNxHXZ4NvKfHbK5j4Vum9_8ux1AUo6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-19 0:50 ` ira.weiny
2015-12-18 8:08 ` Or Gerlitz [this message]
[not found] ` <5673BF09.7050200-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-18 16:49 ` Jason Gunthorpe
[not found] ` <20151218164909.GA7354-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-12-20 17:05 ` Or Gerlitz
2015-12-17 13:18 ` [PATCH rdma-next 2/6] IB/core: Avoid calling ib_query_device when possible Or Gerlitz
2015-12-17 13:18 ` [PATCH rdma-next 3/6] IB/ulps: Avoid calling ib_query_device Or Gerlitz
2015-12-17 13:18 ` [PATCH rdma-next 4/6] net/rds: " Or Gerlitz
2015-12-17 13:18 ` [PATCH rdma-next 5/6] xprtrdma: " Or Gerlitz
2015-12-17 13:19 ` [PATCH rdma-next 6/6] staging/o2iblnd: " Or Gerlitz
[not found] ` <1450358340-19361-7-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-01-07 16:00 ` Håkon Bugge
2015-12-17 15:36 ` [PATCH rdma-next 0/6] dev attr cleanup (less is more) Christoph Hellwig
[not found] ` <20151217153651.GA28053-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-17 20:22 ` Or Gerlitz
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=5673BF09.7050200@mellanox.com \
--to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org \
--cc=bvanassche-HInyCGIudOg@public.gmane.org \
--cc=chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
/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