Skip to contentSkip to conversation

net: Adding netmap network backend

Qemu-devel Michael Tokarev 4 participants 7 messages Feb 12, 2014 – Feb 14, 2014

lore
Share & tools
lore
#0 lore raw

After this patch, qemu fails to build on freebsd with the following error message:

net/netmap.c: In function 'netmap_receive_iov':
net/netmap.c:307: error: 'NS_MOREFRAG' undeclared (first use in this function) net/netmap.c:307: error: (Each undeclared identifier is reported only once net/netmap.c:307: error: for each function it appears in.) net/netmap.c: In function 'netmap_send':
net/netmap.c:356: error: 'NS_MOREFRAG' undeclared (first use in this function)
gmake: *** [net/netmap.o] Error 1

I didn't enable netmap support by default, configure enabled it automatically.

Freebsd has /usr/include/net/netmap.h and netmap_user.h out of the box. I've no idea what is inside and how compatible it is with whatever qemu expects.

I had to explicitly use --disable-netmap for qemu to build on freebsd.

This is FreeBSD 9.1-RELEASE, FWIW.

Thanks,

/mjt

#1 lore raw
Quoted 14 lines · Michael Tokarev

After this patch, qemu fails to build on freebsd with the following error message:

net/netmap.c: In function 'netmap_receive_iov':
net/netmap.c:307: error: 'NS_MOREFRAG' undeclared (first use in this function) net/netmap.c:307: error: (Each undeclared identifier is reported only once net/netmap.c:307: error: for each function it appears in.) net/netmap.c: In function 'netmap_send':
net/netmap.c:356: error: 'NS_MOREFRAG' undeclared (first use in this function)
gmake: *** [net/netmap.o] Error 1

I didn't enable netmap support by default, configure enabled it automatically.

Quoted 7 lines

Freebsd has /usr/include/net/netmap.h and netmap_user.h out of the box. I've no idea what is inside and how compatible it is with whatever qemu expects.

I had to explicitly use --disable-netmap for qemu to build on freebsd.

This is FreeBSD 9.1-RELEASE, FWIW.

Vincenzo: Do you need to add a ./configure check so NS_MOREFRAG is only used when the host kernel supports it?

#2 lore raw

Yes, for sure we need to do a check.

However, this would involve - I think - some non-trivial modifications to net/netmap.c, because without NS_MOREFRAG you cannot split a packet over more "netmap slots/descriptors" (both tx and rx side)

Therefore I would ask (manly Luigi, since netmap is in-tree in FreeBSD):
Wouldn't it be better to force --disable-netmap when we realize that NETMAP_API (version number for the netmap API) is less than the value required by QEMU? This can be done in ./configure. In this way we keep the QEMU code cleaner.

Thanks,
Vincenzo

2014-02-14 10:52 GMT+01:00 Stefan Hajnoczi <[email protected]>:

Quoted 29 lines · Michael Tokarev
Quoted 5 lines

After this patch, qemu fails to build on freebsd with the following error message:

net/netmap.c: In function 'netmap_receive_iov':
net/netmap.c:307: error: 'NS_MOREFRAG' undeclared (first use in this

function)

Quoted 1 line

net/netmap.c:307: error: (Each undeclared identifier is reported only

once

Quoted 3 lines

net/netmap.c:307: error: for each function it appears in.) net/netmap.c: In function 'netmap_send':
net/netmap.c:356: error: 'NS_MOREFRAG' undeclared (first use in this

function)

Quoted 5 lines

gmake: *** [net/netmap.o] Error 1

I didn't enable netmap support by default, configure enabled it automatically.

Quoted 7 lines

Freebsd has /usr/include/net/netmap.h and netmap_user.h out of the box. I've no idea what is inside and how compatible it is with whatever qemu expects.

I had to explicitly use --disable-netmap for qemu to build on freebsd.

This is FreeBSD 9.1-RELEASE, FWIW.

Vincenzo: Do you need to add a ./configure check so NS_MOREFRAG is only used when the host kernel supports it?

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

Yes, for sure we need to do a check.

However, this would involve - I think - some non-trivial modifications to net/netmap.c, because without NS_MOREFRAG you cannot split a packet over more "netmap slots/descriptors" (both tx and rx side)

Quoted 6 lines

Therefore I would ask (manly Luigi, since netmap is in-tree in FreeBSD):
Wouldn't it be better to force --disable-netmap when we realize that NETMAP_API (version number for the netmap API) is less than the value required by QEMU? This can be done in ./configure. In this way we keep the QEMU code cleaner.

yes we should do exactly what vincenzo suggests.

cheers
luigi

#4 lore raw

Stefan,
It is ok for you if I prepare a patch (touching configure and
net/netmap.c) that makes sure the host kernel has the minimum netmap version required for QEMU to work (and if not just --disable-netmap)?

Cheers,
Vincenzo

2014-02-14 11:24 GMT+01:00 Luigi Rizzo <[email protected]>:

Quoted 23 lines · Vincenzo Maffione
Quoted 7 lines

Yes, for sure we need to do a check.

However, this would involve - I think - some non-trivial modifications to net/netmap.c, because without NS_MOREFRAG you cannot split a packet over more "netmap slots/descriptors" (both tx and rx side)

Quoted 6 lines

Therefore I would ask (manly Luigi, since netmap is in-tree in FreeBSD):
Wouldn't it be better to force --disable-netmap when we realize that NETMAP_API (version number for the netmap API) is less than the value required by QEMU? This can be done in ./configure. In this way we keep the QEMU code cleaner.

yes we should do exactly what vincenzo suggests.

cheers
luigi

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

It is ok for you if I prepare a patch (touching configure and
net/netmap.c) that makes sure the host kernel has the minimum netmap version required for QEMU to work (and if not just --disable-netmap)?

Absolutely.

Stefan

#6 lore raw

Ok, this patch should preferably go in before the offloadings.

2014-02-14 16:40 GMT+01:00 Stefan Hajnoczi <[email protected]>:

Quoted 9 lines · Vincenzo Maffione
Quoted 3 lines

It is ok for you if I prepare a patch (touching configure and
net/netmap.c) that makes sure the host kernel has the minimum netmap version required for QEMU to work (and if not just --disable-netmap)?

Absolutely.

Stefan

Signature · 1 line
Vincenzo Maffione