aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep Dutt <sudeep.dutt@intel.com>2015-04-29 08:32:28 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 15:13:36 -0400
commit7df20f2d893db42eaa1ea1e30a2573c971ec9238 (patch)
tree372f796f0c48006754facac07edda9ea390b88c7
parent0d09f1a54d9710548c9af72dc1564c8291a5307c (diff)
misc: mic: SCIF header file and IOCTL interface
This patch introduces the SCIF documentation in the header file and describes the IOCTL interface for user mode. mic_overview.txt is updated with documentation on SCIF and a new document describing SCIF in more details is available in scif_overview.txt. Reviewed-by: Nikhil Rao <nikhil.rao@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--Documentation/mic/mic_overview.txt28
-rw-r--r--Documentation/mic/scif_overview.txt98
-rw-r--r--include/linux/scif.h993
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/scif_ioctl.h130
5 files changed, 1238 insertions, 12 deletions
</
diff --git a/Documentation/mic/mic_overview.txt b/Documentation/mic/mic_overview.txt
index 77c541802ad9..1a2f2c8ec59e 100644
--- a/Documentation/mic/mic_overview.txt
+++ b/Documentation/mic/mic_overview.txt
@@ -24,6 +24,10 @@ a virtual bus called mic bus is created and virtual dma devices are
24created on it by the host/card drivers. On host the channels are private 24created on it by the host/card drivers. On host the channels are private
25and used only by the host driver to transfer data for the virtio devices. 25and used only by the host driver to transfer data for the virtio devices.
26 26
27The Symmetric Communication Interface (SCIF (pronounced as skiff)) is a
28low level communications API across PCIe currently implemented for MIC.
29More details are available at scif_overview.txt.
30
27Here is a block diagram of the various components described above. The 31Here is a block diagram of the various components described above. The
28virtio backends are situated on the host rather than the card given better 32virtio backends are situated on the host rather than the card given better
29single threaded performance for the host compared to MIC, the ability of 33single threaded performance for the host compared to MIC, the ability of
@@ -47,18 +51,18 @@ the fact that the virtio block storage backend can only be on the host.
47 | | | Virtio over PCIe IOCTLs | 51 | | | Virtio over PCIe IOCTLs |
48 | | +--------------------------+ 52 | | +--------------------------+
49+-----------+ | | | +-----------+ 53+-----------+ | | | +-----------+
50| MIC DMA | | | | | MIC DMA | 54| MIC DMA | | +----------+ | +-----------+ | | MIC DMA |
51| Driver | | | | | Driver | 55| Driver | | | SCIF | | | SCIF | | | Driver |
52+-----------+ | | | +-----------+ 56+-----------+ | +----------+ | +-----------+ | +-----------+
53 | | | | | 57 | | | | | | |
54+---------------+ | | | +----------------+ 58+---------------+ | +-----+-----+ | +-----+-----+ | +---------------+
55|MIC virtual Bus| | | | |MIC virtual Bus | 59|MIC virtual Bus| | |SCIF HW Bus| | |SCIF HW BUS| | |MIC virtual Bus|
56+---------------+ | | | +----------------+ 60+---------------+ | +-----------+ | +-----+-----+ | +---------------+
57 | | | | | 61 | | | | | | |
58 | +--------------+ | +---------------+ | 62 | +--------------+ | | | +---------------+ |
59 | |Intel MIC | | |Intel MIC | | 63 | |Intel MIC | | | | |Intel MIC | |
60 +---|Card Driver | | |Host Driver | | 64 +---|Card Driver +----+ | | |Host Driver | |
61 +--------------+ | +---------------+-----+ 65 +--------------+ | +----+---------------+-----+
62 | | | 66 | | |
63 +-------------------------------------------------------------+ 67 +-------------------------------------------------------------+
64 | | 68 | |
diff --git a/Documentation/mic/scif_overview.txt b/Documentation/mic/scif_overview.txt
new file mode 100644
index 000000000000..0a280d986731
--- /dev/null
+++ b/Documentation/mic/scif_overview.txt
@@ -0,0 +1,98 @@
1The Symmetric Communication Interface (SCIF (pronounced as skiff)) is a low
2level communications API across PCIe currently implemented for MIC. Currently
3SCIF provides inter-node communication within a single host platform, where a
4node is a MIC Coprocessor or Xeon based host. SCIF abstracts the details of
5communicating over the PCIe bus while providing an API that is symmetric
6across all the nodes in the PCIe network. An important design objective for SCIF
7is to deliver the maximum possible performance given the communication
8abilities of the hardware. SCIF has been used to implement an offload compiler
9runtime and OFED support for MPI implementations for MIC coprocessors.
10
11==== SCIF API Components ====
12The SCIF API has the following parts:
131. Connection establishment using a client server model
142. Byte stream messaging intended for short messages
153. Node enumeration to determine online nodes
164. Poll semantics for detection of incoming connections and messages
175. Memory registration to pin down pages
186. Remote memory mapping for low latency CPU accesses via mmap
197. Remote DMA (RDMA) for high bandwidth DMA transfers
208. Fence APIs for RDMA synchronization
21
22SCIF exposes the notion of a connection which can be used by peer processes on
23nodes in a SCIF PCIe "network" to share memory "windows" and to communicate. A
24process in a SCIF node initiates a SCIF connection to a peer process on a
25different node via a SCIF "endpoint". SCIF endpoints support messaging APIs
26which are similar to connection oriented socket APIs. Connected SCIF endpoints
27can also register local memory which is followed by data transfer using either
28DMA, CPU copies or remote memory mapping via mmap. SCIF supports both user and
29kernel mode clients which are functionally equivalent.
30
31==== SCIF Performance for MIC ====
32DMA bandwidth comparison between the TCP (over ethernet over PCIe) stack versus
33SCIF shows the performance advantages of SCIF for HPC applications and runtimes.
34
35 Comparison of TCP and SCIF based BW
36
37 Throughput (GB/sec)
38 8 + PCIe Bandwidth ******
39 + TCP ######
40 7 + ************************************** SCIF %%%%%%
41 | %%%%%%%%%%%%%%%%%%%
42 6 + %%%%
43 | %%
44 | %%%
45 5 + %%
46 | %%
47 4 + %%
48 | %%
49 3 + %%
50 | %
51 2 + %%
52 | %%
53 | %
54 1 +
55 + ######################################
56 0 +++---+++--+--+-+--+--+-++-+--+-++-+--+-++-+-
57 1 10 100 1000 10000 100000
58 Transfer Size (KBytes)
59
60SCIF allows memory sharing via mmap(..) between processes on different PCIe
61nodes and thus provides bare-metal PCIe latency. The round trip SCIF mmap
62latency from the host to an x100 MIC for an 8 byte message is 0.44 usecs.
63
64SCIF has a user space library which is a thin IOCTL wrapper providing a user
65space API similar to the kernel API in scif.h. The SCIF user space library
66is distributed @ https://software.intel.com/en-us/mic-developer
67
68Here is some pseudo code for an example of how two applications on two PCIe
69nodes would typically use the SCIF API:
70
71Process A (on node A) Process B (on node B)
72
73/* get online node information */
74scif_get_node_ids(..) scif_get_node_ids(..)
75scif_open(..) scif_open(..)
76scif_bind(..) scif_bind(..)
77scif_listen(..)
78scif_accept(..) scif_connect(..)
79/* SCIF connection established */
80
81/* Send and receive short messages */
82scif_send(..)/scif_recv(..) scif_send(..)/scif_recv(..)
83
84/* Register memory */
85scif_register(..) scif_register(..)
86
87/* RDMA */
88scif_readfrom(..)/scif_writeto(..) scif_readfrom(..)/scif_writeto(..)
89
90/* Fence DMAs */
91scif_fence_signal(..) scif_fence_signal(..)
92
93mmap(..) mmap(..)
94
95/* Access remote registered memory */
96
97/* Close the endpoints */
98scif_close(..) scif_close(..)
diff --git a/include/linux/scif.h b/include/linux/scif.h
new file mode 100644
index 000000000000..44f4f3898bbe
--- /dev/null
+++ b/include/linux/scif.h
@@ -0,0 +1,993 @@
1/*
2 * Intel MIC Platform Software Stack (MPSS)
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *
9 * Copyright(c) 2014 Intel Corporation.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * BSD LICENSE
21 *
22 * Copyright(c) 2014 Intel Corporation.
23 *
24 * Redistribution and use in source and binary forms, with or without
25 * modification, are permitted provided that the following conditions
26 * are met:
27 *
28 * * Redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer.
30 * * Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in
32 * the documentation and/or other materials provided with the
33 * distribution.
34 * * Neither the name of Intel Corporation nor the names of its
35 * contributors may be used to endorse or promote products derived
36 * from this software without specific prior written permission.
37 *
38 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT