Re: [PATCH 1/1] Drivers: infiniband: hw: vmbus-nd: NetworkDirect driver for Linux

From: kbuild test robot
Date: Wed Jul 27 2016 - 00:19:08 EST


Hi,

[auto build test WARNING on rdma/master]
[also build test WARNING on v4.7 next-20160726]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/kys-exchange-microsoft-com/Drivers-infiniband-hw-vmbus-nd-NetworkDirect-driver-for-Linux/20160727-090222
base: https://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git master
config: i386-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_send_pg_buffer':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:247:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_cookie.pkt = (void *)cookie;
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:254:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(u64)(&hvnd_cookie));
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_send_packet':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:279:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_cookie.pkt = (void *)cookie;
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:283:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(u64)(&hvnd_cookie), VM_PKT_DATA_INBAND,
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_open_adaptor':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:763:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
pr_o_adap->ioctl.input.adapter_id = (u64)nd_dev;
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:813:132: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("adaptor handle: %p\n", (void *)uctx->adaptor_hdl);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:818:126: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("uar base: %p\n", (void *)uctx->uar_base);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:822:125: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("bf base: %p\n", (void *)uctx->bf_base);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_create_cq':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:963:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
map_memory.address = (u64)cq->cq_buf;
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:972:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
map_memory.address = (u64)cq->db_addr;
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:982:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
map_memory.address = (u64)&cq->arm_sn;
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1023:60: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt->hdr, cq_pkt_size, (u64)pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1041:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("CQ create after success cq handle is %p\n",
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_destroy_cq':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1071:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(u64)&free_cq_pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_notify_cq':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1114:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(u64)&notify_cq_pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_cr_mr':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1142:130: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("PD handle is %p\n", (void *)pd_handle);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1145:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1153:130: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("mr handle is %p\n", (void *)pkt.ioctl.out);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_deregister_mr':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1192:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_mr_register':
>> drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1283:67: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'phys_addr_t {aka unsigned int}' [-Wformat=]
hvnd_debug("physical address = %llx\n",
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_cr_listener':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1392:135: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("Adaptor handle is %p\n", (void *)uctx->adaptor_hdl);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1396:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1404:136: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("listener handle is %p\n", (void *)pkt.ioctl.out);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_free_listener':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1436:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_bind_listener':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1475:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_listen_listener':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1509:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_get_addr_listener':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1543:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_get_connection_listener':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1570:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ret = get_irp_handle(nd_dev, &irp_fhandle.local, (void *)irp_handle);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1595:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_cr_connector':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1632:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1640:137: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("connector handle is %p\n", (void *)pkt.ioctl.out);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_free_connector':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1670:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_bind_connector':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1709:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_connect':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1773:61: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt->hdr, sizeof(*pkt), (u64)pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_complete_connect':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1807:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_accept':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1866:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_reject':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1914:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_get_rd_limits':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1950:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_get_priv_data':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:1987:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_get_peer_addr':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:2024:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_get_local_addr':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:2061:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_notify_disconnect':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:2099:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_connector_disconnect':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:2137:59: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c: In function 'hvnd_create_qp':
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:2226:135: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("recv cq handle is %p\n", (void *)qp->receive_cq_handle);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:2227:135: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("send cq handle is %p\n", (void *)qp->initiator_cq_handle);
^
drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c:2228:130: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hvnd_debug("pd handle is %p\n", (void *)qp->pd_handle);
^

vim +1283 drivers/infiniband/hw/vmbus-nd/vmbus_rdma.c

1147 if (ret)
1148 goto err;
1149
1150 /*
1151 * Copy the handle.
1152 */
> 1153 hvnd_debug("mr handle is %p\n", (void *)pkt.ioctl.out);
1154 *mr_handle = pkt.ioctl.out;
1155
1156 return 0;
1157
1158 err:
1159 hvnd_error("create mr failed: %d\n", ret);
1160 return ret;
1161
1162 }
1163
1164 int hvnd_free_mr(struct hvnd_dev *nd_dev, struct hvnd_ucontext *uctx,
1165 u64 handle)
1166 {
1167 return hvnd_free_handle(nd_dev, uctx, handle, IOCTL_ND_MR_FREE);
1168 }
1169
1170 int hvnd_deregister_mr(struct hvnd_dev *nd_dev, struct hvnd_ucontext *uctx,
1171 u64 handle)
1172 {
1173 struct pkt_nd_deregister_mr pkt;
1174 int ret;
1175
1176 /* KYS try to avoid having to zero everything */
1177 memset(&pkt, 0, sizeof(pkt));
1178 hvnd_init_hdr(&pkt.hdr,
1179 sizeof(pkt) -
1180 sizeof(struct ndv_packet_hdr_control_1),
1181 uctx->create_pkt.handle.local,
1182 uctx->create_pkt.handle.remote,
1183 IOCTL_ND_MR_DEREGISTER, 0, 0, 0);
1184
1185 /*
1186 * Now fill in the ioctl section.
1187 */
1188 pkt.ioctl.in.version = ND_VERSION_1;
1189 pkt.ioctl.in.handle = handle;
1190 pkt.ioctl.in.reserved = 0;
1191
1192 ret = hvnd_send_ioctl_pkt(nd_dev, &pkt.hdr, sizeof(pkt), (u64)&pkt);
1193
1194 if (ret)
1195 goto err;
1196
1197 return 0;
1198
1199 err:
1200 hvnd_error("de-register mr failed: %d\n", ret);
1201 return ret;
1202
1203 }
1204
1205 static inline u32 hvnd_convert_access(int acc)
1206 {
1207 return (acc & IB_ACCESS_REMOTE_WRITE ?
1208 ND_MR_FLAG_ALLOW_REMOTE_WRITE : 0) |
1209 (acc & IB_ACCESS_REMOTE_READ ?
1210 ND_MR_FLAG_ALLOW_REMOTE_READ : 0) |
1211 (acc & IB_ACCESS_LOCAL_WRITE ?
1212 ND_MR_FLAG_ALLOW_LOCAL_WRITE : 0);
1213 }
1214
1215
1216 int hvnd_mr_register(struct hvnd_dev *nd_dev, struct hvnd_ucontext *uctx,
1217 struct hvnd_mr *mr)
1218 {
1219 struct pkt_nd_register_mr pkt;
1220 int ret;
1221 struct hv_mpb_array *pb;
1222 struct vmbus_packet_mpb_array *tpb;
1223 int sz_leaf;
1224 int num_pgs;
1225 int i = 0;
1226 int ext_data_sz;
1227 u32 acc_flags;
1228 u32 desc_size;
1229 int pkt_type;
1230
1231 /*
1232 * The user address is passed in via a two level structure.
1233 * An Array of struct hv_page_buffer will be used to describe
1234 * the user memory. The pages containing this array will be descibed
1235 * in another array of struct hv_page_buffer. We pass this seconed level
1236 * array to the host.
1237 */
1238
1239 hvnd_debug("ib_umem_page_count(mr->umem)=%d\n",
1240 ib_umem_page_count(mr->umem));
1241
1242 sz_leaf = ib_umem_page_count(mr->umem) * sizeof(u64) +
1243 sizeof(struct hv_mpb_array);
1244
1245 pb = (struct hv_mpb_array *)
1246 __get_free_pages(GFP_KERNEL|__GFP_ZERO, get_order(sz_leaf));
1247
1248 if (pb == NULL)
1249 return -ENOMEM;
1250 /*
1251 * Allocate an array of hv_page_buffer to describe the first level.
1252 */
1253 num_pgs = DIV_ROUND_UP(sz_leaf, PAGE_SIZE);
1254 hvnd_debug("num pages in the top array is %d\n", num_pgs);
1255
1256 desc_size = (num_pgs * sizeof(u64) +
1257 sizeof(struct vmbus_packet_mpb_array));
1258 tpb = (struct vmbus_packet_mpb_array *)
1259 __get_free_pages(GFP_KERNEL|__GFP_ZERO, get_order(desc_size));
1260
1261 if (tpb == NULL) {
1262 free_pages((unsigned long)pb, get_order(sz_leaf));
1263 return -ENOMEM;
1264 }
1265
1266 hvnd_debug("sz leaf: %d; pgs in top %d\n", sz_leaf, num_pgs);
1267
1268 /*
1269 * Now fill the leaf level array.
1270 */
1271 pb->len = mr->length;
1272 pb->offset = offset_in_page(mr->start);
1273 user_va_init_pfn(pb->pfn_array, mr->umem);
1274
1275 /*
1276 * Now fill out the top level array.
1277 */
1278 for (i = 0; i < num_pgs; i++) {
1279 tpb->range.pfn_array[i] = virt_to_phys((u8 *)pb +
1280 (PAGE_SIZE * i)) >> PAGE_SHIFT;
1281 hvnd_debug("virtual address = %p\n",
1282 (u8 *)pb + (PAGE_SIZE * i));
> 1283 hvnd_debug("physical address = %llx\n",
1284 virt_to_phys((u8 *)pb + (PAGE_SIZE * i)));
1285 hvnd_debug("tpb->range.pfn_array[%d]=%llx\n", i,
1286 tpb->range.pfn_array[i]);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: Binary data