Skip to content

Commit 5229f87

Browse files
committed
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. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent d480bb5 commit 5229f87

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎include/uapi/rdma/hfi/hfi1_user.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ struct sdma_req_info {
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 {
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 {
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‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ struct ocrdma_create_qp_uresp {
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;

0 commit comments

Comments
 (0)