Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1239173 > unrolled thread
| Started by | Vlad Zolotarov <vladz@cloudius-systems.com> |
|---|---|
| First post | 2015-10-04 19:40 +0200 |
| Last post | 2015-10-04 19:40 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v2 0/3] uio: add MSI/MSI-X support to uio_pci_generic driver Vlad Zolotarov <vladz@cloudius-systems.com> - 2015-10-04 19:40 +0200
[PATCH v2 1/3] uio: add ioctl support Vlad Zolotarov <vladz@cloudius-systems.com> - 2015-10-04 19:40 +0200
| From | Vlad Zolotarov <vladz@cloudius-systems.com> |
|---|---|
| Date | 2015-10-04 19:40 +0200 |
| Subject | [PATCH v2 0/3] uio: add MSI/MSI-X support to uio_pci_generic driver |
| Message-ID | <qfVqp-772-7@gated-at.bofh.it> |
This series add support for MSI and MSI-X interrupts to uio_pci_generic driver. Currently uio_pci_generic supports only legacy INT#x interrupts source. However there are situations when this is not enough, for instance SR-IOV VF devices that simply don't have INT#x capability. For such devices uio_pci_generic will simply fail (more specifically probe() will fail). When IOMMU is either not available (e.g. Amazon EC2) or not acceptable due to performance overhead and thus VFIO is not an option users that develop user-space drivers are left without any option but to develop some proprietary UIO drivers (e.g. igb_uio driver in Intel's DPDK) just to be able to use UIO infrastructure. This series provides a generic solution for this problem while preserving the original behaviour for devices for which the original uio_pci_generic had worked before (i.e. INT#x will be used by default). New in v2: - Added #include <linux/uaccess.h> to uio_pci_generic.c Vlad Zolotarov (3): uio: add ioctl support uio_pci_generic: add MSI/MSI-X support Documentation: update uio-howto Documentation/DocBook/uio-howto.tmpl | 29 ++- drivers/uio/uio.c | 15 ++ drivers/uio/uio_pci_generic.c | 410 +++++++++++++++++++++++++++++++++-- include/linux/uio_driver.h | 3 + include/linux/uio_pci_generic.h | 36 +++ 5 files changed, 467 insertions(+), 26 deletions(-) create mode 100644 include/linux/uio_pci_generic.h -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Vlad Zolotarov <vladz@cloudius-systems.com> |
|---|---|
| Date | 2015-10-04 19:40 +0200 |
| Subject | [PATCH v2 1/3] uio: add ioctl support |
| Message-ID | <qfVqq-772-29@gated-at.bofh.it> |
| In reply to | #1239173 |
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
---
drivers/uio/uio.c | 15 +++++++++++++++
include/linux/uio_driver.h | 3 +++
2 files changed, 18 insertions(+)
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 8196581..714b0e5 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -704,6 +704,20 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
}
}
+static long uio_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
+{
+ struct uio_listener *listener = filep->private_data;
+ struct uio_device *idev = listener->dev;
+
+ if (!idev->info)
+ return -EIO;
+
+ if (!idev->info->ioctl)
+ return -ENOTTY;
+
+ return idev->info->ioctl(idev->info, cmd, arg);
+}
+
static const struct file_operations uio_fops = {
.owner = THIS_MODULE,
.open = uio_open,
@@ -712,6 +726,7 @@ static const struct file_operations uio_fops = {
.write = uio_write,
.mmap = uio_mmap,
.poll = uio_poll,
+ .unlocked_ioctl = uio_ioctl,
.fasync = uio_fasync,
.llseek = noop_llseek,
};
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 32c0e83..10d7833 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -89,6 +89,7 @@ struct uio_device {
* @mmap: mmap operation for this uio device
* @open: open operation for this uio device
* @release: release operation for this uio device
+ * @ioctl: ioctl handler
* @irqcontrol: disable/enable irqs when 0/1 is written to /dev/uioX
*/
struct uio_info {
@@ -105,6 +106,8 @@ struct uio_info {
int (*open)(struct uio_info *info, struct inode *inode);
int (*release)(struct uio_info *info, struct inode *inode);
int (*irqcontrol)(struct uio_info *info, s32 irq_on);
+ int (*ioctl)(struct uio_info *info, unsigned int cmd,
+ unsigned long arg);
};
extern int __must_check
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web