* [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI
@ 2017-02-07 17:46 Leon Romanovsky
[not found] ` <20170207174600.27218-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2017-02-07 17:46 UTC (permalink / raw)
To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Matan Barak
Remove references to private kernel header and defines from exported
ib_user_verb.h file.
The code snippet below is used to reproduce the issue:
#include <stdio.h>
#include <rdma/ib_user_verb.h>
int main(void)
{
printf("IB_USER_VERBS_ABI_VERSION = %d\n", IB_USER_VERBS_ABI_VERSION);
return 0;
}
It fails during compilation phase with an error:
➜ /tmp gcc main.c
main.c:2:31: fatal error: rdma/ib_user_verb.h: No such file or directory
#include <rdma/ib_user_verb.h>
^
compilation terminated.
Fixes: 189aba99e700 ("IB/uverbs: Extend modify_qp and support packet pacing")
CC: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
CC: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reported-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
include/uapi/rdma/ib_user_verbs.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index dfdfe4e92d31..c56f525b041d 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -37,7 +37,6 @@
#define IB_USER_VERBS_H
#include <linux/types.h>
-#include <rdma/ib_verbs.h>
/*
* Increment this value if any changes that break userspace ABI
@@ -548,11 +547,11 @@ enum {
};
enum {
- IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN
+ IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
};
enum {
- IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT
+ IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
};
struct ib_uverbs_ex_create_qp {
--
2.11.1
--
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
^ permalink raw reply related [flat|nested] 7+ messages in thread[parent not found: <20170207174600.27218-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>]
* Re: [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI [not found] ` <20170207174600.27218-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> @ 2017-02-08 8:26 ` Sl Sh 2017-02-08 8:28 ` Christoph Hellwig 1 sibling, 0 replies; 7+ messages in thread From: Sl Sh @ 2017-02-08 8:26 UTC (permalink / raw) To: Leon Romanovsky Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Matan Barak Works for me. Tested-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> On Tue, Feb 7, 2017 at 7:46 PM, Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote: > Remove references to private kernel header and defines from exported > ib_user_verb.h file. > > The code snippet below is used to reproduce the issue: > > #include <stdio.h> > #include <rdma/ib_user_verb.h> > > int main(void) > { > printf("IB_USER_VERBS_ABI_VERSION = %d\n", IB_USER_VERBS_ABI_VERSION); > return 0; > } > > It fails during compilation phase with an error: > ➜ /tmp gcc main.c > main.c:2:31: fatal error: rdma/ib_user_verb.h: No such file or directory > #include <rdma/ib_user_verb.h> > ^ > compilation terminated. > > Fixes: 189aba99e700 ("IB/uverbs: Extend modify_qp and support packet pacing") > CC: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > CC: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > Reported-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> > --- > include/uapi/rdma/ib_user_verbs.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h > index dfdfe4e92d31..c56f525b041d 100644 > --- a/include/uapi/rdma/ib_user_verbs.h > +++ b/include/uapi/rdma/ib_user_verbs.h > @@ -37,7 +37,6 @@ > #define IB_USER_VERBS_H > > #include <linux/types.h> > -#include <rdma/ib_verbs.h> > > /* > * Increment this value if any changes that break userspace ABI > @@ -548,11 +547,11 @@ enum { > }; > > enum { > - IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN > + IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20, > }; > > enum { > - IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT > + IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25, > }; > > struct ib_uverbs_ex_create_qp { > -- > 2.11.1 > > -- > 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 -- Thank you in advance, Slava Shwartsman -- 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI [not found] ` <20170207174600.27218-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> 2017-02-08 8:26 ` Sl Sh @ 2017-02-08 8:28 ` Christoph Hellwig [not found] ` <20170208082850.GA11087-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> 1 sibling, 1 reply; 7+ messages in thread From: Christoph Hellwig @ 2017-02-08 8:28 UTC (permalink / raw) To: Leon Romanovsky Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Matan Barak > #include <linux/types.h> > -#include <rdma/ib_verbs.h> > > /* > * Increment this value if any changes that break userspace ABI > @@ -548,11 +547,11 @@ enum { > }; > > enum { > - IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN > + IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20, > }; > > enum { > - IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT > + IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25, I disagree with the upendcoding. These constant should be moved to the user verbs header instead. -- 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20170208082850.GA11087-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>]
* Re: [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI [not found] ` <20170208082850.GA11087-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> @ 2017-02-08 10:00 ` Leon Romanovsky [not found] ` <20170208100043.GC6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Leon Romanovsky @ 2017-02-08 10:00 UTC (permalink / raw) To: Christoph Hellwig Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Matan Barak [-- Attachment #1: Type: text/plain, Size: 838 bytes --] On Wed, Feb 08, 2017 at 12:28:50AM -0800, Christoph Hellwig wrote: > > #include <linux/types.h> > > -#include <rdma/ib_verbs.h> > > > > /* > > * Increment this value if any changes that break userspace ABI > > @@ -548,11 +547,11 @@ enum { > > }; > > > > enum { > > - IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN > > + IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20, > > }; > > > > enum { > > - IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT > > + IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25, > > I disagree with the upendcoding. These constant should be moved to > the user verbs header instead. These constants are part of much larger enum ib_qp_attr_mask. IMHO copy two values from that enum isn't good, but copy whole enum (mostly not needed for the users) is bad either. So I decided to open code it as a fix for -rc7. Thanks [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20170208100043.GC6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI [not found] ` <20170208100043.GC6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-02-08 11:53 ` Christoph Hellwig [not found] ` <20170208115349.GA18879-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> 2017-02-08 12:33 ` Matan Barak 1 sibling, 1 reply; 7+ messages in thread From: Christoph Hellwig @ 2017-02-08 11:53 UTC (permalink / raw) To: Leon Romanovsky Cc: Christoph Hellwig, Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Matan Barak On Wed, Feb 08, 2017 at 12:00:43PM +0200, Leon Romanovsky wrote: > These constants are part of much larger enum ib_qp_attr_mask. IMHO copy > two values from that enum isn't good, but copy whole enum (mostly not > needed for the users) is bad either. So I decided to open code it as a fix > for -rc7. At least add comments mentioning the proper symbolic values then. -- 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20170208115349.GA18879-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>]
* Re: [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI [not found] ` <20170208115349.GA18879-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> @ 2017-02-08 14:52 ` Leon Romanovsky 0 siblings, 0 replies; 7+ messages in thread From: Leon Romanovsky @ 2017-02-08 14:52 UTC (permalink / raw) To: Christoph Hellwig Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Matan Barak [-- Attachment #1: Type: text/plain, Size: 483 bytes --] On Wed, Feb 08, 2017 at 03:53:49AM -0800, Christoph Hellwig wrote: > On Wed, Feb 08, 2017 at 12:00:43PM +0200, Leon Romanovsky wrote: > > These constants are part of much larger enum ib_qp_attr_mask. IMHO copy > > two values from that enum isn't good, but copy whole enum (mostly not > > needed for the users) is bad either. So I decided to open code it as a fix > > for -rc7. > > At least add comments mentioning the proper symbolic values then. Sure, I'll send an update. Thanks [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI [not found] ` <20170208100043.GC6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 2017-02-08 11:53 ` Christoph Hellwig @ 2017-02-08 12:33 ` Matan Barak 1 sibling, 0 replies; 7+ messages in thread From: Matan Barak @ 2017-02-08 12:33 UTC (permalink / raw) To: Leon Romanovsky, Christoph Hellwig Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang On 08/02/2017 12:00, Leon Romanovsky wrote: > On Wed, Feb 08, 2017 at 12:28:50AM -0800, Christoph Hellwig wrote: >>> #include <linux/types.h> >>> -#include <rdma/ib_verbs.h> >>> >>> /* >>> * Increment this value if any changes that break userspace ABI >>> @@ -548,11 +547,11 @@ enum { >>> }; >>> >>> enum { >>> - IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN >>> + IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20, >>> }; >>> >>> enum { >>> - IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT >>> + IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25, >> >> I disagree with the upendcoding. These constant should be moved to >> the user verbs header instead. > > These constants are part of much larger enum ib_qp_attr_mask. IMHO copy > two values from that enum isn't good, but copy whole enum (mostly not > needed for the users) is bad either. So I decided to open code it as a fix > for -rc7. > > Thanks > IMHO, since these enum values are actually passed between user-space to kernel (attr_mask), it's acceptable to expose all enum values. Otherwise, the user-space should define all these symbols by by itself, so why bother introduce only this explicit symbol? -- 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-02-08 14:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07 17:46 [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI Leon Romanovsky
[not found] ` <20170207174600.27218-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-02-08 8:26 ` Sl Sh
2017-02-08 8:28 ` Christoph Hellwig
[not found] ` <20170208082850.GA11087-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-02-08 10:00 ` Leon Romanovsky
[not found] ` <20170208100043.GC6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-02-08 11:53 ` Christoph Hellwig
[not found] ` <20170208115349.GA18879-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-02-08 14:52 ` Leon Romanovsky
2017-02-08 12:33 ` Matan Barak
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox