Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ede73bc authored by Matan Barak's avatar Matan Barak Committed by Jason Gunthorpe
Browse files

IB/uverbs: Extend uverbs_ioctl header with driver_id



Extending uverbs_ioctl header with driver_id and another reserved
field. driver_id should be used in order to identify the driver.
Since every driver could have its own parsing tree, this is necessary
for strace support.
Downstream patches take off the EXPERIMENTAL flag from the ioctl() IB
support and thus we add some reserved fields for future usage.

Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 1f7ff9d5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -246,6 +246,9 @@ static long ib_uverbs_cmd_verbs(struct ib_device *ib_dev,
	size_t ctx_size;
	uintptr_t data[UVERBS_OPTIMIZE_USING_STACK_SZ / sizeof(uintptr_t)];

	if (hdr->driver_id != ib_dev->driver_id)
		return -EINVAL;

	object_spec = uverbs_get_object(ib_dev, hdr->object_id);
	if (!object_spec)
		return -EPROTONOSUPPORT;
@@ -350,7 +353,7 @@ long ib_uverbs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
			goto out;
		}

		if (hdr.reserved) {
		if (hdr.reserved1 || hdr.reserved2) {
			err = -EPROTONOSUPPORT;
			goto out;
		}
+1 −0
Original line number Diff line number Diff line
@@ -619,6 +619,7 @@ static int bnxt_re_register_ib(struct bnxt_re_dev *rdev)
	ibdev->get_hw_stats             = bnxt_re_ib_get_hw_stats;
	ibdev->alloc_hw_stats           = bnxt_re_ib_alloc_hw_stats;

	ibdev->driver_id = RDMA_DRIVER_BNXT_RE;
	return ib_register_device(ibdev, NULL);
}

+1 −0
Original line number Diff line number Diff line
@@ -1439,6 +1439,7 @@ int iwch_register_device(struct iwch_dev *dev)
	memcpy(dev->ibdev.iwcm->ifname, dev->rdev.t3cdev_p->lldev->name,
	       sizeof(dev->ibdev.iwcm->ifname));

	dev->ibdev.driver_id = RDMA_DRIVER_CXGB3;
	ret = ib_register_device(&dev->ibdev, NULL);
	if (ret)
		goto bail1;
+1 −0
Original line number Diff line number Diff line
@@ -629,6 +629,7 @@ void c4iw_register_device(struct work_struct *work)
	memcpy(dev->ibdev.iwcm->ifname, dev->rdev.lldi.ports[0]->name,
	       sizeof(dev->ibdev.iwcm->ifname));

	dev->ibdev.driver_id = RDMA_DRIVER_CXGB4;
	ret = ib_register_device(&dev->ibdev, NULL);
	if (ret)
		goto err_kfree_iwcm;
+1 −1
Original line number Diff line number Diff line
@@ -1960,7 +1960,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
			      i,
			      ppd->pkeys);

	ret = rvt_register_device(&dd->verbs_dev.rdi);
	ret = rvt_register_device(&dd->verbs_dev.rdi, RDMA_DRIVER_HFI1);
	if (ret)
		goto err_verbs_txreq;

Loading