Re: [PATCH rdma-rc] RDMA: Remove kernel private defines and reference to header from UAPI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux