2 Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
15 * Neither the name of Intel Corporation nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 This chapter describes the packages required to compile the Intel® DPDK.
36 Compilationofthe Intel® DPDK
37 ----------------------------
41 The Intel® DPDK and its applications requires the GNU make system (gmake)
42 and the GNU Compiler Collection (gcc) to build on FreeBSD*.
43 The installation of these tools is covered in this section.
49 Testing has been performed using FreeBSD* 9.2-RELEASE (x86_64),
50 FreeBSD* 10.0-RELEASE (x86_64) and requires the installation of the kernel sources,
51 which should be included during the installation of FreeBSD*.
52 The Intel® DPDK also requires the use of FreeBSD* ports to compile and function.
54 To use the FreeBSD* ports system,
55 it is required to update and extract the FreeBSD* ports tree by issuing the following commands:
57 .. code-block:: console
59 root@host:~ # portsnap fetch
60 root@host:~ # portsnap extract
62 If the environment requires proxies for external communication, these can be set using:
64 .. code-block:: console
66 root@host:~ # setenv http_proxy <my_proxy_host>:<port>
67 root@host:~ # setenv ftp_proxy <my_proxy_host>:<port>
69 The FreeBSD* ports below need to be installed prior to building the Intel® DPDK.
70 In general these can be installed using the following set of commands:
72 #. cd /usr/ports/<port_location>
74 #. make config-recursive
80 Each port location can be found using:
82 .. code-block:: console
84 user@host:~ # whereis <port_name>
86 The ports required and their locations are as follows:
90 * /usr/ports/ports-mgmt/dialog4ports
92 * gcc: version 4.8 is recommended
94 * /usr/ports/lang/gcc48
96 * Ensure that CPU_OPTS is selected (default is OFF)
100 * Installed automatically with gcc48
104 * /usr/ports/sysutils/coreutils
106 * libexecinfo (Not required for FreeBSD* 10)
108 * /usr/src/contrib/libexecinfo
110 When running the make config-recursive command, a dialog may be presented to the user.
111 For the installation of the Intel® DPDK, the default options were used.
115 To avoid multiple dialogs being presented to the user during make install,
116 it is advisable before running the make install command to re-run the
117 make config -recursive command until no more dialogs are seen.
119 Running Intel® DPDK Applications
120 --------------------------------
122 To run an Intel® DPDK application, physically contiguous memory is required.
123 In the absence of non-transparent superpages,
124 the included sources for the contigmem kernel module provides the ability to
125 present contiguous blocks of memory for the Intel® DPDK to use.
126 Section 3.4, “Loading the Intel® DPDK contigmem Module” on page 8
127 for details on the loading of this module.
129 Using Intel® DPDK contigmem Module
130 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132 The amount of physically contiguous memory along with the number of physically contiguous blocks
133 can be set at runtime and prior to module loading using:
135 .. code-block:: console
137 root@host:~ # kenv hw.contigmem.num_buffers=n
138 root@host:~ # kenv hw.contigmem.buffer_size=m
140 The kernel environment variables can also be specified during boot by placing the following in /boot/loader.conf:
144 hw.contigmem.num_buffers=n hw.contigmem.buffer_size=m
146 The variables can be inspected using the following command:
148 .. code-block:: console
150 root@host:~ # sysctl -a hw.contigmem
152 Where n is the number of blocks and m is the size in bytes of each area of contiguous memory.
153 A default of two buffers of size 1073741824 bytes (1 Gigabyte) each is set during module load
154 if they are not specified in the environment.
158 The /boot/loader.conf file may not exist, but can be created as a root user
159 and should be given permissions as follows:
161 .. code-block:: console
163 root@host:~ # chmod 644 /boot/loader.conf