Skip to content

Commit 1ac04ac

Browse files
authored
Merge pull request #185 from CESNET/dpdkinit
dpdk: propose new variables to control init by ipfixprobed
2 parents af624f2 + 84cecb3 commit 1ac04ac

File tree

6 files changed

+115
-12
lines changed

6 files changed

+115
-12
lines changed

init/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pkgsysconfdir=$(sysconfdir)/ipfixprobe
2-
dist_pkgsysconf_DATA=link0.conf.example
2+
dist_pkgsysconf_DATA=link0.conf.example dpdk_direct.conf.example dpdk_mring.conf.example
33
bin_SCRIPTS=ipfixprobed
44
dist_systemdsystemunit_DATA[email protected] ipfixprobe-monitoring.target
55

init/dpdk_direct.conf.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# See link0.conf.example for description of the options
2+
#######################################################
3+
4+
USE_DPDK=1
5+
DPDK_QUEUES_COUNT=8
6+
DPDK_LCORES="(0-7)@(0,2,4,6,8,10,12,14)"
7+
DPDK_EXTRA_EAL="--file-prefix 0000:17:00.0"
8+
DPDK_OPTS="m=2000;b=2048"
9+
DPDK_DEVICE="0000:17:00.0,rxhdr_dynfield=1,reta_index_global=1,queue_driver=native"
10+
DPDK_PORT=0
11+
PROCESS=(pstats tls http ssdp "dnssd;txt")
12+
CACHE_SIZE=17
13+
ACTIVE_TIMEOUT=300
14+
INACTIVE_TIMEOUT=65
15+
LINK=0
16+
DIR=0
17+
HOST=127.0.0.1
18+
PORT=4739
19+
UDP=yes
20+

init/dpdk_mring.conf.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# See link0.conf.example for description of the options
2+
#######################################################
3+
4+
USE_DPDK=1
5+
DPDK_RING=1
6+
DPDK_QUEUES_COUNT=8
7+
DPDK_LCORES="(0-7)@(0,2,4,6,8,10,12,14)"
8+
DPDK_EXTRA_EAL="--proc-type=secondary"
9+
DPDK_OPTS="b=2048"
10+
DPDK_RING_PATTERN="ipfixprobe_in_%i"
11+
DPDK_RING_STARTIDX=0
12+
PROCESS=(basicplus pstats tls quic http")
13+
CACHE_SIZE=17
14+
ACTIVE_TIMEOUT=300
15+
INACTIVE_TIMEOUT=65
16+
LINK=0
17+
DIR=0
18+
HOST=127.0.0.1
19+
PORT=4739
20+
UDP=yes
21+

init/ipfixprobed

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,38 @@ if [ -e "$CONFFILE" ]; then
77
input=""
88
dpdkinput=""
99
if [ "$USE_DPDK" = "1" ]; then
10+
# check
11+
if [ -z "$DPDK_QUEUES_COUNT" ]; then
12+
echo "Missing DPDK_QUEUES_COUNT in configuration of DPDK mode."
13+
exit 1
14+
fi
15+
1016
# set up DPDK interface(s)
11-
dpdkinput=("-i" "dpdk;p=$DPDK_PORT;q=$DPDK_QUEUES_COUNT;e=--lcores $DPDK_LCORES -a $DPDK_DEVICE")
12-
for ((ifc=1; ifc<$DPDK_QUEUES_COUNT;ifc++)); do
13-
dpdkinput+=("-i" "dpdk")
14-
done
17+
if [ "$DPDK_RING" = "1" ]; then
18+
# checks
19+
if [ -z "$DPDK_RING_PATTERN" ]; then
20+
echo "Missing DPDK_RING_PATTERN in configuration of DPDK_RING mode."
21+
exit 1
22+
fi
23+
if [ -z "$DPDK_RING_STARTIDX" ]; then
24+
echo "Missing DPDK_RING_STARTIDX in configuration of DPDK_RING mode, using 0."
25+
DPDK_RING_STARTIDX=0
26+
fi
27+
# mring interfaces
28+
dpdkinput=("-i" "dpdk-ring;r=$(printf "$DPDK_RING_PATTERN" "$DPDK_RING_STARTIDX");e=--lcores $DPDK_LCORES $DPDK_EXTRA_EAL")
29+
for ((ifc=($DPDK_RING_STARTIDX+1); ifc<($DPDK_RING_STARTIDX + $DPDK_QUEUES_COUNT);ifc++)); do
30+
dpdkinput+=("-i" "dpdk-ring;r=$(printf "$DPDK_RING_PATTERN" "$ifc")")
31+
done
32+
else
33+
# DPDK port interface
34+
if [ -n "$DPDK_PORTOPTS" -a "${DPDK_PORTOPTS:0:1}" != ";" ]; then
35+
DPDK_PORTOPTS=";$DPDK_PORTOPTS"
36+
fi
37+
dpdkinput=("-i" "dpdk;p=${DPDK_PORT}${DPDK_PORTOPTS};q=$DPDK_QUEUES_COUNT;e=--lcores $DPDK_LCORES $DPDK_EXTRA_EAL -a $DPDK_DEVICE")
38+
for ((ifc=1; ifc<$DPDK_QUEUES_COUNT;ifc++)); do
39+
dpdkinput+=("-i" "dpdk")
40+
done
41+
fi
1542
fi
1643
if `declare -p INPUT > /dev/null 2>/dev/null`; then
1744
# list of input plugins

init/link0.conf.example

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,54 @@
5858

5959
#USE_DPDK=1
6060

61-
# Set PCIe address in the format <[domain:]bus:devid.func> for example:
62-
63-
#DPDK_DEVICE=0000:43:00.0
61+
# Required: Set number of parallel queues (RSS feature):
62+
#DPDK_QUEUES_COUNT=8
6463

6564
# Set mapping of DPDK lcores to threads:
65+
#DPDK_LCORES="(0-7)@(0,2,4,6,8,10,12,14)"
66+
67+
# Extra options for DPDK EAL, passed to e= option of `dpdk` or `dpdk-ring` plugin.
68+
# * Use --file-prefix to separate DPDK application into new namespace.
69+
# * Use --proc-type=secondary for Option B) to receive packets via mrings created
70+
# by some other primary DPDK application.
71+
#DPDK_EXTRA_EAL="--file-prefix 0000:17:00.0_0 --proc-type=secondary"
72+
73+
# Additional options of DPDK plugin separated by `;`
74+
# m ~ Size of the memory pool for received packets (only for Option A)
75+
# b ~ Size of the MBUF packet buffer
76+
#DPDK_OPTS="m=2000;b=2048"
77+
78+
#----------------------------------------
79+
# Option A) DPDK direct device
80+
#----------------------------------------
6681

67-
#DPDK_LCORES="(0-7)@(0-7)"
82+
# Required: Set PCIe address in the format <[domain:]bus:devid.func> for example:
83+
#DPDK_DEVICE="0000:43:00.0"
6884

69-
# Set network device port:
85+
# Note that DPDK_DEVICE can be extended by driver-specific parameters, e.g.:
86+
#
87+
#DPDK_DEVICE=0000:17:00.0,rxhdr_dynfield=1,reta_index_global=1,queue_driver=native
88+
#
89+
# this example shows parameters for FPGA firmware by CESNET:
90+
# rxhdr_dynfield=1 ~ memory allocation
91+
# reta_index_global=1 ~ enable redirection table to enhance RSS among multiple ports
92+
# queue_driver=native ~ DPDK driver mode
7093

94+
# Required: Set network device port, can be a list separated by comma:
7195
#DPDK_PORT=0
7296

73-
# Set number of parallel queues (RSS feature)
97+
#----------------------------------------
98+
# Option B) DPDK mring input instead of DPDK_DEVICE
99+
#----------------------------------------
74100

75-
#DPDK_QUEUES_COUNT=8
101+
# Enable option B) instead of A), receive packets via DPDK mrings
102+
#DPDK_RING=1
103+
104+
# Required: set pattern to generate mring identifiers, use %i of printf format to place index:
105+
#DPDK_RING_PATTERN="rx_ipfixprobe_%i"
106+
107+
# set starting index to generate mring identifiers (e.g., startidx=8 with DPDK_QUEUES_COUNT=4 makes indexes 8, 9, 10, 11)
108+
#DPDK_RING_STARTIDX=0
76109

77110
#===================================================
78111

ipfixprobe.spec.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ This package contains header file for liburfilter.
124124
%attr(0755, root, nemead) %{_bindir}/ipfixprobed
125125
%{_sysconfdir}/bash_completion.d/ipfixprobe.bash
126126
%{_sysconfdir}/ipfixprobe/link0.conf.example
127+
%{_sysconfdir}/ipfixprobe/dpdk_direct.conf.example
128+
%{_sysconfdir}/ipfixprobe/dpdk_mring.conf.example
127129
%{_docdir}/ipfixprobe/README.md
128130
%if %{with ndp}
129131
%{_libdir}/libndpRI.so.0

0 commit comments

Comments
 (0)