Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Feb 13, 2024

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 9cfa60d874e9a1da057677619a370409428ea3cf:

verify: fix potential overflow before widen (2024-02-08 17:45:41 -0500)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 097af663e93f86106f32580bfa59e68fae007035:

Merge branch 'vsock' of https://github.com/MPinna/fio (2024-02-12 11:56:33 -0700)

----------------------------------------------------------------
Jens Axboe (1):
Merge branch 'vsock' of https://github.com/MPinna/fio

Marco Pinna (1):
Add support for VSOCK to engine/net.c

 HOWTO.rst                         |   7 +-
 configure                         |  22 +++++++
 engines/net.c                     | 132 +++++++++++++++++++++++++++++++++++++-
 examples/netio_vsock.fio          |  22 +++++++
 examples/netio_vsock_receiver.fio |  14 ++++
 examples/netio_vsock_sender.fio   |  17 +++++
 fio.1                             |   9 ++-
 7 files changed, 217 insertions(+), 6 deletions(-)
 create mode 100644 examples/netio_vsock.fio
 create mode 100644 examples/netio_vsock_receiver.fio
 create mode 100644 examples/netio_vsock_sender.fio

---

Diff of recent changes:

HOWTO.rst +5 -2
index ba160551..53b03021 100644
@@ -2626,10 +2626,13 @@ with the caveat that when used on the command line, they must come after the
 		User datagram protocol V6.
 	**unix**
 		UNIX domain socket.
+	**vsock**
+		VSOCK protocol.
 
-	When the protocol is TCP or UDP, the port must also be given, as well as the
-	hostname if the job is a TCP listener or UDP reader. For unix sockets, the
+	When the protocol is TCP, UDP or VSOCK, the port must also be given, as well as the
+	hostname if the job is a TCP or VSOCK listener or UDP reader. For unix sockets, the
 	normal :option:`filename` option should be used and the port is invalid.
+	When the protocol is VSOCK, the :option:`hostname` is the CID of the remote VM.
 
 .. option:: listen : [netsplice] [net]
 
configure +22 -0
index dea8d07d..becb193e 100755
@@ -1728,6 +1728,25 @@ elif compile_prog "" "-lws2_32" "TCP_NODELAY"; then
 fi
 print_config "TCP_NODELAY" "$tcp_nodelay"
 
+##########################################
+# Check whether we have vsock
+if test "$vsock" != "yes" ; then
+  vsock="no"
+fi
+cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <linux/vm_sockets.h>
+int main(int argc, char **argv)
+{
+  return socket(AF_VSOCK, SOCK_STREAM, 0);
+}
+EOF
+if compile_prog "" "" "vsock"; then
+  vsock="yes"
+fi
+print_config "vsock" "$vsock"
+
 ##########################################
 # Check whether we have SO_SNDBUF
 if test "$window_size" != "yes" ; then
@@ -3192,6 +3211,9 @@ fi
 if test "$ipv6" = "yes" ; then
   output_sym "CONFIG_IPV6"
 fi
+if test "$vsock" = "yes"; then
+  output_sym "CONFIG_VSOCK"
+fi
 if test "$http" = "yes" ; then
   output_sym "CONFIG_HTTP"
 fi
engines/net.c +130 -2

241 lines not on this page · raw message

examples/netio_vsock.fio new file +22 -0
new file mode 100644
index 00000000..8c328f7d
@@ -0,0 +1,22 @@
+# Example network vsock job, just defines two clients that send/recv data
+[global]
+ioengine=net
+
+port=8888
+protocol=vsock
+bs=4k
+size=100g
+
+#set the below option to enable end-to-end data integrity tests
+#verify=md5
+
+[receiver]
+listen
+rw=read
+
+[sender]
+# 1 (VMADDR_CID_LOCAL) is the well-known address
+# for local communication (loopback)
+hostname=1
+startdelay=1
+rw=write
examples/netio_vsock_receiver.fio new file +14 -0
new file mode 100644
index 00000000..e2a00c4d
@@ -0,0 +1,14 @@
+# Example network vsock job, just defines a receiver
+[global]
+ioengine=net
+port=8888
+protocol=vsock
+bs=4k
+size=100g
+
+#set the below option to enable end-to-end data integrity tests
+#verify=md5
+
+[receiver]
+listen
+rw=read
examples/netio_vsock_sender.fio new file +17 -0
new file mode 100644
index 00000000..2451d990
@@ -0,0 +1,17 @@
+# Example network vsock job, just defines a sender
+[global]
+ioengine=net
+port=8888
+protocol=vsock
+bs=4k
+size=100g
+
+#set the below option to enable end-to-end data integrity tests
+#verify=md5
+
+[sender]
+# set the 'hostname' option to the CID of the listening domain
+hostname=3
+startdelay=1
+rw=write
+
fio.1 +7 -2
index aef1dc85..227fcb47 100644
@@ -2376,11 +2376,16 @@ User datagram protocol V6.
 .TP
 .B unix
 UNIX domain socket.
+.TP
+.B vsock
+VSOCK protocol.
 .RE
 .P
-When the protocol is TCP or UDP, the port must also be given, as well as the
-hostname if the job is a TCP listener or UDP reader. For unix sockets, the
+When the protocol is TCP, UDP or VSOCK, the port must also be given, as well as the
+hostname if the job is a TCP or VSOCK listener or UDP reader. For unix sockets, the
 normal \fBfilename\fR option should be used and the port is invalid.
+When the protocol is VSOCK, the \fBhostname\fR is the CID of the remote VM.
+
 .RE
 .TP
 .BI (netsplice,net)listen