summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-08-26 12:04:31 +0000
committerhselasky <hselasky@FreeBSD.org>2016-08-26 12:04:31 +0000
commit97f52eb25d342714fc2336d2ab18039159379fd0 (patch)
tree15dff8bc919a60a4eeae0e28b83ec5851b1317a0
parentf9f7a3e5fc08e0f695494068aafa282cc7e6ea5a (diff)
downloadFreeBSD-src-97f52eb25d342714fc2336d2ab18039159379fd0.zip
FreeBSD-src-97f52eb25d342714fc2336d2ab18039159379fd0.tar.gz
MFC r304342:
Add support for setting blocking and non-blocking mode on /dev/rdma_cm by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags handling is done by the kern_ioctl() function. Reported by: Alex Bowden <alex.bowden@outlook.com> Sponsored by: Mellanox Technologies
-rw-r--r--sys/ofed/drivers/infiniband/core/ucma.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/ofed/drivers/infiniband/core/ucma.c b/sys/ofed/drivers/infiniband/core/ucma.c
index 5f73b40..4000aa2 100644
--- a/sys/ofed/drivers/infiniband/core/ucma.c
+++ b/sys/ofed/drivers/infiniband/core/ucma.c
@@ -42,6 +42,8 @@
#include <linux/slab.h>
#include <linux/module.h>
+#include <sys/filio.h>
+
#include <rdma/rdma_user_cm.h>
#include <rdma/ib_marshall.h>
#include <rdma/rdma_cm.h>
@@ -1345,11 +1347,25 @@ static int ucma_close(struct inode *inode, struct file *filp)
return 0;
}
+static long
+ucma_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+
+ switch (cmd) {
+ case FIONBIO:
+ case FIOASYNC:
+ return (0);
+ default:
+ return (-ENOTTY);
+ }
+}
+
static const struct file_operations ucma_fops = {
.owner = THIS_MODULE,
.open = ucma_open,
.release = ucma_close,
.write = ucma_write,
+ .unlocked_ioctl = ucma_ioctl,
.poll = ucma_poll,
.llseek = no_llseek,
};
OpenPOWER on IntegriCloud