aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/mic_ioctl.h
diff options
context:
space:
mode:
authorAshutosh Dixit <ashutosh.dixit@intel.com>2013-09-05 19:42:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 16:50:56 -0400
commitf69bcbf3b4c4b333dcd7a48eaf868bf0c88edab5 (patch)
tree82edf895c9db652788945faafb8d4301f79cb5f8 /include/uapi/linux/mic_ioctl.h
parentaa27badd8972adb731f05d49ab74ec63e0826935 (diff)
Intel MIC Host Driver Changes for Virtio Devices.
This patch introduces the host "Virtio over PCIe" interface for Intel MIC. It allows creating user space backends on the host and instantiating virtio devices for them on the Intel MIC card. It uses the existing VRINGH infrastructure in the kernel to access virtio rings from the host. A character device per MIC is exposed with IOCTL, mmap and poll callbacks. This allows the user space backend to: (a) add/remove a virtio device via a device page. (b) map (R/O) virtio rings and device page to user space. (c) poll for availability of data. (d) copy a descriptor or entire descriptor chain to/from the card. (e) modify virtio configuration. (f) handle virtio device reset. The buffers are copied over using CPU copies for this initial patch and host initiated MIC DMA support is planned for future patches. The avail and desc virtio rings are in host memory and the used ring is in card memory to maximize writes across PCIe for performance. Co-author: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Caz Yokoyama <Caz.Yokoyama@intel.com> Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Harshavardhan R Kharche <harshavardhan.r.kharche@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Acked-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/mic_ioctl.h')
-rw-r--r--include/uapi/linux/mic_ioctl.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/include/uapi/linux/mic_ioctl.h b/include/uapi/linux/mic_ioctl.h
new file mode 100644
index 000000000000..0e6cbf3e5292
--- /dev/null
+++ b/include/uapi/linux/mic_ioctl.h
@@ -0,0 +1,74 @@
1/*
2 * Intel MIC Platform Software Stack (MPSS)
3 *
4 * Copyright(c) 2013 Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * The full GNU General Public License is included in this distribution in
16 * the file called "COPYING".
17 *
18 * Intel MIC Host driver.
19 *
20 */
21#ifndef _MIC_IOCTL_H_
22#define _MIC_IOCTL_H_
23
24/*
25 * mic_copy - MIC virtio descriptor copy.
26 *
27 * @iov: An array of IOVEC structures containing user space buffers.
28 * @iovcnt: Number of IOVEC structures in iov.
29 * @vr_idx: The vring index.
30 * @update_used: A non zero value results in used index being updated.
31 * @out_len: The aggregate of the total length written to or read from
32 * the virtio device.
33 */
34struct mic_copy_desc {
35#ifdef __KERNEL__
36 struct iovec __user *iov;
37#else
38 struct iovec *iov;
39#endif
40 int iovcnt;
41 __u8 vr_idx;
42 __u8 update_used;
43 __u32 out_len;
44};
45
46/*
47 * Add a new virtio device
48 * The (struct mic_device_desc *) pointer points to a device page entry
49 * for the virtio device consisting of:
50 * - struct mic_device_desc
51 * - struct mic_vqconfig (num_vq of these)
52 * - host and guest features
53 * - virtio device config space
54 * The total size referenced by the pointer should equal the size returned
55 * by desc_size() in mic_common.h
56 */
57#define MIC_VIRTIO_ADD_DEVICE _IOWR('s', 1, struct mic_device_desc *)
58
59/*
60 * Copy the number of entries in the iovec and update the used index
61 * if requested by the user.
62 */
63#define MIC_VIRTIO_COPY_DESC _IOWR('s', 2, struct mic_copy_desc *)
64
65/*
66 * Notify virtio device of a config change
67 * The (__u8 *) pointer points to config space values for the device
68 * as they should be written into the device page. The total size
69 * referenced by the pointer should equal the config_len field of struct
70 * mic_device_desc.
71 */
72#define MIC_VIRTIO_CONFIG_CHANGE _IOWR('s', 5, __u8 *)
73
74#endif