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
219219 * in charge of managing its own ring.
220220 */
221221 __u16 comp_idx;
222−} __packed;
222+} __attribute__((__packed__));
223223
224224 /*
225225 * SW KDETH header.
@@ -230,7 +230,7 @@ struct hfi1_kdeth_header { · 4 unmodified lines
230230 __le16 jkey;
231231 __le16 hcrc;
232232 __le32 swdata[7];
233−} __packed;
233+} __attribute__((__packed__));
234234
235235 /*
236236 * Structure describing the headers that User space uses. The
@@ -241,7 +241,7 @@ struct hfi1_pkt_header { · 4 unmodified lines
241241 __be16 lrh[4];
242242 __be32 bth[3];
243243 struct hfi1_kdeth_header kdeth;
244−} __packed;
244+} __attribute__((__packed__));
245245
246246
247247 /*
include/uapi/rdma/ocrdma-abi.h+1−1
@@ -127,7 +127,7 @@ struct ocrdma_create_qp_uresp { · 126 unmodified lines
127127 __u32 db_rq_offset;
128128 __u32 db_shift;
129129 __u64 rsvd[11];
130−} __packed;
130+};
131131
132132 struct ocrdma_create_srq_uresp {
133133 __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