From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: sudeep.dutt@intel.com, ashutosh.dixit@intel.com,
gregkh@linuxfoundation.org, arnd@arndb.de
Cc: linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
Vincent Whitchurch <rabinv@axis.com>
Subject: [PATCH v2 char-misc-next 7/7] samples: mic: Add sample VOP userspace
Date: Fri, 22 Feb 2019 16:30:56 +0100 [thread overview]
Message-ID: <20190222153056.18878-11-vincent.whitchurch@axis.com> (raw)
In-Reply-To: <20190222153056.18878-1-vincent.whitchurch@axis.com>
Add a sample userspace program which can be used with the VOP framework
with vop-loopback and non-MIC hardware.
For example, the following commands can be used to test networking over
vop-loopback. (IPv6 is used with zone indices to force traffic through
the interfaces instead of short-circuit delivery, since both interfaces
are on the same system.)
# modprobe vop_loopback
# ./vopd &
Setup host interface:
# ip a a dev mic0 scope link fe80::0
# ip link set dev mic0 up
Setup guest interface:
# ip a a dev eth1 scope link fe80::1
# ip link set dev eth1 up
Ping from host to guest:
# ping6 fe80::1%mic0
Ping from guest to host:
# ping6 fe80::0%eth1
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
---
samples/mic/mpssd/.gitignore | 1 +
samples/mic/mpssd/Makefile | 5 ++++-
samples/mic/mpssd/vopd.c | 25 +++++++++++++++++++++++++
3 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 samples/mic/mpssd/vopd.c
diff --git a/samples/mic/mpssd/.gitignore b/samples/mic/mpssd/.gitignore
index 8b7c72f07c92..34c001135abb 100644
--- a/samples/mic/mpssd/.gitignore
+++ b/samples/mic/mpssd/.gitignore
@@ -1 +1,2 @@
mpssd
+vopd
diff --git a/samples/mic/mpssd/Makefile b/samples/mic/mpssd/Makefile
index bc94054dbe2b..b94b18de5a43 100644
--- a/samples/mic/mpssd/Makefile
+++ b/samples/mic/mpssd/Makefile
@@ -5,7 +5,7 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
ifeq ($(ARCH),x86)
-PROGS := mpssd
+PROGS := mpssd vopd
CC = $(CROSS_COMPILE)gcc
CFLAGS := -I../../../usr/include -I../../../tools/include
@@ -17,6 +17,9 @@ all: $(PROGS)
mpssd: mpssd.c sysfs.c vop.o
$(CC) $(CFLAGS) $^ -o $@ -lpthread
+vopd: vopd.c vop.o
+ $(CC) $(CFLAGS) $^ -o $@ -lpthread
+
install:
install mpssd /usr/sbin/mpssd
install micctrl /usr/sbin/micctrl
diff --git a/samples/mic/mpssd/vopd.c b/samples/mic/mpssd/vopd.c
new file mode 100644
index 000000000000..48c1877fed28
--- /dev/null
+++ b/samples/mic/mpssd/vopd.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <stdio.h>
+
+#include "mpssd.h"
+
+void mpsslog(char *format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+ vprintf(format, args);
+ va_end(args);
+}
+
+int main(int argc, char *argv[])
+{
+ struct mic_info themic = {
+ .name = "mic",
+ };
+
+ serve_virtio(&themic, &themic);
+
+ return 0;
+}
--
2.20.0
prev parent reply other threads:[~2019-02-22 15:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 15:30 [PATCH v2 char-misc-next 0/7] Virtio-over-PCIe on non-MIC Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 1/7] mic: vop: Cast pointers to unsigned long Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 1/7] " Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 2/7] mic: Rename ioremap pointer to remap Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 3/7] mic: vop: Allow building on more systems Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 3/7] " Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 4/7] mic: vop: Add loopback driver Vincent Whitchurch
2019-02-26 11:56 ` Greg KH
2019-02-22 15:30 ` [PATCH v2 char-misc-next 4/7] " Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 5/7] mic: vop: Fix init race with shared interrupts Vincent Whitchurch
2019-02-22 15:30 ` [PATCH v2 char-misc-next 6/7] samples: mic: Split out vop code from mpssd Vincent Whitchurch
2019-02-22 15:30 ` Vincent Whitchurch [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190222153056.18878-11-vincent.whitchurch@axis.com \
--to=vincent.whitchurch@axis.com \
--cc=arnd@arndb.de \
--cc=ashutosh.dixit@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rabinv@axis.com \
--cc=sudeep.dutt@intel.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).