|
@@ -635,19 +635,13 @@ err_put_refs:
|
|
return filp;
|
|
return filp;
|
|
}
|
|
}
|
|
|
|
|
|
-static bool verify_command_mask(struct ib_device *ib_dev, __u32 command)
|
|
|
|
|
|
+static bool verify_command_mask(struct ib_device *ib_dev,
|
|
|
|
+ __u32 command, bool extended)
|
|
{
|
|
{
|
|
- u64 mask;
|
|
|
|
|
|
+ if (!extended)
|
|
|
|
+ return ib_dev->uverbs_cmd_mask & BIT_ULL(command);
|
|
|
|
|
|
- if (command <= IB_USER_VERBS_CMD_OPEN_QP)
|
|
|
|
- mask = ib_dev->uverbs_cmd_mask;
|
|
|
|
- else
|
|
|
|
- mask = ib_dev->uverbs_ex_cmd_mask;
|
|
|
|
-
|
|
|
|
- if (mask & ((u64)1 << command))
|
|
|
|
- return true;
|
|
|
|
-
|
|
|
|
- return false;
|
|
|
|
|
|
+ return ib_dev->uverbs_ex_cmd_mask & BIT_ULL(command);
|
|
}
|
|
}
|
|
|
|
|
|
static bool verify_command_idx(u32 command, bool extended)
|
|
static bool verify_command_idx(u32 command, bool extended)
|
|
@@ -722,7 +716,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!verify_command_mask(ib_dev, command)) {
|
|
|
|
|
|
+ if (!verify_command_mask(ib_dev, command, extended)) {
|
|
ret = -EOPNOTSUPP;
|
|
ret = -EOPNOTSUPP;
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|