diff mbox

[v1,rdma-next,2/2] RDMA/CMA: Add rdma_port_space to UAPI

Message ID 20180327180929.8D1572BB7D@smtp.opengridcomputing.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Steve Wise March 27, 2018, 3:38 p.m. UTC
Since the rdma_port_space enum is being passed between
user and kernel for user cm_id setup, we need it in a
UAPI header.  So add it to rdma_user_cm.h.

This also fixes the cm_id restrack changes which pass up the port space
value via the RDMA_NLDEV_ATTR_RES_PS attribute.

Fixes: 00313983cda6 ("RDMA/nldev: provide detailed CM_ID information")

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 include/rdma/rdma_cm.h           | 8 +-------
 include/uapi/rdma/rdma_user_cm.h | 7 +++++++
 2 files changed, 8 insertions(+), 7 deletions(-)

Comments

Steve Wise March 28, 2018, 3:40 p.m. UTC | #1
Doug/Jason,

Seems like I got the authdates screwed up again.  These show up in
reverse order in patchwork.  Would you like a respin? 

These two will enable me to finalize the associated rdma tool submission.

Thanks,

Steve.


On 3/27/2018 10:38 AM, Steve Wise wrote:
> Since the rdma_port_space enum is being passed between
> user and kernel for user cm_id setup, we need it in a
> UAPI header.  So add it to rdma_user_cm.h.
>
> This also fixes the cm_id restrack changes which pass up the port space
> value via the RDMA_NLDEV_ATTR_RES_PS attribute.
>
> Fixes: 00313983cda6 ("RDMA/nldev: provide detailed CM_ID information")
>
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  include/rdma/rdma_cm.h           | 8 +-------
>  include/uapi/rdma/rdma_user_cm.h | 7 +++++++
>  2 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
> index 7652efc..86652a0 100644
> --- a/include/rdma/rdma_cm.h
> +++ b/include/rdma/rdma_cm.h
> @@ -38,6 +38,7 @@
>  #include <linux/in6.h>
>  #include <rdma/ib_addr.h>
>  #include <rdma/ib_sa.h>
> +#include <uapi/rdma/rdma_user_cm.h>
>  
>  /*
>   * Upon receiving a device removal event, users must destroy the associated
> @@ -64,13 +65,6 @@ enum rdma_cm_event_type {
>  
>  const char *__attribute_const__ rdma_event_msg(enum rdma_cm_event_type event);
>  
> -enum rdma_port_space {
> -	RDMA_PS_IPOIB = 0x0002,
> -	RDMA_PS_IB    = 0x013F,
> -	RDMA_PS_TCP   = 0x0106,
> -	RDMA_PS_UDP   = 0x0111,
> -};
> -
>  #define RDMA_IB_IP_PS_MASK   0xFFFFFFFFFFFF0000ULL
>  #define RDMA_IB_IP_PS_TCP    0x0000000001060000ULL
>  #define RDMA_IB_IP_PS_UDP    0x0000000001110000ULL
> diff --git a/include/uapi/rdma/rdma_user_cm.h b/include/uapi/rdma/rdma_user_cm.h
> index c83ef00..851652d 100644
> --- a/include/uapi/rdma/rdma_user_cm.h
> +++ b/include/uapi/rdma/rdma_user_cm.h
> @@ -70,6 +70,13 @@ enum {
>  	RDMA_USER_CM_CMD_JOIN_MCAST
>  };
>  
> +enum rdma_port_space {
> +	RDMA_PS_IPOIB = 0x0002,
> +	RDMA_PS_IB    = 0x013F,
> +	RDMA_PS_TCP   = 0x0106,
> +	RDMA_PS_UDP   = 0x0111,
> +};
> +
>  /*
>   * command ABI structures.
>   */

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe March 28, 2018, 4:44 p.m. UTC | #2
On Wed, Mar 28, 2018 at 10:40:56AM -0500, Steve Wise wrote:
> Doug/Jason,
> 
> Seems like I got the authdates screwed up again.  These show up in
> reverse order in patchwork.  Would you like a respin? 

I can manage..

> These two will enable me to finalize the associated rdma tool submission.

I can't find a user API user of this though? Is netlink introducing
the first user? I'm confused. I thought umca used this
someplace. Maybe I just can't find it today.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise March 28, 2018, 4:57 p.m. UTC | #3
On 3/28/2018 11:44 AM, Jason Gunthorpe wrote:
> On Wed, Mar 28, 2018 at 10:40:56AM -0500, Steve Wise wrote:
>> Doug/Jason,
>>
>> Seems like I got the authdates screwed up again.  These show up in
>> reverse order in patchwork.  Would you like a respin? 
> I can manage..
>
>> These two will enable me to finalize the associated rdma tool submission.
> I can't find a user API user of this though? Is netlink introducing
> the first user? I'm confused. I thought umca used this
> someplace. Maybe I just can't find it today.

Hrm... you're right. I don't see any code using rdma_ucm_create_id.   I
do see ucma_abi_create_id from rdma_cma_abi.h used in
librdmacm:rdma_create_id2() called by rdma_create_id() .  And
ucma_abi_create_id has a ps field.  So perhaps the correct header file
is rdma_cma_abi.h?  But I don't see that file in the kernel at all. 

/me confused. 







> Jason


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise March 28, 2018, 5:58 p.m. UTC | #4
On 3/28/2018 11:57 AM, Steve Wise wrote:
>
> On 3/28/2018 11:44 AM, Jason Gunthorpe wrote:
>> On Wed, Mar 28, 2018 at 10:40:56AM -0500, Steve Wise wrote:
>>> Doug/Jason,
>>>
>>> Seems like I got the authdates screwed up again.  These show up in
>>> reverse order in patchwork.  Would you like a respin? 
>> I can manage..
>>
>>> These two will enable me to finalize the associated rdma tool submission.
>> I can't find a user API user of this though? Is netlink introducing
>> the first user? I'm confused. I thought umca used this
>> someplace. Maybe I just can't find it today.
> Hrm... you're right. I don't see any code using rdma_ucm_create_id.   I
> do see ucma_abi_create_id from rdma_cma_abi.h used in
> librdmacm:rdma_create_id2() called by rdma_create_id() .  And
> ucma_abi_create_id has a ps field.  So perhaps the correct header file
> is rdma_cma_abi.h?  But I don't see that file in the kernel at all. 
>
> /me confused. 

The kernel side, in ucma.c, is using  struct rdma_ucm_create_id to parse
the u->k RDMA_USER_CM_CMD_CREATE_ID command.  So its UAPI header is
include/uapi/rdma/rdma_user_cm.h.  The user side is using struct
ucma_abi_create_id from rdma-core/librdmacm/rdma_cma_abi.h.

Jason, how should I proceed? 


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe March 28, 2018, 10:52 p.m. UTC | #5
On Tue, Mar 27, 2018 at 08:38:07AM -0700, Steve Wise wrote:
> Since the rdma_port_space enum is being passed between
> user and kernel for user cm_id setup, we need it in a
> UAPI header.  So add it to rdma_user_cm.h.
> 
> This also fixes the cm_id restrack changes which pass up the port space
> value via the RDMA_NLDEV_ATTR_RES_PS attribute.
> 
> Fixes: 00313983cda6 ("RDMA/nldev: provide detailed CM_ID information")
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  include/rdma/rdma_cm.h           | 8 +-------
>  include/uapi/rdma/rdma_user_cm.h | 7 +++++++
>  2 files changed, 8 insertions(+), 7 deletions(-)

I applied this patch and one before after modifying it as discussed in
the other thread.. Please check it..

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise March 28, 2018, 11:40 p.m. UTC | #6
> 
> On Tue, Mar 27, 2018 at 08:38:07AM -0700, Steve Wise wrote:
> > Since the rdma_port_space enum is being passed between
> > user and kernel for user cm_id setup, we need it in a
> > UAPI header.  So add it to rdma_user_cm.h.
> >
> > This also fixes the cm_id restrack changes which pass up the port space
> > value via the RDMA_NLDEV_ATTR_RES_PS attribute.
> >
> > Fixes: 00313983cda6 ("RDMA/nldev: provide detailed CM_ID information")
> > Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> > ---
> >  include/rdma/rdma_cm.h           | 8 +-------
> >  include/uapi/rdma/rdma_user_cm.h | 7 +++++++
> >  2 files changed, 8 insertions(+), 7 deletions(-)
> 
> I applied this patch and one before after modifying it as discussed in
> the other thread.. Please check it..
> 
> Jason

Thanks Jason!  This:

