Hi all,
I have been thinking of the submodule suggestion and I have also
prepared a patch for it (attached). However, I am not sure about what we
want to achieve with it. In particular, I am not sure that the option is
useful for end users. The problem is that netmap, unlike capstone and
slirp, is a library plus a kernel module. If netmap is not installed in
the system, the --enable-netmap=git option will successfully build qemu
with netmap support, but then -netdev netmap will fail at runtime. On
the other end, if netmap is installed in the system, using the =git
option may cause qemu to be built against a different, possibly
incompatible version.
If the option is only useful for developers to check that some qemu
change does not break anything, then probably it should be enabled in
some other, less visible way. What do you think?
Cheers,
Giuseppe
On 8/12/19 2:32 PM, Philippe Mathieu-Daudé wrote:
On 8/8/19 1:52 PM, Markus Armbruster wrote:
Giuseppe Lettieri <giuseppe.letti...@unipi.it> writes:
Dear Markus,
the netmap project is alive and well, if a bit understuffed. We have
moved to github:
https://github.com/luigirizzo/netmap
We have users from FreeBSD, where it is part of the official kernel,
and Linux, both from Academia and industry.
But you asked about the netmap backend in QEMU, in particular. When it
was merged, the decision was made to disable it by default because it
was not supported upstream in Linux. As Jason Wang says, this support
is even more unlikely now than it was then.
The fact the the backend has to be explicitly enabled and built from
the sources has obviously cut down the number of potential
users. However, we still think it is useful and we have pending
updates for it. If it's causing problems in the workflow, I am willing
to help as much as I can.
Could we make it a submodule, simililar to slirp and capstone?
Good idea, this would extend the coverage. Netmap users/developers are
probably best suited to do this.
--enable-netmap=system use the system's netmap
--enable-netmap=git use the git submodule
--enable-netmap use system's, else git, else fail
--disable-netmap disable netmap
default use system's, else git, else disable
A fresh clone of https://github.com/luigirizzo/netmap clocks in at
14MiB, which is between libslirp's 1.5MiB and capstone's 72MiB.
In which directory should we clone it? As /netmap directly?
Should we start using a 3rd-party/ subdirectory?
Similarly, what about the virglrenderer component?
Its repository is: https://anongit.freedesktop.org/git/virglrenderer.git
>From ddec3b9e4e1e6e8da44d0d7eec643db7b82b2b81 Mon Sep 17 00:00:00 2001
From: Giuseppe Lettieri <g.letti...@iet.unipi.it>
Date: Mon, 2 Sep 2019 17:35:33 +0200
Subject: [PATCH] netmap: support git-submodule build otption
With this patch, netmap support can be enabled with
the following options to the configure script:
--enable-netmap=system
Use the host system netmap installation.
Fail if not found.
--enable-netmap=git
clone the official netmap repository on
github
--enable-netmap
try system and then git.
---
.gitmodules | 3 +++
configure | 68 ++++++++++++++++++++++++++++++++++++++++++++---------
netmap | 1 +
3 files changed, 61 insertions(+), 11 deletions(-)
create mode 160000 netmap
diff --git a/.gitmodules b/.gitmodules
index c5c474169d..bf75dbc5e3 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -58,3 +58,6 @@
[submodule "roms/opensbi"]
path = roms/opensbi
url = https://git.qemu.org/git/opensbi.git
+[submodule "netmap"]
+ path = netmap
+ url = https://github.com/luigirizzo/netmap.git
diff --git a/configure b/configure
index e44e454c43..560f357967 100755
--- a/configure
+++ b/configure
@@ -1155,6 +1155,10 @@ for opt do
;;
--enable-netmap) netmap="yes"
;;
+ --enable-netmap=git) netmap="git"
+ ;;
+ --enable-netmap=system) netmap="system"
+ ;;
--disable-xen) xen="no"
;;
--enable-xen) xen="yes"
@@ -3351,8 +3355,9 @@ fi
# a minor/major version number. Minor new features will be marked with values up
# to 15, and if something happens that requires a change to the backend we will
# move above 15, submit the backend fixes and modify this two bounds.
-if test "$netmap" != "no" ; then
- cat > $TMPC << EOF
+case "$netmap" in
+ "" | yes | system)
+ cat > $TMPC << EOF
#include <inttypes.h>
#include <net/if.h>
#include <net/netmap.h>
@@ -3362,15 +3367,56 @@ if test "$netmap" != "no" ; then
#endif
int main(void) { return 0; }
EOF
- if compile_prog "" "" ; then
- netmap=yes
- else
- if test "$netmap" = "yes" ; then
- feature_not_found "netmap"
+ if compile_prog "" "" ; then
+ netmap_system=yes
+ else
+ netmap_system=no
+ fi
+ ;;
+esac
+
+case "$netmap" in
+ "" | yes)
+ if test "$netmap_system" = "yes"; then
+ netmap=system
+ elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
+ netmap=git
+ elif test -e "${source_path}/netmap/configure" ; then
+ netmap=internal
+ elif test -z "$netmap" ; then
+ netmap=no
+ else
+ feature_not_found "netmap" "Install netmap or git submodule"
fi
- netmap=no
- fi
-fi
+ ;;
+
+ system)
+ if test "$netmap_system" = "no"; then
+ feature_not_found "netmap" "Install netmap"
+ fi
+ ;;
+esac
+
+case "$netmap" in
+ git | internal)
+ if test "$netmap" = git; then
+ git_submodules="${git_submodules} netmap"
+ fi
+ mkdir -p netmap
+ QEMU_CFLAGS="$QEMU_CFLAGS -I\$(SRC_PATH)/netmap/sys"
+ ;;
+
+ system)
+ ;;
+
+ no)
+ ;;
+ *)
+ error_exit "Unknown state for netmap: $netmap"
+ ;;
+esac
+
+##########################################
##########################################
# libcap-ng library probe
@@ -6630,7 +6676,7 @@ if test "$vde" = "yes" ; then
echo "CONFIG_VDE=y" >> $config_host_mak
echo "VDE_LIBS=$vde_libs" >> $config_host_mak
fi
-if test "$netmap" = "yes" ; then
+if test "$netmap" != "no" ; then
echo "CONFIG_NETMAP=y" >> $config_host_mak
fi
if test "$l2tpv3" = "yes" ; then
diff --git a/netmap b/netmap
new file mode 160000
index 0000000000..137f537eae
--- /dev/null
+++ b/netmap
@@ -0,0 +1 @@
+Subproject commit 137f537eae513f02d5d6871d1f91c049e6345803
--
2.20.1