History

RDMA: Do not used __packed in uapi headers

__packed is not available in linux/types.h, so we cannot use it in the uapi headers. The construction struct ABC {} __packed; may still compile even if __packed is not defined, however it simply creates a variable called __packed, and doesn't set the alignment. All these uses of packed are on structs that already have aligned members. While use in hfi may indicate the struct itself is unaligned, the use in ocrdma is on a UHW struct which should never be unaligned, so just delete it there.

Jason Gunthorpe committed 8 years ago

Commit 5229f871 parent d480bb52 files · +4 −4Browse files

Showing the changes to include/uapi (2 of 2 files). Show all

Unified · Split

2 files
  1. include/uapi/rdma/hfi/hfi1_user.h +3 −3
  2. include/uapi/rdma/ocrdma-abi.h +1 −1
include/uapi/rdma/hfi/hfi1_user.h+3−3
@@ -219,7 +219,7 @@ struct sdma_req_info { · 218 unmodified lines
219 * in charge of managing its own ring.219 * in charge of managing its own ring.
220 */220 */
221 __u16 comp_idx;221 __u16 comp_idx;
222} __packed;222} __attribute__((__packed__));
223 223
224/*224/*
225 * SW KDETH header.225 * SW KDETH header.
@@ -230,7 +230,7 @@ struct hfi1_kdeth_header { · 4 unmodified lines
230 __le16 jkey;230 __le16 jkey;
231 __le16 hcrc;231 __le16 hcrc;
232 __le32 swdata[7];232 __le32 swdata[7];
233} __packed;233} __attribute__((__packed__));
234 234
235/*235/*
236 * Structure describing the headers that User space uses. The236 * Structure describing the headers that User space uses. The
@@ -241,7 +241,7 @@ struct hfi1_pkt_header { · 4 unmodified lines
241 __be16 lrh[4];241 __be16 lrh[4];
242 __be32 bth[3];242 __be32 bth[3];
243 struct hfi1_kdeth_header kdeth;243 struct hfi1_kdeth_header kdeth;
244} __packed;244} __attribute__((__packed__));
245 245
246 246
247/*247/*
include/uapi/rdma/ocrdma-abi.h+1−1
@@ -127,7 +127,7 @@ struct ocrdma_create_qp_uresp { · 126 unmodified lines
127 __u32 db_rq_offset;127 __u32 db_rq_offset;
128 __u32 db_shift;128 __u32 db_shift;
129 __u64 rsvd[11];129 __u64 rsvd[11];
130} __packed;130};
131 131
132struct ocrdma_create_srq_uresp {132struct ocrdma_create_srq_uresp {
133 __u16 rq_dbid;133 __u16 rq_dbid;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t