aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2019-11-06 11:21:32 -0800
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:33 -0800
commit07e04cd76015d13cbb100fc8eb61dae935fd632b (patch)
tree46bcc0ed0e139e0e139b58c5a8167820c301a617 /host
parent2d110b1deda68351fdfbf6a8b7cc0c62897d57bc (diff)
downloaduhd-07e04cd76015d13cbb100fc8eb61dae935fd632b.tar.gz
uhd-07e04cd76015d13cbb100fc8eb61dae935fd632b.tar.bz2
uhd-07e04cd76015d13cbb100fc8eb61dae935fd632b.zip
docs: Change DPDK version to 18.11 and make args use underscores
Swap out hyphens for underscores in the DPDK args. Also update list of distributions with the correct DPDK version in the repos.
Diffstat (limited to 'host')
-rw-r--r--host/cmake/Modules/FindDPDK.cmake27
-rw-r--r--host/docs/dpdk.dox54
-rw-r--r--host/lib/CMakeLists.txt2
-rw-r--r--host/lib/utils/prefs.cpp2
4 files changed, 52 insertions, 33 deletions
diff --git a/host/cmake/Modules/FindDPDK.cmake b/host/cmake/Modules/FindDPDK.cmake
index 53ecf1112..a5029b94c 100644
--- a/host/cmake/Modules/FindDPDK.cmake
+++ b/host/cmake/Modules/FindDPDK.cmake
@@ -24,6 +24,11 @@ find_path ( DPDK_INCLUDE_ETHDEV_DIR rte_ethdev.h
PATH_SUFFIXES dpdk
)
+find_path ( DPDK_INCLUDE_VERSION_DIR rte_version.h
+ PATHS ENV RTE_INCLUDE
+ PATH_SUFFIXES dpdk
+)
+
set(DPDK_INCLUDE_DIR ${DPDK_INCLUDE_CONFIG_DIR} ${DPDK_INCLUDE_ETHDEV_DIR})
list(REMOVE_DUPLICATES DPDK_INCLUDE_DIR)
@@ -33,8 +38,22 @@ find_library(DPDK_LIBRARY
list(APPEND DPDK_LIBRARIES dpdk)
-find_package_handle_standard_args(dpdk
- DEFAULT_MSG
- DPDK_INCLUDE_DIR
- DPDK_LIBRARIES
+if(DPDK_INCLUDE_VERSION_DIR)
+ file(READ "${DPDK_INCLUDE_VERSION_DIR}/rte_version.h"
+ DPDK_VERSION_STR
+ )
+
+ string(REGEX MATCH "#define RTE_VER_YEAR ([0-9]+)" _ ${DPDK_VERSION_STR})
+ set(DPDK_VERSION_MAJOR ${CMAKE_MATCH_1})
+
+ string(REGEX MATCH "#define RTE_VER_MONTH ([0-9]+)" _ ${DPDK_VERSION_STR})
+ set(DPDK_VERSION_MINOR ${CMAKE_MATCH_1})
+endif(DPDK_INCLUDE_VERSION_DIR)
+
+
+set(DPDK_VERSION "${DPDK_VERSION_MAJOR}.${DPDK_VERSION_MINOR}")
+
+find_package_handle_standard_args(DPDK
+ REQUIRED_VARS DPDK_INCLUDE_DIR DPDK_LIBRARIES
+ VERSION_VAR DPDK_VERSION
)
diff --git a/host/docs/dpdk.dox b/host/docs/dpdk.dox
index 3d7b1687b..75a6f458c 100644
--- a/host/docs/dpdk.dox
+++ b/host/docs/dpdk.dox
@@ -26,22 +26,22 @@ computer.
\subsection dpdk_installation DPDK Installation Instructions
As a new and developing technology, the DPDK APIs are unstable. UHD requires
-version 17.11.
+version 18.11.
-On Ubuntu 18.04/18.10, Fedora 28/29, or Debian Stretch (via backports), DPDK is
-available in your distribution's repositories. For example, on Debian systems,
-it can be obtained with the following command:
+On Ubuntu 19.04/19.10, Fedora 31, or Debian Buster/Stretch (via backports),
+DPDK is available in your distribution's repositories. For example, on Debian
+systems, it can be obtained with the following command:
sudo apt install dpdk dpdk-dev
Otherwise, you'll need to follow the build guide at
-https://doc.dpdk.org/guides-17.11/linux_gsg/build_dpdk.html . The software
+https://doc.dpdk.org/guides-18.11/linux_gsg/build_dpdk.html . The software
releases can be found at https://core.dpdk.org/download/.
\subsection dpdk_system_configuration System Configuration
The official documentation regarding system configuration can be found at
-https://doc.dpdk.org/guides-17.11/linux_gsg/sys_reqs.html.
+https://doc.dpdk.org/guides-18.11/linux_gsg/sys_reqs.html.
First, you'll need to enable the IOMMU and set up some hugepages. DPDK will
completely take over all available hugepages, so don't allocate all your memory
@@ -51,7 +51,7 @@ For example, on a system with 16 GB of RAM, a generous appropriation of
512x 2 MiB pages was more than sufficient, and you likely won't need that much.
For best results, hugepages should be enabled at boot. For example, using an
-Intel IOMMU with Ubuntu 18.04 IOMMU drivers, the following line was needed in
+Intel IOMMU with Ubuntu 19.04 IOMMU drivers, the following line was needed in
our Grub config.
iommu=pt intel_iommu=on hugepages=2048
@@ -67,7 +67,7 @@ load that driver with the following command:
For NICs that require vfio-pci (like Intel's X520), you'll want to use the
`dpdk-devbind.py` script to the vfio-pci driver.
-See https://doc.dpdk.org/guides-17.11/linux_gsg/linux_drivers.html#binding-and-unbinding-network-ports-to-from-the-kernel-modules
+See https://doc.dpdk.org/guides-18.11/linux_gsg/linux_drivers.html#binding-and-unbinding-network-ports-to-from-the-kernel-modules
for more details.
With the hugepages, IOMMU, and drivers set up, the system is ready for DPDK to
@@ -92,47 +92,47 @@ options:
;The value here represents a config, so you could have another section labeled use_dpdk=myconf
;instead and swap between them
[use_dpdk=1]
- ;dpdk-mtu is the NIC's MTU setting
+ ;dpdk_mtu is the NIC's MTU setting
;This is separate from MPM's maximum packet size--tops out at 4000
- dpdk-mtu=9000
- ;dpdk-driver is the -d flag for the DPDK EAL. If DPDK doesn't pick up the driver for your NIC
+ dpdk_mtu=9000
+ ;dpdk_driver is the -d flag for the DPDK EAL. If DPDK doesn't pick up the driver for your NIC
;automatically, you may need this argument to point it to the folder where it can find the drivers
;Note that DPDK will attempt to load _everything_ in that folder as a driver, so you may want to
;create a separate folder with symlinks to the librte_pmd_* and librte_mempool_* libraries.
- dpdk-driver=/usr/local/lib/dpdk-pmds/
- ;dpdk-corelist is the -l flag for the DPDK EAL. See more at the link
- ; https://doc.dpdk.org/guides-17.11/linux_gsg/build_sample_apps.html#running-a-sample-application
- dpdk-corelist=0,1
- ;dpdk-num-mbufs is the total number of packet buffers allocated
+ dpdk_driver=/usr/local/lib/dpdk-pmds/
+ ;dpdk_corelist is the -l flag for the DPDK EAL. See more at the link
+ ; https://doc.dpdk.org/guides-18.11/linux_gsg/build_sample_apps.html#running-a-sample-application
+ dpdk_corelist=0,1
+ ;dpdk_num_mbufs is the total number of packet buffers allocated
;to each direction's packet buffer pool
;This will be multiplied by the number of NICs, but NICs on the same
;CPU socket share a pool
- dpdk-num-mbufs=4095
- ;dpdk-mbuf-cache-size is the number of buffers to cache for a CPU
+ dpdk_num_mbufs=512
+ ;dpdk_mbuf_cache_size is the number of buffers to cache for a CPU
;The cache reduces the interaction with the global pool
- dpdk-mbuf-cache-size=315
+ dpdk_mbuf_cache_size=64
The other sections fall under per-NIC arguments. The key for NICs is the MAC
address, and it must be in a particular format. Hex digits must all be lower
case, and octets must be separated by colons. Here is an example:
- [dpdk-mac=3c:fd:fe:a2:a9:09]
- ;dpdk-io-cpu selects the CPU that this NIC's driver will run on
+ [dpdk_mac=3c:fd:fe:a2:a9:09]
+ ;dpdk_io_cpu selects the CPU that this NIC's driver will run on
;Multiple NICs may occupy one CPU, but the I/O thread will completely
;consume that CPU. Also, 0 is reserved for the master thread (i.e.
;the initial UHD thread that calls init() for DPDK). Attempting to
;use it as an I/O thread will only result in hanging.
- dpdk-io-cpu = 1
- ;dpdk-ipv4 specifies the IPv4 address, and both the address and
+ dpdk_io_cpu = 1
+ ;dpdk_ipv4 specifies the IPv4 address, and both the address and
;subnet mask are required (and in this format!). DPDK uses the
;netmask to create a basic routing table. Routing to other networks
;(i.e. via gateways) is not permitted.
- dpdk-ipv4 = 192.168.10.1/24
+ dpdk_ipv4 = 192.168.10.1/24
- [dpdk-mac=3c:fd:fe:a2:a9:0a]
- dpdk-io-cpu = 1
- dpdk-ipv4 = 192.168.20.1/24
+ [dpdk_mac=3c:fd:fe:a2:a9:0a]
+ dpdk_io_cpu = 1
+ dpdk_ipv4 = 192.168.20.1/24
\section dpdk_using Using DPDK in UHD
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index 4e2cf9022..18bc47f54 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -61,7 +61,7 @@ message(STATUS "")
# Dependencies
find_package(USB1)
find_package(LIBERIO)
-find_package(DPDK)
+find_package(DPDK 18.11 EXACT)
LIBUHD_REGISTER_COMPONENT("LIBERIO" ENABLE_LIBERIO ON "ENABLE_LIBUHD;LIBERIO_FOUND" OFF OFF)
LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF OFF)
# Devices
diff --git a/host/lib/utils/prefs.cpp b/host/lib/utils/prefs.cpp
index 88be300cb..5755ad4b4 100644
--- a/host/lib/utils/prefs.cpp
+++ b/host/lib/utils/prefs.cpp
@@ -119,7 +119,7 @@ device_addr_t uhd::prefs::get_dpdk_nic_args(
const uhd::device_addr_t &user_args
) {
const std::vector<std::string> keys_to_update_from = {
- "dpdk-mac"
+ "dpdk_mac"
};
return get_args(user_args, keys_to_update_from);
}