Re: [PATCH rdma-next] RDMA: Use __packed annotation instead of __attribute__ ((packed))

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

 



On 2/24/19 10:52 PM, Leon Romanovsky wrote:
diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h
index 476d4309576d..3d16d614aff6 100644
--- a/drivers/infiniband/core/cm_msgs.h
+++ b/drivers/infiniband/core/cm_msgs.h
@@ -98,7 +98,7 @@ struct cm_req_msg {

  	u32 private_data[IB_CM_REQ_PRIVATE_DATA_SIZE / sizeof(u32)];

-} __attribute__ ((packed));
+} __packed;

Hi Leon,

A previous RDMA maintainer once wrote a blog in which he explained why it is better to apply the __packed attribute only to data members that need it instead of to data structures. The reason is that applying __packed to data structures does not allow compilers to generate optimal code for architectures that cannot perform non-aligned multi-byte reads efficiently. Does that concern apply to the data structures modified by this patch?

Thanks,

Bart.



[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