@@ -82,7 +90,7 @@ struct rdma_ucm_cmd_hdr {
 struct rdma_ucm_create_id {
        __aligned_u64 uid;
        __aligned_u64 response;
-       __u16 ps;
+       __u16 ps;                  /* use enum rdma_port_space */
        __u8  qp_type;
        __u8  reserved[5];
 };

Should the comment be "use rdma_ucm_port_space? "

I'll rebase my series and test it all tomorrow first thing.  

Steve.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe March 29, 2018, 2:51 a.m. UTC | #7
On Wed, Mar 28, 2018 at 06:40:22PM -0500, Steve Wise wrote:
> 
> > 
> > On Tue, Mar 27, 2018 at 08:38:07AM -0700, Steve Wise wrote:
> > > Since the rdma_port_space enum is being passed between
> > > user and kernel for user cm_id setup, we need it in a
> > > UAPI header.  So add it to rdma_user_cm.h.
> > >
> > > This also fixes the cm_id restrack changes which pass up the port space
> > > value via the RDMA_NLDEV_ATTR_RES_PS attribute.
> > >
> > > Fixes: 00313983cda6 ("RDMA/nldev: provide detailed CM_ID information")
> > > Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> > >  include/rdma/rdma_cm.h           | 8 +-------
> > >  include/uapi/rdma/rdma_user_cm.h | 7 +++++++
> > >  2 files changed, 8 insertions(+), 7 deletions(-)
> > 
> > I applied this patch and one before after modifying it as discussed in
> > the other thread.. Please check it..
> > 
> > Jason
> 
> Thanks Jason!  This:
> 
> @@ -82,7 +90,7 @@ struct rdma_ucm_cmd_hdr {
>  struct rdma_ucm_create_id {
>         __aligned_u64 uid;
>         __aligned_u64 response;
> -       __u16 ps;
> +       __u16 ps;                  /* use enum rdma_port_space */
>         __u8  qp_type;
>         __u8  reserved[5];
>  };
> 
> Should the comment be "use rdma_ucm_port_space? "

done

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Wise March 29, 2018, 3:17 p.m. UTC | #8
>> I applied this patch and one before after modifying it as discussed in
>> the other thread.. Please check it..
>>
>> Jason
> Thanks Jason!  This:
>
> @@ -82,7 +90,7 @@ struct rdma_ucm_cmd_hdr {
>  struct rdma_ucm_create_id {
>         __aligned_u64 uid;
>         __aligned_u64 response;
> -       __u16 ps;
> +       __u16 ps;                  /* use enum rdma_port_space */
>         __u8  qp_type;
>         __u8  reserved[5];
>  };
>
> Should the comment be "use rdma_ucm_port_space? "
>
> I'll rebase my series and test it all tomorrow first thing.  
>
> Steve.
>

Testing looks good.

Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index 7652efc..86652a0 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -38,6 +38,7 @@ 
 #include <linux/in6.h>
 #include <rdma/ib_addr.h>
 #include <rdma/ib_sa.h>
+#include <uapi/rdma/rdma_user_cm.h>
 
 /*
  * Upon receiving a device removal event, users must destroy the associated
@@ -64,13 +65,6 @@  enum rdma_cm_event_type {
 
 const char *__attribute_const__ rdma_event_msg(enum rdma_cm_event_type event);
 
-enum rdma_port_space {
-	RDMA_PS_IPOIB = 0x0002,
-	RDMA_PS_IB    = 0x013F,
-	RDMA_PS_TCP   = 0x0106,
-	RDMA_PS_UDP   = 0x0111,
-};
-
 #define RDMA_IB_IP_PS_MASK   0xFFFFFFFFFFFF0000ULL
 #define RDMA_IB_IP_PS_TCP    0x0000000001060000ULL
 #define RDMA_IB_IP_PS_UDP    0x0000000001110000ULL
diff --git a/include/uapi/rdma/rdma_user_cm.h b/include/uapi/rdma/rdma_user_cm.h
index c83ef00..851652d 100644
--- a/include/uapi/rdma/rdma_user_cm.h
+++ b/include/uapi/rdma/rdma_user_cm.h
@@ -70,6 +70,13 @@  enum {
 	RDMA_USER_CM_CMD_JOIN_MCAST
 };
 
+enum rdma_port_space {
+	RDMA_PS_IPOIB = 0x0002,
+	RDMA_PS_IB    = 0x013F,
+	RDMA_PS_TCP   = 0x0106,
+	RDMA_PS_UDP   = 0x0111,
+};
+
 /*
  * command ABI structures.
  */