table: fix incorrect initialization
[dpdk.git] / doc / guides / freebsd_gsg / sys_reqs.rst
1 ..  BSD LICENSE
2     Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
3     All rights reserved.
4
5     Redistribution and use in source and binary forms, with or without
6     modification, are permitted provided that the following conditions
7     are met:
8
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
14     distribution.
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.
18
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.
30
31 System Requirements
32 ===================
33
34 This chapter describes the packages required to compile the Intel® DPDK.
35
36 Compilationofthe Intel® DPDK
37 ----------------------------
38
39 .. note::
40
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.
44
45 **Required Tools:**
46
47 .. note::
48
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.
53
54 To use the FreeBSD* ports system,
55 it is required to update and extract the FreeBSD* ports tree by issuing the following commands:
56
57 .. code-block:: console
58
59     root@host:~ # portsnap fetch
60     root@host:~ # portsnap extract
61
62 If the environment requires proxies for external communication, these can be set using:
63
64 .. code-block:: console
65
66     root@host:~ # setenv http_proxy <my_proxy_host>:<port>
67     root@host:~ # setenv ftp_proxy <my_proxy_host>:<port>
68
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:
71
72 #.  cd /usr/ports/<port_location>
73
74 #.  make config-recursive
75
76 #.  make install
77
78 #.  make clean
79
80 Each port location can be found using:
81
82 .. code-block:: console
83
84     user@host:~ # whereis <port_name>
85
86 The ports required and their locations are as follows:
87
88 *   dialog4ports
89
90 *   /usr/ports/ports-mgmt/dialog4ports
91
92 *   gcc: version 4.8 is recommended
93
94 *   /usr/ports/lang/gcc48
95
96 *   Ensure that CPU_OPTS is selected (default is OFF)
97
98 *   GNU make(gmake)
99
100 *   Installed automatically with gcc48
101
102 *   coreutils
103
104 *   /usr/ports/sysutils/coreutils
105
106 *   libexecinfo  (Not required for FreeBSD* 10)
107
108 *   /usr/src/contrib/libexecinfo
109
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.
112
113 .. note::
114
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.
118
119 Running Intel® DPDK Applications
120 --------------------------------
121
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.
128
129 Using Intel® DPDK contigmem Module
130 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131
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:
134
135 .. code-block:: console
136
137     root@host:~ # kenv hw.contigmem.num_buffers=n
138     root@host:~ # kenv hw.contigmem.buffer_size=m
139
140 The kernel environment variables can also be specified during boot by placing the following in /boot/loader.conf:
141
142 ::
143
144     hw.contigmem.num_buffers=n hw.contigmem.buffer_size=m
145
146 The variables can be inspected using the following command:
147
148 .. code-block:: console
149
150     root@host:~ # sysctl -a hw.contigmem
151
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.
155
156 .. note::
157
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:
160
161 .. code-block:: console
162
163         root@host:~ # chmod 644 /boot/loader.conf