Skip to content

Commit faa81ba

Browse files
authored
Merge pull request #115 from CESNET/dpdkinit
init: add DPDK variables and improve ipfixprobed script
2 parents e471b6c + 47f4dbb commit faa81ba

File tree

2 files changed

+117
-21
lines changed

2 files changed

+117
-21
lines changed

init/ipfixprobed

100755100644
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ CONFFILE="/etc/ipfixprobe/$1.conf"
55
if [ -e "$CONFFILE" ]; then
66
source "$CONFFILE"
77
input=""
8+
dpdkinput=""
9+
if [ "$USE_DPDK" = "1" ]; then
10+
# set up DPDK interface(s)
11+
dpdkinput=("-i" "dpdk;p=$DPDK_PORT;q=$DPDK_QUEUES_COUNT;e=-c $DPDK_CPUMASK -a $DPDK_DEVICE")
12+
for ((ifc=1; ifc<$DPDK_QUEUES_COUNT;ifc++)); do
13+
dpdkinput+=("-i" "dpdk")
14+
done
15+
fi
816
if `declare -p INPUT > /dev/null 2>/dev/null`; then
917
# list of input plugins
1018
for ifc in "${!INPUT[@]}"; do
@@ -37,11 +45,7 @@ if [ -e "$CONFFILE" ]; then
3745
fi
3846
output="-o ipfix;host=${HOST:-127.0.0.1};port=${PORT:-4739};id=${LINK:-0};dir=${DIR:-0};${UDP_PARAM}"
3947

40-
if [ -n "$DPDKARGS" ]; then
41-
exec /usr/bin/ipfixprobe $DPDKARGS -- $input $storage $process $output
42-
else
43-
exec /usr/bin/ipfixprobe $input $storage $process $output
44-
fi
48+
exec /usr/bin/ipfixprobe "${dpdkinput[@]}" $input $storage $process $output
4549
else
4650
echo "Configuration file '$CONFFILE' does not exist, exitting." >&2
4751
exit 1

init/link0.conf.example

Lines changed: 108 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
1-
# set up shell-like variables
1+
# Set up shell-like variables
2+
# Lines starting with '#' are comments.
23

3-
# Use DPDKARGS to specify DPDK related arguments (other ipfixprobe arguments
4-
# are passed after "--")
5-
# WARNING - this does not work with non-DPDK version of ipfixprobe,
6-
# which does not know such arguments! So this should be commented out.
4+
# $$$$$$\ $$\
5+
# \_$$ _| $$ |
6+
# $$ | $$$$$$$\ $$$$$$\ $$\ $$\ $$$$$$\
7+
# $$ | $$ __$$\ $$ __$$\ $$ | $$ |\_$$ _|
8+
# $$ | $$ | $$ |$$ / $$ |$$ | $$ | $$ |
9+
# $$ | $$ | $$ |$$ | $$ |$$ | $$ | $$ |$$\
10+
# $$$$$$\ $$ | $$ |$$$$$$$ |\$$$$$$ | \$$$$ |
11+
# \______|\__| \__|$$ ____/ \______/ \____/
12+
# $$ |
13+
# $$ |
14+
# \__|
15+
#
16+
# Settings depend on type of input plugin.
17+
# For DPDK, skip to the related section and leave INPUT[*] array commented.
18+
#
19+
# For PCAP / NDP / raw, create a list of activated input plugins (arguments for -i parameter).
20+
#
21+
# Specify the array of input plugins with arguments using INPUT[], indexes (subscripts) must be unique.
22+
#
23+
# See `ipfixprobe --help input` for more information
724

8-
# DDPKARGS="-c 0x1 -a 0000:00:06.1"
25+
# Example of PCAP:
26+
#
27+
#INPUT[0]="pcap;ifc=eno2"
928

10-
# List of activated input plugins (arguments for -i parameter)
11-
# Specify array of input plugins with arguments using INPUT[], indexes (subscripts) must be unique
12-
INPUT[0]="ndp;dev=/dev/nfb0:0"
13-
INPUT[1]="ndp;dev=/dev/nfb0:1"
29+
# Example of NDP:
30+
#
31+
#INPUT[0]="ndp;dev=/dev/nfb0:0"
32+
#INPUT[1]="ndp;dev=/dev/nfb0:1"
33+
34+
# Example of raw:
35+
#
36+
#INPUT[0]="raw;ifc=eno2"
1437

1538
# Other examples:
1639
#
@@ -25,11 +48,86 @@ INPUT[1]="ndp;dev=/dev/nfb0:1"
2548
# INPUT[$i]="ndp;dev=/dev/nfb0:$i"
2649
# done
2750

