@@ -122,7 +122,8 @@ static int fill_dev_info(struct sk_buff *msg, struct ib_device *device)
122
122
123
123
BUILD_BUG_ON (sizeof (device -> attrs .device_cap_flags ) != sizeof (u64 ));
124
124
if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_CAP_FLAGS ,
125
- device -> attrs .device_cap_flags , 0 ))
125
+ device -> attrs .device_cap_flags ,
126
+ RDMA_NLDEV_ATTR_PAD ))
126
127
return - EMSGSIZE ;
127
128
128
129
ib_get_device_fw_str (device , fw );
@@ -131,10 +132,12 @@ static int fill_dev_info(struct sk_buff *msg, struct ib_device *device)
131
132
return - EMSGSIZE ;
132
133
133
134
if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_NODE_GUID ,
134
- be64_to_cpu (device -> node_guid ), 0 ))
135
+ be64_to_cpu (device -> node_guid ),
136
+ RDMA_NLDEV_ATTR_PAD ))
135
137
return - EMSGSIZE ;
136
138
if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_SYS_IMAGE_GUID ,
137
- be64_to_cpu (device -> attrs .sys_image_guid ), 0 ))
139
+ be64_to_cpu (device -> attrs .sys_image_guid ),
140
+ RDMA_NLDEV_ATTR_PAD ))
138
141
return - EMSGSIZE ;
139
142
if (nla_put_u8 (msg , RDMA_NLDEV_ATTR_DEV_NODE_TYPE , device -> node_type ))
140
143
return - EMSGSIZE ;
@@ -161,11 +164,11 @@ static int fill_port_info(struct sk_buff *msg,
161
164
162
165
BUILD_BUG_ON (sizeof (attr .port_cap_flags ) > sizeof (u64 ));
163
166
if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_CAP_FLAGS ,
164
- (u64 )attr .port_cap_flags , 0 ))
167
+ (u64 )attr .port_cap_flags , RDMA_NLDEV_ATTR_PAD ))
165
168
return - EMSGSIZE ;
166
169
if (rdma_protocol_ib (device , port ) &&
167
170
nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_SUBNET_PREFIX ,
168
- attr .subnet_prefix , 0 ))
171
+ attr .subnet_prefix , RDMA_NLDEV_ATTR_PAD ))
169
172
return - EMSGSIZE ;
170
173
if (rdma_protocol_ib (device , port )) {
171
174
if (nla_put_u32 (msg , RDMA_NLDEV_ATTR_LID , attr .lid ))
@@ -209,8 +212,8 @@ static int fill_res_info_entry(struct sk_buff *msg,
209
212
210
213
if (nla_put_string (msg , RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_NAME , name ))
211
214
goto err ;
212
- if (nla_put_u64_64bit (msg ,
213
- RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR , curr , 0 ))
215
+ if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_CURR , curr ,
216
+ RDMA_NLDEV_ATTR_PAD ))
214
217
goto err ;
215
218
216
219
nla_nest_end (msg , entry_attr );
@@ -409,7 +412,7 @@ static int fill_res_cq_entry(struct sk_buff *msg, struct netlink_callback *cb,
409
412
if (nla_put_u32 (msg , RDMA_NLDEV_ATTR_RES_CQE , cq -> cqe ))
410
413
goto err ;
411
414
if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_RES_USECNT ,
412
- atomic_read (& cq -> usecnt ), 0 ))
415
+ atomic_read (& cq -> usecnt ), RDMA_NLDEV_ATTR_PAD ))
413
416
goto err ;
414
417
415
418
/* Poll context is only valid for kernel CQs */
@@ -445,11 +448,12 @@ static int fill_res_mr_entry(struct sk_buff *msg, struct netlink_callback *cb,
445
448
if (nla_put_u32 (msg , RDMA_NLDEV_ATTR_RES_LKEY , mr -> lkey ))
446
449
goto err ;
447
450
if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_RES_IOVA ,
448
- mr -> iova , 0 ))
451
+ mr -> iova , RDMA_NLDEV_ATTR_PAD ))
449
452
goto err ;
450
453
}
451
454
452
- if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_RES_MRLEN , mr -> length , 0 ))
455
+ if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_RES_MRLEN , mr -> length ,
456
+ RDMA_NLDEV_ATTR_PAD ))
453
457
goto err ;
454
458
455
459
if (fill_res_name_pid (msg , res ))
@@ -484,7 +488,7 @@ static int fill_res_pd_entry(struct sk_buff *msg, struct netlink_callback *cb,
484
488
goto err ;
485
489
}
486
490
if (nla_put_u64_64bit (msg , RDMA_NLDEV_ATTR_RES_USECNT ,
487
- atomic_read (& pd -> usecnt ), 0 ))
491
+ atomic_read (& pd -> usecnt ), RDMA_NLDEV_ATTR_PAD ))
488
492
goto err ;
489
493
if ((pd -> flags & IB_PD_UNSAFE_GLOBAL_RKEY ) &&
490
494
nla_put_u32 (msg , RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY ,
0 commit comments