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*. The
43 installation of these tools is covered in this section.
49 Testing has been performed using FreeBSD* 9.2-RELEASE (x86_64), FreeBSD*
50 10.0-RELEASE (x86_64) and requires the installation of the kernel sources,
51 which should be included during the installation of FreeBSD*. The Intel®
52 DPDK also requires the use of FreeBSD* ports to compile and function.
54 To use the FreeBSD* ports system, it is required to update and extract the FreeBSD*
55 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
65 .. code-block:: console
67 root@host:~ # setenv http_proxy <my_proxy_host>:<port>
68 root@host:~ # setenv ftp_proxy <my_proxy_host>:<port>
70 The FreeBSD* ports below need to be installed prior to building the Intel® DPDK.
71 In general these can be installed using the following set of commands:
73 #. cd /usr/ports/<port_location>
75 #. make config-recursive
81 Each port location can be found using:
83 .. code-block:: console
85 user@host:~ # whereis <port_name>
87 The ports required and their locations are as follows:
91 * /usr/ports/ports-mgmt/dialog4ports
93 * gcc: version 4.8 is recommended
95 * /usr/ports/lang/gcc48
97 * Ensure that CPU_OPTS is selected (default is OFF)
101 * Installed automatically with gcc48
105 * /usr/ports/sysutils/coreutils
107 * libexecinfo (Not required for FreeBSD* 10)
109 * /usr/src/contrib/libexecinfo
111 When running the make config-recursive command, a dialog may be presented to the
112 user. For the installation of the Intel® DPDK, the default options were used.
116 To avoid multiple dialogs being presented to the user during make install,
117 it is advisable before running the make install command to re-run the
118 make config -recursive command until no more dialogs are seen.
120 Running Intel® DPDK Applications
121 --------------------------------
123 To run an Intel® DPDK application, physically contiguous memory is required.
124 In the absence of non-transparent superpages, the included sources for the
125 contigmem kernel module provides the ability to present contiguous blocks of
126 memory for the Intel® DPDK to use. Section 3.4, “Loading the Intel® DPDK
127 Contigmem Module” on page 8 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
133 contiguous blocks 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
141 following in /boot/loader.conf:
145 hw.contigmem.num_buffers=n hw.contigmem.buffer_size=m
147 The variables can be inspected using the following command:
149 .. code-block:: console
151 root@host:~ # sysctl -a hw.contigmem
153 Where n is the number of blocks and m is the size in bytes of each area of
154 contiguous memory. A default of two buffers of size 1073741824 bytes (1 Gigabyte)
155 each is set during module load if they are not specified in the environment.
159 The /boot/loader.conf file may not exist, but can be created as a root user
160 and should be given permissions as follows:
162 .. code-block:: console
164 root@host:~ # chmod 644 /boot/loader.conf