2013-05-30 14:07:14 +00:00
|
|
|
/*
|
It is 2014 and we have a new version of netmap.
Most relevant features:
- netmap emulation on any NIC, even those without native netmap support.
On the ixgbe we have measured about 4Mpps/core/queue in this mode,
which is still a lot more than with sockets/bpf.
- seamless interconnection of VALE switch, NICs and host stack.
If you disable accelerations on your NIC (say em0)
ifconfig em0 -txcsum -txcsum
you can use the VALE switch to connect the NIC and the host stack:
vale-ctl -h valeXX:em0
allowing sharing the NIC with other netmap clients.
- THE USER API HAS SLIGHTLY CHANGED (head/cur/tail pointers
instead of pointers/count as before). This was unavoidable to support,
in the future, multiple threads operating on the same rings.
Netmap clients require very small source code changes to compile again.
On the plus side, the new API should be easier to understand
and the internals are a lot simpler.
The manual page has been updated extensively to reflect the current
features and give some examples.
This is the result of work of several people including Giuseppe Lettieri,
Vincenzo Maffione, Michio Honda and myself, and has been financially
supported by EU projects CHANGE and OPENLAB, from NetApp University
Research Fund, NEC, and of course the Universita` di Pisa.
2014-01-06 12:53:15 +00:00
|
|
|
* Copyright (C) 2013-2014 Michio Honda. All rights reserved.
|
2013-05-30 14:07:14 +00:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $FreeBSD$ */
|
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
#define LIBNETMAP_NOTHREADSAFE
|
|
|
|
#include <libnetmap.h>
|
Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
parameters, and private and public variables)
We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
|
|
|
|
2013-05-30 14:07:14 +00:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <inttypes.h> /* PRI* macros */
|
|
|
|
#include <string.h> /* strcmp */
|
|
|
|
#include <fcntl.h> /* open */
|
|
|
|
#include <unistd.h> /* close */
|
|
|
|
#include <sys/ioctl.h> /* ioctl */
|
|
|
|
#include <sys/param.h>
|
This new version of netmap brings you the following:
- netmap pipes, providing bidirectional blocking I/O while moving
100+ Mpps between processes using shared memory channels
(no mistake: over one hundred million. But mind you, i said
*moving* not *processing*);
- kqueue support (BHyVe needs it);
- improved user library. Just the interface name lets you select a NIC,
host port, VALE switch port, netmap pipe, and individual queues.
The upcoming netmap-enabled libpcap will use this feature.
- optional extra buffers associated to netmap ports, for applications
that need to buffer data yet don't want to make copies.
- segmentation offloading for the VALE switch, useful between VMs.
and a number of bug fixes and performance improvements.
My colleagues Giuseppe Lettieri and Vincenzo Maffione did a substantial
amount of work on these features so we owe them a big thanks.
There are some external repositories that can be of interest:
https://code.google.com/p/netmap
our public repository for netmap/VALE code, including
linux versions and other stuff that does not belong here,
such as python bindings.
https://code.google.com/p/netmap-libpcap
a clone of the libpcap repository with netmap support.
With this any libpcap client has access to most netmap
feature with no recompilation. E.g. tcpdump can filter
packets at 10-15 Mpps.
https://code.google.com/p/netmap-ipfw
a userspace version of ipfw+dummynet which uses netmap
to send/receive packets. Speed is up in the 7-10 Mpps
range per core for simple rulesets.
Both netmap-libpcap and netmap-ipfw will be merged upstream at some
point, but while this happens it is useful to have access to them.
And yes, this code will be merged soon. It is infinitely better
than the version currently in 10 and 9.
MFC after: 3 days
2014-02-15 04:53:04 +00:00
|
|
|
#include <sys/socket.h> /* apple needs sockaddr */
|
2013-05-30 14:07:14 +00:00
|
|
|
#include <net/if.h> /* ifreq */
|
|
|
|
#include <libgen.h> /* basename */
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
#include <stdlib.h> /* atoi, free */
|
2013-05-30 14:07:14 +00:00
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
int verbose;
|
|
|
|
|
|
|
|
struct args {
|
|
|
|
const char *name;
|
|
|
|
const char *config;
|
|
|
|
const char *mem_id;
|
|
|
|
|
|
|
|
uint16_t nr_reqtype;
|
|
|
|
uint32_t nr_mode;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
dump_port_info(struct nmreq_port_info_get *v)
|
|
|
|
{
|
|
|
|
printf("memsize: %"PRIu64"\n", v->nr_memsize);
|
|
|
|
printf("tx_slots: %"PRIu32"\n", v->nr_tx_slots);
|
|
|
|
printf("rx_slots: %"PRIu32"\n", v->nr_rx_slots);
|
|
|
|
printf("tx_rings: %"PRIu16"\n", v->nr_tx_rings);
|
|
|
|
printf("rx_rings %"PRIu16"\n", v->nr_rx_rings);
|
|
|
|
printf("mem_id: %"PRIu16"\n", v->nr_mem_id);
|
|
|
|
}
|
|
|
|
|
2019-10-31 21:01:34 +00:00
|
|
|
static void
|
2020-11-22 10:02:56 +00:00
|
|
|
dump_newif(struct nmreq_vale_newif *v)
|
|
|
|
{
|
|
|
|
printf("tx_slots: %"PRIu32"\n", v->nr_tx_slots);
|
|
|
|
printf("rx_slots: %"PRIu32"\n", v->nr_rx_slots);
|
|
|
|
printf("tx_rings: %"PRIu16"\n", v->nr_tx_rings);
|
|
|
|
printf("rx_ring: %"PRIu16"\n", v->nr_rx_rings);
|
|
|
|
printf("mem_id: %"PRIu16"\n", v->nr_mem_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dump_vale_list(struct nmreq_vale_list *v)
|
|
|
|
{
|
|
|
|
printf("bridge_idx: %"PRIu16"\n", v->nr_bridge_idx);
|
|
|
|
printf("port_idx: %"PRIu16"\n", v->nr_port_idx);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
parse_ring_config(const char* conf,
|
|
|
|
uint32_t *nr_tx_slots,
|
|
|
|
uint32_t *nr_rx_slots,
|
|
|
|
uint16_t *nr_tx_rings,
|
|
|
|
uint16_t *nr_rx_rings)
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
{
|
|
|
|
char *w, *tok;
|
|
|
|
int i, v;
|
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
*nr_tx_rings = *nr_rx_rings = 0;
|
|
|
|
*nr_tx_slots = *nr_rx_slots = 0;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
if (conf == NULL || ! *conf)
|
|
|
|
return;
|
|
|
|
w = strdup(conf);
|
|
|
|
for (i = 0, tok = strtok(w, ","); tok; i++, tok = strtok(NULL, ",")) {
|
|
|
|
v = atoi(tok);
|
|
|
|
switch (i) {
|
|
|
|
case 0:
|
2020-11-22 10:02:56 +00:00
|
|
|
*nr_tx_slots = *nr_rx_slots = v;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2020-11-22 10:02:56 +00:00
|
|
|
*nr_rx_slots = v;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2020-11-22 10:02:56 +00:00
|
|
|
*nr_tx_rings = *nr_rx_rings = v;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2020-11-22 10:02:56 +00:00
|
|
|
*nr_rx_rings = v;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
|
|
|
default:
|
2020-11-22 10:02:56 +00:00
|
|
|
fprintf(stderr, "ignored config: %s", tok);
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-11-22 10:02:56 +00:00
|
|
|
ND("txr %d txd %d rxr %d rxd %d",
|
|
|
|
*nr_tx_rings, *nr_tx_slots,
|
|
|
|
*nr_rx_rings, *nr_rx_slots);
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
free(w);
|
|
|
|
}
|
|
|
|
|
2013-05-30 14:07:14 +00:00
|
|
|
static int
|
2020-11-22 10:02:56 +00:00
|
|
|
parse_poll_config(const char *conf, struct nmreq_vale_polling *v)
|
2013-05-30 14:07:14 +00:00
|
|
|
{
|
2020-11-22 10:02:56 +00:00
|
|
|
char *w, *tok;
|
|
|
|
int i, p;
|
2013-05-30 14:07:14 +00:00
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
if (conf == NULL || ! *conf) {
|
|
|
|
fprintf(stderr, "invalid null/empty config\n");
|
2013-05-30 14:07:14 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2020-11-22 10:02:56 +00:00
|
|
|
w = strdup(conf);
|
|
|
|
for (i = 0, tok = strtok(w, ","); tok; i++, tok = strtok(NULL, ",")) {
|
|
|
|
p = atoi(tok);
|
|
|
|
switch (i) {
|
|
|
|
case 0:
|
|
|
|
v->nr_mode = p ? NETMAP_POLLING_MODE_MULTI_CPU :
|
|
|
|
NETMAP_POLLING_MODE_SINGLE_CPU;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
v->nr_first_cpu_id = p;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (v->nr_mode != NETMAP_POLLING_MODE_MULTI_CPU) {
|
|
|
|
fprintf(stderr, "too many numbers in '%s'\n", conf);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
v->nr_num_polling_cpus = p;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
fprintf(stderr, "too many numbers in '%s'\n", conf);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(w);
|
|
|
|
return 0;
|
|
|
|
}
|
2013-05-30 14:07:14 +00:00
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
static int32_t
|
|
|
|
parse_mem_id(const char *mem_id)
|
|
|
|
{
|
|
|
|
int32_t id;
|
|
|
|
|
|
|
|
if (mem_id == NULL)
|
|
|
|
return 0;
|
|
|
|
if (isdigit(*mem_id))
|
|
|
|
return atoi(mem_id);
|
|
|
|
id = nmreq_get_mem_id(&mem_id, nmctx_get());
|
|
|
|
if (id == 0) {
|
|
|
|
fprintf(stderr, "invalid format in '-m %s' (missing 'netmap:'?)\n", mem_id);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
list_all(int fd, struct nmreq_header *hdr)
|
|
|
|
{
|
|
|
|
int error;
|
|
|
|
struct nmreq_vale_list *vale_list =
|
2020-12-29 18:20:43 +00:00
|
|
|
(struct nmreq_vale_list *)(uintptr_t)hdr->nr_body;
|
2020-11-22 10:02:56 +00:00
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
hdr->nr_name[0] = '\0';
|
|
|
|
error = ioctl(fd, NIOCCTRL, hdr);
|
|
|
|
if (error < 0) {
|
|
|
|
if (errno == ENOENT)
|
|
|
|
break;
|
|
|
|
|
|
|
|
fprintf(stderr, "failed to list all: %s\n", strerror(errno));
|
|
|
|
return 1;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
}
|
2020-11-22 10:02:56 +00:00
|
|
|
printf("%s bridge_idx %"PRIu16" port_idx %"PRIu32"\n", hdr->nr_name,
|
|
|
|
vale_list->nr_bridge_idx, vale_list->nr_port_idx);
|
|
|
|
vale_list->nr_port_idx++;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
bdg_ctl(struct args *a)
|
|
|
|
{
|
|
|
|
struct nmreq_header hdr;
|
|
|
|
struct nmreq_vale_attach vale_attach;
|
|
|
|
struct nmreq_vale_detach vale_detach;
|
|
|
|
struct nmreq_vale_newif vale_newif;
|
|
|
|
struct nmreq_vale_list vale_list;
|
|
|
|
struct nmreq_vale_polling vale_polling;
|
|
|
|
struct nmreq_port_info_get port_info_get;
|
|
|
|
int error = 0;
|
|
|
|
int fd;
|
|
|
|
int32_t mem_id;
|
|
|
|
const char *action = NULL;
|
|
|
|
|
|
|
|
fd = open("/dev/netmap", O_RDWR);
|
|
|
|
if (fd == -1) {
|
|
|
|
perror("/dev/netmap");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
bzero(&hdr, sizeof(hdr));
|
|
|
|
hdr.nr_version = NETMAP_API;
|
|
|
|
if (a->name != NULL) { /* might be NULL */
|
|
|
|
strncpy(hdr.nr_name, a->name, NETMAP_REQ_IFNAMSIZ - 1);
|
|
|
|
hdr.nr_name[NETMAP_REQ_IFNAMSIZ - 1] = '\0';
|
|
|
|
}
|
|
|
|
hdr.nr_reqtype = a->nr_reqtype;
|
|
|
|
|
|
|
|
switch (a->nr_reqtype) {
|
|
|
|
case NETMAP_REQ_VALE_DELIF:
|
|
|
|
/* no body */
|
|
|
|
action = "remove";
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
2020-11-22 10:02:56 +00:00
|
|
|
|
|
|
|
case NETMAP_REQ_VALE_NEWIF:
|
|
|
|
memset(&vale_newif, 0, sizeof(vale_newif));
|
|
|
|
hdr.nr_body = (uintptr_t)&vale_newif;
|
|
|
|
parse_ring_config(a->config,
|
|
|
|
&vale_newif.nr_tx_slots,
|
|
|
|
&vale_newif.nr_rx_slots,
|
|
|
|
&vale_newif.nr_tx_rings,
|
|
|
|
&vale_newif.nr_rx_rings);
|
|
|
|
mem_id = parse_mem_id(a->mem_id);
|
|
|
|
if (mem_id < 0)
|
|
|
|
return 1;
|
|
|
|
vale_newif.nr_mem_id = mem_id;
|
|
|
|
action = "create";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NETMAP_REQ_VALE_ATTACH:
|
|
|
|
memset(&vale_attach, 0, sizeof(vale_attach));
|
|
|
|
hdr.nr_body = (uintptr_t)&vale_attach;
|
|
|
|
vale_attach.reg.nr_mode = a->nr_mode;
|
|
|
|
parse_ring_config(a->config,
|
|
|
|
&vale_attach.reg.nr_tx_slots,
|
|
|
|
&vale_attach.reg.nr_rx_slots,
|
|
|
|
&vale_attach.reg.nr_tx_rings,
|
|
|
|
&vale_attach.reg.nr_rx_rings);
|
|
|
|
mem_id = parse_mem_id(a->mem_id);
|
|
|
|
if (mem_id < 0)
|
|
|
|
return 1;
|
|
|
|
vale_attach.reg.nr_mem_id = mem_id;
|
|
|
|
action = "attach";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NETMAP_REQ_VALE_DETACH:
|
|
|
|
memset(&vale_detach, 0, sizeof(vale_detach));
|
|
|
|
hdr.nr_body = (uintptr_t)&vale_detach;
|
|
|
|
action = "detach";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NETMAP_REQ_VALE_LIST:
|
|
|
|
memset(&vale_list, 0, sizeof(vale_list));
|
|
|
|
hdr.nr_body = (uintptr_t)&vale_list;
|
|
|
|
if (a->name == NULL) {
|
|
|
|
return list_all(fd, &hdr);
|
Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
parameters, and private and public variables)
We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
|
|
|
}
|
2020-11-22 10:02:56 +00:00
|
|
|
action = "list";
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
case NETMAP_REQ_VALE_POLLING_ENABLE:
|
|
|
|
action = "enable polling on";
|
|
|
|
/* fall through */
|
|
|
|
case NETMAP_REQ_VALE_POLLING_DISABLE:
|
|
|
|
memset(&vale_polling, 0, sizeof(vale_polling));
|
|
|
|
hdr.nr_body = (uintptr_t)&vale_polling;
|
|
|
|
parse_poll_config(a->config, &vale_polling);
|
|
|
|
if (action == NULL)
|
|
|
|
action ="disable polling on";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NETMAP_REQ_PORT_INFO_GET:
|
|
|
|
memset(&port_info_get, 0, sizeof(port_info_get));
|
|
|
|
hdr.nr_body = (uintptr_t)&port_info_get;
|
|
|
|
action = "obtain info for";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
error = ioctl(fd, NIOCCTRL, &hdr);
|
|
|
|
if (error < 0) {
|
|
|
|
fprintf(stderr, "failed to %s %s: %s\n",
|
|
|
|
action, a->name, strerror(errno));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
switch (hdr.nr_reqtype) {
|
|
|
|
case NETMAP_REQ_VALE_NEWIF:
|
|
|
|
if (verbose) {
|
|
|
|
dump_newif(&vale_newif);
|
2013-05-30 14:07:14 +00:00
|
|
|
}
|
2020-11-22 10:02:56 +00:00
|
|
|
break;
|
2013-05-30 14:07:14 +00:00
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
case NETMAP_REQ_VALE_ATTACH:
|
|
|
|
if (verbose) {
|
|
|
|
printf("port_index: %"PRIu32"\n", vale_attach.port_index);
|
2013-05-30 14:07:14 +00:00
|
|
|
}
|
2020-11-22 10:02:56 +00:00
|
|
|
break;
|
2013-05-30 14:07:14 +00:00
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
case NETMAP_REQ_VALE_DETACH:
|
|
|
|
if (verbose) {
|
|
|
|
printf("port_index: %"PRIu32"\n", vale_detach.port_index);
|
|
|
|
}
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
case NETMAP_REQ_VALE_LIST:
|
|
|
|
dump_vale_list(&vale_list);
|
Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
parameters, and private and public variables)
We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
case NETMAP_REQ_PORT_INFO_GET:
|
|
|
|
dump_port_info(&port_info_get);
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
close(fd);
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2018-10-24 16:01:56 +00:00
|
|
|
static void
|
|
|
|
usage(int errcode)
|
|
|
|
{
|
|
|
|
fprintf(stderr,
|
|
|
|
"Usage:\n"
|
2020-11-22 10:02:56 +00:00
|
|
|
"vale-ctl [arguments]\n"
|
2018-10-24 16:01:56 +00:00
|
|
|
"\t-g interface interface name to get info\n"
|
|
|
|
"\t-d interface interface name to be detached\n"
|
|
|
|
"\t-a interface interface name to be attached\n"
|
|
|
|
"\t-h interface interface name to be attached with the host stack\n"
|
|
|
|
"\t-n interface interface name to be created\n"
|
|
|
|
"\t-r interface interface name to be deleted\n"
|
2020-11-22 10:02:56 +00:00
|
|
|
"\t-l vale-port show bridge and port indices\n"
|
2018-10-24 16:01:56 +00:00
|
|
|
"\t-C string ring/slot setting of an interface creating by -n\n"
|
|
|
|
"\t-p interface start polling. Additional -C x,y,z configures\n"
|
|
|
|
"\t\t x: 0 (REG_ALL_NIC) or 1 (REG_ONE_NIC),\n"
|
|
|
|
"\t\t y: CPU core id for ALL_NIC and core/ring for ONE_NIC\n"
|
|
|
|
"\t\t z: (ONE_NIC only) num of total cores/rings\n"
|
|
|
|
"\t-P interface stop polling\n"
|
2020-11-22 10:02:56 +00:00
|
|
|
"\t-m memid to use when creating a new interface\n"
|
|
|
|
"\t-v increase verbosity\n"
|
|
|
|
"with no arguments: list all existing vale ports\n");
|
2018-10-24 16:01:56 +00:00
|
|
|
exit(errcode);
|
|
|
|
}
|
|
|
|
|
2013-05-30 14:07:14 +00:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
2020-11-22 10:02:56 +00:00
|
|
|
int ch;
|
|
|
|
struct args a = {
|
|
|
|
.name = NULL,
|
|
|
|
.config = NULL,
|
|
|
|
.mem_id = NULL,
|
|
|
|
.nr_reqtype = 0,
|
|
|
|
.nr_mode = NR_REG_ALL_NIC,
|
|
|
|
};
|
2013-05-30 14:07:14 +00:00
|
|
|
|
2020-11-22 10:02:56 +00:00
|
|
|
while ((ch = getopt(argc, argv, "d:a:h:g:l:n:r:C:p:P:m:v")) != -1) {
|
2013-05-30 14:07:14 +00:00
|
|
|
switch (ch) {
|
|
|
|
default:
|
|
|
|
fprintf(stderr, "bad option %c %s", ch, optarg);
|
2020-11-22 10:02:56 +00:00
|
|
|
usage(1);
|
2018-10-24 16:01:56 +00:00
|
|
|
break;
|
2013-05-30 14:07:14 +00:00
|
|
|
case 'd':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_DETACH;
|
|
|
|
a.name = optarg;
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
|
|
|
case 'a':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_ATTACH;
|
|
|
|
a.nr_mode = NR_REG_ALL_NIC;
|
|
|
|
a.name = optarg;
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
|
|
|
case 'h':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_ATTACH;
|
|
|
|
a.nr_mode = NR_REG_NIC_SW;
|
|
|
|
a.name = optarg;
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
case 'n':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_NEWIF;
|
|
|
|
a.name = optarg;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
|
|
|
case 'r':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_DELIF;
|
|
|
|
a.name = optarg;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
2013-05-30 14:07:14 +00:00
|
|
|
case 'g':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_PORT_INFO_GET;
|
|
|
|
a.name = optarg;
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
|
|
|
case 'l':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_LIST;
|
|
|
|
a.name = optarg;
|
|
|
|
if (strncmp(a.name, NM_BDG_NAME, strlen(NM_BDG_NAME))) {
|
|
|
|
fprintf(stderr, "invalid vale port name: '%s'\n", a.name);
|
|
|
|
usage(1);
|
|
|
|
}
|
2013-05-30 14:07:14 +00:00
|
|
|
break;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
case 'C':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.config = optarg;
|
Update to the current version of netmap.
Mostly bugfixes or features developed in the past 6 months,
so this is a 10.1 candidate.
Basically no user API changes (some bugfixes in sys/net/netmap_user.h).
In detail:
1. netmap support for virtio-net, including in netmap mode.
Under bhyve and with a netmap backend [2] we reach over 1Mpps
with standard APIs (e.g. libpcap), and 5-8 Mpps in netmap mode.
2. (kernel) add support for multiple memory allocators, so we can
better partition physical and virtual interfaces giving access
to separate users. The most visible effect is one additional
argument to the various kernel functions to compute buffer
addresses. All netmap-supported drivers are affected, but changes
are mechanical and trivial
3. (kernel) simplify the prototype for *txsync() and *rxsync()
driver methods. All netmap drivers affected, changes mostly mechanical.
4. add support for netmap-monitor ports. Think of it as a mirroring
port on a physical switch: a netmap monitor port replicates traffic
present on the main port. Restrictions apply. Drive carefully.
5. if_lem.c: support for various paravirtualization features,
experimental and disabled by default.
Most of these are described in our ANCS'13 paper [1].
Paravirtualized support in netmap mode is new, and beats the
numbers in the paper by a large factor (under qemu-kvm,
we measured gues-host throughput up to 10-12 Mpps).
A lot of refactoring and additional documentation in the files
in sys/dev/netmap, but apart from #2 and #3 above, almost nothing
of this stuff is visible to other kernel parts.
Example programs in tools/tools/netmap have been updated with bugfixes
and to support more of the existing features.
This is meant to go into 10.1 so we plan an MFC before the Aug.22 deadline.
A lot of this code has been contributed by my colleagues at UNIPI,
including Giuseppe Lettieri, Vincenzo Maffione, Stefano Garzarella.
MFC after: 3 days.
2014-08-16 15:00:01 +00:00
|
|
|
break;
|
Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
parameters, and private and public variables)
We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
|
|
|
case 'p':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_POLLING_ENABLE;
|
|
|
|
a.name = optarg;
|
Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
parameters, and private and public variables)
We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
|
|
|
break;
|
|
|
|
case 'P':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_POLLING_DISABLE;
|
|
|
|
a.name = optarg;
|
Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
parameters, and private and public variables)
We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
|
|
|
break;
|
2018-10-24 16:01:56 +00:00
|
|
|
case 'm':
|
2020-11-22 10:02:56 +00:00
|
|
|
a.mem_id = optarg;
|
|
|
|
break;
|
|
|
|
case 'v':
|
|
|
|
verbose++;
|
2018-10-24 16:01:56 +00:00
|
|
|
break;
|
2013-05-30 14:07:14 +00:00
|
|
|
}
|
Import the current version of netmap, aligned with the one on github.
This commit, long overdue, contains contributions in the last 2 years
from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including:
+ fixes on monitor ports
+ the 'ptnet' virtual device driver, and ptnetmap backend, for
high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit)
+ improved emulated netmap mode
+ more robust error handling
+ removal of stale code
+ various fixes to code and documentation (some mixup between RX and TX
parameters, and private and public variables)
We also include an additional tool, nmreplay, which is functionally
equivalent to tcpreplay but operating on netmap ports.
2016-10-16 14:13:32 +00:00
|
|
|
}
|
|
|
|
if (optind != argc) {
|
2020-11-22 10:02:56 +00:00
|
|
|
usage(1);
|
2013-05-30 14:07:14 +00:00
|
|
|
}
|
2018-10-24 16:01:56 +00:00
|
|
|
if (argc == 1) {
|
2020-11-22 10:02:56 +00:00
|
|
|
a.nr_reqtype = NETMAP_REQ_VALE_LIST;
|
|
|
|
a.name = NULL;
|
|
|
|
}
|
|
|
|
if (!a.nr_reqtype) {
|
|
|
|
usage(1);
|
2018-10-24 16:01:56 +00:00
|
|
|
}
|
2020-11-22 10:02:56 +00:00
|
|
|
return bdg_ctl(&a);
|
2013-05-30 14:07:14 +00:00
|
|
|
}
|