public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next V1] IB/usnic: Fix userspace/kernel ABI alignment discrepancy
@ 2013-12-21  2:05 Upinder Malhi (umalhi)
       [not found] ` <BB49315F-37F6-4B91-9374-E7C886DA2B3D-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Upinder Malhi (umalhi) @ 2013-12-21  2:05 UTC (permalink / raw)
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Dreier

Change from V0:
Make reserved field 9 bytes instead of 8 bytes.

This patch depends on http://www.spinics.net/lists/linux-rdma/msg18193.html.

Change the type of the reserve field to u32 from u64 in
usnic_ib_create_qp_resp bc u64 will align differently for
32 and 64 bit archs.  And reserve even more space for future
expansion.

Signed-off-by: Upinder Malhi <umalhi-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/hw/usnic/usnic_abi.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/usnic/usnic_abi.h b/drivers/infiniband/hw/usnic/usnic_abi.h
index 730a371..6c56fbf 100644
--- a/drivers/infiniband/hw/usnic/usnic_abi.h
+++ b/drivers/infiniband/hw/usnic/usnic_abi.h
@@ -21,7 +21,7 @@
#define USNIC_ABI_H

/* ABI between userspace and kernel */
-#define USNIC_UVERBS_ABI_VERSION	3
+#define USNIC_UVERBS_ABI_VERSION	4

#define USNIC_QP_GRP_MAX_WQS		8
#define USNIC_QP_GRP_MAX_RQS		8
@@ -67,7 +67,7 @@ struct usnic_ib_create_qp_resp {
	u32				rq_idx[USNIC_QP_GRP_MAX_RQS];
	u32				cq_idx[USNIC_QP_GRP_MAX_CQS];
	u32				transport;
-	u64				reserved;
+	u32				reserved[9];
};

#endif /* USNIC_ABI_H */
------
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] 3+ messages in thread

* Re: [PATCH for-next V1] IB/usnic: Fix userspace/kernel ABI alignment discrepancy
       [not found] ` <BB49315F-37F6-4B91-9374-E7C886DA2B3D-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2013-12-21  9:52   ` Bart Van Assche
       [not found]     ` <52B564C0.2090606-HInyCGIudOg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2013-12-21  9:52 UTC (permalink / raw)
  To: Upinder Malhi (umalhi),
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Dreier

On 12/21/13 03:05, Upinder Malhi (umalhi) wrote:
> Change from V0:
> Make reserved field 9 bytes instead of 8 bytes.
> 
> This patch depends on http://www.spinics.net/lists/linux-rdma/msg18193.html.
> 
> Change the type of the reserve field to u32 from u64 in
> usnic_ib_create_qp_resp bc u64 will align differently for
> 32 and 64 bit archs.  And reserve even more space for future
> expansion.
> 
> Signed-off-by: Upinder Malhi <umalhi-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/infiniband/hw/usnic/usnic_abi.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/usnic/usnic_abi.h b/drivers/infiniband/hw/usnic/usnic_abi.h
> index 730a371..6c56fbf 100644
> --- a/drivers/infiniband/hw/usnic/usnic_abi.h
> +++ b/drivers/infiniband/hw/usnic/usnic_abi.h
> @@ -21,7 +21,7 @@
> #define USNIC_ABI_H
> 
> /* ABI between userspace and kernel */
> -#define USNIC_UVERBS_ABI_VERSION	3
> +#define USNIC_UVERBS_ABI_VERSION	4
> 
> #define USNIC_QP_GRP_MAX_WQS		8
> #define USNIC_QP_GRP_MAX_RQS		8
> @@ -67,7 +67,7 @@ struct usnic_ib_create_qp_resp {
> 	u32				rq_idx[USNIC_QP_GRP_MAX_RQS];
> 	u32				cq_idx[USNIC_QP_GRP_MAX_CQS];
> 	u32				transport;
> -	u64				reserved;
> +	u32				reserved[9];
> };
> 
> #endif /* USNIC_ABI_H */

Sorry but to me it seems like the patch description does not match the
patch itself. In the patch I see an increase of the size of "reserved"
from 8 to 36 bytes while the description says that the size of that
member has been increased from 8 to 9 bytes ?

Bart.

--
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] 3+ messages in thread

* Re: [PATCH for-next V1] IB/usnic: Fix userspace/kernel ABI alignment discrepancy
       [not found]     ` <52B564C0.2090606-HInyCGIudOg@public.gmane.org>
@ 2013-12-22 22:54       ` Upinder Malhi (umalhi)
  0 siblings, 0 replies; 3+ messages in thread
From: Upinder Malhi (umalhi) @ 2013-12-22 22:54 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Dreier

Gaaah.  Yes, you are right.  That should say '36 bytes instead of 32 bytes.'

I won't re-spin bc the error is in the version change description, going from V0 to V1, which will not go in the commit log.

Upinder

On Dec 21, 2013, at 1:52 AM, Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
 wrote:

> On 12/21/13 03:05, Upinder Malhi (umalhi) wrote:
>> Change from V0:
>> Make reserved field 9 bytes instead of 8 bytes.
>> 
>> This patch depends on http://www.spinics.net/lists/linux-rdma/msg18193.html.
>> 
>> Change the type of the reserve field to u32 from u64 in
>> usnic_ib_create_qp_resp bc u64 will align differently for
>> 32 and 64 bit archs.  And reserve even more space for future
>> expansion.
>> 
>> Signed-off-by: Upinder Malhi <umalhi-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/infiniband/hw/usnic/usnic_abi.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/infiniband/hw/usnic/usnic_abi.h b/drivers/infiniband/hw/usnic/usnic_abi.h
>> index 730a371..6c56fbf 100644
>> --- a/drivers/infiniband/hw/usnic/usnic_abi.h
>> +++ b/drivers/infiniband/hw/usnic/usnic_abi.h
>> @@ -21,7 +21,7 @@
>> #define USNIC_ABI_H
>> 
>> /* ABI between userspace and kernel */
>> -#define USNIC_UVERBS_ABI_VERSION	3
>> +#define USNIC_UVERBS_ABI_VERSION	4
>> 
>> #define USNIC_QP_GRP_MAX_WQS		8
>> #define USNIC_QP_GRP_MAX_RQS		8
>> @@ -67,7 +67,7 @@ struct usnic_ib_create_qp_resp {
>> 	u32				rq_idx[USNIC_QP_GRP_MAX_RQS];
>> 	u32				cq_idx[USNIC_QP_GRP_MAX_CQS];
>> 	u32				transport;
>> -	u64				reserved;
>> +	u32				reserved[9];
>> };
>> 
>> #endif /* USNIC_ABI_H */
> 
> Sorry but to me it seems like the patch description does not match the
> patch itself. In the patch I see an increase of the size of "reserved"
> from 8 to 36 bytes while the description says that the size of that
> member has been increased from 8 to 9 bytes ?
> 
> Bart.
> 

--
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] 3+ messages in thread

end of thread, other threads:[~2013-12-22 22:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-21  2:05 [PATCH for-next V1] IB/usnic: Fix userspace/kernel ABI alignment discrepancy Upinder Malhi (umalhi)
     [not found] ` <BB49315F-37F6-4B91-9374-E7C886DA2B3D-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2013-12-21  9:52   ` Bart Van Assche
     [not found]     ` <52B564C0.2090606-HInyCGIudOg@public.gmane.org>
2013-12-22 22:54       ` Upinder Malhi (umalhi)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox