Re: [PATCH rdma-core 2/2] mlx5: Allow creation of a Multi-Packet RQ using direct verbs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/21/2017 8:05 AM, Leon Romanovsky wrote:
On Mon, Nov 20, 2017 at 12:04:34PM -0700, Jason Gunthorpe wrote:
On Sun, Nov 19, 2017 at 09:21:08PM +0200, Yishai Hadas wrote:
+	if (mlx5wq_attr) {
+		if (mlx5wq_attr->comp_mask & ~(MLX5DV_WQ_INIT_ATTR_MASK_RESERVED - 1))
+			return -EINVAL;

Please no. Check that only the bits this function actually supports
are set and get rid of _RESERVED.

It is classical API mistake do not properly check validity of input parameters [1].


Each new bit that is added in the DV API is supported by the mlx5 driver that was compiled with, so there is no validity issue here when checking with the _RESERVED value. A case might be when a verb API exposes bits that might not be supported by a specific driver.

However, I'm fine with having some internal supported mask and drop the RESERVED_ as applications don't really need to see it, will have V1 with that change.
--
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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux