Skip to content

Commit 18af517

Browse files
linux/README: details on configure usage
1 parent f02659d commit 18af517

File tree

1 file changed

+114
-20
lines changed

1 file changed

+114
-20
lines changed

LINUX/README

+114-20
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ of the code and documentation as well as pre-built TinyCore
1818
images based on linux 3.0.3 and containing the netmap modules
1919
and some test applications.
2020

21-
This version supports r8169, ixgbe, igb, i40e, e1000, e1000e and forcedeth.
21+
This version supports r8169, ixgbe, igb, i40e, e1000, e1000e and
22+
forcedeth.
2223

2324
Netmap relies on a kernel module (netmap.ko) and slightly modified
2425
device drivers. Userspace programs can use the native API (documented
@@ -50,31 +51,124 @@ Supported for general compatibility:
5051
CentOS 7 (tested on kernel 3.10.0-514.2.2.el7.x86_64)
5152

5253
On Archlinux systems the netmap software is provided by the 'netmap'
53-
AUR package (https://aur.archlinux.org/packages/netmap/).
54-
In general, you can build and install netmap following the instruction
55-
in 'HOW TO BUILD THE CODE'.
54+
AUR package (https://aur.archlinux.org/packages/netmap/). In general,
55+
you can build and install netmap following the instruction in 'HOW TO
56+
BUILD THE CODE'.
5657

5758
HOW TO BUILD THE CODE
5859
---------------------
5960

60-
1. make sure you have kernel sources/headers matching your installed system
61+
The netmap port for linux is built and installed using the standard
62+
./configure; make; sudo make install workflow.
6163

62-
2. do the following (either here, or in the parent directory)
63-
./configure
64-
make
65-
this produces ./netmap.ko and other kernel modules.
66-
(If your kernel sources are not in standard places, follow the
67-
instructions in the errors output by ./configure)
64+
The main purpose of the configure script is to determine the features of
65+
your kernel using simple compile tests, since just trusting the kernel
66+
version number is unreliable. The outcomes of the tests are stored in
67+
a set of macros in the generated netmap_linux_config.h file.
6868

69-
This also builds a few netmap applications. (you will need the
70-
pthreads and libpcap-dev packages to build them)
69+
The configure script also controls the compilation of optional netmap
70+
features, namely:
7171

72-
If you want support for additional drivers please have a look at
73-
ixgbe_netmap_linux.h and the patches in patches/
74-
The patch file are named as diff--DRIVER--LOW--HIGH--otherstuff
75-
where DRIVER is the driver name to patch, LOW and HIGH are the
76-
versions to which the patch applies (LOW included, HIGH excluded, so
77-
vanilla--r8169.c--20638--30300--ok applies from 2.6.38 to 3.3.0 (excluded).
72+
netmap subsystems
73+
-----------------
74+
75+
These are optional parts of netmap that can be compiled in with
76+
--enable-SUBSYSTEM and commented out with --disable-SUBSYSTEM.
77+
The available subsystems the following (the starred ones are enabled
78+
by default):
79+
80+
vale (*): the VALE switch (a fast switch that uses
81+
the netmap API).
82+
83+
pipe (*): netmap pipes (pairs of netmap ports connected
84+
back to back).
85+
86+
monitor (*): netmap monitors (can monitor other netmap ports
87+
in copy and zero-copy modes, without stopping
88+
traffic).
89+
90+
generic (*): the generic driver that is used to access
91+
NICs without native netmap support (at reduced
92+
performance).
93+
94+
ptnetmap-guest: netmap passthrough support for guests
95+
(including the ptnet driver).
96+
97+
ptnetmap-host: netmap passthrough support for the host
98+
99+
ptnetmap: shortcut to include both ptnetmap-guest and
100+
ptnetmap-host.
101+
102+
sink: a dummy drop-everything device with native netmap
103+
support. It can emulate a link with configurable
104+
packet rate.
105+
106+
NIC drivers
107+
--------------
108+
109+
The generic driver can be used to open in netmap mode any NIC for which
110+
the host OS already supplies a driver. The optimal performance, however,
111+
is only obtained with netmap-enabled NIC drivers. The configure script
112+
implements two methods to obtain the netmap-enabled drivers:
113+
114+
1. patching the native drivers that come with your kernel;
115+
2. patching NIC-vendors out-of-tree drivers selected by us.
116+
117+
Both methods have advantages and drawbacks and none is perfect.
118+
In method 1 the patches we supply may fail to apply (especially on
119+
Red Hat based distributions), but compilation of successfully patched
120+
drivers usually works. In method 2 the patches will be guaranteed to
121+
apply, but compilation may fail since the out-of-tree drivers may
122+
not support your kernel.
123+
124+
By default e1000e, i40e, ixgbe, ixgbevf and igb use method 2, while
125+
e1000, r8169.c, forcedeth.c, veth.c and virtio_net.c drivers use method
126+
1. The list of supported drivers can be obtained by running configure
127+
with the --show-drivers option, while --show-ext-drivers lists the
128+
drivers that use method 2 by default. For the latter drivers you may
129+
also choose to use method 1 using the --no-ext-drivers (use method
130+
1 for everything) or --no-ext-drivers= followed by a comma separated
131+
list of drivers.
132+
133+
For method 1 you need the driver sources for your kernel.
134+
135+
- If you have built your own kernel, you need to tell configure
136+
where the kernel build directory is using the --kernel-dir=
137+
option. The build directory must have been prepared for external
138+
modules compilation.
139+
140+
- If you are using the kernel provided by your Linux distribution
141+
you need to install the full kernel-sources package (how to do
142+
so depends on the distribution). Note that, even when you have
143+
installed the sources, configure will automatically find them
144+
only if they are pointed to by /lib/modules/$(uname -r)/build
145+
or /lib/modules/$(uname -r)/build/sources. If the sources are
146+
anywhere else, you need to tell configure where to find them
147+
using the --kernel-sources= options. The --kernel-dir= option
148+
must still point to a directory where all the information for
149+
external module compilation is available and there is typically
150+
no need to supply it, since configure is already able to find
151+
it in the standard place.
152+
153+
The configure script selects the patch to apply based only on the
154+
kernel version. Moreover, we only supply patches for the vanilla kernel
155+
from the Torvalds repository (not even the stable kernels). If the
156+
patch selected by configure for a driver fails to apply, the driver
157+
is disabled and will not be built my make.
158+
159+
For method 2 you need an Internet connection, since the external drivers
160+
are downloaded by configure from the vendor repository. Otherwise,
161+
follow the instructions printed by the script. The configure script
162+
will try to build the original external driver before applying the
163+
netmap patches: if the clean build fails then the vendor driver does
164+
not support your kernel (yet?) and the driver is disabled.
165+
166+
If you want support for additional drivers please have a look at
167+
ixgbe_netmap_linux.h and the patches in patches/ The patch file are
168+
named as vanilla--DRIVER--LOW--HIGH where DRIVER is the driver name
169+
to patch, LOW and HIGH are the versions to which the patch applies
170+
(LOW included, HIGH excluded, so vanilla--r8169.c--20638--30300 applies
171+
from 2.6.38 to 3.3.0 (excluded).
78172

79173
HOW TO USE THE CODE
80174
-------------------
@@ -140,7 +234,7 @@ COMMON PROBLEMS
140234
use the '-w' argument on the generator to specify a longer timeout
141235

142236
* the ixgbe driver (and perhaps others) is severely slowed down if the
143-
remote party is senting flow control frames to slow down traffic.
237+
remote party is sending flow control frames to slow down traffic.
144238
If that happens try to use the ethtool command to disable flow control.
145239

146240
* netmap does not program the NICs to perform offloadings such as TSO,

0 commit comments

Comments
 (0)