On Tue, Nov 04, 2014 at 02:35:09PM +0200, Haggai Eran wrote: > On 03/11/2014 10:02, Eli Cohen wrote: > > + > > + if (ucore->outlen < sizeof(resp)) > > + return -ENOSPC; > > This check may cause compatibility problems when running a newer kernel > with old userspace. The userspace code will have a smaller > ib_uverbs_ex_query_device_resp struct, so the verb will always fail. A > possible solution is to drop this check, and modify ib_copy_to_udata so > that it only copies up to ucore->outlen bytes. > Makes sense. Will fix that in V1. > > + > > + if (cmd.comp_mask) > > + return -EINVAL; > > This check may make it difficult for userspace to use this verb. If > running an older kernel with a newer userspace, the userspace will need > to run the verb multiple times to find out which combination of > comp_mask bits is actually supported. I think a better way would be to > drop this check, and let userspace rely on the returned comp_mask in the > ib_uverbs_ex_query_device_resp struct to determine which features are > supported by the current kernel. > Agree - this should hold true for any extended query. Will fix in v1. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html