1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2010-2014 Intel Corporation.
4 .. _install_from_ports:
6 Installing DPDK from the Ports Collection
7 =========================================
9 The easiest way to get up and running with the DPDK on FreeBSD is to
10 install it from the ports collection. Details of getting and using the ports
11 collection are documented in the
12 `FreeBSD Handbook <http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html>`_.
14 Installing the DPDK FreeBSD Port
15 --------------------------------
17 On a system with the ports collection installed in ``/usr/ports``, the DPDK
18 can be installed using the commands:
20 .. code-block:: console
22 cd /usr/ports/net/dpdk
26 After the installation of the DPDK port, instructions will be printed on
27 how to install the kernel modules required to use the DPDK. A more
28 complete version of these instructions can be found in the sections
29 :ref:`loading_contigmem` and :ref:`loading_nic_uio`. Normally, lines like
30 those below would be added to the file ``/boot/loader.conf``.
32 .. code-block:: console
34 # Reserve 2 x 1G blocks of contiguous memory using contigmem driver:
35 hw.contigmem.num_buffers=2
36 hw.contigmem.buffer_size=1073741824
39 # Identify NIC devices for DPDK apps to use and load nic_uio driver:
40 hw.nic_uio.bdfs="2:0:0,2:0:1"
45 Please ensure that the latest patches are applied to third party libraries
46 and software to avoid any known vulnerabilities.
49 Compiling and Running the Example Applications
50 ----------------------------------------------
52 When the DPDK has been installed from the ports collection it installs
53 its example applications in ``/usr/local/share/dpdk/examples`` - also accessible via
54 symlink as ``/usr/local/share/examples/dpdk``. These examples can be compiled and
55 run as described in :ref:`compiling_sample_apps`. In this case, the required
56 environmental variables should be set as below:
58 * ``RTE_SDK=/usr/local/share/dpdk``
60 * ``RTE_TARGET=x86_64-native-freebsd-clang``
64 To install a copy of the DPDK compiled using gcc, please download the
65 official DPDK package from http://core.dpdk.org/download/ and install manually using
66 the instructions given in the next chapter, :ref:`building_from_source`
68 An example application can therefore be copied to a user's home directory and
69 compiled and run as below:
71 .. code-block:: console
73 export RTE_SDK=/usr/local/share/dpdk
75 export RTE_TARGET=x86_64-native-freebsd-clang
77 cp -r /usr/local/share/dpdk/examples/helloworld .
84 INSTALL-APP helloworld
85 INSTALL-MAP helloworld.map
87 sudo ./build//helloworld -l 0-3
88 EAL: Sysctl reports 8 cpus
89 EAL: Detected 8 lcore(s)
90 EAL: Detected 1 NUMA nodes
91 EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
92 EAL: Selected IOVA mode 'PA'
93 EAL: Contigmem driver has 2 buffers, each of size 1GB
94 EAL: Mapped memory segment 0 @ 0x1040000000: physaddr:0x180000000, len 1073741824
95 EAL: Mapped memory segment 1 @ 0x1080000000: physaddr:0x1c0000000, len 1073741824
96 EAL: PCI device 0000:00:19.0 on NUMA socket 0
97 EAL: probe driver: 8086:153b net_e1000_em
98 EAL: 0000:00:19.0 not managed by UIO driver, skipping
99 EAL: PCI device 0000:01:00.0 on NUMA socket 0
100 EAL: probe driver: 8086:1572 net_i40e
101 EAL: 0000:01:00.0 not managed by UIO driver, skipping
102 EAL: PCI device 0000:01:00.1 on NUMA socket 0
103 EAL: probe driver: 8086:1572 net_i40e
104 EAL: 0000:01:00.1 not managed by UIO driver, skipping
105 EAL: PCI device 0000:01:00.2 on NUMA socket 0
106 EAL: probe driver: 8086:1572 net_i40e
107 EAL: 0000:01:00.2 not managed by UIO driver, skipping
108 EAL: PCI device 0000:01:00.3 on NUMA socket 0
109 EAL: probe driver: 8086:1572 net_i40e
110 EAL: 0000:01:00.3 not managed by UIO driver, skipping
119 To run a DPDK process as a non-root user, adjust the permissions on
120 the ``/dev/contigmem`` and ``/dev/uio device`` nodes as described in section
121 :ref:`running_non_root`
125 For an explanation of the command-line parameters that can be passed to an
126 DPDK application, see section :ref:`running_sample_app`.