All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-rc v1] RDMA: Remove kernel private defines and reference to header from UAPI
@ 2017-02-08 15:04 Leon Romanovsky
       [not found] ` <20170208150409.29537-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2017-02-08 15:04 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Matan Barak,
	Christoph Hellwig

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>
CC: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Tested-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
Changelog v0 -> v1
 * Document the origin of hard-coded values.
---
 include/uapi/rdma/ib_user_verbs.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index dfdfe4e92d31..f4f87cff6dc6 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,17 @@ enum {
 };

 enum {
-	IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN
+	/*
+	 * This value is equal to IB_QP_DEST_QPN.
+	 */
+	IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
 };

 enum {
-	IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT
+	/*
+	 * This value is equal to 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] 4+ messages in thread

* Re: [PATCH rdma-rc v1] RDMA: Remove kernel private defines and reference to header from UAPI
       [not found] ` <20170208150409.29537-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2017-02-08 15:15   ` Matan Barak (External)
       [not found]     ` <8c2f6c58-f622-95cf-e146-ed7a5747fd9a-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Matan Barak (External) @ 2017-02-08 15:15 UTC (permalink / raw)
  To: Leon Romanovsky, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Christoph Hellwig

On 08/02/2017 17:04, Leon Romanovsky 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>
> CC: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
> Tested-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> Changelog v0 -> v1
>  * Document the origin of hard-coded values.
> ---
>  include/uapi/rdma/ib_user_verbs.h | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
> index dfdfe4e92d31..f4f87cff6dc6 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,17 @@ enum {
>  };
>
>  enum {
> -	IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN
> +	/*
> +	 * This value is equal to IB_QP_DEST_QPN.
> +	 */
> +	IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
>  };
>
>  enum {
> -	IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT
> +	/*
> +	 * This value is equal to IB_QP_RATE_LIMIT.
> +	 */
> +	IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
>  };
>
>  struct ib_uverbs_ex_create_qp {
> --
> 2.11.1
>

I tried to write this earlier, but for some reason my mailer didn't 
really send it.
IMHO, since these enum values are actually passed between user-space and 
kernel (attr_mask), it's acceptable to expose all enum values.
Otherwise, user-space should define all these symbols by by itself (as 
done today), 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] 4+ messages in thread

* Re: [PATCH rdma-rc v1] RDMA: Remove kernel private defines and reference to header from UAPI
       [not found]     ` <8c2f6c58-f622-95cf-e146-ed7a5747fd9a-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2017-02-08 17:25       ` Leon Romanovsky
       [not found]         ` <20170208172544.GF6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2017-02-08 17:25 UTC (permalink / raw)
  To: Matan Barak (External)
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang,
	Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 3094 bytes --]

On Wed, Feb 08, 2017 at 05:15:49PM +0200, Matan Barak (External) wrote:
> On 08/02/2017 17:04, Leon Romanovsky 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>
> > CC: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
> > Tested-by: Slava Shwartsman <slavash-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > ---
> > Changelog v0 -> v1
> >  * Document the origin of hard-coded values.
> > ---
> >  include/uapi/rdma/ib_user_verbs.h | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
> > index dfdfe4e92d31..f4f87cff6dc6 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,17 @@ enum {
> >  };
> >
> >  enum {
> > -	IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN
> > +	/*
> > +	 * This value is equal to IB_QP_DEST_QPN.
> > +	 */
> > +	IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
> >  };
> >
> >  enum {
> > -	IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT
> > +	/*
> > +	 * This value is equal to IB_QP_RATE_LIMIT.
> > +	 */
> > +	IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
> >  };
> >
> >  struct ib_uverbs_ex_create_qp {
> > --
> > 2.11.1
> >
>
> I tried to write this earlier, but for some reason my mailer didn't really
> send it.
> IMHO, since these enum values are actually passed between user-space and
> kernel (attr_mask), it's acceptable to expose all enum values.
> Otherwise, user-space should define all these symbols by by itself (as done
> today), so why bother introduce only this explicit symbol?

Mainly because it is -rc7 fix and it is MUST be applied as soon
as possible, currently IB stack is broken.

> --
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH rdma-rc v1] RDMA: Remove kernel private defines and reference to header from UAPI
       [not found]         ` <20170208172544.GF6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
@ 2017-02-08 17:42           ` Doug Ledford
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2017-02-08 17:42 UTC (permalink / raw)
  To: Leon Romanovsky, Matan Barak (External)
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bodong Wang, Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

On Wed, 2017-02-08 at 19:25 +0200, Leon Romanovsky wrote:
> > I tried to write this earlier, but for some reason my mailer didn't
> really
> > send it.
> > IMHO, since these enum values are actually passed between user-
> space and
> > kernel (attr_mask), it's acceptable to expose all enum values.
> > Otherwise, user-space should define all these symbols by by itself
> (as done
> > today), so why bother introduce only this explicit symbol?
> 
> Mainly because it is -rc7 fix and it is MUST be applied as soon
> as possible, currently IB stack is broken.

Indeed, which is why I took the V1 of the patch.  We can fix it up
nicer in -next if people prefer.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-08 17:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 15:04 [PATCH rdma-rc v1] RDMA: Remove kernel private defines and reference to header from UAPI Leon Romanovsky
     [not found] ` <20170208150409.29537-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-02-08 15:15   ` Matan Barak (External)
     [not found]     ` <8c2f6c58-f622-95cf-e146-ed7a5747fd9a-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-02-08 17:25       ` Leon Romanovsky
     [not found]         ` <20170208172544.GF6005-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-02-08 17:42           ` Doug Ledford

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.