|
@@ -291,9 +291,6 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,
|
|
|
struct ib_uverbs_get_context cmd;
|
|
|
struct ib_uverbs_get_context_resp resp;
|
|
|
struct ib_udata udata;
|
|
|
-#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
|
|
|
- struct ib_device_attr dev_attr;
|
|
|
-#endif
|
|
|
struct ib_ucontext *ucontext;
|
|
|
struct file *filp;
|
|
|
int ret;
|
|
@@ -342,10 +339,7 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,
|
|
|
ucontext->odp_mrs_count = 0;
|
|
|
INIT_LIST_HEAD(&ucontext->no_private_counters);
|
|
|
|
|
|
- ret = ib_query_device(ib_dev, &dev_attr);
|
|
|
- if (ret)
|
|
|
- goto err_free;
|
|
|
- if (!(dev_attr.device_cap_flags & IB_DEVICE_ON_DEMAND_PAGING))
|
|
|
+ if (!(ib_dev->attrs.device_cap_flags & IB_DEVICE_ON_DEMAND_PAGING))
|
|
|
ucontext->invalidate_range = NULL;
|
|
|
|
|
|
#endif
|
|
@@ -447,8 +441,6 @@ ssize_t ib_uverbs_query_device(struct ib_uverbs_file *file,
|
|
|
{
|
|
|
struct ib_uverbs_query_device cmd;
|
|
|
struct ib_uverbs_query_device_resp resp;
|
|
|
- struct ib_device_attr attr;
|
|
|
- int ret;
|
|
|
|
|
|
if (out_len < sizeof resp)
|
|
|
return -ENOSPC;
|
|
@@ -456,12 +448,8 @@ ssize_t ib_uverbs_query_device(struct ib_uverbs_file *file,
|
|
|
if (copy_from_user(&cmd, buf, sizeof cmd))
|
|
|
return -EFAULT;
|
|
|
|
|
|
- ret = ib_query_device(ib_dev, &attr);
|
|
|
- if (ret)
|
|
|
- return ret;
|
|
|
-
|
|
|
memset(&resp, 0, sizeof resp);
|
|
|
- copy_query_dev_fields(file, ib_dev, &resp, &attr);
|
|
|
+ copy_query_dev_fields(file, ib_dev, &resp, &ib_dev->attrs);
|
|
|
|
|
|
if (copy_to_user((void __user *) (unsigned long) cmd.response,
|
|
|
&resp, sizeof resp))
|
|
@@ -986,11 +974,8 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,
|
|
|
}
|
|
|
|
|
|
if (cmd.access_flags & IB_ACCESS_ON_DEMAND) {
|
|
|
- struct ib_device_attr attr;
|
|
|
-
|
|
|
- ret = ib_query_device(pd->device, &attr);
|
|
|
- if (ret || !(attr.device_cap_flags &
|
|
|
- IB_DEVICE_ON_DEMAND_PAGING)) {
|
|
|
+ if (!(pd->device->attrs.device_cap_flags &
|
|
|
+ IB_DEVICE_ON_DEMAND_PAGING)) {
|
|
|
pr_debug("ODP support not available\n");
|
|
|
ret = -EINVAL;
|
|
|
goto err_put;
|