51+
#===================================================
52+
# DPDK input plugin settings
53+
# --------------------------------------------------
54+
#
55+
# It is recommended to use either DPDK or NDP.
56+
#
57+
# Enable USE_DPDK input by setting USE_DPDK=1:
58+
59+
#USE_DPDK=1
60+
61+
# Set PCIe address in the format <[domain:]bus:devid.func> for example:
62+
63+
#DPDK_DEVICE=0000:43:00.0
64+
65+
# Set CPU mask:
66+
67+
#DPDK_CPUMASK=0x1
68+
69+
# Set network device port:
70+
71+
#DPDK_PORT=0
72+
73+
# Set number of parallel queues (RSS feature)
74+
75+
#DPDK_QUEUES_COUNT=8
76+
77+
#===================================================
78+
79+
# $$$$$$$\ $$\
80+
# $$ __$$\ \__|
81+
# $$ | $$ | $$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$\ $$\ $$$$$$$\ $$$$$$\
82+
# $$$$$$$ |$$ __$$\ $$ __$$\ $$ _____|$$ __$$\ $$ _____|$$ _____|$$ |$$ __$$\ $$ __$$\
83+
# $$ ____/ $$ | \__|$$ / $$ |$$ / $$$$$$$$ |\$$$$$$\ \$$$$$$\ $$ |$$ | $$ |$$ / $$ |
84+
# $$ | $$ | $$ | $$ |$$ | $$ ____| \____$$\ \____$$\ $$ |$$ | $$ |$$ | $$ |
85+
# $$ | $$ | \$$$$$$ |\$$$$$$$\ \$$$$$$$\ $$$$$$$ |$$$$$$$ |$$ |$$ | $$ |\$$$$$$$ |
86+
# \__| \__| \______/ \_______| \_______|\_______/ \_______/ \__|\__| \__| \____$$ |
87+
# $$\ $$ |
88+
# \$$$$$$ |
89+
# \______/
90+
#
2891
# List of activated process plugins (arguments for -p parameter), to skip plugins, use "basic" only:
2992
# PROCESS=(basic)
93+
#
94+
# See `ipfixprobe -h process` for the list of available plugins.
95+
#
3096
PROCESS=(pstats tls http ssdp "dnssd;txt")
3197

98+
#
99+
# $$$$$$$$\ $$\ $$$$$$\ $$\
100+
# $$ _____|$$ | $$ __$$\ $$ |
101+
# $$ | $$ | $$$$$$\ $$\ $$\ $$\ $$ / \__| $$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$\
102+
# $$$$$\ $$ |$$ __$$\ $$ | $$ | $$ | $$ | \____$$\ $$ _____|$$ __$$\ $$ __$$\
103+
# $$ __| $$ |$$ / $$ |$$ | $$ | $$ | $$ | $$$$$$$ |$$ / $$ | $$ |$$$$$$$$ |
104+
# $$ | $$ |$$ | $$ |$$ | $$ | $$ | $$ | $$\ $$ __$$ |$$ | $$ | $$ |$$ ____|
105+
# $$ | $$ |\$$$$$$ |\$$$$$\$$$$ | \$$$$$$ |\$$$$$$$ |\$$$$$$$\ $$ | $$ |\$$$$$$$\
106+
# \__| \__| \______/ \_____\____/ \______/ \_______| \_______|\__| \__| \_______|
107+
#
108+
#
109+
# Size of flow cache, exponent to the power of two
110+
CACHE_SIZE=17
32111

112+
# Active and inactive timeout in seconds
113+
ACTIVE_TIMEOUT=300
114+
INACTIVE_TIMEOUT=65
115+
116+
#
117+
# $$$$$$\ $$\ $$\
118+
# $$ __$$\ $$ | $$ |
119+
# $$ / $$ |$$\ $$\ $$$$$$\ $$$$$$\ $$\ $$\ $$$$$$\
120+
# $$ | $$ |$$ | $$ |\_$$ _| $$ __$$\ $$ | $$ |\_$$ _|
121+
# $$ | $$ |$$ | $$ | $$ | $$ / $$ |$$ | $$ | $$ |
122+
# $$ | $$ |$$ | $$ | $$ |$$\ $$ | $$ |$$ | $$ | $$ |$$\
123+
# $$$$$$ |\$$$$$$ | \$$$$ |$$$$$$$ |\$$$$$$ | \$$$$ |
124+
# \______/ \______/ \____/ $$ ____/ \______/ \____/
125+
# $$ |
126+
# $$ |
127+
# \__|
128+
#
129+
# The following variables set IPFIX output.
130+
#
33131
# Link / ODID identifier
34132
LINK=0
35133

@@ -43,9 +141,3 @@ PORT=4739
43141
# Use UDP yes/no? (instead of TCP)
44142
UDP=yes
45143

46-
# Size of flow cache, exponent to the power of two
47-
CACHE_SIZE=17
48-
49-
# Active and inactive timeout in seconds
50-
ACTIVE_TIMEOUT=300
51-
INACTIVE_TIMEOUT=65

0 commit comments

Comments
 (0)