Skip to contentSkip to conversation

net: Disable netmap backend when not supported

PATCH Applied Vincenzo Maffione 2 participants 4 messages Feb 20, 2014 – Feb 25, 2014 Networking

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: Disable netmap backend when not supported

This patch fixes configure so that the netmap backend is not compiled in if the host doesn't support an API version >= 11. A version upper bound (15) has been added so that the netmap API can be extended with some minor features without requiring QEMU code modifications.

Moreover, some changes have been done to net/netmap.c in order to reflect the current netmap API/ABI (11).

The NETMAP_WITH_LIBS macro makes possible to include some utilities (e.g. netmap ring macros, D(), RD() and other high level functions) through the netmap headers. In this way we get rid of the D and RD macro definitions in the QEMU code, and we open the way for further code simplifications that will be introduced by future patches.

---
Note: This patch is against the net-next/net Stefan's branch.

Changes against the previous version:
(1) more complete commit description
(2) add comment in ./configure to explain version checks

 configure    | 10 +++++++++-
 net/netmap.c | 55 +++++++++++++------------------------------------------
 2 files changed, 22 insertions(+), 43 deletions(-)
configure +9 -1
index 4648117..e399b3e 100755
@@ -2118,13 +2118,21 @@ EOF
 fi
 
 ##########################################
-# netmap headers probe
+# netmap support probe
+# Apart from looking for netmap headers, we make sure that the host API version
+# supports the netmap backend (>=11). The upper bound (15) is meant to simulate
+# 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
 #include <inttypes.h>
 #include <net/if.h>
 #include <net/netmap.h>
 #include <net/netmap_user.h>
+#if (NETMAP_API < 11) || (NETMAP_API > 15)
+#error
+#endif
 int main(void) { return 0; }
 EOF
   if compile_prog "" "" ; then
net/netmap.c +13 -42

123 lines not on this page · raw message

Signature · 1 line
1.9.0
#1 lore raw
Quoted 18 lines · Vincenzo Maffione

This patch fixes configure so that the netmap backend is not compiled in if the host doesn't support an API version >= 11. A version upper bound (15) has been added so that the netmap API can be extended with some minor features without requiring QEMU code modifications.

Moreover, some changes have been done to net/netmap.c in order to reflect the current netmap API/ABI (11).

The NETMAP_WITH_LIBS macro makes possible to include some utilities (e.g. netmap ring macros, D(), RD() and other high level functions) through the netmap headers. In this way we get rid of the D and RD macro definitions in the QEMU code, and we open the way for further code simplifications that will be introduced by future patches.

---
Note: This patch is against the net-next/net Stefan's branch.

Quoted 7 lines

Changes against the previous version:
(1) more complete commit description
(2) add comment in ./configure to explain version checks

 configure    | 10 +++++++++-
 net/netmap.c | 55 +++++++++++++------------------------------------------
 2 files changed, 22 insertions(+), 43 deletions(-)

Thanks for adding the explanations, it will make it easier for people reading the code to understand this change in the future.

Applied to my net tree:
https://github.com/stefanha/qemu/commits/net

Stefan

#2 lore raw

Hi,
I cannot see it in your net tree.

Thanks,
Vincenzo

2014-02-21 11:05 GMT+01:00 Stefan Hajnoczi <[email protected]>:

Quoted 42 lines · Vincenzo Maffione
Quoted 1 line

This patch fixes configure so that the netmap backend is not compiled in

if the

Quoted 1 line

host doesn't support an API version >= 11. A version upper bound (15)

has been

Quoted 1 line

added so that the netmap API can be extended with some minor features

without

Quoted 3 lines

requiring QEMU code modifications.

Moreover, some changes have been done to net/netmap.c in order to

reflect the

Quoted 4 lines

current netmap API/ABI (11).

The NETMAP_WITH_LIBS macro makes possible to include some utilities (e.g. netmap ring macros, D(), RD() and other high level functions) through

the netmap

Quoted 1 line

headers. In this way we get rid of the D and RD macro definitions in the

QEMU

Quoted 7 lines

code, and we open the way for further code simplifications that will be introduced by future patches.

---
Note: This patch is against the net-next/net Stefan's branch.

Quoted 6 lines

Changes against the previous version:
(1) more complete commit description
(2) add comment in ./configure to explain version checks

 configure    | 10 +++++++++-
 net/netmap.c | 55

+++++++++++++------------------------------------------

Quoted 1 line
 2 files changed, 22 insertions(+), 43 deletions(-)

Thanks for adding the explanations, it will make it easier for people reading the code to understand this change in the future.

Applied to my net tree:
https://github.com/stefanha/qemu/commits/net

Stefan

Signature · 1 line
Vincenzo Maffione
#3 lore raw
Quoted 1 line · Vincenzo Maffione

I cannot see it in your net tree.

It's there now. Sorry, I sometimes forget to push to my public repo.

Stefan