Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

Pull one more infiniband revert from Roland Dreier:
"One more last-second RDMA change for 3.19: Yann realized that the
previous revert of new userspace ABI did not go far enough, and we're
still exposing a change that we don't want. Revert even closer to
3.18 interface to make sure we get things right in the long run"

Yann Droneaud pipes up:
"I hope this could go in v3.19 as, at this stage, we don't want to
expose any bits of this ABI in a released kernel"

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
Revert "IB/core: Add support for extended query device caps"

+42 -130
-1
drivers/infiniband/core/uverbs.h
··· 258 258 259 259 IB_UVERBS_DECLARE_EX_CMD(create_flow); 260 260 IB_UVERBS_DECLARE_EX_CMD(destroy_flow); 261 - IB_UVERBS_DECLARE_EX_CMD(query_device); 262 261 263 262 #endif /* UVERBS_H */
+41 -96
drivers/infiniband/core/uverbs_cmd.c
··· 400 400 return ret; 401 401 } 402 402 403 - static void copy_query_dev_fields(struct ib_uverbs_file *file, 404 - struct ib_uverbs_query_device_resp *resp, 405 - struct ib_device_attr *attr) 406 - { 407 - resp->fw_ver = attr->fw_ver; 408 - resp->node_guid = file->device->ib_dev->node_guid; 409 - resp->sys_image_guid = attr->sys_image_guid; 410 - resp->max_mr_size = attr->max_mr_size; 411 - resp->page_size_cap = attr->page_size_cap; 412 - resp->vendor_id = attr->vendor_id; 413 - resp->vendor_part_id = attr->vendor_part_id; 414 - resp->hw_ver = attr->hw_ver; 415 - resp->max_qp = attr->max_qp; 416 - resp->max_qp_wr = attr->max_qp_wr; 417 - resp->device_cap_flags = attr->device_cap_flags; 418 - resp->max_sge = attr->max_sge; 419 - resp->max_sge_rd = attr->max_sge_rd; 420 - resp->max_cq = attr->max_cq; 421 - resp->max_cqe = attr->max_cqe; 422 - resp->max_mr = attr->max_mr; 423 - resp->max_pd = attr->max_pd; 424 - resp->max_qp_rd_atom = attr->max_qp_rd_atom; 425 - resp->max_ee_rd_atom = attr->max_ee_rd_atom; 426 - resp->max_res_rd_atom = attr->max_res_rd_atom; 427 - resp->max_qp_init_rd_atom = attr->max_qp_init_rd_atom; 428 - resp->max_ee_init_rd_atom = attr->max_ee_init_rd_atom; 429 - resp->atomic_cap = attr->atomic_cap; 430 - resp->max_ee = attr->max_ee; 431 - resp->max_rdd = attr->max_rdd; 432 - resp->max_mw = attr->max_mw; 433 - resp->max_raw_ipv6_qp = attr->max_raw_ipv6_qp; 434 - resp->max_raw_ethy_qp = attr->max_raw_ethy_qp; 435 - resp->max_mcast_grp = attr->max_mcast_grp; 436 - resp->max_mcast_qp_attach = attr->max_mcast_qp_attach; 437 - resp->max_total_mcast_qp_attach = attr->max_total_mcast_qp_attach; 438 - resp->max_ah = attr->max_ah; 439 - resp->max_fmr = attr->max_fmr; 440 - resp->max_map_per_fmr = attr->max_map_per_fmr; 441 - resp->max_srq = attr->max_srq; 442 - resp->max_srq_wr = attr->max_srq_wr; 443 - resp->max_srq_sge = attr->max_srq_sge; 444 - resp->max_pkeys = attr->max_pkeys; 445 - resp->local_ca_ack_delay = attr->local_ca_ack_delay; 446 - resp->phys_port_cnt = file->device->ib_dev->phys_port_cnt; 447 - } 448 - 449 403 ssize_t ib_uverbs_query_device(struct ib_uverbs_file *file, 450 404 const char __user *buf, 451 405 int in_len, int out_len) ··· 420 466 return ret; 421 467 422 468 memset(&resp, 0, sizeof resp); 423 - copy_query_dev_fields(file, &resp, &attr); 469 + 470 + resp.fw_ver = attr.fw_ver; 471 + resp.node_guid = file->device->ib_dev->node_guid; 472 + resp.sys_image_guid = attr.sys_image_guid; 473 + resp.max_mr_size = attr.max_mr_size; 474 + resp.page_size_cap = attr.page_size_cap; 475 + resp.vendor_id = attr.vendor_id; 476 + resp.vendor_part_id = attr.vendor_part_id; 477 + resp.hw_ver = attr.hw_ver; 478 + resp.max_qp = attr.max_qp; 479 + resp.max_qp_wr = attr.max_qp_wr; 480 + resp.device_cap_flags = attr.device_cap_flags; 481 + resp.max_sge = attr.max_sge; 482 + resp.max_sge_rd = attr.max_sge_rd; 483 + resp.max_cq = attr.max_cq; 484 + resp.max_cqe = attr.max_cqe; 485 + resp.max_mr = attr.max_mr; 486 + resp.max_pd = attr.max_pd; 487 + resp.max_qp_rd_atom = attr.max_qp_rd_atom; 488 + resp.max_ee_rd_atom = attr.max_ee_rd_atom; 489 + resp.max_res_rd_atom = attr.max_res_rd_atom; 490 + resp.max_qp_init_rd_atom = attr.max_qp_init_rd_atom; 491 + resp.max_ee_init_rd_atom = attr.max_ee_init_rd_atom; 492 + resp.atomic_cap = attr.atomic_cap; 493 + resp.max_ee = attr.max_ee; 494 + resp.max_rdd = attr.max_rdd; 495 + resp.max_mw = attr.max_mw; 496 + resp.max_raw_ipv6_qp = attr.max_raw_ipv6_qp; 497 + resp.max_raw_ethy_qp = attr.max_raw_ethy_qp; 498 + resp.max_mcast_grp = attr.max_mcast_grp; 499 + resp.max_mcast_qp_attach = attr.max_mcast_qp_attach; 500 + resp.max_total_mcast_qp_attach = attr.max_total_mcast_qp_attach; 501 + resp.max_ah = attr.max_ah; 502 + resp.max_fmr = attr.max_fmr; 503 + resp.max_map_per_fmr = attr.max_map_per_fmr; 504 + resp.max_srq = attr.max_srq; 505 + resp.max_srq_wr = attr.max_srq_wr; 506 + resp.max_srq_sge = attr.max_srq_sge; 507 + resp.max_pkeys = attr.max_pkeys; 508 + resp.local_ca_ack_delay = attr.local_ca_ack_delay; 509 + resp.phys_port_cnt = file->device->ib_dev->phys_port_cnt; 424 510 425 511 if (copy_to_user((void __user *) (unsigned long) cmd.response, 426 512 &resp, sizeof resp)) ··· 3286 3292 ret = -EFAULT; 3287 3293 3288 3294 return ret ? ret : in_len; 3289 - } 3290 - 3291 - int ib_uverbs_ex_query_device(struct ib_uverbs_file *file, 3292 - struct ib_udata *ucore, 3293 - struct ib_udata *uhw) 3294 - { 3295 - struct ib_uverbs_ex_query_device_resp resp; 3296 - struct ib_uverbs_ex_query_device cmd; 3297 - struct ib_device_attr attr; 3298 - struct ib_device *device; 3299 - int err; 3300 - 3301 - device = file->device->ib_dev; 3302 - if (ucore->inlen < sizeof(cmd)) 3303 - return -EINVAL; 3304 - 3305 - err = ib_copy_from_udata(&cmd, ucore, sizeof(cmd)); 3306 - if (err) 3307 - return err; 3308 - 3309 - if (cmd.reserved) 3310 - return -EINVAL; 3311 - 3312 - err = device->query_device(device, &attr); 3313 - if (err) 3314 - return err; 3315 - 3316 - memset(&resp, 0, sizeof(resp)); 3317 - copy_query_dev_fields(file, &resp.base, &attr); 3318 - resp.comp_mask = 0; 3319 - 3320 - #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING 3321 - if (cmd.comp_mask & IB_USER_VERBS_EX_QUERY_DEVICE_ODP) { 3322 - resp.odp_caps.general_caps = attr.odp_caps.general_caps; 3323 - resp.odp_caps.per_transport_caps.rc_odp_caps = 3324 - attr.odp_caps.per_transport_caps.rc_odp_caps; 3325 - resp.odp_caps.per_transport_caps.uc_odp_caps = 3326 - attr.odp_caps.per_transport_caps.uc_odp_caps; 3327 - resp.odp_caps.per_transport_caps.ud_odp_caps = 3328 - attr.odp_caps.per_transport_caps.ud_odp_caps; 3329 - resp.comp_mask |= IB_USER_VERBS_EX_QUERY_DEVICE_ODP; 3330 - } 3331 - #endif 3332 - 3333 - err = ib_copy_to_udata(ucore, &resp, sizeof(resp)); 3334 - if (err) 3335 - return err; 3336 - 3337 - return 0; 3338 3295 }
-2
drivers/infiniband/hw/mlx5/main.c
··· 1331 1331 (1ull << IB_USER_VERBS_CMD_DESTROY_SRQ) | 1332 1332 (1ull << IB_USER_VERBS_CMD_CREATE_XSRQ) | 1333 1333 (1ull << IB_USER_VERBS_CMD_OPEN_QP); 1334 - dev->ib_dev.uverbs_ex_cmd_mask = 1335 - (1ull << IB_USER_VERBS_EX_CMD_QUERY_DEVICE); 1336 1334 1337 1335 dev->ib_dev.query_device = mlx5_ib_query_device; 1338 1336 dev->ib_dev.query_port = mlx5_ib_query_port;
+1 -4
include/rdma/ib_verbs.h
··· 1707 1707 1708 1708 static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len) 1709 1709 { 1710 - size_t copy_sz; 1711 - 1712 - copy_sz = min_t(size_t, len, udata->outlen); 1713 - return copy_to_user(udata->outbuf, src, copy_sz) ? -EFAULT : 0; 1710 + return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0; 1714 1711 } 1715 1712 1716 1713 /**
-27
include/uapi/rdma/ib_user_verbs.h
··· 90 90 }; 91 91 92 92 enum { 93 - IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE, 94 93 IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, 95 94 IB_USER_VERBS_EX_CMD_DESTROY_FLOW, 96 95 }; ··· 199 200 __u8 local_ca_ack_delay; 200 201 __u8 phys_port_cnt; 201 202 __u8 reserved[4]; 202 - }; 203 - 204 - enum { 205 - IB_USER_VERBS_EX_QUERY_DEVICE_ODP = 1ULL << 0, 206 - }; 207 - 208 - struct ib_uverbs_ex_query_device { 209 - __u32 comp_mask; 210 - __u32 reserved; 211 - }; 212 - 213 - struct ib_uverbs_odp_caps { 214 - __u64 general_caps; 215 - struct { 216 - __u32 rc_odp_caps; 217 - __u32 uc_odp_caps; 218 - __u32 ud_odp_caps; 219 - } per_transport_caps; 220 - __u32 reserved; 221 - }; 222 - 223 - struct ib_uverbs_ex_query_device_resp { 224 - struct ib_uverbs_query_device_resp base; 225 - __u32 comp_mask; 226 - __u32 reserved; 227 - struct ib_uverbs_odp_caps odp_caps; 228 203 }; 229 204 230 205 struct ib_uverbs_query_port {