DPDK: upgrade to 17.11.2 LTS.

Changes:
1. This version is downloaded from
https://fast.dpdk.org/rel/dpdk-17.11.2.tar.xz.
2. Adapt the new interface `rte_ring_dequeue_burst`.
3. Change the type of `port_id` from uint8_t to uint16_t.
4. Just link libdpdk.a instead of the other libaries.
5. Install libnuma-dev first.
6. Update the documents.
dev
logwang 2018-05-15 17:49:22 +08:00
parent 5e5c25c329
commit 2bfe3f2e55
2336 changed files with 575213 additions and 113360 deletions

View File

@ -33,12 +33,16 @@ Currently, besides authorized DNS server of DNSPod, there are various products i
# clone F-Stack
mkdir /data/f-stack
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
# install libnuma-dev
yum install numactl-devel # on Centos
#sudo apt-get install libnuma-dev # on Ubuntu
cd f-stack
# compile DPDK
cd dpdk/tools
cd dpdk/usertools
./dpdk-setup.sh # compile with x86_64-native-linuxapp-gcc
# Set hugepage
# single-node system
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

View File

@ -29,11 +29,9 @@ endif
DEBUG= -g
BINARY = libmt.a
FF_LIBS+= -L${FF_PATH}/lib -L${FF_DPDK}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
FF_LIBS+= -Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring
FF_LIBS+= -Wl,--whole-archive -lrte_hash -lrte_kvargs -Wl,-lrte_mbuf -lethdev -lrte_eal -Wl,-lrte_mempool
FF_LIBS+= -lrte_ring -lrte_cmdline -lrte_cfgfile -lrte_kni -lrte_timer -Wl,-lrte_pmd_virtio
FF_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -pthread
FF_LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
FF_LIBS+= -L${FF_DPDK}/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive
FF_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -lpthread -lnuma
# Comment the following line if you are not using the gnu c compiler
#C_ARGS = -Wall -g -fPIC -D_DEBUG

View File

@ -28,12 +28,9 @@ if [ ! $FF_DPDK ]; then
echo "FF_DPDK environment variable not defined, default:$FF_DPDK"
fi
CORE_LIBS="$CORE_LIBS -L$FF_PATH/lib -L$FF_DPDK/lib -Wl,--whole-archive,-lfstack,--no-whole-archive"
CORE_LIBS="$CORE_LIBS -g -Wl,--no-as-needed -fvisibility=default -pthread -lm -lrt"
CORE_LIBS="$CORE_LIBS -Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring"
CORE_LIBS="$CORE_LIBS -Wl,--whole-archive -lrte_hash -lrte_kvargs -Wl,-lrte_mbuf -lethdev -lrte_eal -Wl,-lrte_mempool"
CORE_LIBS="$CORE_LIBS -lrte_ring -lrte_cmdline -lrte_cfgfile -lrte_kni -lrte_timer -Wl,-lrte_pmd_virtio"
CORE_LIBS="$CORE_LIBS -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto"
CORE_LIBS="$CORE_LIBS -L$FF_PATH/lib -Wl,--whole-archive,-lfstack,--no-whole-archive"
CORE_LIBS="$CORE_LIBS -L$FF_DPDK/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive"
CORE_LIBS="$CORE_LIBS -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -lpthread -lnuma"
cat << END > $NGX_MAKEFILE

View File

@ -16,7 +16,7 @@ ifeq ($(FF_PATH),)
$(error variable FF_PATH is not set)
endif
ifeq ($(FF_DPDK),)
$(error variable FF_DPDK is not set)
FF_DPDK= $(FF_PATH)/dpdk/x86_64-native-linuxapp-gcc
endif
release_hdr := $(shell sh -c './mkreleasehdr.sh')
@ -119,12 +119,9 @@ endif
FINAL_CFLAGS+= -DHAVE_FF_KQUEUE
FINAL_CFLAGS+= -I$(FF_PATH)/lib
FINAL_LIBS+= -L$(FF_PATH)/lib -L$(FF_DPDK)/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
FINAL_LIBS+= -g -Wl,--no-as-needed -fvisibility=default -pthread -lm -lrt
FINAL_LIBS+= -Wl,--whole-archive -lrte_pmd_vmxnet3_uio -lrte_pmd_i40e -lrte_pmd_ixgbe -lrte_pmd_e1000 -lrte_pmd_ring
FINAL_LIBS+= -Wl,--whole-archive -lrte_hash -lrte_kvargs -Wl,-lrte_mbuf -lethdev -lrte_eal -Wl,-lrte_mempool
FINAL_LIBS+= -lrte_ring -lrte_cmdline -lrte_cfgfile -lrte_kni -lrte_timer -Wl,-lrte_pmd_virtio
FINAL_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lm -lcrypto
FINAL_LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
FINAL_LIBS+= -L${FF_DPDK}/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive
FINAL_LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -lpthread -lnuma
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)

View File

@ -1,15 +1,15 @@
# F-Stack Development Guide
With the rapid development of NIC, the poor performance of data packets processing with Linux kernel has become the bottleneck. However the rapid development of the Internet needs high performance of network processing, kernel bypass has caught more and more attention. There are various similar technologies appear, such as DPDK, NETMAP and PF_RING. The main idea of kernel bypass is that Linux is only used to deal with control flow, all data streams are processed in user space. Therefore kernel bypass can avoid performance bottlenecks caused by kernel packet copy, thread scheduling, system calls and interrupt. Further more, kernel bypass can achieve higher performance with multi optimizing methods. Within various techniques, DPDK has been widely used because of its more thorough isolation from kernel scheduling and active community support.
With the rapid development of Network Interface Cards the poor performance of data packet processing with the Linux kernel has become the bottleneck in modern network systems. Yet, the increasing demands of the Internet's growth demand a higher performant network processing solution. Kernel bypass has emerged to catch more and more attention. There are various similar technologies such as: DPDK, NETMAP and PF_RING. The main idea of kernel bypass is that Linux is only used to deal with control flow; all data streams are processed in user space. Therefore, kernel bypass can avoid performance bottlenecks caused by kernel packet copying, thread scheduling, system calls, and interrupts. Furthermore, kernel bypass can achieve higher performance with multi-optimizing methods. Within various techniques, DPDK has been widely used because of it's more thorough isolation from kernel scheduling and active community support.
F-Stack is an open source network framework with high performance based on DPDK. With follow characteristics
F-Stack is an open source high performant network framework based on DPDK with the following characteristics:
1. Ultra high network performance which can achieve network card under full load, 10 million concurrent, five million RPS, 1 million CPS.
2. Transplant FreeBSD 11.01 user space stack, provides a complete stack function, cut a great amount of irrelevant features. Therefore greatly enhance the performance.
3. Support Nginx, Redis and other mature applications, service can easily use F-Stack
4. With Multi-process architecture, easy to extend
5. Provide micro thread interface. Various applications with long time consuming can easily use F-Stack to get high performance without processing complex asynchronous logic.
6. Provide Epoll/kqueue interface that allow many kinds of applications easily use F-Stack
1. Ultra high network performance which the network card can achieve under full load: 10 million concurrent connections, 5 million RPS, 1 million CPS.
2. Transplant FreeBSD 11.01 user space stack, which provides a complete stack function, and cut a great amount of irrelevant features. This greatly enhances network performance.
3. Support Nginx, Redis, and other mature applications. Services can easily use F-Stack.
4. Easy to extend with multi-process architecture.
5. Provides micro thread interface. Various applications with stateful applications can easily use F-Stack to get high performance without processing complex asynchronous logic.
6. Provide an Epoll/Kqueue interface that allow many kinds of applications to easily use F-Stack.
## Structure of F-Stack code

View File

@ -7,11 +7,18 @@
See Intel DPDK [linux_gsg](http://dpdk.org/doc/guides/linux_gsg/index.html)
## clone F-Stack
## Clone F-Stack
mkdir /data/f-stack
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
## Install libnuma-dev
# on Centos
yum install numactl-devel
# on Ubuntu
sudo apt-get install libnuma-dev
## Compile DPDK
Read DPDK Quick Started Guide or run the command below
@ -43,20 +50,20 @@ The mount point can be made permanent across reboots, by adding the following li
## offload NIC
modprobe uio
insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko
python dpdk-devbind.py --status
ifconfig eth0 down
python dpdk-devbind.py --bind=igb_uio eth0 # assuming that use 10GE NIC and eth0
modprobe uio
insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
insmod /data/f-stack/dpdk/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko
python dpdk-devbind.py --status
ifconfig eth0 down
python dpdk-devbind.py --bind=igb_uio eth0 # assuming that use 10GE NIC and eth0
## Compile lib
export FF_PATH=/data/f-stack
export FF_DPDK=/data/f-stack/dpdk/x86_64-native-linuxapp-gcc
cd ../../
cd lib
make
export FF_PATH=/data/f-stack
export FF_DPDK=/data/f-stack/dpdk/x86_64-native-linuxapp-gcc
cd ../../
cd lib
make
### Compile Nginx

View File

@ -3,8 +3,8 @@
If you have a Redhat7.3 EC2 instanceand then execute the following cmds, you will get the F-Stack server in one minute
sudo -i
yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc
yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc numactl-devel
mkdir /data/f-stack
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
@ -17,7 +17,7 @@
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
# close ASLR; it is necessary in multiple process
echo 0 > /proc/sys/kernel/randomize_va_space
@ -40,7 +40,7 @@
#export mybc=`ifconfig eth0 | grep "Bcast" | awk -F ' ' '{print $3}' | awk -F ':' '{print $2}'`
#export myhw=`ifconfig eth0 | grep "HWaddr" | awk -F ' ' '{print $5}'`
#export mygw=`route -n | grep 0.0.0.0 | grep eth0 | grep UG | awk -F ' ' '{print $2}'
sed "s/addr=192.168.1.2/addr=${myaddr}/" -i /data/f-stack/config.ini
sed "s/netmask=255.255.255.0/netmask=${mymask}/" -i /data/f-stack/config.ini
sed "s/broadcast=192.168.1.255/broadcast=${mybc}/" -i /data/f-stack/config.ini
@ -53,7 +53,6 @@
sed "s/#tcp_port=80/tcp_port=80/" -i /data/f-stack/config.ini
sed "s/#vlanstrip=1/vlanstrip=1/" -i /data/f-stack/config.ini
# Compile F-Stack lib
export FF_PATH=/data/f-stack
export FF_DPDK=/data/f-stack/dpdk/build
@ -68,7 +67,7 @@
# offload NICif there is only one NICthe follow commands must run in a script
ifconfig eth0 down
python /data/f-stack/dpdk/tools/dpdk-devbind.py --bind=igb_uio eth0
python /data/f-stack/dpdk/usertools/dpdk-devbind.py --bind=igb_uio eth0
# copy config.ini to $NGX_PREFIX/conf/f-stack.conf
cp /data/f-stack/config.ini /usr/local/nginx_fstack/conf/f-stack.conf

3
dpdk/.gitattributes vendored Normal file
View File

@ -0,0 +1,3 @@
*.c diff=cpp
*.h diff=cpp
*.py diff=python

14
dpdk/.gitignore vendored
View File

@ -0,0 +1,14 @@
doc/guides/nics/overview_table.txt
doc/guides/cryptodevs/overview_feature_table.txt
doc/guides/cryptodevs/overview_cipher_table.txt
doc/guides/cryptodevs/overview_auth_table.txt
doc/guides/cryptodevs/overview_aead_table.txt
cscope.out.po
cscope.out.in
cscope.out
cscope.files
GTAGS
GPATH
GRTAGS
tags
TAGS

View File

@ -41,5 +41,6 @@ export RTE_SDK
#
ROOTDIRS-y := buildtools lib drivers app
ROOTDIRS- := test
include $(RTE_SDK)/mk/rte.sdkroot.mk

File diff suppressed because it is too large Load Diff

View File

@ -31,12 +31,16 @@
include $(RTE_SDK)/mk/rte.vars.mk
DIRS-$(CONFIG_RTE_APP_TEST) += test
DIRS-$(CONFIG_RTE_LIBRTE_ACL) += test-acl
DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test-pipeline
DIRS-$(CONFIG_RTE_TEST_PMD) += test-pmd
DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_test
DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += proc_info
DIRS-$(CONFIG_RTE_PROC_INFO) += proc_info
DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += pdump
ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
DIRS-$(CONFIG_RTE_APP_CRYPTO_PERF) += test-crypto-perf
endif
ifeq ($(CONFIG_RTE_LIBRTE_EVENTDEV),y)
DIRS-$(CONFIG_RTE_APP_EVENTDEV) += test-eventdev
endif
include $(RTE_SDK)/mk/rte.subdir.mk

View File

@ -1,55 +0,0 @@
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(RTE_SDK)/mk/rte.vars.mk
ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y)
#
# library name
#
APP = cmdline_test
#
# all sources are stored in SRCS-y
#
SRCS-y += cmdline_test.c
SRCS-y += commands.c
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
# this application needs libraries first
DEPDIRS-y += lib drivers
include $(RTE_SDK)/mk/rte.app.mk
endif

View File

@ -1,113 +0,0 @@
#!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Script that runs cmdline_test app and feeds keystrokes into it.
import sys, pexpect, string, os, cmdline_test_data
#
# function to run test
#
def runTest(child,test):
child.send(test["Sequence"])
if test["Result"] == None:
return 0
child.expect(test["Result"],1)
#
# history test is a special case
#
# This test does the following:
# 1) fills the history with garbage up to its full capacity
# (just enough to remove last entry)
# 2) scrolls back history to the very beginning
# 3) checks if the output is as expected, that is, the first
# number in the sequence (not the last entry before it)
#
# This is a self-contained test, it needs only a pexpect child
#
def runHistoryTest(child):
# find out history size
child.sendline(cmdline_test_data.CMD_GET_BUFSIZE)
child.expect("History buffer size: \\d+", timeout=1)
history_size = int(child.after[len(cmdline_test_data.BUFSIZE_TEMPLATE):])
i = 0
# fill the history with numbers
while i < history_size / 10:
# add 1 to prevent from parsing as octals
child.send("1" + str(i).zfill(8) + cmdline_test_data.ENTER)
# the app will simply print out the number
child.expect(str(i + 100000000), timeout=1)
i += 1
# scroll back history
child.send(cmdline_test_data.UP * (i + 2) + cmdline_test_data.ENTER)
child.expect("100000000", timeout=1)
# the path to cmdline_test executable is supplied via command-line.
if len(sys.argv) < 2:
print "Error: please supply cmdline_test app path"
sys.exit(1)
test_app_path = sys.argv[1]
if not os.path.exists(test_app_path):
print "Error: please supply cmdline_test app path"
sys.exit(1)
child = pexpect.spawn(test_app_path)
print "Running command-line tests..."
for test in cmdline_test_data.tests:
print (test["Name"] + ":").ljust(30),
try:
runTest(child,test)
print "PASS"
except:
print "FAIL"
print child
sys.exit(1)
# since last test quits the app, run new instance
child = pexpect.spawn(test_app_path)
print ("History fill test:").ljust(30),
try:
runHistoryTest(child)
print "PASS"
except:
print "FAIL"
print child
sys.exit(1)
child.close()
sys.exit(0)

View File

@ -1,311 +0,0 @@
#!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# collection of static data
import sys
# keycode constants
CTRL_A = chr(1)
CTRL_B = chr(2)
CTRL_C = chr(3)
CTRL_D = chr(4)
CTRL_E = chr(5)
CTRL_F = chr(6)
CTRL_K = chr(11)
CTRL_L = chr(12)
CTRL_N = chr(14)
CTRL_P = chr(16)
CTRL_W = chr(23)
CTRL_Y = chr(25)
ALT_B = chr(27) + chr(98)
ALT_D = chr(27) + chr(100)
ALT_F = chr(27) + chr(102)
ALT_BKSPACE = chr(27) + chr(127)
DEL = chr(27) + chr(91) + chr(51) + chr(126)
TAB = chr(9)
HELP = chr(63)
BKSPACE = chr(127)
RIGHT = chr(27) + chr(91) + chr(67)
DOWN = chr(27) + chr(91) + chr(66)
LEFT = chr(27) + chr(91) + chr(68)
UP = chr(27) + chr(91) + chr(65)
ENTER2 = '\r'
ENTER = '\n'
# expected result constants
NOT_FOUND = "Command not found"
BAD_ARG = "Bad arguments"
AMBIG = "Ambiguous command"
CMD1 = "Command 1 parsed!"
CMD2 = "Command 2 parsed!"
SINGLE = "Single word command parsed!"
SINGLE_LONG = "Single long word command parsed!"
AUTO1 = "Autocomplete command 1 parsed!"
AUTO2 = "Autocomplete command 2 parsed!"
# misc defines
CMD_QUIT = "quit"
CMD_GET_BUFSIZE = "get_history_bufsize"
BUFSIZE_TEMPLATE = "History buffer size: "
PROMPT = "CMDLINE_TEST>>"
# test defines
# each test tests progressively diverse set of keys. this way for example
# if we want to use some key sequence in the test, we first need to test
# that it itself does what it is expected to do. Most of the tests are
# designed that way.
#
# example: "arrows & delete test 1". we enter a partially valid command,
# then move 3 chars left and use delete three times. this way we get to
# know that "delete", "left" and "ctrl+B" all work (because if any of
# them fails, the whole test will fail and next tests won't be run).
#
# each test consists of name, character sequence to send to child,
# and expected output (if any).
tests = [
# test basic commands
{"Name" : "command test 1",
"Sequence" : "ambiguous first" + ENTER,
"Result" : CMD1},
{"Name" : "command test 2",
"Sequence" : "ambiguous second" + ENTER,
"Result" : CMD2},
{"Name" : "command test 3",
"Sequence" : "ambiguous ambiguous" + ENTER,
"Result" : AMBIG},
{"Name" : "command test 4",
"Sequence" : "ambiguous ambiguous2" + ENTER,
"Result" : AMBIG},
{"Name" : "invalid command test 1",
"Sequence" : "ambiguous invalid" + ENTER,
"Result" : BAD_ARG},
# test invalid commands
{"Name" : "invalid command test 2",
"Sequence" : "invalid" + ENTER,
"Result" : NOT_FOUND},
{"Name" : "invalid command test 3",
"Sequence" : "ambiguousinvalid" + ENTER2,
"Result" : NOT_FOUND},
# test arrows and deletes
{"Name" : "arrows & delete test 1",
"Sequence" : "singlebad" + LEFT*2 + CTRL_B + DEL*3 + ENTER,
"Result" : SINGLE},
{"Name" : "arrows & delete test 2",
"Sequence" : "singlebad" + LEFT*5 + RIGHT + CTRL_F + DEL*3 + ENTER,
"Result" : SINGLE},
# test backspace
{"Name" : "backspace test",
"Sequence" : "singlebad" + BKSPACE*3 + ENTER,
"Result" : SINGLE},
# test goto left and goto right
{"Name" : "goto left test",
"Sequence" : "biguous first" + CTRL_A + "am" + ENTER,
"Result" : CMD1},
{"Name" : "goto right test",
"Sequence" : "biguous fir" + CTRL_A + "am" + CTRL_E + "st" + ENTER,
"Result" : CMD1},
# test goto words
{"Name" : "goto left word test",
"Sequence" : "ambiguous st" + ALT_B + "fir" + ENTER,
"Result" : CMD1},
{"Name" : "goto right word test",
"Sequence" : "ambig first" + CTRL_A + ALT_F + "uous" + ENTER,
"Result" : CMD1},
# test removing words
{"Name" : "remove left word 1",
"Sequence" : "single invalid" + CTRL_W + ENTER,
"Result" : SINGLE},
{"Name" : "remove left word 2",
"Sequence" : "single invalid" + ALT_BKSPACE + ENTER,
"Result" : SINGLE},
{"Name" : "remove right word",
"Sequence" : "single invalid" + ALT_B + ALT_D + ENTER,
"Result" : SINGLE},
# test kill buffer (copy and paste)
{"Name" : "killbuffer test 1",
"Sequence" : "ambiguous" + CTRL_A + CTRL_K + " first" + CTRL_A + CTRL_Y + ENTER,
"Result" : CMD1},
{"Name" : "killbuffer test 2",
"Sequence" : "ambiguous" + CTRL_A + CTRL_K + CTRL_Y*26 + ENTER,
"Result" : NOT_FOUND},
# test newline
{"Name" : "newline test",
"Sequence" : "invalid" + CTRL_C + "single" + ENTER,
"Result" : SINGLE},
# test redisplay (nothing should really happen)
{"Name" : "redisplay test",
"Sequence" : "single" + CTRL_L + ENTER,
"Result" : SINGLE},
# test autocomplete
{"Name" : "autocomplete test 1",
"Sequence" : "si" + TAB + ENTER,
"Result" : SINGLE},
{"Name" : "autocomplete test 2",
"Sequence" : "si" + TAB + "_" + TAB + ENTER,
"Result" : SINGLE_LONG},
{"Name" : "autocomplete test 3",
"Sequence" : "in" + TAB + ENTER,
"Result" : NOT_FOUND},
{"Name" : "autocomplete test 4",
"Sequence" : "am" + TAB + ENTER,
"Result" : BAD_ARG},
{"Name" : "autocomplete test 5",
"Sequence" : "am" + TAB + "fir" + TAB + ENTER,
"Result" : CMD1},
{"Name" : "autocomplete test 6",
"Sequence" : "am" + TAB + "fir" + TAB + TAB + ENTER,
"Result" : CMD1},
{"Name" : "autocomplete test 7",
"Sequence" : "am" + TAB + "fir" + TAB + " " + TAB + ENTER,
"Result" : CMD1},
{"Name" : "autocomplete test 8",
"Sequence" : "am" + TAB + " am" + TAB + " " + ENTER,
"Result" : AMBIG},
{"Name" : "autocomplete test 9",
"Sequence" : "am" + TAB + "inv" + TAB + ENTER,
"Result" : BAD_ARG},
{"Name" : "autocomplete test 10",
"Sequence" : "au" + TAB + ENTER,
"Result" : NOT_FOUND},
{"Name" : "autocomplete test 11",
"Sequence" : "au" + TAB + "1" + ENTER,
"Result" : AUTO1},
{"Name" : "autocomplete test 12",
"Sequence" : "au" + TAB + "2" + ENTER,
"Result" : AUTO2},
{"Name" : "autocomplete test 13",
"Sequence" : "au" + TAB + "2" + TAB + ENTER,
"Result" : AUTO2},
{"Name" : "autocomplete test 14",
"Sequence" : "au" + TAB + "2 " + TAB + ENTER,
"Result" : AUTO2},
{"Name" : "autocomplete test 15",
"Sequence" : "24" + TAB + ENTER,
"Result" : "24"},
# test history
{"Name" : "history test 1",
"Sequence" : "invalid" + ENTER + "single" + ENTER + "invalid" + ENTER + UP + CTRL_P + ENTER,
"Result" : SINGLE},
{"Name" : "history test 2",
"Sequence" : "invalid" + ENTER + "ambiguous first" + ENTER + "invalid" + ENTER + "single" + ENTER + UP * 3 + CTRL_N + DOWN + ENTER,
"Result" : SINGLE},
#
# tests that improve coverage
#
# empty space tests
{"Name" : "empty space test 1",
"Sequence" : RIGHT + LEFT + CTRL_B + CTRL_F + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 2",
"Sequence" : BKSPACE + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 3",
"Sequence" : CTRL_E*2 + CTRL_A*2 + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 4",
"Sequence" : ALT_F*2 + ALT_B*2 + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 5",
"Sequence" : " " + CTRL_E*2 + CTRL_A*2 + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 6",
"Sequence" : " " + CTRL_A + ALT_F*2 + ALT_B*2 + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 7",
"Sequence" : " " + CTRL_A + CTRL_D + CTRL_E + CTRL_D + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 8",
"Sequence" : " space" + CTRL_W*2 + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 9",
"Sequence" : " space" + ALT_BKSPACE*2 + ENTER,
"Result" : PROMPT},
{"Name" : "empty space test 10",
"Sequence" : " space " + CTRL_A + ALT_D*3 + ENTER,
"Result" : PROMPT},
# non-printable char tests
{"Name" : "non-printable test 1",
"Sequence" : chr(27) + chr(47) + ENTER,
"Result" : PROMPT},
{"Name" : "non-printable test 2",
"Sequence" : chr(27) + chr(128) + ENTER*7,
"Result" : PROMPT},
{"Name" : "non-printable test 3",
"Sequence" : chr(27) + chr(91) + chr(127) + ENTER*6,
"Result" : PROMPT},
# miscellaneous tests
{"Name" : "misc test 1",
"Sequence" : ENTER,
"Result" : PROMPT},
{"Name" : "misc test 2",
"Sequence" : "single #comment" + ENTER,
"Result" : SINGLE},
{"Name" : "misc test 3",
"Sequence" : "#empty line" + ENTER,
"Result" : PROMPT},
{"Name" : "misc test 4",
"Sequence" : " single " + ENTER,
"Result" : SINGLE},
{"Name" : "misc test 5",
"Sequence" : "single#" + ENTER,
"Result" : SINGLE},
{"Name" : "misc test 6",
"Sequence" : 'a' * 257 + ENTER,
"Result" : NOT_FOUND},
{"Name" : "misc test 7",
"Sequence" : "clear_history" + UP*5 + DOWN*5 + ENTER,
"Result" : PROMPT},
{"Name" : "misc test 8",
"Sequence" : "a" + HELP + CTRL_C,
"Result" : PROMPT},
{"Name" : "misc test 9",
"Sequence" : CTRL_D*3,
"Result" : None},
]

View File

@ -41,9 +41,6 @@ CFLAGS += $(WERROR_FLAGS)
SRCS-y := main.c
# this application needs libraries first
DEPDIRS-y += lib
include $(RTE_SDK)/mk/rte.app.mk
endif

View File

@ -68,8 +68,8 @@
#define CMD_LINE_OPT_SER_SOCK_PATH "server-socket-path"
#define CMD_LINE_OPT_CLI_SOCK_PATH "client-socket-path"
#define VDEV_PCAP "eth_pcap_%s_%d,tx_pcap=%s"
#define VDEV_IFACE "eth_pcap_%s_%d,tx_iface=%s"
#define VDEV_PCAP "net_pcap_%s_%d,tx_pcap=%s"
#define VDEV_IFACE "net_pcap_%s_%d,tx_iface=%s"
#define TX_STREAM_SIZE 64
#define MP_NAME "pdump_pool_%d"
@ -92,7 +92,6 @@
#define BURST_SIZE 32
#define NUM_VDEVS 2
#define RTE_RING_SZ_MASK (unsigned)(0x0fffffff) /**< Ring size mask */
/* true if x is a power of 2 */
#define POWEROF2(x) ((((x)-1) & (x)) == 0)
@ -132,7 +131,7 @@ struct pdump_stats {
struct pdump_tuples {
/* cli params */
uint8_t port;
uint16_t port;
char *device_id;
uint16_t queue;
char rx_dev[TX_STREAM_SIZE];
@ -497,7 +496,7 @@ pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
/* first dequeue packets from ring of primary process */
const uint16_t nb_in_deq = rte_ring_dequeue_burst(ring,
(void *)rxtx_bufs, BURST_SIZE);
(void *)rxtx_bufs, BURST_SIZE, NULL);
stats->dequeue_pkts += nb_in_deq;
if (nb_in_deq) {
@ -580,7 +579,7 @@ signal_handler(int sig_num)
}
static inline int
configure_vdev(uint8_t port_id)
configure_vdev(uint16_t port_id)
{
struct ether_addr addr;
const uint16_t rxRings = 0, txRings = 1;
@ -610,7 +609,7 @@ configure_vdev(uint8_t port_id)
rte_eth_macaddr_get(port_id, &addr);
printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
(unsigned)port_id,
port_id,
addr.addr_bytes[0], addr.addr_bytes[1],
addr.addr_bytes[2], addr.addr_bytes[3],
addr.addr_bytes[4], addr.addr_bytes[5]);
@ -624,7 +623,7 @@ static void
create_mp_ring_vdev(void)
{
int i;
uint8_t portid;
uint16_t portid;
struct pdump_tuples *pt = NULL;
struct rte_mempool *mbuf_pool = NULL;
char vdev_args[SIZE];

View File

@ -39,7 +39,4 @@ CFLAGS += $(WERROR_FLAGS)
SRCS-y := main.c
# this application needs libraries first
DEPDIRS-y += lib
include $(RTE_SDK)/mk/rte.app.mk

View File

@ -1,7 +1,7 @@
/*
* BSD LICENSE
*
* Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include <sys/queue.h>
#include <stdlib.h>
#include <getopt.h>
#include <unistd.h>
#include <rte_eal.h>
#include <rte_common.h>
@ -52,28 +53,46 @@
#include <rte_tailq.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_debug.h>
#include <rte_log.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_string_fns.h>
#include <rte_metrics.h>
/* Maximum long option length for option parsing. */
#define MAX_LONG_OPT_SZ 64
#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1
#define MAX_STRING_LEN 256
/**< mask of enabled ports */
static uint32_t enabled_port_mask;
/**< Enable stats. */
static uint32_t enable_stats;
/**< Enable xstats. */
static uint32_t enable_xstats;
/**< Enable collectd format*/
static uint32_t enable_collectd_format;
/**< FD to send collectd format messages to STDOUT*/
static int stdout_fd;
/**< Host id process is running on */
static char host_id[MAX_LONG_OPT_SZ];
/**< Enable metrics. */
static uint32_t enable_metrics;
/**< Enable stats reset. */
static uint32_t reset_stats;
/**< Enable xstats reset. */
static uint32_t reset_xstats;
/**< Enable memory info. */
static uint32_t mem_info;
/**< Enable displaying xstat name. */
static uint32_t enable_xstats_name;
static char *xstats_name;
/**< Enable xstats by ids. */
#define MAX_NB_XSTATS_IDS 1024
static uint32_t nb_xstats_ids;
static uint64_t xstats_ids[MAX_NB_XSTATS_IDS];
/**< display usage */
static void
@ -85,8 +104,15 @@ proc_info_usage(const char *prgname)
" --stats: to display port statistics, enabled by default\n"
" --xstats: to display extended port statistics, disabled by "
"default\n"
" --metrics: to display derived metrics of the ports, disabled by "
"default\n"
" --xstats-name NAME: to display single xstat id by NAME\n"
" --xstats-ids IDLIST: to display xstat values by id. "
"The argument is comma-separated list of xstat ids to print out.\n"
" --stats-reset: to reset port statistics\n"
" --xstats-reset: to reset port extended statistics\n",
" --xstats-reset: to reset port extended statistics\n"
" --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
" --host-id STRING: host id used to identify the system process is running on\n",
prgname);
}
@ -116,6 +142,66 @@ parse_portmask(const char *portmask)
}
/*
* Parse ids value list into array
*/
static int
parse_xstats_ids(char *list, uint64_t *ids, int limit) {
int length;
char *token;
char *ctx = NULL;
char *endptr;
length = 0;
token = strtok_r(list, ",", &ctx);
while (token != NULL) {
ids[length] = strtoull(token, &endptr, 10);
if (*endptr != '\0')
return -EINVAL;
length++;
if (length >= limit)
return -E2BIG;
token = strtok_r(NULL, ",", &ctx);
}
return length;
}
static int
proc_info_preparse_args(int argc, char **argv)
{
char *prgname = argv[0];
int i;
for (i = 0; i < argc; i++) {
/* Print stats or xstats to STDOUT in collectd format */
if (!strncmp(argv[i], "--collectd-format", MAX_LONG_OPT_SZ)) {
enable_collectd_format = 1;
stdout_fd = dup(STDOUT_FILENO);
close(STDOUT_FILENO);
}
if (!strncmp(argv[i], "--host-id", MAX_LONG_OPT_SZ)) {
if ((i + 1) == argc) {
printf("Invalid host id or not specified\n");
proc_info_usage(prgname);
return -1;
}
strncpy(host_id, argv[i+1], sizeof(host_id));
}
}
if (!strlen(host_id)) {
int err = gethostname(host_id, MAX_LONG_OPT_SZ-1);
if (err)
strcpy(host_id, "unknown");
}
return 0;
}
/* Parse the argument given in the command line of the application */
static int
proc_info_parse_args(int argc, char **argv)
@ -127,7 +213,12 @@ proc_info_parse_args(int argc, char **argv)
{"stats", 0, NULL, 0},
{"stats-reset", 0, NULL, 0},
{"xstats", 0, NULL, 0},
{"metrics", 0, NULL, 0},
{"xstats-reset", 0, NULL, 0},
{"xstats-name", required_argument, NULL, 1},
{"collectd-format", 0, NULL, 0},
{"xstats-ids", 1, NULL, 1},
{"host-id", 0, NULL, 0},
{NULL, 0, 0, 0}
};
@ -159,6 +250,10 @@ proc_info_parse_args(int argc, char **argv)
else if (!strncmp(long_option[option_index].name, "xstats",
MAX_LONG_OPT_SZ))
enable_xstats = 1;
else if (!strncmp(long_option[option_index].name,
"metrics",
MAX_LONG_OPT_SZ))
enable_metrics = 1;
/* Reset stats */
if (!strncmp(long_option[option_index].name, "stats-reset",
MAX_LONG_OPT_SZ))
@ -168,7 +263,28 @@ proc_info_parse_args(int argc, char **argv)
MAX_LONG_OPT_SZ))
reset_xstats = 1;
break;
case 1:
/* Print xstat single value given by name*/
if (!strncmp(long_option[option_index].name,
"xstats-name", MAX_LONG_OPT_SZ)) {
enable_xstats_name = 1;
xstats_name = optarg;
printf("name:%s:%s\n",
long_option[option_index].name,
optarg);
} else if (!strncmp(long_option[option_index].name,
"xstats-ids",
MAX_LONG_OPT_SZ)) {
nb_xstats_ids = parse_xstats_ids(optarg,
xstats_ids, MAX_NB_XSTATS_IDS);
if (nb_xstats_ids <= 0) {
printf("xstats-id list parse error.\n");
return -1;
}
}
break;
default:
proc_info_usage(prgname);
return -1;
@ -194,7 +310,7 @@ meminfo_display(void)
}
static void
nic_stats_display(uint8_t port_id)
nic_stats_display(uint16_t port_id)
{
struct rte_eth_stats stats;
uint8_t i;
@ -233,28 +349,92 @@ nic_stats_display(uint8_t port_id)
}
static void
nic_stats_clear(uint8_t port_id)
nic_stats_clear(uint16_t port_id)
{
printf("\n Clearing NIC stats for port %d\n", port_id);
rte_eth_stats_reset(port_id);
printf("\n NIC statistics for port %d cleared\n", port_id);
}
static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
const char *cnt_name) {
char *type_end = strrchr(cnt_name, '_');
if ((type_end != NULL) &&
(strncmp(cnt_name, "rx_", strlen("rx_")) == 0)) {
if (strncmp(type_end, "_errors", strlen("_errors")) == 0)
strncpy(cnt_type, "if_rx_errors", cnt_type_len);
else if (strncmp(type_end, "_dropped", strlen("_dropped")) == 0)
strncpy(cnt_type, "if_rx_dropped", cnt_type_len);
else if (strncmp(type_end, "_bytes", strlen("_bytes")) == 0)
strncpy(cnt_type, "if_rx_octets", cnt_type_len);
else if (strncmp(type_end, "_packets", strlen("_packets")) == 0)
strncpy(cnt_type, "if_rx_packets", cnt_type_len);
else if (strncmp(type_end, "_placement",
strlen("_placement")) == 0)
strncpy(cnt_type, "if_rx_errors", cnt_type_len);
else if (strncmp(type_end, "_buff", strlen("_buff")) == 0)
strncpy(cnt_type, "if_rx_errors", cnt_type_len);
else
/* Does not fit obvious type: use a more generic one */
strncpy(cnt_type, "derive", cnt_type_len);
} else if ((type_end != NULL) &&
(strncmp(cnt_name, "tx_", strlen("tx_"))) == 0) {
if (strncmp(type_end, "_errors", strlen("_errors")) == 0)
strncpy(cnt_type, "if_tx_errors", cnt_type_len);
else if (strncmp(type_end, "_dropped", strlen("_dropped")) == 0)
strncpy(cnt_type, "if_tx_dropped", cnt_type_len);
else if (strncmp(type_end, "_bytes", strlen("_bytes")) == 0)
strncpy(cnt_type, "if_tx_octets", cnt_type_len);
else if (strncmp(type_end, "_packets", strlen("_packets")) == 0)
strncpy(cnt_type, "if_tx_packets", cnt_type_len);
else
/* Does not fit obvious type: use a more generic one */
strncpy(cnt_type, "derive", cnt_type_len);
} else if ((type_end != NULL) &&
(strncmp(cnt_name, "flow_", strlen("flow_"))) == 0) {
if (strncmp(type_end, "_filters", strlen("_filters")) == 0)
strncpy(cnt_type, "operations", cnt_type_len);
else if (strncmp(type_end, "_errors", strlen("_errors")) == 0)
strncpy(cnt_type, "errors", cnt_type_len);
else if (strncmp(type_end, "_filters", strlen("_filters")) == 0)
strncpy(cnt_type, "filter_result", cnt_type_len);
} else if ((type_end != NULL) &&
(strncmp(cnt_name, "mac_", strlen("mac_"))) == 0) {
if (strncmp(type_end, "_errors", strlen("_errors")) == 0)
strncpy(cnt_type, "errors", cnt_type_len);
} else {
/* Does not fit obvious type, or strrchr error: */
/* use a more generic type */
strncpy(cnt_type, "derive", cnt_type_len);
}
}
static void
nic_xstats_display(uint8_t port_id)
nic_xstats_by_name_display(uint16_t port_id, char *name)
{
uint64_t id;
printf("###### NIC statistics for port %-2d, statistic name '%s':\n",
port_id, name);
if (rte_eth_xstats_get_id_by_name(port_id, name, &id) == 0)
printf("%s: %"PRIu64"\n", name, id);
else
printf("Statistic not found...\n");
}
static void
nic_xstats_by_ids_display(uint16_t port_id, uint64_t *ids, int len)
{
struct rte_eth_xstat_name *xstats_names;
struct rte_eth_xstat *xstats;
int len, ret, i;
uint64_t *values;
int ret, i;
static const char *nic_stats_border = "########################";
len = rte_eth_xstats_get_names(port_id, NULL, 0);
if (len < 0) {
printf("Cannot get xstats count\n");
return;
}
xstats = malloc(sizeof(xstats[0]) * len);
if (xstats == NULL) {
values = malloc(sizeof(*values) * len);
if (values == NULL) {
printf("Cannot allocate memory for xstats\n");
return;
}
@ -262,20 +442,20 @@ nic_xstats_display(uint8_t port_id)
xstats_names = malloc(sizeof(struct rte_eth_xstat_name) * len);
if (xstats_names == NULL) {
printf("Cannot allocate memory for xstat names\n");
free(xstats);
free(values);
return;
}
if (len != rte_eth_xstats_get_names(
port_id, xstats_names, len)) {
if (len != rte_eth_xstats_get_names_by_id(
port_id, xstats_names, len, ids)) {
printf("Cannot get xstat names\n");
goto err;
}
printf("###### NIC extended statistics for port %-2d #########\n",
port_id);
printf("%s############################\n",
nic_stats_border);
ret = rte_eth_xstats_get(port_id, xstats, len);
printf("%s############################\n", nic_stats_border);
ret = rte_eth_xstats_get_by_id(port_id, ids, values, len);
if (ret < 0 || ret > len) {
printf("Cannot get xstats\n");
goto err;
@ -284,23 +464,151 @@ nic_xstats_display(uint8_t port_id)
for (i = 0; i < len; i++)
printf("%s: %"PRIu64"\n",
xstats_names[i].name,
xstats[i].value);
values[i]);
printf("%s############################\n",
nic_stats_border);
printf("%s############################\n", nic_stats_border);
err:
free(xstats);
free(values);
free(xstats_names);
}
static void
nic_xstats_clear(uint8_t port_id)
nic_xstats_display(uint16_t port_id)
{
struct rte_eth_xstat_name *xstats_names;
uint64_t *values;
int len, ret, i;
static const char *nic_stats_border = "########################";
len = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL);
if (len < 0) {
printf("Cannot get xstats count\n");
return;
}
values = malloc(sizeof(*values) * len);
if (values == NULL) {
printf("Cannot allocate memory for xstats\n");
return;
}
xstats_names = malloc(sizeof(struct rte_eth_xstat_name) * len);
if (xstats_names == NULL) {
printf("Cannot allocate memory for xstat names\n");
free(values);
return;
}
if (len != rte_eth_xstats_get_names_by_id(
port_id, xstats_names, len, NULL)) {
printf("Cannot get xstat names\n");
goto err;
}
printf("###### NIC extended statistics for port %-2d #########\n",
port_id);
printf("%s############################\n",
nic_stats_border);
ret = rte_eth_xstats_get_by_id(port_id, NULL, values, len);
if (ret < 0 || ret > len) {
printf("Cannot get xstats\n");
goto err;
}
for (i = 0; i < len; i++) {
if (enable_collectd_format) {
char counter_type[MAX_STRING_LEN];
char buf[MAX_STRING_LEN];
collectd_resolve_cnt_type(counter_type,
sizeof(counter_type),
xstats_names[i].name);
sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
PRIu64"\n", host_id, port_id, counter_type,
xstats_names[i].name, values[i]);
ret = write(stdout_fd, buf, strlen(buf));
if (ret < 0)
goto err;
} else {
printf("%s: %"PRIu64"\n", xstats_names[i].name,
values[i]);
}
}
printf("%s############################\n",
nic_stats_border);
err:
free(values);
free(xstats_names);
}
static void
nic_xstats_clear(uint16_t port_id)
{
printf("\n Clearing NIC xstats for port %d\n", port_id);
rte_eth_xstats_reset(port_id);
printf("\n NIC extended statistics for port %d cleared\n", port_id);
}
static void
metrics_display(int port_id)
{
struct rte_metric_value *metrics;
struct rte_metric_name *names;
int len, ret;
static const char *nic_stats_border = "########################";
len = rte_metrics_get_names(NULL, 0);
if (len < 0) {
printf("Cannot get metrics count\n");
return;
}
if (len == 0) {
printf("No metrics to display (none have been registered)\n");
return;
}
metrics = rte_malloc("proc_info_metrics",
sizeof(struct rte_metric_value) * len, 0);
if (metrics == NULL) {
printf("Cannot allocate memory for metrics\n");
return;
}
names = rte_malloc(NULL, sizeof(struct rte_metric_name) * len, 0);
if (names == NULL) {
printf("Cannot allocate memory for metrcis names\n");
rte_free(metrics);
return;
}
if (len != rte_metrics_get_names(names, len)) {
printf("Cannot get metrics names\n");
rte_free(metrics);
rte_free(names);
return;
}
if (port_id == RTE_METRICS_GLOBAL)
printf("###### Non port specific metrics #########\n");
else
printf("###### metrics for port %-2d #########\n", port_id);
printf("%s############################\n", nic_stats_border);
ret = rte_metrics_get_values(port_id, metrics, len);
if (ret < 0 || ret > len) {
printf("Cannot get metrics values\n");
rte_free(metrics);
rte_free(names);
return;
}
int i;
for (i = 0; i < len; i++)
printf("%s: %"PRIu64"\n", names[i].name, metrics[i].value);
printf("%s############################\n", nic_stats_border);
rte_free(metrics);
rte_free(names);
}
int
main(int argc, char **argv)
{
@ -310,7 +618,14 @@ main(int argc, char **argv)
char n_flag[] = "-n4";
char mp_flag[] = "--proc-type=secondary";
char *argp[argc + 3];
uint8_t nb_ports;
uint16_t nb_ports;
/* preparse app arguments */
ret = proc_info_preparse_args(argc, argv);
if (ret < 0) {
printf("Failed to parse arguments\n");
return -1;
}
argp[0] = argv[0];
argp[1] = c_flag;
@ -329,6 +644,9 @@ main(int argc, char **argv)
argc -= ret;
argv += (ret - 3);
if (!rte_eal_primary_proc_alive(NULL))
rte_exit(EXIT_FAILURE, "No primary DPDK process is running.\n");
/* parse app arguments */
ret = proc_info_parse_args(argc, argv);
if (ret < 0)
@ -357,8 +675,19 @@ main(int argc, char **argv)
nic_stats_clear(i);
else if (reset_xstats)
nic_xstats_clear(i);
else if (enable_xstats_name)
nic_xstats_by_name_display(i, xstats_name);
else if (nb_xstats_ids > 0)
nic_xstats_by_ids_display(i, xstats_ids,
nb_xstats_ids);
else if (enable_metrics)
metrics_display(i);
}
}
/* print port independent stats */
if (enable_metrics)
metrics_display(RTE_METRICS_GLOBAL);
return 0;
}

View File

@ -1,48 +0,0 @@
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(RTE_SDK)/mk/rte.vars.mk
ifeq ($(CONFIG_RTE_LIBRTE_ACL),y)
APP = testacl
CFLAGS += $(WERROR_FLAGS)
# all source are stored in SRCS-y
SRCS-y := main.c
# this application needs libraries first
DEPDIRS-y += lib
include $(RTE_SDK)/mk/rte.app.mk
endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,54 @@
# BSD LICENSE
#
# Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(RTE_SDK)/mk/rte.vars.mk
APP = dpdk-test-crypto-perf
CFLAGS += $(WERROR_FLAGS)
# all source are stored in SRCS-y
SRCS-y := main.c
SRCS-y += cperf_ops.c
SRCS-y += cperf_options_parsing.c
SRCS-y += cperf_test_vectors.c
SRCS-y += cperf_test_throughput.c
SRCS-y += cperf_test_latency.c
SRCS-y += cperf_test_pmd_cyclecount.c
SRCS-y += cperf_test_verify.c
SRCS-y += cperf_test_vector_parsing.c
SRCS-y += cperf_test_common.c
ifeq ($(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER),y)
LDLIBS += -lrte_pmd_crypto_scheduler
endif
include $(RTE_SDK)/mk/rte.app.mk

View File

@ -0,0 +1,61 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_
#define _CPERF_
#include <rte_crypto.h>
#include "cperf_ops.h"
struct cperf_options;
struct cperf_test_vector;
struct cperf_op_fns;
typedef void *(*cperf_constructor_t)(
struct rte_mempool *sess_mp,
uint8_t dev_id,
uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *t_vec,
const struct cperf_op_fns *op_fns);
typedef int (*cperf_runner_t)(void *test_ctx);
typedef void (*cperf_destructor_t)(void *test_ctx);
struct cperf_test {
cperf_constructor_t constructor;
cperf_runner_t runner;
cperf_destructor_t destructor;
};
#endif /* _CPERF_ */

View File

@ -0,0 +1,651 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <rte_cryptodev.h>
#include "cperf_ops.h"
#include "cperf_test_vectors.h"
static int
cperf_set_ops_null_cipher(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector __rte_unused,
uint16_t iv_offset __rte_unused)
{
uint16_t i;
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_crypto_op_attach_sym_session(ops[i], sess);
sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
src_buf_offset);
/* Set dest mbuf to NULL if out-of-place (dst_buf_offset = 0) */
if (dst_buf_offset == 0)
sym_op->m_dst = NULL;
else
sym_op->m_dst = (struct rte_mbuf *)((uint8_t *)ops[i] +
dst_buf_offset);
/* cipher parameters */
sym_op->cipher.data.length = options->test_buffer_size;
sym_op->cipher.data.offset = 0;
}
return 0;
}
static int
cperf_set_ops_null_auth(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector __rte_unused,
uint16_t iv_offset __rte_unused)
{
uint16_t i;
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_crypto_op_attach_sym_session(ops[i], sess);
sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
src_buf_offset);
/* Set dest mbuf to NULL if out-of-place (dst_buf_offset = 0) */
if (dst_buf_offset == 0)
sym_op->m_dst = NULL;
else
sym_op->m_dst = (struct rte_mbuf *)((uint8_t *)ops[i] +
dst_buf_offset);
/* auth parameters */
sym_op->auth.data.length = options->test_buffer_size;
sym_op->auth.data.offset = 0;
}
return 0;
}
static int
cperf_set_ops_cipher(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset)
{
uint16_t i;
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_crypto_op_attach_sym_session(ops[i], sess);
sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
src_buf_offset);
/* Set dest mbuf to NULL if out-of-place (dst_buf_offset = 0) */
if (dst_buf_offset == 0)
sym_op->m_dst = NULL;
else
sym_op->m_dst = (struct rte_mbuf *)((uint8_t *)ops[i] +
dst_buf_offset);
/* cipher parameters */
if (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||
options->cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||
options->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3)
sym_op->cipher.data.length = options->test_buffer_size << 3;
else
sym_op->cipher.data.length = options->test_buffer_size;
sym_op->cipher.data.offset = 0;
}
if (options->test == CPERF_TEST_TYPE_VERIFY) {
for (i = 0; i < nb_ops; i++) {
uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
uint8_t *, iv_offset);
memcpy(iv_ptr, test_vector->cipher_iv.data,
test_vector->cipher_iv.length);
}
}
return 0;
}
static int
cperf_set_ops_auth(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset)
{
uint16_t i;
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_crypto_op_attach_sym_session(ops[i], sess);
sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
src_buf_offset);
/* Set dest mbuf to NULL if out-of-place (dst_buf_offset = 0) */
if (dst_buf_offset == 0)
sym_op->m_dst = NULL;
else
sym_op->m_dst = (struct rte_mbuf *)((uint8_t *)ops[i] +
dst_buf_offset);
if (test_vector->auth_iv.length) {
uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
uint8_t *,
iv_offset);
memcpy(iv_ptr, test_vector->auth_iv.data,
test_vector->auth_iv.length);
}
/* authentication parameters */
if (options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {
sym_op->auth.digest.data = test_vector->digest.data;
sym_op->auth.digest.phys_addr =
test_vector->digest.phys_addr;
} else {
uint32_t offset = options->test_buffer_size;
struct rte_mbuf *buf, *tbuf;
if (options->out_of_place) {
buf = sym_op->m_dst;
} else {
tbuf = sym_op->m_src;
while ((tbuf->next != NULL) &&
(offset >= tbuf->data_len)) {
offset -= tbuf->data_len;
tbuf = tbuf->next;
}
/*
* If there is not enough room in segment,
* place the digest in the next segment
*/
if ((tbuf->data_len - offset) < options->digest_sz) {
tbuf = tbuf->next;
offset = 0;
}
buf = tbuf;
}
sym_op->auth.digest.data = rte_pktmbuf_mtod_offset(buf,
uint8_t *, offset);
sym_op->auth.digest.phys_addr =
rte_pktmbuf_iova_offset(buf, offset);
}
if (options->auth_algo == RTE_CRYPTO_AUTH_SNOW3G_UIA2 ||
options->auth_algo == RTE_CRYPTO_AUTH_KASUMI_F9 ||
options->auth_algo == RTE_CRYPTO_AUTH_ZUC_EIA3)
sym_op->auth.data.length = options->test_buffer_size << 3;
else
sym_op->auth.data.length = options->test_buffer_size;
sym_op->auth.data.offset = 0;
}
if (options->test == CPERF_TEST_TYPE_VERIFY) {
if (test_vector->auth_iv.length) {
for (i = 0; i < nb_ops; i++) {
uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
uint8_t *, iv_offset);
memcpy(iv_ptr, test_vector->auth_iv.data,
test_vector->auth_iv.length);
}
}
}
return 0;
}
static int
cperf_set_ops_cipher_auth(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset)
{
uint16_t i;
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_crypto_op_attach_sym_session(ops[i], sess);
sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
src_buf_offset);
/* Set dest mbuf to NULL if out-of-place (dst_buf_offset = 0) */
if (dst_buf_offset == 0)
sym_op->m_dst = NULL;
else
sym_op->m_dst = (struct rte_mbuf *)((uint8_t *)ops[i] +
dst_buf_offset);
/* cipher parameters */
if (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||
options->cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||
options->cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3)
sym_op->cipher.data.length = options->test_buffer_size << 3;
else
sym_op->cipher.data.length = options->test_buffer_size;
sym_op->cipher.data.offset = 0;
/* authentication parameters */
if (options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {
sym_op->auth.digest.data = test_vector->digest.data;
sym_op->auth.digest.phys_addr =
test_vector->digest.phys_addr;
} else {
uint32_t offset = options->test_buffer_size;
struct rte_mbuf *buf, *tbuf;
if (options->out_of_place) {
buf = sym_op->m_dst;
} else {
tbuf = sym_op->m_src;
while ((tbuf->next != NULL) &&
(offset >= tbuf->data_len)) {
offset -= tbuf->data_len;
tbuf = tbuf->next;
}
/*
* If there is not enough room in segment,
* place the digest in the next segment
*/
if ((tbuf->data_len - offset) < options->digest_sz) {
tbuf = tbuf->next;
offset = 0;
}
buf = tbuf;
}
sym_op->auth.digest.data = rte_pktmbuf_mtod_offset(buf,
uint8_t *, offset);
sym_op->auth.digest.phys_addr =
rte_pktmbuf_iova_offset(buf, offset);
}
if (options->auth_algo == RTE_CRYPTO_AUTH_SNOW3G_UIA2 ||
options->auth_algo == RTE_CRYPTO_AUTH_KASUMI_F9 ||
options->auth_algo == RTE_CRYPTO_AUTH_ZUC_EIA3)
sym_op->auth.data.length = options->test_buffer_size << 3;
else
sym_op->auth.data.length = options->test_buffer_size;
sym_op->auth.data.offset = 0;
}
if (options->test == CPERF_TEST_TYPE_VERIFY) {
for (i = 0; i < nb_ops; i++) {
uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
uint8_t *, iv_offset);
memcpy(iv_ptr, test_vector->cipher_iv.data,
test_vector->cipher_iv.length);
if (test_vector->auth_iv.length) {
/*
* Copy IV after the crypto operation and
* the cipher IV
*/
iv_ptr += test_vector->cipher_iv.length;
memcpy(iv_ptr, test_vector->auth_iv.data,
test_vector->auth_iv.length);
}
}
}
return 0;
}
static int
cperf_set_ops_aead(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset)
{
uint16_t i;
/* AAD is placed after the IV */
uint16_t aad_offset = iv_offset +
RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16);
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_crypto_op_attach_sym_session(ops[i], sess);
sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
src_buf_offset);
/* Set dest mbuf to NULL if out-of-place (dst_buf_offset = 0) */
if (dst_buf_offset == 0)
sym_op->m_dst = NULL;
else
sym_op->m_dst = (struct rte_mbuf *)((uint8_t *)ops[i] +
dst_buf_offset);
/* AEAD parameters */
sym_op->aead.data.length = options->test_buffer_size;
sym_op->aead.data.offset = 0;
sym_op->aead.aad.data = rte_crypto_op_ctod_offset(ops[i],
uint8_t *, aad_offset);
sym_op->aead.aad.phys_addr = rte_crypto_op_ctophys_offset(ops[i],
aad_offset);
if (options->aead_op == RTE_CRYPTO_AEAD_OP_DECRYPT) {
sym_op->aead.digest.data = test_vector->digest.data;
sym_op->aead.digest.phys_addr =
test_vector->digest.phys_addr;
} else {
uint32_t offset = sym_op->aead.data.length +
sym_op->aead.data.offset;
struct rte_mbuf *buf, *tbuf;
if (options->out_of_place) {
buf = sym_op->m_dst;
} else {
tbuf = sym_op->m_src;
while ((tbuf->next != NULL) &&
(offset >= tbuf->data_len)) {
offset -= tbuf->data_len;
tbuf = tbuf->next;
}
/*
* If there is not enough room in segment,
* place the digest in the next segment
*/
if ((tbuf->data_len - offset) < options->digest_sz) {
tbuf = tbuf->next;
offset = 0;
}
buf = tbuf;
}
sym_op->aead.digest.data = rte_pktmbuf_mtod_offset(buf,
uint8_t *, offset);
sym_op->aead.digest.phys_addr =
rte_pktmbuf_iova_offset(buf, offset);
}
}
if (options->test == CPERF_TEST_TYPE_VERIFY) {
for (i = 0; i < nb_ops; i++) {
uint8_t *iv_ptr = rte_crypto_op_ctod_offset(ops[i],
uint8_t *, iv_offset);
/*
* If doing AES-CCM, nonce is copied one byte
* after the start of IV field, and AAD is copied
* 18 bytes after the start of the AAD field.
*/
if (options->aead_algo == RTE_CRYPTO_AEAD_AES_CCM) {
memcpy(iv_ptr + 1, test_vector->aead_iv.data,
test_vector->aead_iv.length);
memcpy(ops[i]->sym->aead.aad.data + 18,
test_vector->aad.data,
test_vector->aad.length);
} else {
memcpy(iv_ptr, test_vector->aead_iv.data,
test_vector->aead_iv.length);
memcpy(ops[i]->sym->aead.aad.data,
test_vector->aad.data,
test_vector->aad.length);
}
}
}
return 0;
}
static struct rte_cryptodev_sym_session *
cperf_create_session(struct rte_mempool *sess_mp,
uint8_t dev_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset)
{
struct rte_crypto_sym_xform cipher_xform;
struct rte_crypto_sym_xform auth_xform;
struct rte_crypto_sym_xform aead_xform;
struct rte_cryptodev_sym_session *sess = NULL;
sess = rte_cryptodev_sym_session_create(sess_mp);
/*
* cipher only
*/
if (options->op_type == CPERF_CIPHER_ONLY) {
cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cipher_xform.next = NULL;
cipher_xform.cipher.algo = options->cipher_algo;
cipher_xform.cipher.op = options->cipher_op;
cipher_xform.cipher.iv.offset = iv_offset;
/* cipher different than null */
if (options->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
cipher_xform.cipher.key.data =
test_vector->cipher_key.data;
cipher_xform.cipher.key.length =
test_vector->cipher_key.length;
cipher_xform.cipher.iv.length =
test_vector->cipher_iv.length;
} else {
cipher_xform.cipher.key.data = NULL;
cipher_xform.cipher.key.length = 0;
cipher_xform.cipher.iv.length = 0;
}
/* create crypto session */
rte_cryptodev_sym_session_init(dev_id, sess, &cipher_xform,
sess_mp);
/*
* auth only
*/
} else if (options->op_type == CPERF_AUTH_ONLY) {
auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
auth_xform.next = NULL;
auth_xform.auth.algo = options->auth_algo;
auth_xform.auth.op = options->auth_op;
/* auth different than null */
if (options->auth_algo != RTE_CRYPTO_AUTH_NULL) {
auth_xform.auth.digest_length =
options->digest_sz;
auth_xform.auth.key.length =
test_vector->auth_key.length;
auth_xform.auth.key.data = test_vector->auth_key.data;
auth_xform.auth.iv.length =
test_vector->auth_iv.length;
} else {
auth_xform.auth.digest_length = 0;
auth_xform.auth.key.length = 0;
auth_xform.auth.key.data = NULL;
auth_xform.auth.iv.length = 0;
}
/* create crypto session */
rte_cryptodev_sym_session_init(dev_id, sess, &auth_xform,
sess_mp);
/*
* cipher and auth
*/
} else if (options->op_type == CPERF_CIPHER_THEN_AUTH
|| options->op_type == CPERF_AUTH_THEN_CIPHER) {
/*
* cipher
*/
cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cipher_xform.next = NULL;
cipher_xform.cipher.algo = options->cipher_algo;
cipher_xform.cipher.op = options->cipher_op;
cipher_xform.cipher.iv.offset = iv_offset;
/* cipher different than null */
if (options->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
cipher_xform.cipher.key.data =
test_vector->cipher_key.data;
cipher_xform.cipher.key.length =
test_vector->cipher_key.length;
cipher_xform.cipher.iv.length =
test_vector->cipher_iv.length;
} else {
cipher_xform.cipher.key.data = NULL;
cipher_xform.cipher.key.length = 0;
cipher_xform.cipher.iv.length = 0;
}
/*
* auth
*/
auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
auth_xform.next = NULL;
auth_xform.auth.algo = options->auth_algo;
auth_xform.auth.op = options->auth_op;
/* auth different than null */
if (options->auth_algo != RTE_CRYPTO_AUTH_NULL) {
auth_xform.auth.digest_length = options->digest_sz;
auth_xform.auth.iv.length = test_vector->auth_iv.length;
auth_xform.auth.key.length =
test_vector->auth_key.length;
auth_xform.auth.key.data =
test_vector->auth_key.data;
} else {
auth_xform.auth.digest_length = 0;
auth_xform.auth.key.length = 0;
auth_xform.auth.key.data = NULL;
auth_xform.auth.iv.length = 0;
}
/* cipher then auth */
if (options->op_type == CPERF_CIPHER_THEN_AUTH) {
cipher_xform.next = &auth_xform;
/* create crypto session */
rte_cryptodev_sym_session_init(dev_id,
sess, &cipher_xform, sess_mp);
} else { /* auth then cipher */
auth_xform.next = &cipher_xform;
/* create crypto session */
rte_cryptodev_sym_session_init(dev_id,
sess, &auth_xform, sess_mp);
}
} else { /* options->op_type == CPERF_AEAD */
aead_xform.type = RTE_CRYPTO_SYM_XFORM_AEAD;
aead_xform.next = NULL;
aead_xform.aead.algo = options->aead_algo;
aead_xform.aead.op = options->aead_op;
aead_xform.aead.iv.offset = iv_offset;
aead_xform.aead.key.data =
test_vector->aead_key.data;
aead_xform.aead.key.length =
test_vector->aead_key.length;
aead_xform.aead.iv.length = test_vector->aead_iv.length;
aead_xform.aead.digest_length = options->digest_sz;
aead_xform.aead.aad_length =
options->aead_aad_sz;
/* Create crypto session */
rte_cryptodev_sym_session_init(dev_id,
sess, &aead_xform, sess_mp);
}
return sess;
}
int
cperf_get_op_functions(const struct cperf_options *options,
struct cperf_op_fns *op_fns)
{
memset(op_fns, 0, sizeof(struct cperf_op_fns));
op_fns->sess_create = cperf_create_session;
if (options->op_type == CPERF_AEAD) {
op_fns->populate_ops = cperf_set_ops_aead;
return 0;
}
if (options->op_type == CPERF_AUTH_THEN_CIPHER
|| options->op_type == CPERF_CIPHER_THEN_AUTH) {
op_fns->populate_ops = cperf_set_ops_cipher_auth;
return 0;
}
if (options->op_type == CPERF_AUTH_ONLY) {
if (options->auth_algo == RTE_CRYPTO_AUTH_NULL)
op_fns->populate_ops = cperf_set_ops_null_auth;
else
op_fns->populate_ops = cperf_set_ops_auth;
return 0;
}
if (options->op_type == CPERF_CIPHER_ONLY) {
if (options->cipher_algo == RTE_CRYPTO_CIPHER_NULL)
op_fns->populate_ops = cperf_set_ops_null_cipher;
else
op_fns->populate_ops = cperf_set_ops_cipher;
return 0;
}
return -1;
}

View File

@ -0,0 +1,65 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_OPS_
#define _CPERF_OPS_
#include <rte_crypto.h>
#include "cperf.h"
#include "cperf_options.h"
#include "cperf_test_vectors.h"
typedef struct rte_cryptodev_sym_session *(*cperf_sessions_create_t)(
struct rte_mempool *sess_mp,
uint8_t dev_id, const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset);
typedef int (*cperf_populate_ops_t)(struct rte_crypto_op **ops,
uint32_t src_buf_offset, uint32_t dst_buf_offset,
uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint16_t iv_offset);
struct cperf_op_fns {
cperf_sessions_create_t sess_create;
cperf_populate_ops_t populate_ops;
};
int
cperf_get_op_functions(const struct cperf_options *options,
struct cperf_op_fns *op_fns);
#endif /* _CPERF_OPS_ */

View File

@ -0,0 +1,140 @@
#ifndef _CPERF_OPTIONS_
#define _CPERF_OPTIONS_
#include <rte_crypto.h>
#define CPERF_PTEST_TYPE ("ptest")
#define CPERF_SILENT ("silent")
#define CPERF_POOL_SIZE ("pool-sz")
#define CPERF_TOTAL_OPS ("total-ops")
#define CPERF_BURST_SIZE ("burst-sz")
#define CPERF_BUFFER_SIZE ("buffer-sz")
#define CPERF_SEGMENT_SIZE ("segment-sz")
#define CPERF_DESC_NB ("desc-nb")
#define CPERF_DEVTYPE ("devtype")
#define CPERF_OPTYPE ("optype")
#define CPERF_SESSIONLESS ("sessionless")
#define CPERF_OUT_OF_PLACE ("out-of-place")
#define CPERF_TEST_FILE ("test-file")
#define CPERF_TEST_NAME ("test-name")
#define CPERF_CIPHER_ALGO ("cipher-algo")
#define CPERF_CIPHER_OP ("cipher-op")
#define CPERF_CIPHER_KEY_SZ ("cipher-key-sz")
#define CPERF_CIPHER_IV_SZ ("cipher-iv-sz")
#define CPERF_AUTH_ALGO ("auth-algo")
#define CPERF_AUTH_OP ("auth-op")
#define CPERF_AUTH_KEY_SZ ("auth-key-sz")
#define CPERF_AUTH_IV_SZ ("auth-iv-sz")
#define CPERF_AEAD_ALGO ("aead-algo")
#define CPERF_AEAD_OP ("aead-op")
#define CPERF_AEAD_KEY_SZ ("aead-key-sz")
#define CPERF_AEAD_IV_SZ ("aead-iv-sz")
#define CPERF_AEAD_AAD_SZ ("aead-aad-sz")
#define CPERF_DIGEST_SZ ("digest-sz")
#define CPERF_CSV ("csv-friendly")
/* benchmark-specific options */
#define CPERF_PMDCC_DELAY_MS ("pmd-cyclecount-delay-ms")
#define MAX_LIST 32
enum cperf_perf_test_type {
CPERF_TEST_TYPE_THROUGHPUT,
CPERF_TEST_TYPE_LATENCY,
CPERF_TEST_TYPE_VERIFY,
CPERF_TEST_TYPE_PMDCC
};
extern const char *cperf_test_type_strs[];
enum cperf_op_type {
CPERF_CIPHER_ONLY = 1,
CPERF_AUTH_ONLY,
CPERF_CIPHER_THEN_AUTH,
CPERF_AUTH_THEN_CIPHER,
CPERF_AEAD
};
extern const char *cperf_op_type_strs[];
struct cperf_options {
enum cperf_perf_test_type test;
uint32_t pool_sz;
uint32_t total_ops;
uint32_t segment_sz;
uint32_t test_buffer_size;
uint32_t nb_descriptors;
uint16_t nb_qps;
uint32_t sessionless:1;
uint32_t out_of_place:1;
uint32_t silent:1;
uint32_t csv:1;
enum rte_crypto_cipher_algorithm cipher_algo;
enum rte_crypto_cipher_operation cipher_op;
uint16_t cipher_key_sz;
uint16_t cipher_iv_sz;
enum rte_crypto_auth_algorithm auth_algo;
enum rte_crypto_auth_operation auth_op;
uint16_t auth_key_sz;
uint16_t auth_iv_sz;
enum rte_crypto_aead_algorithm aead_algo;
enum rte_crypto_aead_operation aead_op;
uint16_t aead_key_sz;
uint16_t aead_iv_sz;
uint16_t aead_aad_sz;
uint16_t digest_sz;
char device_type[RTE_CRYPTODEV_NAME_LEN];
enum cperf_op_type op_type;
char *test_file;
char *test_name;
uint32_t buffer_size_list[MAX_LIST];
uint8_t buffer_size_count;
uint32_t max_buffer_size;
uint32_t min_buffer_size;
uint32_t inc_buffer_size;
uint32_t burst_size_list[MAX_LIST];
uint8_t burst_size_count;
uint32_t max_burst_size;
uint32_t min_burst_size;
uint32_t inc_burst_size;
/* pmd-cyclecount specific options */
uint32_t pmdcc_delay;
};
void
cperf_options_default(struct cperf_options *options);
int
cperf_options_parse(struct cperf_options *options,
int argc, char **argv);
int
cperf_options_check(struct cperf_options *options);
void
cperf_options_dump(struct cperf_options *options);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,244 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <rte_malloc.h>
#include "cperf_test_common.h"
struct obj_params {
uint32_t src_buf_offset;
uint32_t dst_buf_offset;
uint16_t segment_sz;
uint16_t segments_nb;
};
static void
fill_single_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
void *obj, uint32_t mbuf_offset, uint16_t segment_sz)
{
uint32_t mbuf_hdr_size = sizeof(struct rte_mbuf);
/* start of buffer is after mbuf structure and priv data */
m->priv_size = 0;
m->buf_addr = (char *)m + mbuf_hdr_size;
m->buf_iova = rte_mempool_virt2iova(obj) +
mbuf_offset + mbuf_hdr_size;
m->buf_len = segment_sz;
m->data_len = segment_sz;
/* No headroom needed for the buffer */
m->data_off = 0;
/* init some constant fields */
m->pool = mp;
m->nb_segs = 1;
m->port = 0xff;
rte_mbuf_refcnt_set(m, 1);
m->next = NULL;
}
static void
fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
void *obj, uint32_t mbuf_offset, uint16_t segment_sz,
uint16_t segments_nb)
{
uint16_t mbuf_hdr_size = sizeof(struct rte_mbuf);
uint16_t remaining_segments = segments_nb;
struct rte_mbuf *next_mbuf;
rte_iova_t next_seg_phys_addr = rte_mempool_virt2iova(obj) +
mbuf_offset + mbuf_hdr_size;
do {
/* start of buffer is after mbuf structure and priv data */
m->priv_size = 0;
m->buf_addr = (char *)m + mbuf_hdr_size;
m->buf_iova = next_seg_phys_addr;
next_seg_phys_addr += mbuf_hdr_size + segment_sz;
m->buf_len = segment_sz;
m->data_len = segment_sz;
/* No headroom needed for the buffer */
m->data_off = 0;
/* init some constant fields */
m->pool = mp;
m->nb_segs = segments_nb;
m->port = 0xff;
rte_mbuf_refcnt_set(m, 1);
next_mbuf = (struct rte_mbuf *) ((uint8_t *) m +
mbuf_hdr_size + segment_sz);
m->next = next_mbuf;
m = next_mbuf;
remaining_segments--;
} while (remaining_segments > 0);
m->next = NULL;
}
static void
mempool_obj_init(struct rte_mempool *mp,
void *opaque_arg,
void *obj,
__attribute__((unused)) unsigned int i)
{
struct obj_params *params = opaque_arg;
struct rte_crypto_op *op = obj;
struct rte_mbuf *m = (struct rte_mbuf *) ((uint8_t *) obj +
params->src_buf_offset);
/* Set crypto operation */
op->type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
op->sess_type = RTE_CRYPTO_OP_WITH_SESSION;
op->phys_addr = rte_mem_virt2phy(obj);
op->mempool = mp;
/* Set source buffer */
op->sym->m_src = m;
if (params->segments_nb == 1)
fill_single_seg_mbuf(m, mp, obj, params->src_buf_offset,
params->segment_sz);
else
fill_multi_seg_mbuf(m, mp, obj, params->src_buf_offset,
params->segment_sz, params->segments_nb);
/* Set destination buffer */
if (params->dst_buf_offset) {
m = (struct rte_mbuf *) ((uint8_t *) obj +
params->dst_buf_offset);
fill_single_seg_mbuf(m, mp, obj, params->dst_buf_offset,
params->segment_sz);
op->sym->m_dst = m;
} else
op->sym->m_dst = NULL;
}
int
cperf_alloc_common_memory(const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint8_t dev_id, uint16_t qp_id,
size_t extra_op_priv_size,
uint32_t *src_buf_offset,
uint32_t *dst_buf_offset,
struct rte_mempool **pool)
{
char pool_name[32] = "";
int ret;
/* Calculate the object size */
uint16_t crypto_op_size = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op);
uint16_t crypto_op_private_size;
/*
* If doing AES-CCM, IV field needs to be 16 bytes long,
* and AAD field needs to be long enough to have 18 bytes,
* plus the length of the AAD, and all rounded to a
* multiple of 16 bytes.
*/
if (options->aead_algo == RTE_CRYPTO_AEAD_AES_CCM) {
crypto_op_private_size = extra_op_priv_size +
test_vector->cipher_iv.length +
test_vector->auth_iv.length +
RTE_ALIGN_CEIL(test_vector->aead_iv.length, 16) +
RTE_ALIGN_CEIL(options->aead_aad_sz + 18, 16);
} else {
crypto_op_private_size = extra_op_priv_size +
test_vector->cipher_iv.length +
test_vector->auth_iv.length +
test_vector->aead_iv.length +
options->aead_aad_sz;
}
uint16_t crypto_op_total_size = crypto_op_size +
crypto_op_private_size;
uint16_t crypto_op_total_size_padded =
RTE_CACHE_LINE_ROUNDUP(crypto_op_total_size);
uint32_t mbuf_size = sizeof(struct rte_mbuf) + options->segment_sz;
uint32_t max_size = options->max_buffer_size + options->digest_sz;
uint16_t segments_nb = (max_size % options->segment_sz) ?
(max_size / options->segment_sz) + 1 :
max_size / options->segment_sz;
uint32_t obj_size = crypto_op_total_size_padded +
(mbuf_size * segments_nb);
snprintf(pool_name, sizeof(pool_name), "pool_cdev_%u_qp_%u",
dev_id, qp_id);
*src_buf_offset = crypto_op_total_size_padded;
struct obj_params params = {
.segment_sz = options->segment_sz,
.segments_nb = segments_nb,
.src_buf_offset = crypto_op_total_size_padded,
.dst_buf_offset = 0
};
if (options->out_of_place) {
*dst_buf_offset = *src_buf_offset +
(mbuf_size * segments_nb);
params.dst_buf_offset = *dst_buf_offset;
/* Destination buffer will be one segment only */
obj_size += max_size;
}
*pool = rte_mempool_create_empty(pool_name,
options->pool_sz, obj_size, 512, 0,
rte_socket_id(), 0);
if (*pool == NULL) {
RTE_LOG(ERR, USER1,
"Cannot allocate mempool for device %u\n",
dev_id);
return -1;
}
ret = rte_mempool_set_ops_byname(*pool,
RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL);
if (ret != 0) {
RTE_LOG(ERR, USER1,
"Error setting mempool handler for device %u\n",
dev_id);
return -1;
}
ret = rte_mempool_populate_default(*pool);
if (ret < 0) {
RTE_LOG(ERR, USER1,
"Error populating mempool for device %u\n",
dev_id);
return -1;
}
rte_mempool_obj_iter(*pool, mempool_obj_init, (void *)&params);
return 0;
}

View File

@ -0,0 +1,52 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_TEST_COMMON_H_
#define _CPERF_TEST_COMMON_H_
#include <stdint.h>
#include <rte_mempool.h>
#include "cperf_options.h"
#include "cperf_test_vectors.h"
int
cperf_alloc_common_memory(const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
uint8_t dev_id, uint16_t qp_id,
size_t extra_op_priv_size,
uint32_t *src_buf_offset,
uint32_t *dst_buf_offset,
struct rte_mempool **pool);
#endif /* _CPERF_TEST_COMMON_H_ */

View File

@ -0,0 +1,405 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_crypto.h>
#include <rte_cryptodev.h>
#include "cperf_test_latency.h"
#include "cperf_ops.h"
#include "cperf_test_common.h"
struct cperf_op_result {
uint64_t tsc_start;
uint64_t tsc_end;
enum rte_crypto_op_status status;
};
struct cperf_latency_ctx {
uint8_t dev_id;
uint16_t qp_id;
uint8_t lcore_id;
struct rte_mempool *pool;
struct rte_cryptodev_sym_session *sess;
cperf_populate_ops_t populate_ops;
uint32_t src_buf_offset;
uint32_t dst_buf_offset;
const struct cperf_options *options;
const struct cperf_test_vector *test_vector;
struct cperf_op_result *res;
};
struct priv_op_data {
struct cperf_op_result *result;
};
#define max(a, b) (a > b ? (uint64_t)a : (uint64_t)b)
#define min(a, b) (a < b ? (uint64_t)a : (uint64_t)b)
static void
cperf_latency_test_free(struct cperf_latency_ctx *ctx)
{
if (ctx) {
if (ctx->sess) {
rte_cryptodev_sym_session_clear(ctx->dev_id, ctx->sess);
rte_cryptodev_sym_session_free(ctx->sess);
}
if (ctx->pool)
rte_mempool_free(ctx->pool);
rte_free(ctx->res);
rte_free(ctx);
}
}
void *
cperf_latency_test_constructor(struct rte_mempool *sess_mp,
uint8_t dev_id, uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *op_fns)
{
struct cperf_latency_ctx *ctx = NULL;
size_t extra_op_priv_size = sizeof(struct priv_op_data);
ctx = rte_malloc(NULL, sizeof(struct cperf_latency_ctx), 0);
if (ctx == NULL)
goto err;
ctx->dev_id = dev_id;
ctx->qp_id = qp_id;
ctx->populate_ops = op_fns->populate_ops;
ctx->options = options;
ctx->test_vector = test_vector;
/* IV goes at the end of the crypto operation */
uint16_t iv_offset = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op) +
sizeof(struct cperf_op_result *);
ctx->sess = op_fns->sess_create(sess_mp, dev_id, options, test_vector,
iv_offset);
if (ctx->sess == NULL)
goto err;
if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id,
extra_op_priv_size,
&ctx->src_buf_offset, &ctx->dst_buf_offset,
&ctx->pool) < 0)
goto err;
ctx->res = rte_malloc(NULL, sizeof(struct cperf_op_result) *
ctx->options->total_ops, 0);
if (ctx->res == NULL)
goto err;
return ctx;
err:
cperf_latency_test_free(ctx);
return NULL;
}
static inline void
store_timestamp(struct rte_crypto_op *op, uint64_t timestamp)
{
struct priv_op_data *priv_data;
priv_data = (struct priv_op_data *) (op->sym + 1);
priv_data->result->status = op->status;
priv_data->result->tsc_end = timestamp;
}
int
cperf_latency_test_runner(void *arg)
{
struct cperf_latency_ctx *ctx = arg;
uint16_t test_burst_size;
uint8_t burst_size_idx = 0;
static int only_once;
if (ctx == NULL)
return 0;
struct rte_crypto_op *ops[ctx->options->max_burst_size];
struct rte_crypto_op *ops_processed[ctx->options->max_burst_size];
uint64_t i;
struct priv_op_data *priv_data;
uint32_t lcore = rte_lcore_id();
#ifdef CPERF_LINEARIZATION_ENABLE
struct rte_cryptodev_info dev_info;
int linearize = 0;
/* Check if source mbufs require coalescing */
if (ctx->options->segment_sz < ctx->options->max_buffer_size) {
rte_cryptodev_info_get(ctx->dev_id, &dev_info);
if ((dev_info.feature_flags &
RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER) == 0)
linearize = 1;
}
#endif /* CPERF_LINEARIZATION_ENABLE */
ctx->lcore_id = lcore;
/* Warm up the host CPU before starting the test */
for (i = 0; i < ctx->options->total_ops; i++)
rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id, NULL, 0);
/* Get first size from range or list */
if (ctx->options->inc_burst_size != 0)
test_burst_size = ctx->options->min_burst_size;
else
test_burst_size = ctx->options->burst_size_list[0];
uint16_t iv_offset = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op) +
sizeof(struct cperf_op_result *);
while (test_burst_size <= ctx->options->max_burst_size) {
uint64_t ops_enqd = 0, ops_deqd = 0;
uint64_t b_idx = 0;
uint64_t tsc_val, tsc_end, tsc_start;
uint64_t tsc_max = 0, tsc_min = ~0UL, tsc_tot = 0, tsc_idx = 0;
uint64_t enqd_max = 0, enqd_min = ~0UL, enqd_tot = 0;
uint64_t deqd_max = 0, deqd_min = ~0UL, deqd_tot = 0;
while (enqd_tot < ctx->options->total_ops) {
uint16_t burst_size = ((enqd_tot + test_burst_size)
<= ctx->options->total_ops) ?
test_burst_size :
ctx->options->total_ops -
enqd_tot;
/* Allocate objects containing crypto operations and mbufs */
if (rte_mempool_get_bulk(ctx->pool, (void **)ops,
burst_size) != 0) {
RTE_LOG(ERR, USER1,
"Failed to allocate more crypto operations "
"from the the crypto operation pool.\n"
"Consider increasing the pool size "
"with --pool-sz\n");
return -1;
}
/* Setup crypto op, attach mbuf etc */
(ctx->populate_ops)(ops, ctx->src_buf_offset,
ctx->dst_buf_offset,
burst_size, ctx->sess, ctx->options,
ctx->test_vector, iv_offset);
tsc_start = rte_rdtsc_precise();
#ifdef CPERF_LINEARIZATION_ENABLE
if (linearize) {
/* PMD doesn't support scatter-gather and source buffer
* is segmented.
* We need to linearize it before enqueuing.
*/
for (i = 0; i < burst_size; i++)
rte_pktmbuf_linearize(ops[i]->sym->m_src);
}
#endif /* CPERF_LINEARIZATION_ENABLE */
/* Enqueue burst of ops on crypto device */
ops_enqd = rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id,
ops, burst_size);
/* Dequeue processed burst of ops from crypto device */
ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
ops_processed, test_burst_size);
tsc_end = rte_rdtsc_precise();
/* Free memory for not enqueued operations */
if (ops_enqd != burst_size)
rte_mempool_put_bulk(ctx->pool,
(void **)&ops[ops_enqd],
burst_size - ops_enqd);
for (i = 0; i < ops_enqd; i++) {
ctx->res[tsc_idx].tsc_start = tsc_start;
/*
* Private data structure starts after the end of the
* rte_crypto_sym_op structure.
*/
priv_data = (struct priv_op_data *) (ops[i]->sym + 1);
priv_data->result = (void *)&ctx->res[tsc_idx];
tsc_idx++;
}
if (likely(ops_deqd)) {
/* Free crypto ops so they can be reused. */
for (i = 0; i < ops_deqd; i++)
store_timestamp(ops_processed[i], tsc_end);
rte_mempool_put_bulk(ctx->pool,
(void **)ops_processed, ops_deqd);
deqd_tot += ops_deqd;
deqd_max = max(ops_deqd, deqd_max);
deqd_min = min(ops_deqd, deqd_min);
}
enqd_tot += ops_enqd;
enqd_max = max(ops_enqd, enqd_max);
enqd_min = min(ops_enqd, enqd_min);
b_idx++;
}
/* Dequeue any operations still in the crypto device */
while (deqd_tot < ctx->options->total_ops) {
/* Sending 0 length burst to flush sw crypto device */
rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id, NULL, 0);
/* dequeue burst */
ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
ops_processed, test_burst_size);
tsc_end = rte_rdtsc_precise();
if (ops_deqd != 0) {
for (i = 0; i < ops_deqd; i++)
store_timestamp(ops_processed[i], tsc_end);
rte_mempool_put_bulk(ctx->pool,
(void **)ops_processed, ops_deqd);
deqd_tot += ops_deqd;
deqd_max = max(ops_deqd, deqd_max);
deqd_min = min(ops_deqd, deqd_min);
}
}
for (i = 0; i < tsc_idx; i++) {
tsc_val = ctx->res[i].tsc_end - ctx->res[i].tsc_start;
tsc_max = max(tsc_val, tsc_max);
tsc_min = min(tsc_val, tsc_min);
tsc_tot += tsc_val;
}
double time_tot, time_avg, time_max, time_min;
const uint64_t tunit = 1000000; /* us */
const uint64_t tsc_hz = rte_get_tsc_hz();
uint64_t enqd_avg = enqd_tot / b_idx;
uint64_t deqd_avg = deqd_tot / b_idx;
uint64_t tsc_avg = tsc_tot / tsc_idx;
time_tot = tunit*(double)(tsc_tot) / tsc_hz;
time_avg = tunit*(double)(tsc_avg) / tsc_hz;
time_max = tunit*(double)(tsc_max) / tsc_hz;
time_min = tunit*(double)(tsc_min) / tsc_hz;
if (ctx->options->csv) {
if (!only_once)
printf("\n# lcore, Buffer Size, Burst Size, Pakt Seq #, "
"Packet Size, cycles, time (us)");
for (i = 0; i < ctx->options->total_ops; i++) {
printf("\n%u;%u;%u;%"PRIu64";%"PRIu64";%.3f",
ctx->lcore_id, ctx->options->test_buffer_size,
test_burst_size, i + 1,
ctx->res[i].tsc_end - ctx->res[i].tsc_start,
tunit * (double) (ctx->res[i].tsc_end
- ctx->res[i].tsc_start)
/ tsc_hz);
}
only_once = 1;
} else {
printf("\n# Device %d on lcore %u\n", ctx->dev_id,
ctx->lcore_id);
printf("\n# total operations: %u", ctx->options->total_ops);
printf("\n# Buffer size: %u", ctx->options->test_buffer_size);
printf("\n# Burst size: %u", test_burst_size);
printf("\n# Number of bursts: %"PRIu64,
b_idx);
printf("\n#");
printf("\n# \t Total\t Average\t "
"Maximum\t Minimum");
printf("\n# enqueued\t%12"PRIu64"\t%10"PRIu64"\t"
"%10"PRIu64"\t%10"PRIu64, enqd_tot,
enqd_avg, enqd_max, enqd_min);
printf("\n# dequeued\t%12"PRIu64"\t%10"PRIu64"\t"
"%10"PRIu64"\t%10"PRIu64, deqd_tot,
deqd_avg, deqd_max, deqd_min);
printf("\n# cycles\t%12"PRIu64"\t%10"PRIu64"\t"
"%10"PRIu64"\t%10"PRIu64, tsc_tot,
tsc_avg, tsc_max, tsc_min);
printf("\n# time [us]\t%12.0f\t%10.3f\t%10.3f\t%10.3f",
time_tot, time_avg, time_max, time_min);
printf("\n\n");
}
/* Get next size from range or list */
if (ctx->options->inc_burst_size != 0)
test_burst_size += ctx->options->inc_burst_size;
else {
if (++burst_size_idx == ctx->options->burst_size_count)
break;
test_burst_size =
ctx->options->burst_size_list[burst_size_idx];
}
}
return 0;
}
void
cperf_latency_test_destructor(void *arg)
{
struct cperf_latency_ctx *ctx = arg;
if (ctx == NULL)
return;
cperf_latency_test_free(ctx);
}

View File

@ -0,0 +1,60 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_LATENCY_
#define _CPERF_LATENCY_
#include <stdint.h>
#include <rte_mbuf.h>
#include "cperf.h"
#include "cperf_ops.h"
#include "cperf_options.h"
#include "cperf_test_vectors.h"
void *
cperf_latency_test_constructor(
struct rte_mempool *sess_mp,
uint8_t dev_id,
uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *ops_fn);
int
cperf_latency_test_runner(void *test_ctx);
void
cperf_latency_test_destructor(void *test_ctx);
#endif /* _CPERF_LATENCY_ */

View File

@ -0,0 +1,520 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdbool.h>
#include <rte_crypto.h>
#include <rte_cryptodev.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
#include "cperf_ops.h"
#include "cperf_test_pmd_cyclecount.h"
#include "cperf_test_common.h"
#define PRETTY_HDR_FMT "%12s%12s%12s%12s%12s%12s%12s%12s%12s%12s\n\n"
#define PRETTY_LINE_FMT "%12u%12u%12u%12u%12u%12u%12u%12.0f%12.0f%12.0f\n"
#define CSV_HDR_FMT "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n"
#define CSV_LINE_FMT "%10u;%10u;%u;%u;%u;%u;%u;%.f3;%.f3;%.f3\n"
struct cperf_pmd_cyclecount_ctx {
uint8_t dev_id;
uint16_t qp_id;
uint8_t lcore_id;
struct rte_mempool *pool;
struct rte_crypto_op **ops;
struct rte_crypto_op **ops_processed;
struct rte_cryptodev_sym_session *sess;
cperf_populate_ops_t populate_ops;
uint32_t src_buf_offset;
uint32_t dst_buf_offset;
const struct cperf_options *options;
const struct cperf_test_vector *test_vector;
};
struct pmd_cyclecount_state {
struct cperf_pmd_cyclecount_ctx *ctx;
const struct cperf_options *opts;
uint32_t lcore;
uint64_t delay;
int linearize;
uint32_t ops_enqd;
uint32_t ops_deqd;
uint32_t ops_enq_retries;
uint32_t ops_deq_retries;
double cycles_per_build;
double cycles_per_enq;
double cycles_per_deq;
};
static const uint16_t iv_offset =
sizeof(struct rte_crypto_op) + sizeof(struct rte_crypto_sym_op);
static void
cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx)
{
if (ctx) {
if (ctx->sess) {
rte_cryptodev_sym_session_clear(ctx->dev_id, ctx->sess);
rte_cryptodev_sym_session_free(ctx->sess);
}
if (ctx->pool)
rte_mempool_free(ctx->pool);
if (ctx->ops)
rte_free(ctx->ops);
if (ctx->ops_processed)
rte_free(ctx->ops_processed);
rte_free(ctx);
}
}
void *
cperf_pmd_cyclecount_test_constructor(struct rte_mempool *sess_mp,
uint8_t dev_id, uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *op_fns)
{
struct cperf_pmd_cyclecount_ctx *ctx = NULL;
/* preallocate buffers for crypto ops as they can get quite big */
size_t alloc_sz = sizeof(struct rte_crypto_op *) *
options->nb_descriptors;
ctx = rte_malloc(NULL, sizeof(struct cperf_pmd_cyclecount_ctx), 0);
if (ctx == NULL)
goto err;
ctx->dev_id = dev_id;
ctx->qp_id = qp_id;
ctx->populate_ops = op_fns->populate_ops;
ctx->options = options;
ctx->test_vector = test_vector;
/* IV goes at the end of the crypto operation */
uint16_t iv_offset = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op);
ctx->sess = op_fns->sess_create(
sess_mp, dev_id, options, test_vector, iv_offset);
if (ctx->sess == NULL)
goto err;
if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id, 0,
&ctx->src_buf_offset, &ctx->dst_buf_offset,
&ctx->pool) < 0)
goto err;
ctx->ops = rte_malloc("ops", alloc_sz, 0);
if (!ctx->ops)
goto err;
ctx->ops_processed = rte_malloc("ops_processed", alloc_sz, 0);
if (!ctx->ops_processed)
goto err;
return ctx;
err:
cperf_pmd_cyclecount_test_free(ctx);
return NULL;
}
/* benchmark alloc-build-free of ops */
static inline int
pmd_cyclecount_bench_ops(struct pmd_cyclecount_state *state, uint32_t cur_op,
uint16_t test_burst_size)
{
uint32_t iter_ops_left = state->opts->total_ops - cur_op;
uint32_t iter_ops_needed =
RTE_MIN(state->opts->nb_descriptors, iter_ops_left);
uint32_t cur_iter_op;
for (cur_iter_op = 0; cur_iter_op < iter_ops_needed;
cur_iter_op += test_burst_size) {
uint32_t burst_size = RTE_MIN(state->opts->total_ops - cur_op,
test_burst_size);
struct rte_crypto_op **ops = &state->ctx->ops[cur_iter_op];
/* Allocate objects containing crypto operations and mbufs */
if (rte_mempool_get_bulk(state->ctx->pool, (void **)ops,
burst_size) != 0) {
RTE_LOG(ERR, USER1,
"Failed to allocate more crypto operations "
"from the the crypto operation pool.\n"
"Consider increasing the pool size "
"with --pool-sz\n");
return -1;
}
/* Setup crypto op, attach mbuf etc */
(state->ctx->populate_ops)(ops,
state->ctx->src_buf_offset,
state->ctx->dst_buf_offset,
burst_size,
state->ctx->sess, state->opts,
state->ctx->test_vector, iv_offset);
#ifdef CPERF_LINEARIZATION_ENABLE
/* Check if source mbufs require coalescing */
if (state->linearize) {
uint8_t i;
for (i = 0; i < burst_size; i++) {
struct rte_mbuf *src = ops[i]->sym->m_src;
rte_pktmbuf_linearize(src);
}
}
#endif /* CPERF_LINEARIZATION_ENABLE */
rte_mempool_put_bulk(state->ctx->pool, (void **)ops,
burst_size);
}
return 0;
}
/* allocate and build ops (no free) */
static int
pmd_cyclecount_build_ops(struct pmd_cyclecount_state *state,
uint32_t iter_ops_needed, uint16_t test_burst_size)
{
uint32_t cur_iter_op;
for (cur_iter_op = 0; cur_iter_op < iter_ops_needed;
cur_iter_op += test_burst_size) {
uint32_t burst_size = RTE_MIN(
iter_ops_needed - cur_iter_op, test_burst_size);
struct rte_crypto_op **ops = &state->ctx->ops[cur_iter_op];
/* Allocate objects containing crypto operations and mbufs */
if (rte_mempool_get_bulk(state->ctx->pool, (void **)ops,
burst_size) != 0) {
RTE_LOG(ERR, USER1,
"Failed to allocate more crypto operations "
"from the the crypto operation pool.\n"
"Consider increasing the pool size "
"with --pool-sz\n");
return -1;
}
/* Setup crypto op, attach mbuf etc */
(state->ctx->populate_ops)(ops,
state->ctx->src_buf_offset,
state->ctx->dst_buf_offset,
burst_size,
state->ctx->sess, state->opts,
state->ctx->test_vector, iv_offset);
}
return 0;
}
/* benchmark enqueue, returns number of ops enqueued */
static uint32_t
pmd_cyclecount_bench_enq(struct pmd_cyclecount_state *state,
uint32_t iter_ops_needed, uint16_t test_burst_size)
{
/* Enqueue full descriptor ring of ops on crypto device */
uint32_t cur_iter_op = 0;
while (cur_iter_op < iter_ops_needed) {
uint32_t burst_size = RTE_MIN(iter_ops_needed - cur_iter_op,
test_burst_size);
struct rte_crypto_op **ops = &state->ctx->ops[cur_iter_op];
uint32_t burst_enqd;
burst_enqd = rte_cryptodev_enqueue_burst(state->ctx->dev_id,
state->ctx->qp_id, ops, burst_size);
/* if we couldn't enqueue anything, the queue is full */
if (!burst_enqd) {
/* don't try to dequeue anything we didn't enqueue */
return cur_iter_op;
}
if (burst_enqd < burst_size)
state->ops_enq_retries++;
state->ops_enqd += burst_enqd;
cur_iter_op += burst_enqd;
}
return iter_ops_needed;
}
/* benchmark dequeue */
static void
pmd_cyclecount_bench_deq(struct pmd_cyclecount_state *state,
uint32_t iter_ops_needed, uint16_t test_burst_size)
{
/* Dequeue full descriptor ring of ops on crypto device */
uint32_t cur_iter_op = 0;
while (cur_iter_op < iter_ops_needed) {
uint32_t burst_size = RTE_MIN(iter_ops_needed - cur_iter_op,
test_burst_size);
struct rte_crypto_op **ops_processed =
&state->ctx->ops[cur_iter_op];
uint32_t burst_deqd;
burst_deqd = rte_cryptodev_dequeue_burst(state->ctx->dev_id,
state->ctx->qp_id, ops_processed, burst_size);
if (burst_deqd < burst_size)
state->ops_deq_retries++;
state->ops_deqd += burst_deqd;
cur_iter_op += burst_deqd;
}
}
/* run benchmark per burst size */
static inline int
pmd_cyclecount_bench_burst_sz(
struct pmd_cyclecount_state *state, uint16_t test_burst_size)
{
uint64_t tsc_start;
uint64_t tsc_end;
uint64_t tsc_op;
uint64_t tsc_enq;
uint64_t tsc_deq;
uint32_t cur_op;
/* reset all counters */
tsc_enq = 0;
tsc_deq = 0;
state->ops_enqd = 0;
state->ops_enq_retries = 0;
state->ops_deqd = 0;
state->ops_deq_retries = 0;
/*
* Benchmark crypto op alloc-build-free separately.
*/
tsc_start = rte_rdtsc_precise();
for (cur_op = 0; cur_op < state->opts->total_ops;
cur_op += state->opts->nb_descriptors) {
if (unlikely(pmd_cyclecount_bench_ops(
state, cur_op, test_burst_size)))
return -1;
}
tsc_end = rte_rdtsc_precise();
tsc_op = tsc_end - tsc_start;
/*
* Hardware acceleration cyclecount benchmarking loop.
*
* We're benchmarking raw enq/deq performance by filling up the device
* queue, so we never get any failed enqs unless the driver won't accept
* the exact number of descriptors we requested, or the driver won't
* wrap around the end of the TX ring. However, since we're only
* dequeueing once we've filled up the queue, we have to benchmark it
* piecemeal and then average out the results.
*/
cur_op = 0;
while (cur_op < state->opts->total_ops) {
uint32_t iter_ops_left = state->opts->total_ops - cur_op;
uint32_t iter_ops_needed = RTE_MIN(
state->opts->nb_descriptors, iter_ops_left);
uint32_t iter_ops_allocd = iter_ops_needed;
/* allocate and build ops */
if (unlikely(pmd_cyclecount_build_ops(state, iter_ops_needed,
test_burst_size)))
return -1;
tsc_start = rte_rdtsc_precise();
/* fill up TX ring */
iter_ops_needed = pmd_cyclecount_bench_enq(state,
iter_ops_needed, test_burst_size);
tsc_end = rte_rdtsc_precise();
tsc_enq += tsc_end - tsc_start;
/* allow for HW to catch up */
if (state->delay)
rte_delay_us_block(state->delay);
tsc_start = rte_rdtsc_precise();
/* drain RX ring */
pmd_cyclecount_bench_deq(state, iter_ops_needed,
test_burst_size);
tsc_end = rte_rdtsc_precise();
tsc_deq += tsc_end - tsc_start;
cur_op += iter_ops_needed;
/*
* we may not have processed all ops that we allocated, so
* free everything we've allocated.
*/
rte_mempool_put_bulk(state->ctx->pool,
(void **)state->ctx->ops, iter_ops_allocd);
}
state->cycles_per_build = (double)tsc_op / state->opts->total_ops;
state->cycles_per_enq = (double)tsc_enq / state->ops_enqd;
state->cycles_per_deq = (double)tsc_deq / state->ops_deqd;
return 0;
}
int
cperf_pmd_cyclecount_test_runner(void *test_ctx)
{
struct pmd_cyclecount_state state = {0};
const struct cperf_options *opts;
uint16_t test_burst_size;
uint8_t burst_size_idx = 0;
state.ctx = test_ctx;
opts = state.ctx->options;
state.opts = opts;
state.lcore = rte_lcore_id();
state.linearize = 0;
static int only_once;
static bool warmup = true;
/*
* We need a small delay to allow for hardware to process all the crypto
* operations. We can't automatically figure out what the delay should
* be, so we leave it up to the user (by default it's 0).
*/
state.delay = 1000 * opts->pmdcc_delay;
#ifdef CPERF_LINEARIZATION_ENABLE
struct rte_cryptodev_info dev_info;
/* Check if source mbufs require coalescing */
if (opts->segments_sz < ctx->options->max_buffer_size) {
rte_cryptodev_info_get(state.ctx->dev_id, &dev_info);
if ((dev_info.feature_flags &
RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER) ==
0) {
state.linearize = 1;
}
}
#endif /* CPERF_LINEARIZATION_ENABLE */
state.ctx->lcore_id = state.lcore;
/* Get first size from range or list */
if (opts->inc_burst_size != 0)
test_burst_size = opts->min_burst_size;
else
test_burst_size = opts->burst_size_list[0];
while (test_burst_size <= opts->max_burst_size) {
/* do a benchmark run */
if (pmd_cyclecount_bench_burst_sz(&state, test_burst_size))
return -1;
/*
* First run is always a warm up run.
*/
if (warmup) {
warmup = false;
continue;
}
if (!opts->csv) {
if (!only_once)
printf(PRETTY_HDR_FMT, "lcore id", "Buf Size",
"Burst Size", "Enqueued",
"Dequeued", "Enq Retries",
"Deq Retries", "Cycles/Op",
"Cycles/Enq", "Cycles/Deq");
only_once = 1;
printf(PRETTY_LINE_FMT, state.ctx->lcore_id,
opts->test_buffer_size, test_burst_size,
state.ops_enqd, state.ops_deqd,
state.ops_enq_retries,
state.ops_deq_retries,
state.cycles_per_build,
state.cycles_per_enq,
state.cycles_per_deq);
} else {
if (!only_once)
printf(CSV_HDR_FMT, "# lcore id", "Buf Size",
"Burst Size", "Enqueued",
"Dequeued", "Enq Retries",
"Deq Retries", "Cycles/Op",
"Cycles/Enq", "Cycles/Deq");
only_once = 1;
printf(CSV_LINE_FMT, state.ctx->lcore_id,
opts->test_buffer_size, test_burst_size,
state.ops_enqd, state.ops_deqd,
state.ops_enq_retries,
state.ops_deq_retries,
state.cycles_per_build,
state.cycles_per_enq,
state.cycles_per_deq);
}
/* Get next size from range or list */
if (opts->inc_burst_size != 0)
test_burst_size += opts->inc_burst_size;
else {
if (++burst_size_idx == opts->burst_size_count)
break;
test_burst_size = opts->burst_size_list[burst_size_idx];
}
}
return 0;
}
void
cperf_pmd_cyclecount_test_destructor(void *arg)
{
struct cperf_pmd_cyclecount_ctx *ctx = arg;
if (ctx == NULL)
return;
cperf_pmd_cyclecount_test_free(ctx);
}

View File

@ -0,0 +1,61 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_TEST_PMD_CYCLECOUNT_H_
#define _CPERF_TEST_PMD_CYCLECOUNT_H_
#include <stdint.h>
#include <rte_mbuf.h>
#include "cperf.h"
#include "cperf_ops.h"
#include "cperf_options.h"
#include "cperf_test_vectors.h"
void *
cperf_pmd_cyclecount_test_constructor(
struct rte_mempool *sess_mp,
uint8_t dev_id,
uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *ops_fn);
int
cperf_pmd_cyclecount_test_runner(void *test_ctx);
void
cperf_pmd_cyclecount_test_destructor(void *test_ctx);
#endif /* _CPERF_TEST_PMD_CYCLECOUNT_H_ */

View File

@ -0,0 +1,357 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_crypto.h>
#include <rte_cryptodev.h>
#include "cperf_test_throughput.h"
#include "cperf_ops.h"
#include "cperf_test_common.h"
struct cperf_throughput_ctx {
uint8_t dev_id;
uint16_t qp_id;
uint8_t lcore_id;
struct rte_mempool *pool;
struct rte_cryptodev_sym_session *sess;
cperf_populate_ops_t populate_ops;
uint32_t src_buf_offset;
uint32_t dst_buf_offset;
const struct cperf_options *options;
const struct cperf_test_vector *test_vector;
};
static void
cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
{
if (ctx) {
if (ctx->sess) {
rte_cryptodev_sym_session_clear(ctx->dev_id, ctx->sess);
rte_cryptodev_sym_session_free(ctx->sess);
}
if (ctx->pool)
rte_mempool_free(ctx->pool);
rte_free(ctx);
}
}
void *
cperf_throughput_test_constructor(struct rte_mempool *sess_mp,
uint8_t dev_id, uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *op_fns)
{
struct cperf_throughput_ctx *ctx = NULL;
ctx = rte_malloc(NULL, sizeof(struct cperf_throughput_ctx), 0);
if (ctx == NULL)
goto err;
ctx->dev_id = dev_id;
ctx->qp_id = qp_id;
ctx->populate_ops = op_fns->populate_ops;
ctx->options = options;
ctx->test_vector = test_vector;
/* IV goes at the end of the crypto operation */
uint16_t iv_offset = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op);
ctx->sess = op_fns->sess_create(sess_mp, dev_id, options, test_vector,
iv_offset);
if (ctx->sess == NULL)
goto err;
if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id, 0,
&ctx->src_buf_offset, &ctx->dst_buf_offset,
&ctx->pool) < 0)
goto err;
return ctx;
err:
cperf_throughput_test_free(ctx);
return NULL;
}
int
cperf_throughput_test_runner(void *test_ctx)
{
struct cperf_throughput_ctx *ctx = test_ctx;
uint16_t test_burst_size;
uint8_t burst_size_idx = 0;
static int only_once;
struct rte_crypto_op *ops[ctx->options->max_burst_size];
struct rte_crypto_op *ops_processed[ctx->options->max_burst_size];
uint64_t i;
uint32_t lcore = rte_lcore_id();
#ifdef CPERF_LINEARIZATION_ENABLE
struct rte_cryptodev_info dev_info;
int linearize = 0;
/* Check if source mbufs require coalescing */
if (ctx->options->segment_sz < ctx->options->max_buffer_size) {
rte_cryptodev_info_get(ctx->dev_id, &dev_info);
if ((dev_info.feature_flags &
RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER) == 0)
linearize = 1;
}
#endif /* CPERF_LINEARIZATION_ENABLE */
ctx->lcore_id = lcore;
/* Warm up the host CPU before starting the test */
for (i = 0; i < ctx->options->total_ops; i++)
rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id, NULL, 0);
/* Get first size from range or list */
if (ctx->options->inc_burst_size != 0)
test_burst_size = ctx->options->min_burst_size;
else
test_burst_size = ctx->options->burst_size_list[0];
uint16_t iv_offset = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op);
while (test_burst_size <= ctx->options->max_burst_size) {
uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;
uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;
uint64_t tsc_start, tsc_end, tsc_duration;
uint16_t ops_unused = 0;
tsc_start = rte_rdtsc_precise();
while (ops_enqd_total < ctx->options->total_ops) {
uint16_t burst_size = ((ops_enqd_total + test_burst_size)
<= ctx->options->total_ops) ?
test_burst_size :
ctx->options->total_ops -
ops_enqd_total;
uint16_t ops_needed = burst_size - ops_unused;
/* Allocate objects containing crypto operations and mbufs */
if (rte_mempool_get_bulk(ctx->pool, (void **)ops,
ops_needed) != 0) {
RTE_LOG(ERR, USER1,
"Failed to allocate more crypto operations "
"from the the crypto operation pool.\n"
"Consider increasing the pool size "
"with --pool-sz\n");
return -1;
}
/* Setup crypto op, attach mbuf etc */
(ctx->populate_ops)(ops, ctx->src_buf_offset,
ctx->dst_buf_offset,
ops_needed, ctx->sess,
ctx->options, ctx->test_vector,
iv_offset);
/**
* When ops_needed is smaller than ops_enqd, the
* unused ops need to be moved to the front for
* next round use.
*/
if (unlikely(ops_enqd > ops_needed)) {
size_t nb_b_to_mov = ops_unused * sizeof(
struct rte_crypto_op *);
memmove(&ops[ops_needed], &ops[ops_enqd],
nb_b_to_mov);
}
#ifdef CPERF_LINEARIZATION_ENABLE
if (linearize) {
/* PMD doesn't support scatter-gather and source buffer
* is segmented.
* We need to linearize it before enqueuing.
*/
for (i = 0; i < burst_size; i++)
rte_pktmbuf_linearize(ops[i]->sym->m_src);
}
#endif /* CPERF_LINEARIZATION_ENABLE */
/* Enqueue burst of ops on crypto device */
ops_enqd = rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id,
ops, burst_size);
if (ops_enqd < burst_size)
ops_enqd_failed++;
/**
* Calculate number of ops not enqueued (mainly for hw
* accelerators whose ingress queue can fill up).
*/
ops_unused = burst_size - ops_enqd;
ops_enqd_total += ops_enqd;
/* Dequeue processed burst of ops from crypto device */
ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
ops_processed, test_burst_size);
if (likely(ops_deqd)) {
/* Free crypto ops so they can be reused. */
rte_mempool_put_bulk(ctx->pool,
(void **)ops_processed, ops_deqd);
ops_deqd_total += ops_deqd;
} else {
/**
* Count dequeue polls which didn't return any
* processed operations. This statistic is mainly
* relevant to hw accelerators.
*/
ops_deqd_failed++;
}
}
/* Dequeue any operations still in the crypto device */
while (ops_deqd_total < ctx->options->total_ops) {
/* Sending 0 length burst to flush sw crypto device */
rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id, NULL, 0);
/* dequeue burst */
ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
ops_processed, test_burst_size);
if (ops_deqd == 0)
ops_deqd_failed++;
else {
rte_mempool_put_bulk(ctx->pool,
(void **)ops_processed, ops_deqd);
ops_deqd_total += ops_deqd;
}
}
tsc_end = rte_rdtsc_precise();
tsc_duration = (tsc_end - tsc_start);
/* Calculate average operations processed per second */
double ops_per_second = ((double)ctx->options->total_ops /
tsc_duration) * rte_get_tsc_hz();
/* Calculate average throughput (Gbps) in bits per second */
double throughput_gbps = ((ops_per_second *
ctx->options->test_buffer_size * 8) / 1000000000);
/* Calculate average cycles per packet */
double cycles_per_packet = ((double)tsc_duration /
ctx->options->total_ops);
if (!ctx->options->csv) {
if (!only_once)
printf("%12s%12s%12s%12s%12s%12s%12s%12s%12s%12s\n\n",
"lcore id", "Buf Size", "Burst Size",
"Enqueued", "Dequeued", "Failed Enq",
"Failed Deq", "MOps", "Gbps",
"Cycles/Buf");
only_once = 1;
printf("%12u%12u%12u%12"PRIu64"%12"PRIu64"%12"PRIu64
"%12"PRIu64"%12.4f%12.4f%12.2f\n",
ctx->lcore_id,
ctx->options->test_buffer_size,
test_burst_size,
ops_enqd_total,
ops_deqd_total,
ops_enqd_failed,
ops_deqd_failed,
ops_per_second/1000000,
throughput_gbps,
cycles_per_packet);
} else {
if (!only_once)
printf("#lcore id,Buffer Size(B),"
"Burst Size,Enqueued,Dequeued,Failed Enq,"
"Failed Deq,Ops(Millions),Throughput(Gbps),"
"Cycles/Buf\n\n");
only_once = 1;
printf("%u;%u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
"%.3f;%.3f;%.3f\n",
ctx->lcore_id,
ctx->options->test_buffer_size,
test_burst_size,
ops_enqd_total,
ops_deqd_total,
ops_enqd_failed,
ops_deqd_failed,
ops_per_second/1000000,
throughput_gbps,
cycles_per_packet);
}
/* Get next size from range or list */
if (ctx->options->inc_burst_size != 0)
test_burst_size += ctx->options->inc_burst_size;
else {
if (++burst_size_idx == ctx->options->burst_size_count)
break;
test_burst_size = ctx->options->burst_size_list[burst_size_idx];
}
}
return 0;
}
void
cperf_throughput_test_destructor(void *arg)
{
struct cperf_throughput_ctx *ctx = arg;
if (ctx == NULL)
return;
cperf_throughput_test_free(ctx);
}

View File

@ -0,0 +1,61 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_THROUGHPUT_
#define _CPERF_THROUGHPUT_
#include <stdint.h>
#include <rte_mbuf.h>
#include "cperf.h"
#include "cperf_ops.h"
#include "cperf_options.h"
#include "cperf_test_vectors.h"
void *
cperf_throughput_test_constructor(
struct rte_mempool *sess_mp,
uint8_t dev_id,
uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *ops_fn);
int
cperf_throughput_test_runner(void *test_ctx);
void
cperf_throughput_test_destructor(void *test_ctx);
#endif /* _CPERF_THROUGHPUT_ */

View File

@ -0,0 +1,620 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef RTE_EXEC_ENV_BSDAPP
#define _WITH_GETLINE
#endif
#include <stdio.h>
#include <rte_malloc.h>
#include "cperf_options.h"
#include "cperf_test_vectors.h"
#include "cperf_test_vector_parsing.h"
int
free_test_vector(struct cperf_test_vector *vector, struct cperf_options *opts)
{
if (vector == NULL || opts == NULL)
return -1;
rte_free(vector->cipher_iv.data);
rte_free(vector->auth_iv.data);
rte_free(vector->aad.data);
rte_free(vector->digest.data);
if (opts->test_file != NULL) {
rte_free(vector->plaintext.data);
rte_free(vector->cipher_key.data);
rte_free(vector->auth_key.data);
rte_free(vector->ciphertext.data);
}
rte_free(vector);
return 0;
}
void
show_test_vector(struct cperf_test_vector *test_vector)
{
const uint8_t wrap = 32;
uint32_t i;
if (test_vector == NULL)
return;
if (test_vector->plaintext.data) {
printf("\nplaintext =\n");
for (i = 0; i < test_vector->plaintext.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == test_vector->plaintext.length - 1)
printf("0x%02x",
test_vector->plaintext.data[i]);
else
printf("0x%02x, ",
test_vector->plaintext.data[i]);
}
printf("\n");
}
if (test_vector->cipher_key.data) {
printf("\ncipher_key =\n");
for (i = 0; i < test_vector->cipher_key.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->cipher_key.length - 1))
printf("0x%02x",
test_vector->cipher_key.data[i]);
else
printf("0x%02x, ",
test_vector->cipher_key.data[i]);
}
printf("\n");
}
if (test_vector->auth_key.data) {
printf("\nauth_key =\n");
for (i = 0; i < test_vector->auth_key.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->auth_key.length - 1))
printf("0x%02x", test_vector->auth_key.data[i]);
else
printf("0x%02x, ",
test_vector->auth_key.data[i]);
}
printf("\n");
}
if (test_vector->aead_key.data) {
printf("\naead_key =\n");
for (i = 0; i < test_vector->aead_key.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->aead_key.length - 1))
printf("0x%02x", test_vector->aead_key.data[i]);
else
printf("0x%02x, ",
test_vector->aead_key.data[i]);
}
printf("\n");
}
if (test_vector->cipher_iv.data) {
printf("\ncipher_iv =\n");
for (i = 0; i < test_vector->cipher_iv.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->cipher_iv.length - 1))
printf("0x%02x", test_vector->cipher_iv.data[i]);
else
printf("0x%02x, ", test_vector->cipher_iv.data[i]);
}
printf("\n");
}
if (test_vector->auth_iv.data) {
printf("\nauth_iv =\n");
for (i = 0; i < test_vector->auth_iv.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->auth_iv.length - 1))
printf("0x%02x", test_vector->auth_iv.data[i]);
else
printf("0x%02x, ", test_vector->auth_iv.data[i]);
}
printf("\n");
}
if (test_vector->aead_iv.data) {
printf("\naead_iv =\n");
for (i = 0; i < test_vector->aead_iv.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->aead_iv.length - 1))
printf("0x%02x", test_vector->aead_iv.data[i]);
else
printf("0x%02x, ", test_vector->aead_iv.data[i]);
}
printf("\n");
}
if (test_vector->ciphertext.data) {
printf("\nciphertext =\n");
for (i = 0; i < test_vector->ciphertext.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == test_vector->ciphertext.length - 1)
printf("0x%02x",
test_vector->ciphertext.data[i]);
else
printf("0x%02x, ",
test_vector->ciphertext.data[i]);
}
printf("\n");
}
if (test_vector->aad.data) {
printf("\naad =\n");
for (i = 0; i < test_vector->aad.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->aad.length - 1))
printf("0x%02x", test_vector->aad.data[i]);
else
printf("0x%02x, ", test_vector->aad.data[i]);
}
printf("\n");
}
if (test_vector->digest.data) {
printf("\ndigest =\n");
for (i = 0; i < test_vector->digest.length; ++i) {
if ((i % wrap == 0) && (i != 0))
printf("\n");
if (i == (uint32_t)(test_vector->digest.length - 1))
printf("0x%02x", test_vector->digest.data[i]);
else
printf("0x%02x, ", test_vector->digest.data[i]);
}
printf("\n");
}
}
/* trim leading and trailing spaces */
static char *
trim_space(char *str)
{
char *start, *end;
for (start = str; *start; start++) {
if (!isspace((unsigned char) start[0]))
break;
}
for (end = start + strlen(start); end > start + 1; end--) {
if (!isspace((unsigned char) end[-1]))
break;
}
*end = 0;
/* Shift from "start" to the beginning of the string */
if (start > str)
memmove(str, start, (end - start) + 1);
return str;
}
/* tokenization test values separated by a comma */
static int
parse_values(char *tokens, uint8_t **data, uint32_t *data_length)
{
uint32_t n_tokens;
uint32_t data_size = 32;
uint8_t *values, *values_resized;
char *tok, *error = NULL;
tok = strtok(tokens, CPERF_VALUE_DELIMITER);
if (tok == NULL)
return -1;
values = (uint8_t *) rte_zmalloc(NULL, sizeof(uint8_t) * data_size, 0);
if (values == NULL)
return -1;
n_tokens = 0;
while (tok != NULL) {
values_resized = NULL;
if (n_tokens >= data_size) {
data_size *= 2;
values_resized = (uint8_t *) rte_realloc(values,
sizeof(uint8_t) * data_size, 0);
if (values_resized == NULL) {
rte_free(values);
return -1;
}
values = values_resized;
}
values[n_tokens] = (uint8_t) strtoul(tok, &error, 0);
if ((error == NULL) || (*error != '\0')) {
printf("Failed with convert '%s'\n", tok);
rte_free(values);
return -1;
}
tok = strtok(NULL, CPERF_VALUE_DELIMITER);
if (tok == NULL)
break;
n_tokens++;
}
values_resized = (uint8_t *) rte_realloc(values,
sizeof(uint8_t) * (n_tokens + 1), 0);
if (values_resized == NULL) {
rte_free(values);
return -1;
}
*data = values_resized;
*data_length = n_tokens + 1;
return 0;
}
/* checks the type of key and assigns data */
static int
parse_entry(char *entry, struct cperf_test_vector *vector,
struct cperf_options *opts, uint8_t tc_found)
{
int status;
uint32_t data_length;
uint8_t *data = NULL;
char *token, *key_token;
if (entry == NULL) {
printf("Expected entry value\n");
return -1;
}
/* get key */
token = strtok(entry, CPERF_ENTRY_DELIMITER);
key_token = token;
/* get values for key */
token = strtok(NULL, CPERF_ENTRY_DELIMITER);
if (key_token == NULL || token == NULL) {
printf("Expected 'key = values' but was '%.40s'..\n", entry);
return -1;
}
status = parse_values(token, &data, &data_length);
if (status)
return -1;
/* compare keys */
if (strstr(key_token, "plaintext")) {
rte_free(vector->plaintext.data);
vector->plaintext.data = data;
if (tc_found)
vector->plaintext.length = data_length;
else {
if (opts->max_buffer_size > data_length) {
printf("Global plaintext shorter than "
"buffer_sz\n");
return -1;
}
vector->plaintext.length = opts->max_buffer_size;
}
} else if (strstr(key_token, "cipher_key")) {
rte_free(vector->cipher_key.data);
vector->cipher_key.data = data;
if (tc_found)
vector->cipher_key.length = data_length;
else {
if (opts->cipher_key_sz > data_length) {
printf("Global cipher_key shorter than "
"cipher_key_sz\n");
return -1;
}
vector->cipher_key.length = opts->cipher_key_sz;
}
} else if (strstr(key_token, "auth_key")) {
rte_free(vector->auth_key.data);
vector->auth_key.data = data;
if (tc_found)
vector->auth_key.length = data_length;
else {
if (opts->auth_key_sz > data_length) {
printf("Global auth_key shorter than "
"auth_key_sz\n");
return -1;
}
vector->auth_key.length = opts->auth_key_sz;
}
} else if (strstr(key_token, "aead_key")) {
rte_free(vector->aead_key.data);
vector->aead_key.data = data;
if (tc_found)
vector->aead_key.length = data_length;
else {
if (opts->aead_key_sz > data_length) {
printf("Global aead_key shorter than "
"aead_key_sz\n");
return -1;
}
vector->aead_key.length = opts->aead_key_sz;
}
} else if (strstr(key_token, "cipher_iv")) {
rte_free(vector->cipher_iv.data);
vector->cipher_iv.data = data;
if (tc_found)
vector->cipher_iv.length = data_length;
else {
if (opts->cipher_iv_sz > data_length) {
printf("Global cipher iv shorter than "
"cipher_iv_sz\n");
return -1;
}
vector->cipher_iv.length = opts->cipher_iv_sz;
}
} else if (strstr(key_token, "auth_iv")) {
rte_free(vector->auth_iv.data);
vector->auth_iv.data = data;
if (tc_found)
vector->auth_iv.length = data_length;
else {
if (opts->auth_iv_sz > data_length) {
printf("Global auth iv shorter than "
"auth_iv_sz\n");
return -1;
}
vector->auth_iv.length = opts->auth_iv_sz;
}
} else if (strstr(key_token, "aead_iv")) {
rte_free(vector->aead_iv.data);
vector->aead_iv.data = data;
if (tc_found)
vector->aead_iv.length = data_length;
else {
if (opts->aead_iv_sz > data_length) {
printf("Global aead iv shorter than "
"aead_iv_sz\n");
return -1;
}
vector->aead_iv.length = opts->aead_iv_sz;
}
} else if (strstr(key_token, "ciphertext")) {
rte_free(vector->ciphertext.data);
vector->ciphertext.data = data;
if (tc_found)
vector->ciphertext.length = data_length;
else {
if (opts->max_buffer_size > data_length) {
printf("Global ciphertext shorter than "
"buffer_sz\n");
return -1;
}
vector->ciphertext.length = opts->max_buffer_size;
}
} else if (strstr(key_token, "aad")) {
rte_free(vector->aad.data);
vector->aad.data = data;
vector->aad.phys_addr = rte_malloc_virt2iova(vector->aad.data);
if (tc_found)
vector->aad.length = data_length;
else {
if (opts->aead_aad_sz > data_length) {
printf("Global aad shorter than "
"aead_aad_sz\n");
return -1;
}
vector->aad.length = opts->aead_aad_sz;
}
} else if (strstr(key_token, "digest")) {
rte_free(vector->digest.data);
vector->digest.data = data;
vector->digest.phys_addr = rte_malloc_virt2iova(
vector->digest.data);
if (tc_found)
vector->digest.length = data_length;
else {
if (opts->digest_sz > data_length) {
printf("Global digest shorter than "
"digest_sz\n");
return -1;
}
vector->digest.length = opts->digest_sz;
}
} else {
printf("Not valid key: '%s'\n", trim_space(key_token));
return -1;
}
return 0;
}
/* searches in the file for test keys and values */
static int
parse_file(struct cperf_test_vector *vector, struct cperf_options *opts)
{
uint8_t tc_found = 0;
uint8_t tc_data_start = 0;
ssize_t read;
size_t len = 0;
int status = 0;
FILE *fp;
char *line = NULL;
char *entry = NULL;
fp = fopen(opts->test_file, "r");
if (fp == NULL) {
printf("File %s does not exists\n", opts->test_file);
return -1;
}
while ((read = getline(&line, &len, fp)) != -1) {
/* ignore comments and new lines */
if (line[0] == '#' || line[0] == '/' || line[0] == '\n'
|| line[0] == '\r' || line[0] == ' ')
continue;
trim_space(line);
/* next test case is started */
if (line[0] == '[' && line[strlen(line) - 1] == ']' && tc_found)
break;
/* test case section started, end of global data */
else if (line[0] == '[' && line[strlen(line) - 1] == ']')
tc_data_start = 1;
/* test name unspecified, end after global data */
if (tc_data_start && opts->test_name == NULL)
break;
/* searching for a suitable test */
else if (tc_data_start && tc_found == 0) {
if (!strcmp(line, opts->test_name)) {
tc_found = 1;
continue;
} else
continue;
}
/* buffer for multiline */
entry = (char *) rte_realloc(entry,
sizeof(char) * strlen(line) + 1, 0);
if (entry == NULL)
return -1;
memset(entry, 0, strlen(line) + 1);
strncpy(entry, line, strlen(line));
/* check if entry ends with , or = */
if (entry[strlen(entry) - 1] == ','
|| entry[strlen(entry) - 1] == '=') {
while ((read = getline(&line, &len, fp)) != -1) {
trim_space(line);
/* extend entry about length of new line */
char *entry_extended = (char *) rte_realloc(
entry, sizeof(char)
* (strlen(line) + strlen(entry))
+ 1, 0);
if (entry_extended == NULL)
goto err;
entry = entry_extended;
strncat(entry, line, strlen(line));
if (entry[strlen(entry) - 1] != ',')
break;
}
}
status = parse_entry(entry, vector, opts, tc_found);
if (status) {
printf("An error occurred while parsing!\n");
goto err;
}
}
if (tc_found == 0 && opts->test_name != NULL) {
printf("Not found '%s' case in test file\n", opts->test_name);
goto err;
}
fclose(fp);
free(line);
rte_free(entry);
return 0;
err:
if (fp)
fclose(fp);
if (line)
free(line);
if (entry)
rte_free(entry);
return -1;
}
struct cperf_test_vector*
cperf_test_vector_get_from_file(struct cperf_options *opts)
{
int status;
struct cperf_test_vector *test_vector = NULL;
if (opts == NULL || opts->test_file == NULL)
return test_vector;
test_vector = (struct cperf_test_vector *) rte_zmalloc(NULL,
sizeof(struct cperf_test_vector), 0);
if (test_vector == NULL)
return test_vector;
/* filling the vector with data from a file */
status = parse_file(test_vector, opts);
if (status) {
free_test_vector(test_vector, opts);
return NULL;
}
/* other values not included in the file */
test_vector->data.cipher_offset = 0;
test_vector->data.cipher_length = opts->max_buffer_size;
test_vector->data.auth_offset = 0;
test_vector->data.auth_length = opts->max_buffer_size;
return test_vector;
}

View File

@ -0,0 +1,73 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef APP_CRYPTO_PERF_CPERF_TEST_VECTOR_PARSING_H_
#define APP_CRYPTO_PERF_CPERF_TEST_VECTOR_PARSING_H_
#define CPERF_VALUE_DELIMITER ","
#define CPERF_ENTRY_DELIMITER "="
/**
* Frees the allocated memory for test vector
*
* @param vector
* Destination vector test to release
* @param opts
* Test options
* @return
* 0 on success, (-1) on error.
*/
int
free_test_vector(struct cperf_test_vector *vector, struct cperf_options *opts);
/**
* Displays data in test vector
*
* @param vector
* Vector to display
*/
void
show_test_vector(struct cperf_test_vector *test_vector);
/**
* Completes test vector with data from file
*
* @param opts
* Test options
* @return
* NULL on error.
* Test vector pointer on successful.
*/
struct cperf_test_vector*
cperf_test_vector_get_from_file(struct cperf_options *opts);
#endif /* APP_CRYPTO_PERF_CPERF_TEST_VECTOR_PARSING_H_ */

View File

@ -0,0 +1,568 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <rte_crypto.h>
#include <rte_malloc.h>
#include "cperf_test_vectors.h"
uint8_t plaintext[2048] = {
0x71, 0x75, 0x83, 0x98, 0x75, 0x42, 0x51, 0x09, 0x94, 0x02, 0x13, 0x20,
0x15, 0x64, 0x46, 0x32, 0x08, 0x18, 0x91, 0x82, 0x86, 0x52, 0x23, 0x93,
0x44, 0x54, 0x28, 0x68, 0x78, 0x78, 0x70, 0x06, 0x42, 0x74, 0x41, 0x27,
0x73, 0x38, 0x53, 0x77, 0x51, 0x96, 0x53, 0x24, 0x03, 0x88, 0x74, 0x14,
0x70, 0x23, 0x88, 0x30, 0x85, 0x18, 0x89, 0x27, 0x41, 0x71, 0x61, 0x23,
0x04, 0x83, 0x30, 0x57, 0x26, 0x47, 0x23, 0x75, 0x25, 0x62, 0x53, 0x80,
0x38, 0x34, 0x21, 0x33, 0x34, 0x51, 0x46, 0x29, 0x94, 0x64, 0x22, 0x67,
0x25, 0x45, 0x70, 0x26, 0x74, 0x39, 0x46, 0x71, 0x08, 0x85, 0x27, 0x18,
0x93, 0x39, 0x72, 0x11, 0x57, 0x26, 0x88, 0x46, 0x47, 0x49, 0x86, 0x92,
0x03, 0x37, 0x96, 0x40, 0x84, 0x53, 0x67, 0x47, 0x60, 0x60, 0x37, 0x67,
0x02, 0x68, 0x76, 0x62, 0x42, 0x01, 0x59, 0x11, 0x01, 0x89, 0x40, 0x87,
0x58, 0x20, 0x51, 0x21, 0x66, 0x26, 0x26, 0x73, 0x03, 0x06, 0x14, 0x25,
0x98, 0x42, 0x44, 0x67, 0x24, 0x78, 0x71, 0x45, 0x32, 0x61, 0x20, 0x26,
0x08, 0x88, 0x44, 0x26, 0x40, 0x63, 0x76, 0x23, 0x78, 0x55, 0x81, 0x97,
0x95, 0x89, 0x39, 0x07, 0x14, 0x50, 0x50, 0x73, 0x07, 0x20, 0x86, 0x83,
0x74, 0x57, 0x72, 0x36, 0x68, 0x61, 0x14, 0x41, 0x56, 0x49, 0x64, 0x72,
0x75, 0x81, 0x47, 0x91, 0x08, 0x76, 0x47, 0x06, 0x55, 0x77, 0x61, 0x45,
0x50, 0x10, 0x07, 0x46, 0x46, 0x89, 0x80, 0x07, 0x24, 0x95, 0x39, 0x43,
0x03, 0x75, 0x24, 0x35, 0x57, 0x82, 0x09, 0x64, 0x29, 0x24, 0x26, 0x66,
0x67, 0x29, 0x05, 0x90, 0x82, 0x02, 0x45, 0x71, 0x21, 0x34, 0x25, 0x48,
0x68, 0x26, 0x01, 0x18, 0x73, 0x18, 0x46, 0x15, 0x14, 0x33, 0x28, 0x44,
0x24, 0x82, 0x20, 0x12, 0x99, 0x43, 0x68, 0x43, 0x25, 0x14, 0x34, 0x33,
0x31, 0x13, 0x77, 0x44, 0x95, 0x22, 0x99, 0x02, 0x30, 0x50, 0x74, 0x43,
0x81, 0x78, 0x32, 0x17, 0x09, 0x85, 0x04, 0x37, 0x31, 0x98, 0x76, 0x79,
0x64, 0x10, 0x39, 0x89, 0x59, 0x90, 0x50, 0x15, 0x77, 0x39, 0x28, 0x14,
0x30, 0x19, 0x68, 0x77, 0x89, 0x48, 0x86, 0x16, 0x11, 0x33, 0x84, 0x56,
0x10, 0x20, 0x94, 0x72, 0x41, 0x69, 0x13, 0x00, 0x56, 0x27, 0x01, 0x57,
0x46, 0x65, 0x65, 0x19, 0x33, 0x07, 0x62, 0x19, 0x91, 0x60, 0x29, 0x11,
0x41, 0x25, 0x88, 0x21, 0x93, 0x85, 0x87, 0x40, 0x91, 0x25, 0x32, 0x86,
0x76, 0x54, 0x92, 0x52, 0x72, 0x46, 0x61, 0x84, 0x20, 0x14, 0x65, 0x83,
0x69, 0x90, 0x80, 0x11, 0x35, 0x70, 0x42, 0x64, 0x74, 0x85, 0x15, 0x23,
0x06, 0x55, 0x67, 0x49, 0x76, 0x47, 0x11, 0x95, 0x00, 0x85, 0x05, 0x12,
0x58, 0x53, 0x25, 0x73, 0x62, 0x81, 0x63, 0x82, 0x32, 0x75, 0x16, 0x48,
0x04, 0x96, 0x75, 0x16, 0x43, 0x83, 0x41, 0x85, 0x95, 0x67, 0x27, 0x83,
0x22, 0x43, 0x02, 0x27, 0x69, 0x62, 0x78, 0x50, 0x57, 0x66, 0x99, 0x89,
0x05, 0x06, 0x35, 0x86, 0x37, 0x27, 0x48, 0x46, 0x50, 0x80, 0x96, 0x40,
0x42, 0x36, 0x21, 0x54, 0x49, 0x18, 0x63, 0x38, 0x45, 0x76, 0x23, 0x20,
0x28, 0x06, 0x17, 0x32, 0x58, 0x50, 0x49, 0x54, 0x29, 0x46, 0x18, 0x12,
0x17, 0x50, 0x02, 0x80, 0x99, 0x53, 0x15, 0x02, 0x07, 0x14, 0x19, 0x60,
0x56, 0x43, 0x76, 0x71, 0x49, 0x99, 0x54, 0x83, 0x28, 0x94, 0x30, 0x30,
0x57, 0x05, 0x89, 0x80, 0x11, 0x03, 0x78, 0x35, 0x73, 0x52, 0x67, 0x39,
0x67, 0x07, 0x04, 0x49, 0x23, 0x83, 0x86, 0x89, 0x57, 0x71, 0x08, 0x41,
0x15, 0x97, 0x19, 0x72, 0x03, 0x27, 0x72, 0x52, 0x66, 0x67, 0x99, 0x15,
0x33, 0x64, 0x69, 0x78, 0x07, 0x83, 0x53, 0x71, 0x21, 0x50, 0x05, 0x48,
0x59, 0x85, 0x01, 0x36, 0x65, 0x02, 0x52, 0x01, 0x09, 0x49, 0x28, 0x77,
0x25, 0x35, 0x67, 0x77, 0x81, 0x64, 0x24, 0x29, 0x42, 0x32, 0x59, 0x22,
0x93, 0x48, 0x59, 0x03, 0x85, 0x87, 0x15, 0x55, 0x23, 0x42, 0x58, 0x17,
0x18, 0x37, 0x70, 0x83, 0x80, 0x12, 0x44, 0x83, 0x45, 0x70, 0x55, 0x86,
0x03, 0x23, 0x01, 0x56, 0x94, 0x12, 0x41, 0x34, 0x82, 0x90, 0x83, 0x46,
0x17, 0x56, 0x66, 0x96, 0x75, 0x80, 0x59, 0x07, 0x15, 0x84, 0x19, 0x52,
0x37, 0x44, 0x44, 0x83, 0x72, 0x43, 0x25, 0x42, 0x26, 0x86, 0x87, 0x86,
0x91, 0x62, 0x14, 0x90, 0x34, 0x26, 0x14, 0x33, 0x59, 0x70, 0x73, 0x15,
0x49, 0x40, 0x66, 0x88, 0x42, 0x66, 0x16, 0x42, 0x55, 0x92, 0x82, 0x06,
0x20, 0x96, 0x36, 0x96, 0x13, 0x07, 0x84, 0x94, 0x37, 0x66, 0x62, 0x78,
0x60, 0x58, 0x80, 0x50, 0x69, 0x03, 0x97, 0x16, 0x64, 0x45, 0x21, 0x39,
0x79, 0x28, 0x52, 0x17, 0x14, 0x77, 0x31, 0x60, 0x86, 0x70, 0x09, 0x53,
0x39, 0x32, 0x52, 0x31, 0x35, 0x79, 0x24, 0x70, 0x25, 0x48, 0x23, 0x49,
0x10, 0x64, 0x54, 0x30, 0x82, 0x34, 0x51, 0x20, 0x46, 0x04, 0x29, 0x25,
0x65, 0x09, 0x55, 0x30, 0x30, 0x52, 0x85, 0x32, 0x79, 0x19, 0x59, 0x07,
0x05, 0x12, 0x11, 0x03, 0x21, 0x90, 0x36, 0x62, 0x23, 0x67, 0x36, 0x67,
0x47, 0x39, 0x92, 0x88, 0x45, 0x43, 0x71, 0x16, 0x48, 0x27, 0x68, 0x39,
0x98, 0x38, 0x03, 0x31, 0x85, 0x10, 0x06, 0x95, 0x54, 0x79, 0x28, 0x79,
0x56, 0x16, 0x65, 0x69, 0x00, 0x54, 0x09, 0x91, 0x06, 0x10, 0x10, 0x86,
0x75, 0x01, 0x02, 0x71, 0x01, 0x09, 0x32, 0x94, 0x66, 0x43, 0x68, 0x36,
0x19, 0x52, 0x02, 0x04, 0x45, 0x49, 0x40, 0x94, 0x07, 0x87, 0x86, 0x79,
0x84, 0x07, 0x75, 0x30, 0x73, 0x02, 0x57, 0x81, 0x65, 0x02, 0x28, 0x96,
0x57, 0x07, 0x70, 0x34, 0x39, 0x35, 0x75, 0x19, 0x47, 0x57, 0x08, 0x75,
0x86, 0x57, 0x11, 0x32, 0x09, 0x47, 0x83, 0x93, 0x20, 0x94, 0x90, 0x88,
0x39, 0x63, 0x22, 0x88, 0x54, 0x54, 0x95, 0x75, 0x67, 0x26, 0x02, 0x49,
0x26, 0x17, 0x35, 0x16, 0x27, 0x65, 0x64, 0x26, 0x93, 0x92, 0x77, 0x85,
0x84, 0x40, 0x59, 0x29, 0x49, 0x69, 0x94, 0x71, 0x72, 0x21, 0x55, 0x03,
0x19, 0x74, 0x09, 0x40, 0x57, 0x68, 0x41, 0x19, 0x11, 0x21, 0x63, 0x56,
0x29, 0x77, 0x57, 0x81, 0x44, 0x40, 0x76, 0x77, 0x02, 0x71, 0x66, 0x35,
0x89, 0x02, 0x64, 0x51, 0x61, 0x02, 0x46, 0x91, 0x38, 0x93, 0x62, 0x57,
0x18, 0x98, 0x12, 0x87, 0x29, 0x48, 0x65, 0x39, 0x99, 0x45, 0x54, 0x69,
0x51, 0x16, 0x25, 0x75, 0x60, 0x70, 0x33, 0x72, 0x01, 0x60, 0x26, 0x51,
0x44, 0x14, 0x39, 0x12, 0x95, 0x48, 0x87, 0x33, 0x90, 0x16, 0x42, 0x78,
0x48, 0x58, 0x96, 0x93, 0x75, 0x23, 0x07, 0x13, 0x86, 0x07, 0x96, 0x30,
0x22, 0x82, 0x91, 0x36, 0x72, 0x16, 0x48, 0x77, 0x64, 0x99, 0x07, 0x34,
0x78, 0x60, 0x61, 0x13, 0x48, 0x93, 0x46, 0x62, 0x48, 0x38, 0x37, 0x96,
0x58, 0x64, 0x39, 0x90, 0x69, 0x46, 0x81, 0x98, 0x61, 0x89, 0x15, 0x59,
0x78, 0x98, 0x21, 0x34, 0x00, 0x69, 0x97, 0x80, 0x28, 0x81, 0x53, 0x49,
0x79, 0x53, 0x92, 0x20, 0x29, 0x40, 0x70, 0x06, 0x09, 0x55, 0x99, 0x41,
0x51, 0x35, 0x55, 0x27, 0x39, 0x06, 0x29, 0x83, 0x66, 0x03, 0x68, 0x14,
0x11, 0x69, 0x95, 0x51, 0x71, 0x55, 0x24, 0x60, 0x52, 0x58, 0x88, 0x11,
0x88, 0x25, 0x37, 0x86, 0x01, 0x52, 0x93, 0x52, 0x02, 0x24, 0x91, 0x58,
0x56, 0x37, 0x50, 0x88, 0x39, 0x09, 0x61, 0x19, 0x08, 0x86, 0x29, 0x51,
0x63, 0x38, 0x81, 0x14, 0x75, 0x75, 0x39, 0x99, 0x22, 0x04, 0x32, 0x63,
0x14, 0x68, 0x41, 0x79, 0x09, 0x57, 0x87, 0x29, 0x26, 0x94, 0x05, 0x71,
0x82, 0x41, 0x26, 0x98, 0x68, 0x18, 0x55, 0x42, 0x78, 0x05, 0x74, 0x17,
0x34, 0x34, 0x07, 0x62, 0x94, 0x72, 0x21, 0x08, 0x54, 0x72, 0x21, 0x08,
0x31, 0x53, 0x82, 0x35, 0x27, 0x40, 0x85, 0x77, 0x08, 0x52, 0x58, 0x48,
0x03, 0x86, 0x65, 0x51, 0x96, 0x43, 0x89, 0x19, 0x15, 0x08, 0x49, 0x62,
0x57, 0x46, 0x17, 0x68, 0x56, 0x04, 0x70, 0x63, 0x75, 0x88, 0x13, 0x27,
0x87, 0x44, 0x46, 0x27, 0x02, 0x97, 0x71, 0x07, 0x40, 0x17, 0x24, 0x61,
0x16, 0x94, 0x86, 0x85, 0x67, 0x58, 0x87, 0x92, 0x02, 0x84, 0x75, 0x19,
0x43, 0x60, 0x68, 0x03, 0x54, 0x75, 0x33, 0x17, 0x97, 0x75, 0x12, 0x62,
0x43, 0x08, 0x35, 0x75, 0x32, 0x21, 0x08, 0x82, 0x78, 0x04, 0x74, 0x09,
0x13, 0x48, 0x63, 0x68, 0x67, 0x09, 0x08, 0x50, 0x11, 0x71, 0x64, 0x72,
0x63, 0x76, 0x21, 0x62, 0x80, 0x57, 0x19, 0x15, 0x26, 0x88, 0x02, 0x26,
0x83, 0x17, 0x61, 0x76, 0x28, 0x10, 0x22, 0x37, 0x56, 0x71, 0x51, 0x60,
0x12, 0x79, 0x24, 0x83, 0x78, 0x47, 0x78, 0x20, 0x52, 0x27, 0x19, 0x88,
0x81, 0x04, 0x70, 0x20, 0x25, 0x10, 0x04, 0x01, 0x72, 0x57, 0x30, 0x93,
0x96, 0x23, 0x02, 0x94, 0x61, 0x44, 0x17, 0x65, 0x77, 0x60, 0x27, 0x43,
0x24, 0x59, 0x46, 0x76, 0x00, 0x11, 0x31, 0x99, 0x41, 0x48, 0x75, 0x32,
0x05, 0x15, 0x45, 0x31, 0x57, 0x89, 0x10, 0x47, 0x53, 0x14, 0x66, 0x54,
0x60, 0x55, 0x36, 0x93, 0x30, 0x03, 0x63, 0x80, 0x65, 0x43, 0x17, 0x36,
0x18, 0x64, 0x21, 0x38, 0x16, 0x19, 0x19, 0x51, 0x73, 0x80, 0x38, 0x27,
0x30, 0x89, 0x13, 0x43, 0x54, 0x11, 0x78, 0x05, 0x24, 0x38, 0x83, 0x56,
0x50, 0x59, 0x12, 0x47, 0x69, 0x70, 0x70, 0x91, 0x28, 0x02, 0x08, 0x91,
0x66, 0x09, 0x31, 0x65, 0x46, 0x20, 0x04, 0x85, 0x89, 0x53, 0x91, 0x42,
0x34, 0x09, 0x36, 0x92, 0x42, 0x06, 0x87, 0x88, 0x23, 0x54, 0x87, 0x85,
0x52, 0x98, 0x95, 0x76, 0x13, 0x50, 0x59, 0x89, 0x18, 0x14, 0x17, 0x47,
0x10, 0x97, 0x39, 0x14, 0x33, 0x79, 0x83, 0x62, 0x55, 0x18, 0x30, 0x83,
0x03, 0x45, 0x38, 0x37, 0x35, 0x20, 0x94, 0x84, 0x89, 0x80, 0x89, 0x10,
0x48, 0x77, 0x33, 0x36, 0x50, 0x07, 0x93, 0x02, 0x45, 0x42, 0x91, 0x12,
0x98, 0x09, 0x77, 0x20, 0x31, 0x95, 0x10, 0x29, 0x89, 0x02, 0x38, 0x92,
0x90, 0x19, 0x51, 0x10, 0x19, 0x82, 0x23, 0x68, 0x06, 0x00, 0x67, 0x50,
0x25, 0x03, 0x41, 0x69, 0x53, 0x42, 0x23, 0x99, 0x29, 0x21, 0x63, 0x22,
0x72, 0x54, 0x72, 0x40, 0x23, 0x39, 0x74, 0x92, 0x53, 0x28, 0x67, 0x56,
0x46, 0x84, 0x59, 0x85, 0x10, 0x92, 0x31, 0x20, 0x39, 0x95, 0x65, 0x15,
0x76, 0x35, 0x37, 0x21, 0x98, 0x41, 0x68, 0x74, 0x94, 0x94, 0x86, 0x90,
0x35, 0x07, 0x06, 0x38, 0x78, 0x32, 0x00, 0x60, 0x86, 0x12, 0x34, 0x65,
0x67, 0x35, 0x76, 0x94, 0x78, 0x22, 0x99, 0x42, 0x82, 0x40, 0x05, 0x74,
0x18, 0x59, 0x03, 0x83, 0x89, 0x05, 0x19, 0x28, 0x88, 0x35, 0x59, 0x10,
0x12, 0x96, 0x48, 0x67, 0x59, 0x87, 0x26, 0x85, 0x74, 0x64, 0x78, 0x56,
0x91, 0x81, 0x45, 0x90, 0x21, 0x80, 0x32, 0x19, 0x61, 0x38, 0x61, 0x70,
0x35, 0x08, 0x93, 0x53, 0x21, 0x95, 0x08, 0x27, 0x90, 0x28, 0x94, 0x27,
0x35, 0x78, 0x03, 0x57, 0x74, 0x84, 0x73, 0x63, 0x27, 0x98, 0x14, 0x21,
0x22, 0x36, 0x75, 0x31, 0x81, 0x65, 0x85, 0x51, 0x02, 0x45, 0x18, 0x06,
0x39, 0x13, 0x29, 0x29, 0x73, 0x26, 0x99, 0x51, 0x38, 0x43, 0x35, 0x58,
0x70, 0x92, 0x32, 0x13, 0x80, 0x16, 0x26, 0x44, 0x22, 0x28, 0x05, 0x45,
0x86, 0x90, 0x38, 0x19, 0x40, 0x06, 0x30, 0x56, 0x94, 0x09, 0x02, 0x02,
0x96, 0x29, 0x22, 0x44, 0x87, 0x38, 0x09, 0x95, 0x58, 0x46, 0x42, 0x78,
0x72, 0x77, 0x86, 0x31, 0x97, 0x19, 0x86, 0x51, 0x73, 0x76, 0x63, 0x98,
0x39, 0x40, 0x20, 0x20, 0x67, 0x42, 0x55, 0x50, 0x63, 0x76, 0x81, 0x87,
0x13, 0x81, 0x19, 0x54, 0x11, 0x77, 0x90, 0x26, 0x47, 0x25, 0x92, 0x88,
0x18, 0x56, 0x23, 0x73, 0x91, 0x52, 0x39, 0x08, 0x59, 0x51, 0x81, 0x57,
0x78, 0x17, 0x13, 0x90, 0x90, 0x50, 0x65, 0x59, 0x99, 0x77, 0x42, 0x28,
0x21, 0x59, 0x97, 0x64, 0x25, 0x17, 0x92, 0x24, 0x50, 0x00, 0x28, 0x40,
0x85, 0x33, 0x78, 0x86, 0x79, 0x40, 0x28, 0x30, 0x14, 0x12, 0x01, 0x72,
0x41, 0x43, 0x06, 0x87, 0x67, 0x31, 0x66, 0x77, 0x07, 0x50, 0x55, 0x50,
0x22, 0x80, 0x42, 0x06, 0x38, 0x01, 0x63, 0x66, 0x70, 0x12, 0x52, 0x91,
0x90, 0x97, 0x21, 0x28, 0x22, 0x65, 0x02, 0x80, 0x72, 0x31, 0x17, 0x76,
0x35, 0x16, 0x03, 0x56, 0x59, 0x93, 0x36, 0x37, 0x67, 0x54, 0x46, 0x87,
0x29, 0x01, 0x30, 0x80, 0x47, 0x47, 0x31, 0x98, 0x34, 0x30, 0x23, 0x86,
0x86, 0x14, 0x05, 0x75, 0x09, 0x88, 0x77, 0x92, 0x59, 0x43, 0x98, 0x72,
0x55, 0x54, 0x25, 0x59, 0x22, 0x27, 0x21, 0x62, 0x97, 0x10, 0x61, 0x73,
0x86, 0x95, 0x99, 0x10, 0x62, 0x35, 0x25, 0x16, 0x62, 0x60, 0x51, 0x48,
0x69, 0x69, 0x92, 0x27, 0x19, 0x43, 0x40, 0x52, 0x70, 0x23, 0x37, 0x28,
0x73, 0x10, 0x32, 0x55, 0x85, 0x46, 0x97, 0x59, 0x88, 0x48, 0x54, 0x06,
0x58, 0x04, 0x82, 0x98, 0x88, 0x34, 0x05, 0x41, 0x94, 0x44, 0x35, 0x10,
0x96, 0x48, 0x21, 0x17, 0x24, 0x40, 0x26, 0x15, 0x49, 0x28, 0x12, 0x17,
0x10, 0x17, 0x91, 0x42, 0x84, 0x15, 0x83, 0x36, 0x29, 0x49, 0x92, 0x77,
0x74, 0x11, 0x72, 0x97, 0x64, 0x53, 0x23, 0x29, 0x16, 0x35, 0x22, 0x10,
0x87, 0x07, 0x44, 0x78, 0x18, 0x19, 0x79, 0x03, 0x58, 0x24, 0x15, 0x63,
0x55, 0x75, 0x56, 0x14, 0x63, 0x65, 0x86, 0x61, 0x92, 0x94, 0x30, 0x92,
0x69, 0x78, 0x40, 0x95, 0x19, 0x81, 0x41, 0x66, 0x97, 0x00, 0x17, 0x37,
0x20, 0x82, 0x14, 0x26, 0x42, 0x63, 0x84, 0x20, 0x96, 0x11, 0x68, 0x37,
0x60, 0x28, 0x69, 0x85, 0x45, 0x04, 0x62, 0x20, 0x49, 0x39, 0x74, 0x84,
0x60, 0x23, 0x38, 0x33, 0x42, 0x49, 0x38, 0x82, 0x30, 0x63, 0x21, 0x51,
0x69, 0x09, 0x05, 0x55, 0x78, 0x90, 0x68, 0x69, 0x22, 0x20, 0x17, 0x26,
0x54, 0x01, 0x10, 0x04, 0x68, 0x19, 0x88, 0x40, 0x91, 0x74, 0x81, 0x29,
0x07, 0x45, 0x33, 0x77, 0x12, 0x47, 0x08, 0x60, 0x09, 0x42, 0x84, 0x15,
0x63, 0x92, 0x64, 0x77, 0x07, 0x44, 0x11, 0x07, 0x79, 0x81, 0x24, 0x05,
0x21, 0x60, 0x81, 0x70, 0x66, 0x36, 0x69, 0x68, 0x45, 0x01, 0x11, 0x95,
0x67, 0x95, 0x55, 0x07, 0x96, 0x63, 0x84, 0x04, 0x74, 0x72, 0x61, 0x91,
0x60, 0x09, 0x90, 0x14, 0x34, 0x94, 0x06, 0x12, 0x01, 0x94, 0x40, 0x14,
0x12, 0x53, 0x64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C, 0x4E, 0xFC, 0x41, 0xD1, 0x5B,
0xDD, 0x84, 0x6E, 0x13, 0x6C, 0xF8, 0x12, 0xE6, 0xB7, 0xA4, 0xB9, 0xC8,
0x13, 0x89, 0x0C, 0x34, 0xA6, 0xAF, 0x09, 0xEB, 0xF2, 0xB3, 0x79, 0x77,
0x80, 0xD8, 0x77, 0x64, 0xAD, 0x32, 0x3D, 0xD2, 0x06, 0xDF, 0x72, 0x11,
0x4A, 0xA7, 0x70, 0xCE, 0xF9, 0xE6, 0x81, 0x35, 0xA4, 0xA7, 0x52, 0xB5,
0x13, 0x68, 0x5C, 0x69, 0x45, 0xE2, 0x77, 0x2D, 0xBE, 0x2C, 0xE9, 0x38,
0x25, 0x28, 0x7B, 0x63, 0x2C, 0x19, 0x8F, 0x59
};
/* aad */
uint8_t aad[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B
};
/* iv */
uint8_t iv[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F
};
/* cipher key */
uint8_t cipher_key[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F
};
/* auth key */
uint8_t auth_key[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23,
0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53,
0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B,
0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F
};
/* AEAD key */
uint8_t aead_key[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F
};
/* Digests */
uint8_t digest[2048] = { 0x00 };
struct cperf_test_vector*
cperf_test_vector_get_dummy(struct cperf_options *options)
{
struct cperf_test_vector *t_vec;
t_vec = (struct cperf_test_vector *)rte_malloc(NULL,
sizeof(struct cperf_test_vector), 0);
if (t_vec == NULL)
return t_vec;
t_vec->plaintext.data = plaintext;
t_vec->plaintext.length = options->max_buffer_size;
if (options->op_type == CPERF_CIPHER_ONLY ||
options->op_type == CPERF_CIPHER_THEN_AUTH ||
options->op_type == CPERF_AUTH_THEN_CIPHER) {
if (options->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
t_vec->cipher_key.length = 0;
t_vec->ciphertext.data = plaintext;
t_vec->cipher_key.data = NULL;
t_vec->cipher_iv.data = NULL;
} else {
t_vec->cipher_key.length = options->cipher_key_sz;
t_vec->ciphertext.data = ciphertext;
t_vec->cipher_key.data = cipher_key;
t_vec->cipher_iv.data = rte_malloc(NULL, options->cipher_iv_sz,
16);
if (t_vec->cipher_iv.data == NULL) {
rte_free(t_vec);
return NULL;
}
memcpy(t_vec->cipher_iv.data, iv, options->cipher_iv_sz);
}
t_vec->ciphertext.length = options->max_buffer_size;
/* Set IV parameters */
t_vec->cipher_iv.data = rte_malloc(NULL, options->cipher_iv_sz,
16);
if (options->cipher_iv_sz && t_vec->cipher_iv.data == NULL) {
rte_free(t_vec);
return NULL;
}
memcpy(t_vec->cipher_iv.data, iv, options->cipher_iv_sz);
t_vec->cipher_iv.length = options->cipher_iv_sz;
t_vec->data.cipher_offset = 0;
t_vec->data.cipher_length = options->max_buffer_size;
}
if (options->op_type == CPERF_AUTH_ONLY ||
options->op_type == CPERF_CIPHER_THEN_AUTH ||
options->op_type == CPERF_AUTH_THEN_CIPHER) {
if (options->auth_algo == RTE_CRYPTO_AUTH_NULL) {
t_vec->auth_key.length = 0;
t_vec->auth_key.data = NULL;
t_vec->digest.data = NULL;
t_vec->digest.length = 0;
} else {
t_vec->auth_key.length = options->auth_key_sz;
t_vec->auth_key.data = auth_key;
t_vec->digest.data = rte_malloc(NULL,
options->digest_sz,
16);
if (t_vec->digest.data == NULL) {
rte_free(t_vec->cipher_iv.data);
rte_free(t_vec);
return NULL;
}
t_vec->digest.phys_addr =
rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest,
options->digest_sz);
}
t_vec->data.auth_offset = 0;
t_vec->data.auth_length = options->max_buffer_size;
/* Set IV parameters */
t_vec->auth_iv.data = rte_malloc(NULL, options->auth_iv_sz,
16);
if (options->auth_iv_sz && t_vec->auth_iv.data == NULL) {
if (options->op_type != CPERF_AUTH_ONLY)
rte_free(t_vec->cipher_iv.data);
rte_free(t_vec);
return NULL;
}
memcpy(t_vec->auth_iv.data, iv, options->auth_iv_sz);
t_vec->auth_iv.length = options->auth_iv_sz;
}
if (options->op_type == CPERF_AEAD) {
t_vec->aead_key.length = options->aead_key_sz;
t_vec->aead_key.data = aead_key;
if (options->aead_aad_sz) {
t_vec->aad.data = rte_malloc(NULL,
options->aead_aad_sz, 16);
if (t_vec->aad.data == NULL) {
rte_free(t_vec);
return NULL;
}
memcpy(t_vec->aad.data, aad, options->aead_aad_sz);
t_vec->aad.phys_addr = rte_malloc_virt2iova(t_vec->aad.data);
t_vec->aad.length = options->aead_aad_sz;
} else {
t_vec->aad.data = NULL;
t_vec->aad.length = 0;
}
t_vec->digest.data = rte_malloc(NULL, options->digest_sz,
16);
if (t_vec->digest.data == NULL) {
rte_free(t_vec->aad.data);
rte_free(t_vec);
return NULL;
}
t_vec->digest.phys_addr =
rte_malloc_virt2iova(t_vec->digest.data);
t_vec->digest.length = options->digest_sz;
memcpy(t_vec->digest.data, digest, options->digest_sz);
t_vec->data.aead_offset = 0;
t_vec->data.aead_length = options->max_buffer_size;
/* Set IV parameters */
t_vec->aead_iv.data = rte_malloc(NULL, options->aead_iv_sz,
16);
if (options->aead_iv_sz && t_vec->aead_iv.data == NULL) {
rte_free(t_vec->aad.data);
rte_free(t_vec->digest.data);
rte_free(t_vec);
return NULL;
}
memcpy(t_vec->aead_iv.data, iv, options->aead_iv_sz);
t_vec->aead_iv.length = options->aead_iv_sz;
}
return t_vec;
}

View File

@ -0,0 +1,114 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_TEST_VECTRORS_
#define _CPERF_TEST_VECTRORS_
#include "cperf_options.h"
struct cperf_test_vector {
struct {
uint8_t *data;
uint32_t length;
} plaintext;
struct {
uint8_t *data;
uint16_t length;
} cipher_key;
struct {
uint8_t *data;
uint16_t length;
} auth_key;
struct {
uint8_t *data;
uint16_t length;
} aead_key;
struct {
uint8_t *data;
uint16_t length;
} cipher_iv;
struct {
uint8_t *data;
uint16_t length;
} auth_iv;
struct {
uint8_t *data;
uint16_t length;
} aead_iv;
struct {
uint8_t *data;
uint32_t length;
} ciphertext;
struct {
uint8_t *data;
rte_iova_t phys_addr;
uint16_t length;
} aad;
struct {
uint8_t *data;
rte_iova_t phys_addr;
uint16_t length;
} digest;
struct {
uint32_t auth_offset;
uint32_t auth_length;
uint32_t cipher_offset;
uint32_t cipher_length;
uint32_t aead_offset;
uint32_t aead_length;
} data;
};
struct cperf_test_vector*
cperf_test_vector_get_dummy(struct cperf_options *options);
extern uint8_t ciphertext[2048];
extern uint8_t cipher_key[];
extern uint8_t auth_key[];
extern uint8_t iv[];
extern uint8_t aad[];
extern uint8_t digest[2048];
#endif

View File

@ -0,0 +1,455 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_crypto.h>
#include <rte_cryptodev.h>
#include "cperf_test_verify.h"
#include "cperf_ops.h"
#include "cperf_test_common.h"
struct cperf_verify_ctx {
uint8_t dev_id;
uint16_t qp_id;
uint8_t lcore_id;
struct rte_mempool *pool;
struct rte_cryptodev_sym_session *sess;
cperf_populate_ops_t populate_ops;
uint32_t src_buf_offset;
uint32_t dst_buf_offset;
const struct cperf_options *options;
const struct cperf_test_vector *test_vector;
};
struct cperf_op_result {
enum rte_crypto_op_status status;
};
static void
cperf_verify_test_free(struct cperf_verify_ctx *ctx)
{
if (ctx) {
if (ctx->sess) {
rte_cryptodev_sym_session_clear(ctx->dev_id, ctx->sess);
rte_cryptodev_sym_session_free(ctx->sess);
}
if (ctx->pool)
rte_mempool_free(ctx->pool);
rte_free(ctx);
}
}
void *
cperf_verify_test_constructor(struct rte_mempool *sess_mp,
uint8_t dev_id, uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *op_fns)
{
struct cperf_verify_ctx *ctx = NULL;
ctx = rte_malloc(NULL, sizeof(struct cperf_verify_ctx), 0);
if (ctx == NULL)
goto err;
ctx->dev_id = dev_id;
ctx->qp_id = qp_id;
ctx->populate_ops = op_fns->populate_ops;
ctx->options = options;
ctx->test_vector = test_vector;
/* IV goes at the end of the crypto operation */
uint16_t iv_offset = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op);
ctx->sess = op_fns->sess_create(sess_mp, dev_id, options, test_vector,
iv_offset);
if (ctx->sess == NULL)
goto err;
if (cperf_alloc_common_memory(options, test_vector, dev_id, qp_id, 0,
&ctx->src_buf_offset, &ctx->dst_buf_offset,
&ctx->pool) < 0)
goto err;
return ctx;
err:
cperf_verify_test_free(ctx);
return NULL;
}
static int
cperf_verify_op(struct rte_crypto_op *op,
const struct cperf_options *options,
const struct cperf_test_vector *vector)
{
const struct rte_mbuf *m;
uint32_t len;
uint16_t nb_segs;
uint8_t *data;
uint32_t cipher_offset, auth_offset;
uint8_t cipher, auth;
int res = 0;
if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS)
return 1;
if (op->sym->m_dst)
m = op->sym->m_dst;
else
m = op->sym->m_src;
nb_segs = m->nb_segs;
len = 0;
while (m && nb_segs != 0) {
len += m->data_len;
m = m->next;
nb_segs--;
}
data = rte_malloc(NULL, len, 0);
if (data == NULL)
return 1;
if (op->sym->m_dst)
m = op->sym->m_dst;
else
m = op->sym->m_src;
nb_segs = m->nb_segs;
len = 0;
while (m && nb_segs != 0) {
memcpy(data + len, rte_pktmbuf_mtod(m, uint8_t *),
m->data_len);
len += m->data_len;
m = m->next;
nb_segs--;
}
switch (options->op_type) {
case CPERF_CIPHER_ONLY:
cipher = 1;
cipher_offset = 0;
auth = 0;
auth_offset = 0;
break;
case CPERF_CIPHER_THEN_AUTH:
cipher = 1;
cipher_offset = 0;
auth = 1;
auth_offset = options->test_buffer_size;
break;
case CPERF_AUTH_ONLY:
cipher = 0;
cipher_offset = 0;
auth = 1;
auth_offset = options->test_buffer_size;
break;
case CPERF_AUTH_THEN_CIPHER:
cipher = 1;
cipher_offset = 0;
auth = 1;
auth_offset = options->test_buffer_size;
break;
case CPERF_AEAD:
cipher = 1;
cipher_offset = 0;
auth = 1;
auth_offset = options->test_buffer_size;
break;
default:
res = 1;
goto out;
}
if (cipher == 1) {
if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)
res += memcmp(data + cipher_offset,
vector->ciphertext.data,
options->test_buffer_size);
else
res += memcmp(data + cipher_offset,
vector->plaintext.data,
options->test_buffer_size);
}
if (auth == 1) {
if (options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE)
res += memcmp(data + auth_offset,
vector->digest.data,
options->digest_sz);
}
out:
rte_free(data);
return !!res;
}
static void
cperf_mbuf_set(struct rte_mbuf *mbuf,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector)
{
uint32_t segment_sz = options->segment_sz;
uint8_t *mbuf_data;
uint8_t *test_data =
(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ?
test_vector->plaintext.data :
test_vector->ciphertext.data;
uint32_t remaining_bytes = options->max_buffer_size;
while (remaining_bytes) {
mbuf_data = rte_pktmbuf_mtod(mbuf, uint8_t *);
if (remaining_bytes <= segment_sz) {
memcpy(mbuf_data, test_data, remaining_bytes);
return;
}
memcpy(mbuf_data, test_data, segment_sz);
remaining_bytes -= segment_sz;
test_data += segment_sz;
mbuf = mbuf->next;
}
}
int
cperf_verify_test_runner(void *test_ctx)
{
struct cperf_verify_ctx *ctx = test_ctx;
uint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;
uint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;
uint64_t ops_failed = 0;
static int only_once;
uint64_t i;
uint16_t ops_unused = 0;
struct rte_crypto_op *ops[ctx->options->max_burst_size];
struct rte_crypto_op *ops_processed[ctx->options->max_burst_size];
uint32_t lcore = rte_lcore_id();
#ifdef CPERF_LINEARIZATION_ENABLE
struct rte_cryptodev_info dev_info;
int linearize = 0;
/* Check if source mbufs require coalescing */
if (ctx->options->segment_sz < ctx->options->max_buffer_size) {
rte_cryptodev_info_get(ctx->dev_id, &dev_info);
if ((dev_info.feature_flags &
RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER) == 0)
linearize = 1;
}
#endif /* CPERF_LINEARIZATION_ENABLE */
ctx->lcore_id = lcore;
if (!ctx->options->csv)
printf("\n# Running verify test on device: %u, lcore: %u\n",
ctx->dev_id, lcore);
uint16_t iv_offset = sizeof(struct rte_crypto_op) +
sizeof(struct rte_crypto_sym_op);
while (ops_enqd_total < ctx->options->total_ops) {
uint16_t burst_size = ((ops_enqd_total + ctx->options->max_burst_size)
<= ctx->options->total_ops) ?
ctx->options->max_burst_size :
ctx->options->total_ops -
ops_enqd_total;
uint16_t ops_needed = burst_size - ops_unused;
/* Allocate objects containing crypto operations and mbufs */
if (rte_mempool_get_bulk(ctx->pool, (void **)ops,
ops_needed) != 0) {
RTE_LOG(ERR, USER1,
"Failed to allocate more crypto operations "
"from the the crypto operation pool.\n"
"Consider increasing the pool size "
"with --pool-sz\n");
return -1;
}
/* Setup crypto op, attach mbuf etc */
(ctx->populate_ops)(ops, ctx->src_buf_offset,
ctx->dst_buf_offset,
ops_needed, ctx->sess, ctx->options,
ctx->test_vector, iv_offset);
/* Populate the mbuf with the test vector, for verification */
for (i = 0; i < ops_needed; i++)
cperf_mbuf_set(ops[i]->sym->m_src,
ctx->options,
ctx->test_vector);
#ifdef CPERF_LINEARIZATION_ENABLE
if (linearize) {
/* PMD doesn't support scatter-gather and source buffer
* is segmented.
* We need to linearize it before enqueuing.
*/
for (i = 0; i < burst_size; i++)
rte_pktmbuf_linearize(ops[i]->sym->m_src);
}
#endif /* CPERF_LINEARIZATION_ENABLE */
/* Enqueue burst of ops on crypto device */
ops_enqd = rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id,
ops, burst_size);
if (ops_enqd < burst_size)
ops_enqd_failed++;
/**
* Calculate number of ops not enqueued (mainly for hw
* accelerators whose ingress queue can fill up).
*/
ops_unused = burst_size - ops_enqd;
ops_enqd_total += ops_enqd;
/* Dequeue processed burst of ops from crypto device */
ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
ops_processed, ctx->options->max_burst_size);
if (ops_deqd == 0) {
/**
* Count dequeue polls which didn't return any
* processed operations. This statistic is mainly
* relevant to hw accelerators.
*/
ops_deqd_failed++;
continue;
}
for (i = 0; i < ops_deqd; i++) {
if (cperf_verify_op(ops_processed[i], ctx->options,
ctx->test_vector))
ops_failed++;
}
/* Free crypto ops so they can be reused. */
rte_mempool_put_bulk(ctx->pool,
(void **)ops_processed, ops_deqd);
ops_deqd_total += ops_deqd;
}
/* Dequeue any operations still in the crypto device */
while (ops_deqd_total < ctx->options->total_ops) {
/* Sending 0 length burst to flush sw crypto device */
rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id, NULL, 0);
/* dequeue burst */
ops_deqd = rte_cryptodev_dequeue_burst(ctx->dev_id, ctx->qp_id,
ops_processed, ctx->options->max_burst_size);
if (ops_deqd == 0) {
ops_deqd_failed++;
continue;
}
for (i = 0; i < ops_deqd; i++) {
if (cperf_verify_op(ops_processed[i], ctx->options,
ctx->test_vector))
ops_failed++;
}
/* Free crypto ops so they can be reused. */
rte_mempool_put_bulk(ctx->pool,
(void **)ops_processed, ops_deqd);
ops_deqd_total += ops_deqd;
}
if (!ctx->options->csv) {
if (!only_once)
printf("%12s%12s%12s%12s%12s%12s%12s%12s\n\n",
"lcore id", "Buf Size", "Burst size",
"Enqueued", "Dequeued", "Failed Enq",
"Failed Deq", "Failed Ops");
only_once = 1;
printf("%12u%12u%12u%12"PRIu64"%12"PRIu64"%12"PRIu64
"%12"PRIu64"%12"PRIu64"\n",
ctx->lcore_id,
ctx->options->max_buffer_size,
ctx->options->max_burst_size,
ops_enqd_total,
ops_deqd_total,
ops_enqd_failed,
ops_deqd_failed,
ops_failed);
} else {
if (!only_once)
printf("\n# lcore id, Buffer Size(B), "
"Burst Size,Enqueued,Dequeued,Failed Enq,"
"Failed Deq,Failed Ops\n");
only_once = 1;
printf("%10u;%10u;%u;%"PRIu64";%"PRIu64";%"PRIu64";%"PRIu64";"
"%"PRIu64"\n",
ctx->lcore_id,
ctx->options->max_buffer_size,
ctx->options->max_burst_size,
ops_enqd_total,
ops_deqd_total,
ops_enqd_failed,
ops_deqd_failed,
ops_failed);
}
return 0;
}
void
cperf_verify_test_destructor(void *arg)
{
struct cperf_verify_ctx *ctx = arg;
if (ctx == NULL)
return;
cperf_verify_test_free(ctx);
}

View File

@ -0,0 +1,61 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CPERF_VERIFY_
#define _CPERF_VERIFY_
#include <stdint.h>
#include <rte_mbuf.h>
#include "cperf.h"
#include "cperf_ops.h"
#include "cperf_options.h"
#include "cperf_test_vectors.h"
void *
cperf_verify_test_constructor(
struct rte_mempool *sess_mp,
uint8_t dev_id,
uint16_t qp_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
const struct cperf_op_fns *ops_fn);
int
cperf_verify_test_runner(void *test_ctx);
void
cperf_verify_test_destructor(void *test_ctx);
#endif /* _CPERF_VERIFY_ */

View File

@ -0,0 +1,502 @@
# List of tests for AES-128 CBC:
# 1) [sha1_hmac_buff_x]
# 2) [sha224_hmac_buff_x]
# 3) [sha256_hmac_buff_x]
# 4) [sha384_hmac_buff_x]
# 5) [sha512_hmac_buff_x]
# where x is one of the values: 32, 64, 128, 256, 512, 1024, 2048
##########
# GLOBAL #
##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 0x52, 0x6b, 0x50, 0xaf, 0x8b, 0xb7, 0xb5, 0x2c, 0x52, 0x84
cipher_iv =
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
####################
# sha_hmac_buff_32 #
####################
[sha1_hmac_buff_32]
digest =
0xAD, 0x0F, 0xE8, 0xAD, 0x30, 0xD6, 0x0A, 0x2B, 0x6B, 0x3D, 0x24, 0x79, 0x6D, 0xB6, 0x80, 0x43,
0x1D, 0xD1, 0x8A, 0xA8
[sha224_hmac_buff_32]
digest =
0xB4, 0x1C, 0xF4, 0x73, 0x04, 0x62, 0x2D, 0xAF, 0x59, 0x05, 0xE8, 0x55, 0xE4, 0x8B, 0x24, 0xB4,
0x0F, 0x4C, 0x3D, 0xBE, 0xFF, 0xFF, 0x8D, 0x19, 0x0D, 0x38, 0xA1, 0xFC
[sha256_hmac_buff_32]
digest =
0x77, 0x54, 0x8D, 0x73, 0x7D, 0xB9, 0x78, 0x2F, 0x3D, 0xEE, 0xA2, 0xE7, 0xC9, 0x03, 0xF3, 0xB0,
0x17, 0x8E, 0x71, 0x81, 0xB7, 0xA7, 0x5F, 0x9F, 0xF3, 0xED, 0x55, 0x1A, 0x69, 0x68, 0x52, 0xE5
[sha384_hmac_buff_32]
digest =
0x1A, 0x3D, 0x1A, 0xD8, 0x0C, 0x04, 0x4B, 0x14, 0x9F, 0xF6, 0x9B, 0x80, 0x5C, 0xA2, 0x78, 0xFC,
0xE6, 0xA3, 0xBA, 0x32, 0x09, 0x04, 0x52, 0x24, 0x76, 0xC9, 0xFC, 0x70, 0xA6, 0x00, 0xB4, 0x41,
0xA1, 0x48, 0x1D, 0xCC, 0x54, 0x59, 0xE6, 0x94, 0x35, 0x36, 0xCC, 0xAB, 0x4B, 0xF5, 0xE4, 0xCA
[sha512_hmac_buff_32]
digest =
0xED, 0xD7, 0x96, 0x0B, 0xC4, 0x8F, 0xBF, 0xF3, 0xEA, 0x7D, 0x5D, 0x57, 0x2A, 0x50, 0x50, 0xAC,
0x33, 0xF2, 0xED, 0x56, 0x0A, 0xF7, 0x97, 0x4A, 0x36, 0x8D, 0x3B, 0xA5, 0x9F, 0x7A, 0x6D, 0x57,
0xE0, 0x94, 0x10, 0xB9, 0x15, 0xC6, 0x1B, 0x7F, 0x17, 0xB3, 0x48, 0xB5, 0xF9, 0x93, 0xD8, 0xCA,
0x74, 0x56, 0xED, 0xBD, 0x55, 0x14, 0xD2, 0xB6, 0x36, 0x07, 0x06, 0x73, 0x66, 0x41, 0x50, 0x84
####################
# sha_hmac_buff_64 #
####################
[sha1_hmac_buff_64]
digest =
0xC9, 0xC3, 0x65, 0x23, 0xCE, 0x9D, 0x6E, 0x35, 0xDC, 0x65, 0x3B, 0x21, 0x33, 0xFF, 0x1E, 0x74,
0xAF, 0x48, 0x24, 0xD9
[sha224_hmac_buff_64]
digest =
0x9F, 0xC3, 0x34, 0x0F, 0xB0, 0xA5, 0x4D, 0x89, 0xA4, 0x20, 0x01, 0xDF, 0x40, 0xAE, 0xA2, 0x41,
0x4E, 0x97, 0x38, 0xBA, 0xA7, 0xF9, 0x94, 0x1F, 0x56, 0x4E, 0x00, 0x0A
[sha256_hmac_buff_64]
digest =
0x66, 0x52, 0xF3, 0xEB, 0xC7, 0x06, 0xEF, 0x21, 0x82, 0x7C, 0xCF, 0x7F, 0x5B, 0x6B, 0x77, 0x2F,
0x28, 0x61, 0x06, 0x2B, 0x67, 0x4B, 0x2D, 0x62, 0x71, 0x53, 0xBE, 0x12, 0xF9, 0x5B, 0xD8, 0x64
[sha384_hmac_buff_64]
digest =
0x63, 0x50, 0x09, 0x45, 0x87, 0x02, 0x7F, 0x85, 0xD3, 0xC8, 0xF2, 0x26, 0x01, 0xE8, 0x2C, 0x28,
0xB4, 0x86, 0x5A, 0x8E, 0x8E, 0x95, 0x27, 0x6A, 0x74, 0xF0, 0x29, 0xC2, 0x2D, 0x13, 0x91, 0xD5,
0x38, 0xDB, 0x06, 0x7E, 0xB4, 0x8C, 0xD6, 0x30, 0x54, 0x86, 0xE7, 0xBB, 0x5C, 0xB6, 0xDD, 0x90
[sha512_hmac_buff_64]
digest =
0xBE, 0x52, 0xBF, 0x69, 0x2B, 0x7F, 0xD5, 0x37, 0x48, 0x76, 0xCF, 0xBD, 0x23, 0x18, 0x45, 0x90,
0x74, 0x25, 0x07, 0x91, 0x13, 0x37, 0xF3, 0x26, 0xEE, 0x68, 0xEC, 0xFC, 0xCB, 0x60, 0x53, 0x96,
0x54, 0xF6, 0xE8, 0xAC, 0xF7, 0xB1, 0x52, 0x31, 0x7E, 0x5D, 0x99, 0xF3, 0x86, 0xF2, 0x98, 0x7D,
0xD4, 0x38, 0xD9, 0xF1, 0x4C, 0x08, 0x87, 0x7F, 0xB9, 0x17, 0x97, 0x39, 0xDB, 0x68, 0x39, 0x19
#####################
# sha_hmac_buff_128 #
#####################
[sha1_hmac_buff_128]
digest =
0xB0, 0x6F, 0x7D, 0xB3, 0x29, 0xC3, 0x2B, 0x5D, 0xB7, 0xF1, 0x13, 0xFB, 0x9E, 0x90, 0x5D, 0xF1,
0x48, 0xBC, 0x71, 0xA4
[sha224_hmac_buff_128]
digest =
0xFC, 0x59, 0xAF, 0xF2, 0x83, 0x2E, 0x07, 0x08, 0xBF, 0xB4, 0x3C, 0x24, 0xA8, 0x52, 0x7B, 0x9E,
0x92, 0x83, 0xCE, 0x96, 0xEE, 0x8B, 0x65, 0x72, 0x00, 0x12, 0xC6, 0x98
[sha256_hmac_buff_128]
digest =
0x7E, 0xCA, 0x95, 0xD5, 0x63, 0xA8, 0xCA, 0xA6, 0xC5, 0x41, 0x75, 0x12, 0x60, 0xDF, 0xFE, 0x16,
0x70, 0xEB, 0xCC, 0x4E, 0xEB, 0x00, 0x86, 0xF0, 0xEC, 0x45, 0x44, 0x76, 0x62, 0x55, 0x48, 0x56
[sha384_hmac_buff_128]
digest =
0x1B, 0x2A, 0xAA, 0x7F, 0x2E, 0x58, 0x1F, 0x64, 0xB4, 0xE6, 0x29, 0xE4, 0x74, 0x78, 0x09, 0xD7,
0xBA, 0xDD, 0x18, 0xB6, 0xE4, 0x21, 0xF5, 0x8F, 0x40, 0x45, 0x65, 0xD1, 0xBE, 0x4F, 0x7B, 0x27,
0xF4, 0x64, 0x72, 0x55, 0x53, 0xAB, 0x39, 0x05, 0x7A, 0x6D, 0xAA, 0x12, 0x75, 0x03, 0x67, 0x4E
[sha512_hmac_buff_128]
digest =
0x5F, 0x8F, 0xA8, 0xFA, 0xEA, 0x05, 0x29, 0xBD, 0x3B, 0xBA, 0xF6, 0xA7, 0x93, 0x9E, 0x16, 0xF1,
0x8B, 0x10, 0x2F, 0x6D, 0x08, 0x18, 0x54, 0xD2, 0x39, 0xEB, 0xF9, 0x70, 0xCC, 0x55, 0xA0, 0xC3,
0x08, 0x9B, 0x8E, 0x55, 0x81, 0x1A, 0xCE, 0x0D, 0x09, 0x97, 0x4E, 0x34, 0xD1, 0xE6, 0x25, 0x05,
0x94, 0xC7, 0x05, 0x30, 0xAF, 0x2F, 0x7F, 0x54, 0xAA, 0xB8, 0xC5, 0x8E, 0x3D, 0xBB, 0xF2, 0x12
#####################
# sha_hmac_buff_256 #
#####################
[sha1_hmac_buff_256]
digest =
0xF9, 0xCA, 0x12, 0x7D, 0x60, 0x68, 0xB7, 0xAF, 0xDC, 0xAC, 0x41, 0x13, 0x1C, 0xA8, 0xC1, 0x85,
0x65, 0x11, 0x31, 0x4C
[sha224_hmac_buff_256]
digest =
0x49, 0xED, 0xA4, 0x27, 0x51, 0x6A, 0x46, 0xE4, 0x31, 0x12, 0x72, 0x92, 0xB8, 0x81, 0x16, 0x97,
0x19, 0x4F, 0x3B, 0xAC, 0xD1, 0xCE, 0x06, 0x40, 0xD4, 0xEA, 0x8E, 0xC3
[sha256_hmac_buff_256]
digest =
0xB9, 0xFB, 0x21, 0x16, 0x0C, 0x08, 0xD1, 0xE0, 0x49, 0xB8, 0xC8, 0x7E, 0xCC, 0xF0, 0xBA, 0x29,
0x32, 0xCE, 0x53, 0x03, 0xE8, 0xFB, 0xD2, 0x44, 0xB7, 0xB9, 0xFE, 0xE8, 0x03, 0x86, 0xE2, 0x68
[sha384_hmac_buff_256]
digest =
0x47, 0xEA, 0x51, 0xA7, 0xAD, 0xA2, 0x34, 0x3D, 0x4A, 0x3A, 0x86, 0x89, 0x78, 0x56, 0xCF, 0x21,
0x94, 0xBF, 0x80, 0x33, 0x6B, 0x42, 0x73, 0x01, 0xAD, 0x6B, 0xE0, 0xEC, 0x10, 0xEE, 0x6E, 0xEC,
0xED, 0x54, 0x50, 0x5E, 0x96, 0x3B, 0xE8, 0x2A, 0x8C, 0x33, 0x67, 0x9B, 0x17, 0x6C, 0xBB, 0xF8
[sha512_hmac_buff_256]
digest =
0x01, 0xAE, 0xE7, 0x74, 0xCD, 0x86, 0x43, 0xBC, 0x8A, 0xF6, 0xAF, 0x6C, 0xDE, 0x9E, 0x9A, 0xB7,
0x6B, 0xCF, 0x98, 0x95, 0x31, 0xE8, 0x37, 0x3B, 0x3F, 0xF3, 0xC1, 0x00, 0xA0, 0xA6, 0xE5, 0x15,
0x60, 0x36, 0x7E, 0x7C, 0x96, 0xAB, 0x17, 0xB9, 0x79, 0x3D, 0x3E, 0x43, 0xBC, 0xA0, 0xA0, 0x8B,
0x14, 0x14, 0x22, 0x86, 0xE9, 0xF6, 0x96, 0x38, 0x9F, 0x24, 0x45, 0x9C, 0xE8, 0x63, 0x2A, 0x22
#####################
# sha_hmac_buff_512 #
#####################
[sha1_hmac_buff_512]
digest =
0x45, 0x8D, 0x5B, 0x40, 0x0D, 0x34, 0x3A, 0x7B, 0xB2, 0xB1, 0xE7, 0x62, 0xDE, 0x2B, 0xD0, 0x46,
0xCD, 0x4B, 0x55, 0x95
[sha224_hmac_buff_512]
digest =
0xE1, 0x82, 0x07, 0x4F, 0x6B, 0x24, 0x4A, 0x57, 0xE9, 0x04, 0x14, 0xB1, 0x7F, 0xD2, 0x4C, 0xA0,
0x89, 0x8B, 0xB2, 0xA2, 0x28, 0x9F, 0xFE, 0x7C, 0xD1, 0x7F, 0x35, 0x07
[sha256_hmac_buff_512]
digest =
0xB9, 0x75, 0x4F, 0x70, 0xC7, 0x8C, 0xF2, 0x62, 0x89, 0x3C, 0x41, 0x4D, 0x1D, 0x15, 0x81, 0x2A,
0x5A, 0xCB, 0x56, 0x62, 0xF8, 0xE9, 0x38, 0x13, 0xC9, 0x4D, 0xC3, 0x9D, 0xF0, 0x82, 0xAC, 0xD2
[sha384_hmac_buff_512]
digest =
0x9C, 0xAE, 0x77, 0x8D, 0x7E, 0x26, 0x01, 0xA6, 0x46, 0x47, 0xDF, 0xB7, 0x23, 0x6F, 0x17, 0x6B,
0x9F, 0x4D, 0x94, 0xBB, 0x78, 0xD8, 0x2D, 0x90, 0xB1, 0xC1, 0x65, 0x6D, 0x92, 0x4E, 0x54, 0x7A,
0xA5, 0xF6, 0x80, 0x29, 0x82, 0x77, 0xAC, 0xC3, 0x58, 0xE5, 0x14, 0x75, 0x64, 0x9D, 0x02, 0x6E
[sha512_hmac_buff_512]
digest =
0x33, 0xB6, 0xD1, 0xC4, 0x5F, 0xDB, 0xEF, 0xF4, 0x14, 0xE8, 0xDA, 0x07, 0x30, 0xB6, 0xC6, 0xC9,
0x4F, 0xCF, 0x64, 0x48, 0x08, 0xA2, 0xC1, 0x9D, 0x03, 0xAD, 0x93, 0x62, 0x41, 0xB6, 0xB9, 0xEC,
0x1B, 0xD1, 0xAC, 0xA1, 0xC5, 0x94, 0x67, 0x19, 0xA3, 0x4B, 0x53, 0xCE, 0x0C, 0x8A, 0x27, 0x07,
0x37, 0x75, 0x93, 0xC3, 0xC6, 0x60, 0x19, 0x39, 0x9E, 0x02, 0x23, 0x9A, 0xE6, 0xA9, 0x34, 0x1A
######################
# sha_hmac_buff_1024 #
######################
[sha1_hmac_buff_1024]
digest =
0x0B, 0x26, 0x34, 0xAD, 0x56, 0x44, 0x39, 0x4A, 0x0D, 0x2F, 0x14, 0xFB, 0x60, 0x77, 0xDD, 0xFC,
0x0B, 0x5F, 0x9F, 0x99
[sha224_hmac_buff_1024]
digest =
0x56, 0x41, 0xC2, 0xF0, 0x73, 0x5C, 0x21, 0x13, 0x7E, 0x47, 0xCC, 0xAB, 0x21, 0x3D, 0x5E, 0xA7,
0xC6, 0x1E, 0xFF, 0x26, 0x59, 0x0C, 0x71, 0x95, 0x72, 0x76, 0x0D, 0x00
[sha256_hmac_buff_1024]
digest =
0x08, 0x91, 0x23, 0x89, 0x0F, 0xB0, 0xE4, 0x25, 0x9F, 0xC7, 0x46, 0x6B, 0xC3, 0x39, 0xE0, 0x9C,
0xE2, 0xAE, 0xA3, 0xCF, 0xB8, 0xA0, 0x0A, 0xCF, 0x29, 0xEE, 0x0D, 0x83, 0x8A, 0xE5, 0xE4, 0x85
[sha384_hmac_buff_1024]
digest =
0x38, 0xC7, 0x19, 0xA4, 0x46, 0x14, 0x79, 0xA4, 0xAB, 0x40, 0x61, 0xBC, 0xFB, 0x87, 0x16, 0xE2,
0x08, 0x90, 0xAD, 0x33, 0x5D, 0x37, 0xB6, 0xCA, 0x80, 0xEE, 0x59, 0x9C, 0xBF, 0xA8, 0xEB, 0x78,
0xC2, 0xE2, 0x2D, 0x6E, 0x2E, 0x98, 0x98, 0x6F, 0x07, 0x6A, 0x39, 0x57, 0x8F, 0xCE, 0xEE, 0x64
[sha512_hmac_buff_1024]
digest =
0x17, 0x60, 0x08, 0x57, 0x43, 0x20, 0xF6, 0xB5, 0x6D, 0x0D, 0x7F, 0x7C, 0xB9, 0x09, 0x3F, 0x6D,
0x3E, 0x75, 0x2F, 0x17, 0xDA, 0x19, 0x58, 0xF0, 0xEC, 0xED, 0x96, 0xA9, 0x57, 0x05, 0xCD, 0x23,
0x0F, 0x1E, 0x38, 0x55, 0x2D, 0x8E, 0x36, 0x14, 0xF4, 0x99, 0x5E, 0x3C, 0x33, 0xBB, 0x99, 0xC9,
0xCD, 0x7A, 0xF4, 0x87, 0x10, 0xB8, 0x6C, 0xB1, 0x14, 0x2D, 0xA8, 0xCE, 0xFE, 0xF8, 0x6F, 0xD9
######################
# sha_hmac_buff_2048 #
######################
[sha1_hmac_buff_2048]
digest =
0x58, 0xE4, 0xBB, 0x8D, 0x63, 0x5D, 0x23, 0xF1, 0xAB, 0xB5, 0xBD, 0xD8, 0x71, 0xC9, 0x05, 0x0A,
0x65, 0x5D, 0x2D, 0x2D
[sha224_hmac_buff_2048]
digest =
0xA3, 0x9A, 0x47, 0x68, 0x32, 0x3A, 0xA8, 0xE4, 0xBE, 0x23, 0xEA, 0xEE, 0x2D, 0x5E, 0x3C, 0x2E,
0xD3, 0x99, 0xBE, 0x87, 0x19, 0x17, 0xC5, 0x13, 0x6D, 0xB7, 0x05, 0x97
[sha256_hmac_buff_2048]
digest =
0x5B, 0x36, 0x1A, 0xF0, 0x55, 0xAC, 0xC3, 0xEA, 0x1B, 0x01, 0xCF, 0xCE, 0x89, 0x0D, 0x6A, 0xC3,
0x5F, 0x9A, 0xD3, 0x49, 0xCC, 0xA4, 0xDF, 0xDD, 0x44, 0x1F, 0x9D, 0x6C, 0xB1, 0x92, 0xDF, 0xB9
[sha384_hmac_buff_2048]
digest =
0x24, 0x17, 0xA2, 0x61, 0xFF, 0x46, 0xA2, 0x2E, 0xE5, 0xC3, 0xB4, 0x47, 0x10, 0x8C, 0x54, 0xD2,
0xC2, 0x4D, 0x15, 0xA2, 0x8D, 0xEF, 0x98, 0x6E, 0xE0, 0xB1, 0x31, 0x3B, 0x7D, 0xDE, 0x41, 0x8E,
0x98, 0xB9, 0xE9, 0xD2, 0xD8, 0xE5, 0x75, 0x6D, 0xC5, 0xF0, 0x1A, 0xC4, 0x1B, 0x8B, 0xC1, 0xA4
[sha512_hmac_buff_2048]
digest =
0xD8, 0x77, 0x7A, 0x0F, 0x63, 0x1E, 0x92, 0x7B, 0x87, 0xCE, 0x07, 0x24, 0x7E, 0xE4, 0x36, 0x30,
0x16, 0x76, 0x0D, 0xEC, 0xEF, 0x01, 0xF5, 0xD5, 0x44, 0xB7, 0xF3, 0x51, 0x31, 0x6A, 0xC2, 0x80,
0xCD, 0x4C, 0x7F, 0xD4, 0xA6, 0x90, 0x85, 0xAE, 0x49, 0xB1, 0xF1, 0xB0, 0xC4, 0x16, 0x79, 0xC3,
0xE3, 0x8B, 0x67, 0xC3, 0xAA, 0xC1, 0x9C, 0x8D, 0xE0, 0x22, 0xB3, 0xFD, 0x09, 0xD5, 0x40, 0xAC

View File

@ -0,0 +1,504 @@
# List of tests for AES-192 CBC:
# 1) [sha1_hmac_buff_x]
# 2) [sha224_hmac_buff_x]
# 3) [sha256_hmac_buff_x]
# 4) [sha384_hmac_buff_x]
# 5) [sha512_hmac_buff_x]
# where x is one of the values: 32, 64, 128, 256, 512, 1024, 2048
##########
# GLOBAL #
##########
plaintext =
0xff, 0xca, 0xfb, 0xf1, 0x38, 0x20, 0x2f, 0x7b, 0x24, 0x98, 0x26, 0x7d, 0x1d, 0x9f, 0xb3, 0x93,
0xd9, 0xef, 0xbd, 0xad, 0x4e, 0x40, 0xbd, 0x60, 0xe9, 0x48, 0x59, 0x90, 0x67, 0xd7, 0x2b, 0x7b,
0x8a, 0xe0, 0x4d, 0xb0, 0x70, 0x38, 0xcc, 0x48, 0x61, 0x7d, 0xee, 0xd6, 0x35, 0x49, 0xae, 0xb4,
0xaf, 0x6b, 0xdd, 0xe6, 0x21, 0xc0, 0x60, 0xce, 0x0a, 0xf4, 0x1c, 0x2e, 0x1c, 0x8d, 0xe8, 0x7b,
0x59, 0xda, 0x19, 0x4f, 0xec, 0x07, 0x8e, 0xe2, 0xf0, 0x61, 0xf9, 0x27, 0x61, 0x6f, 0xf8, 0xdf,
0x62, 0x4d, 0xaf, 0x06, 0xfe, 0x41, 0xa6, 0xa6, 0xf9, 0xa2, 0x06, 0x40, 0xb3, 0x04, 0xbd, 0xe6,
0xc8, 0x17, 0xfb, 0x56, 0x6f, 0xa9, 0x3b, 0x8e,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, 0x62, 0xc7, 0x04, 0xab, 0x05,
0xf5, 0x0c, 0xe7, 0xa2, 0xa6, 0x23, 0xd5, 0x3d, 0x95, 0xd8, 0xcd, 0x86, 0x79, 0xf5, 0x01, 0x47,
0x4f, 0xf9, 0x1d, 0x9d, 0x36, 0xf7, 0x68, 0x1a, 0x64, 0x44, 0x58, 0x5d, 0xe5, 0x81, 0x15, 0x2a,
0x41, 0xe4, 0x0e, 0xaa, 0x1f, 0x04, 0x21, 0xff, 0x2c, 0xf3, 0x73, 0x2b, 0x48, 0x1e, 0xd2, 0xf7,
0xf6, 0xd9, 0xaf, 0xbf, 0x08, 0x3b, 0xbb, 0x19, 0x5f, 0xf6, 0x7d, 0x25, 0x85, 0xdf, 0x6b, 0x54,
0xd0, 0xe7, 0x4b, 0x9e, 0xc7, 0xef, 0xca, 0x48, 0x6f, 0x21, 0xd7, 0x51, 0xc8, 0x21, 0xc1, 0x15,
0xe8, 0x38, 0x36, 0x58, 0x39, 0xd9, 0x9a, 0xc5, 0xe7, 0x3b, 0xc4, 0x47, 0xe2, 0xbd, 0x80, 0x73,
0xf8, 0xd1, 0x9a, 0x5e, 0x4b, 0xfb, 0x52, 0x6b, 0x50, 0xaf, 0x8b, 0xb7, 0xb5, 0x2c, 0x52, 0x84
cipher_iv =
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
####################
# sha_hmac_buff_32 #
####################
[sha1_hmac_buff_32]
digest =
0x34, 0xCB, 0xFA, 0xE6, 0xBF, 0x60, 0x88, 0x82, 0x2C, 0x9F, 0x96, 0x4A, 0x5A, 0xD8, 0xAE, 0x48,
0x1D, 0x2B, 0x0A, 0x22
[sha224_hmac_buff_32]
digest =
0x17, 0xDD, 0xF3, 0xC0, 0xFC, 0xBC, 0x89, 0xE1, 0x02, 0x94, 0x51, 0x2B, 0xA0, 0x63, 0x4D, 0x1B,
0x78, 0xCA, 0x0D, 0xD5, 0x99, 0xC0, 0xB8, 0x8E, 0x7F, 0x8A, 0xCB, 0x92
[sha256_hmac_buff_32]
digest =
0xF7, 0xC0, 0xFD, 0x09, 0x94, 0x8F, 0x88, 0xF3, 0x26, 0xE1, 0xB1, 0xA6, 0x70, 0xFD, 0x57, 0xA2,
0xB7, 0x63, 0x9C, 0x35, 0x97, 0x60, 0x27, 0x6A, 0xCC, 0xD8, 0x4A, 0xAE, 0xFD, 0xEC, 0x14, 0x56
[sha384_hmac_buff_32]
digest =
0x01, 0x90, 0x96, 0x95, 0x8B, 0xE8, 0xF8, 0x30, 0xE0, 0xFE, 0xD4, 0x83, 0xE4, 0xE1, 0x48, 0xEB,
0xEB, 0x3E, 0x6D, 0xBC, 0x72, 0xD8, 0xBF, 0x00, 0x86, 0x0B, 0x80, 0xCB, 0xCF, 0x0E, 0x83, 0x7E,
0x77, 0x29, 0xA0, 0x71, 0xA9, 0x15, 0x8F, 0xE5, 0xC4, 0x32, 0xC8, 0xDB, 0x0A, 0xD1, 0xE3, 0x79
[sha512_hmac_buff_32]
digest =
0x45, 0x72, 0x2B, 0xF4, 0x10, 0x82, 0xB6, 0xBC, 0xDB, 0x44, 0x34, 0x47, 0x55, 0xA7, 0x34, 0x4C,
0x1C, 0x5D, 0x4D, 0x88, 0x58, 0x0B, 0xC2, 0x3E, 0xE7, 0x49, 0xF4, 0x6A, 0x99, 0x35, 0xE5, 0x2B,
0xF4, 0x18, 0xD7, 0xD1, 0xAF, 0xC9, 0x81, 0xC5, 0x97, 0xE7, 0x94, 0xC4, 0xFD, 0x95, 0x7E, 0x1D,
0x4E, 0xF4, 0x88, 0xC0, 0x10, 0x31, 0xB5, 0x1E, 0x39, 0x91, 0x1A, 0x48, 0xC2, 0x2F, 0xFE, 0xF6
####################
# sha_hmac_buff_64 #
####################
[sha1_hmac_buff_64]
digest =
0xD5, 0x0D, 0x9A, 0x30, 0xED, 0x71, 0x88, 0xF3, 0x72, 0x5D, 0x1C, 0xEF, 0x44, 0x36, 0xC1, 0x0C,
0x66, 0x32, 0x15, 0xB5
[sha224_hmac_buff_64]
digest =
0x59, 0xF0, 0x38, 0xA5, 0x7F, 0xDC, 0x55, 0xAF, 0x0A, 0x18, 0x0B, 0x34, 0xC1, 0x48, 0xFC, 0xB2,
0xF8, 0x3B, 0xC2, 0x4A, 0x36, 0x0F, 0xEA, 0x4F, 0xD9, 0x46, 0x25, 0x1F
[sha256_hmac_buff_64]
digest =
0x00, 0xD2, 0x5F, 0xAC, 0x89, 0x4B, 0x16, 0x08, 0x89, 0x8D, 0x4F, 0x8F, 0x56, 0xF5, 0xA2, 0x9B,
0xDB, 0x91, 0x2F, 0xCE, 0x90, 0x0E, 0x4B, 0x17, 0x74, 0x8B, 0xC4, 0x8A, 0x47, 0xF0, 0x7C, 0x7A
[sha384_hmac_buff_64]
digest =
0xFE, 0x79, 0x5C, 0x3D, 0xEA, 0x2C, 0x04, 0xB9, 0xE9, 0x37, 0x4E, 0x02, 0xE8, 0x56, 0xE8, 0x7E,
0xB4, 0xA7, 0x3D, 0x37, 0xDD, 0x05, 0x58, 0x6A, 0x3D, 0x44, 0x0E, 0x84, 0xA9, 0xB4, 0x1F, 0x26,
0xED, 0xAF, 0xA3, 0x4D, 0xA3, 0x6E, 0x30, 0x8F, 0xE3, 0x79, 0xB9, 0x58, 0x4E, 0xB3, 0x36, 0x1D
[sha512_hmac_buff_64]
digest =
0x3A, 0xFE, 0x1E, 0xC8, 0x75, 0x0D, 0xF3, 0x15, 0x03, 0xCC, 0x7B, 0x50, 0xD1, 0x3E, 0x35, 0x97,
0x4D, 0x80, 0xB8, 0x0B, 0x5E, 0x22, 0x4D, 0xB9, 0xD2, 0xC9, 0x0E, 0x24, 0xC4, 0xD9, 0xDD, 0x95,
0xA1, 0x7D, 0xED, 0xE4, 0x28, 0x17, 0x7C, 0x50, 0x0B, 0x40, 0x81, 0x18, 0xEA, 0xFF, 0xBA, 0x1C,
0x8C, 0x5D, 0x17, 0xB3, 0x5B, 0x39, 0x70, 0x93, 0x9A, 0xA0, 0x47, 0x59, 0x06, 0x01, 0xE5, 0xD0
#####################
# sha_hmac_buff_128 #
#####################
[sha1_hmac_buff_128]
digest =
0xF6, 0x21, 0x56, 0x15, 0xEC, 0xB6, 0xDE, 0x2B, 0x68, 0x79, 0x30, 0x69, 0x69, 0x82, 0x4B, 0x97,
0x57, 0x61, 0xED, 0x01
[sha224_hmac_buff_128]
digest =
0xC4, 0x5A, 0x48, 0x07, 0xCC, 0xFD, 0x68, 0x28, 0xCC, 0xDA, 0x13, 0x9C, 0xFE, 0x02, 0x22, 0x1C,
0xD5, 0x2E, 0x9F, 0x0D, 0xED, 0x0B, 0x9B, 0x6D, 0xF3, 0x81, 0xD6, 0xDF
[sha256_hmac_buff_128]
digest =
0x44, 0xA6, 0x70, 0x6C, 0xD2, 0xA6, 0x3F, 0xFB, 0x98, 0xB9, 0x6A, 0x71, 0x40, 0xCF, 0xD2, 0x40,
0xA3, 0xC0, 0xC6, 0x4E, 0xF6, 0xD8, 0x4D, 0x87, 0xF5, 0x9B, 0xAC, 0xB0, 0x7B, 0xB7, 0x35, 0x5B
[sha384_hmac_buff_128]
digest =
0xD7, 0xFA, 0xF1, 0xC5, 0xD6, 0xCE, 0xB9, 0x77, 0xD5, 0x6B, 0x4D, 0x7F, 0xFE, 0xAF, 0xDF, 0xCE,
0x68, 0x1A, 0xB7, 0x3E, 0xA5, 0x9A, 0xF5, 0x79, 0x91, 0x96, 0x7C, 0xED, 0xC9, 0x02, 0x31, 0x67,
0xC4, 0xD9, 0xD7, 0x5A, 0xD7, 0xF0, 0x82, 0x2C, 0xBD, 0x4A, 0xFF, 0x03, 0x25, 0xB6, 0x50, 0x17
[sha512_hmac_buff_128]
digest =
0x78, 0xE1, 0x86, 0x74, 0xC1, 0x83, 0xDB, 0x3C, 0xAC, 0x2B, 0x17, 0xAC, 0x12, 0xAA, 0x30, 0xDE,
0x2C, 0x86, 0xC4, 0x53, 0x4A, 0xC2, 0x78, 0x86, 0x3A, 0x8A, 0x96, 0x36, 0x2B, 0x09, 0xB1, 0x62,
0xCA, 0xD0, 0x25, 0xB2, 0x5B, 0x3A, 0x76, 0xFA, 0xED, 0x5B, 0xFB, 0xF0, 0x8F, 0xF2, 0x06, 0x76,
0x9B, 0xE0, 0x82, 0x25, 0x10, 0x5E, 0x8A, 0x13, 0xA1, 0x25, 0x3B, 0xB7, 0xFC, 0xC3, 0x15, 0xED
#####################
# sha_hmac_buff_256 #
#####################
[sha1_hmac_buff_256]
digest =
0x31, 0x36, 0xC8, 0xC7, 0x95, 0xDB, 0xF7, 0xF3, 0xA0, 0xFF, 0x89, 0x94, 0x8D, 0xB2, 0x3D, 0x5F,
0x7A, 0xC1, 0x38, 0x97
[sha224_hmac_buff_256]
digest =
0xAE, 0x1B, 0xA4, 0x42, 0xE6, 0x3C, 0x3D, 0xEE, 0xEE, 0xD1, 0x24, 0xD2, 0xFF, 0xD2, 0x1A, 0xF3,
0x28, 0x87, 0x8F, 0x00, 0xE3, 0x74, 0xA1, 0xA2, 0xED, 0x70, 0x2D, 0x9D
[sha256_hmac_buff_256]
digest =
0x73, 0x89, 0x54, 0x06, 0x65, 0x71, 0x1D, 0xA1, 0xAB, 0x4A, 0x0A, 0x36, 0x63, 0x92, 0xB8, 0x94,
0x98, 0x98, 0xB5, 0x27, 0x9D, 0x9C, 0xF2, 0x91, 0x0C, 0x56, 0xC4, 0xEE, 0x99, 0xC6, 0xDE, 0xC7
[sha384_hmac_buff_256]
digest =
0xFE, 0x6E, 0xA5, 0xDC, 0x82, 0x57, 0xBB, 0x4D, 0xA8, 0xF1, 0x2F, 0xD1, 0xA2, 0x05, 0x0A, 0xFE,
0xF2, 0x64, 0x8A, 0xB3, 0x96, 0xBA, 0x06, 0x47, 0xA4, 0x40, 0x76, 0x8E, 0xB8, 0xE3, 0xAD, 0xD1,
0xB2, 0x90, 0x9A, 0x02, 0xD1, 0x13, 0x4F, 0x74, 0x9B, 0xEB, 0x09, 0xFC, 0x7F, 0x99, 0xAC, 0xCD
[sha512_hmac_buff_256]
digest =
0x9F, 0x71, 0xE0, 0x86, 0xF9, 0x76, 0x3F, 0xAB, 0x16, 0x4D, 0x9C, 0x28, 0x72, 0x3A, 0x17, 0x8F,
0x35, 0xD1, 0x44, 0x18, 0xE0, 0x4A, 0xBD, 0x8B, 0x25, 0x9F, 0x6E, 0x5B, 0xE3, 0xF4, 0x1C, 0x40,
0x2B, 0xF4, 0x61, 0x59, 0x60, 0x8D, 0x55, 0xD8, 0x18, 0x9B, 0x65, 0x8D, 0x9F, 0xAA, 0xB3, 0x71,
0x3D, 0xB5, 0x70, 0xD2, 0x26, 0xF1, 0x55, 0xDC, 0xCE, 0x49, 0x40, 0xD7, 0x23, 0x6B, 0x20, 0x4A
#####################
# sha_hmac_buff_512 #
#####################
[sha1_hmac_buff_512]
digest =
0x0F, 0xF6, 0x33, 0x61, 0x16, 0x5C, 0xD1, 0x9E, 0xE0, 0x3D, 0x95, 0x93, 0xD2, 0x82, 0xDE, 0x2E,
0xFA, 0x25, 0x56, 0xE4
[sha224_hmac_buff_512]
digest =
0x85, 0x61, 0x57, 0x9F, 0x3E, 0x6A, 0xE1, 0x5C, 0x1D, 0xA3, 0x98, 0x9C, 0x28, 0x2C, 0x96, 0x8E,
0xD0, 0x7D, 0x70, 0x7D, 0xF5, 0x98, 0xA4, 0x7C, 0x88, 0x1C, 0xA4, 0x5C
[sha256_hmac_buff_512]
digest =
0xF4, 0x77, 0xB2, 0x2E, 0xAD, 0xBC, 0xA2, 0xCD, 0x49, 0xE0, 0xD2, 0xB0, 0xB3, 0xDE, 0x51, 0xD0,
0xBC, 0xEF, 0x33, 0x50, 0x4F, 0x39, 0xBC, 0x94, 0x18, 0xF3, 0xDD, 0xFC, 0xB5, 0x8E, 0x44, 0x18
[sha384_hmac_buff_512]
digest =
0x03, 0x4F, 0x86, 0xA0, 0xBC, 0x00, 0x44, 0xEB, 0x06, 0x75, 0x61, 0x13, 0x92, 0x60, 0x74, 0x44,
0x1D, 0xCB, 0x2C, 0x8D, 0xEC, 0xE5, 0x5C, 0xBE, 0xA3, 0xAE, 0x5F, 0xE2, 0x71, 0xED, 0xAC, 0x69,
0x9C, 0x6C, 0xE3, 0x20, 0x5C, 0x90, 0xC3, 0xF4, 0x36, 0x76, 0x70, 0xAE, 0x2A, 0x9C, 0xF5, 0x0B
[sha512_hmac_buff_512]
digest =
0x3B, 0x83, 0x4B, 0x7F, 0x2A, 0x62, 0x9A, 0xF6, 0x42, 0x29, 0x7A, 0xF0, 0xCA, 0xE7, 0xBE, 0x1F,
0x92, 0x5C, 0x66, 0x88, 0x58, 0xFA, 0xA4, 0xC7, 0xE7, 0xF0, 0xEA, 0x83, 0xB2, 0x0A, 0x2C, 0x3B,
0xA7, 0xD4, 0xA4, 0x3E, 0x87, 0x00, 0x44, 0x2B, 0x3F, 0xB2, 0x4B, 0xFF, 0xAD, 0x9B, 0x07, 0x7D,
0xA1, 0x09, 0x09, 0x60, 0x68, 0x2F, 0x7B, 0x16, 0x43, 0x0E, 0x22, 0xAF, 0x78, 0x8D, 0xC7, 0x16
######################
# sha_hmac_buff_1024 #
######################
[sha1_hmac_buff_1024]
digest =
0xCD, 0x04, 0x78, 0x4A, 0xD5, 0xFE, 0x95, 0xFB, 0x04, 0x85, 0xD5, 0x25, 0x58, 0xE6, 0x6C, 0x81,
0xFA, 0x4B, 0xE7, 0x75
[sha224_hmac_buff_1024]
digest =
0x10, 0xA5, 0x18, 0x56, 0x66, 0xDE, 0xE6, 0xF6, 0x71, 0xAF, 0x65, 0xEC, 0xE3, 0x77, 0x08, 0x58,
0xD5, 0x45, 0xE6, 0x21, 0xF5, 0xCC, 0x2B, 0xE2, 0x76, 0x91, 0x51, 0xD9
[sha256_hmac_buff_1024]
digest =
0xB4, 0x09, 0xF9, 0xA0, 0x5B, 0x80, 0xFF, 0xBA, 0x21, 0x5F, 0x57, 0xAB, 0x8B, 0x67, 0x89, 0x6D,
0xB4, 0xE9, 0xEA, 0x5D, 0x77, 0x57, 0xBD, 0x0A, 0x60, 0xA4, 0x6B, 0xE8, 0xAA, 0x8A, 0x9B, 0xC7
[sha384_hmac_buff_1024]
digest =
0x9D, 0xAE, 0x37, 0x87, 0x2C, 0x36, 0xFD, 0x51, 0xF1, 0xF2, 0x4C, 0x82, 0x27, 0xB5, 0x99, 0x63,
0xAB, 0xD7, 0x62, 0x4A, 0x4E, 0xF1, 0xBF, 0xFB, 0xCA, 0x30, 0x55, 0x3F, 0x43, 0x85, 0xDE, 0x6B,
0xA2, 0xB2, 0x8B, 0x45, 0x2A, 0x9D, 0x39, 0x29, 0x63, 0x1C, 0x04, 0x47, 0x58, 0x94, 0x5C, 0x91
[sha512_hmac_buff_1024]
digest =
0xBF, 0x06, 0x94, 0xBB, 0x2E, 0x9C, 0x0A, 0xA4, 0xF3, 0x5F, 0x52, 0x4B, 0x42, 0x6E, 0xE1, 0x6C,
0xA8, 0xAB, 0xB7, 0xE9, 0x6F, 0xAB, 0x77, 0xF8, 0x94, 0xD0, 0xA1, 0x81, 0xB8, 0x17, 0x21, 0xAC,
0xB2, 0x3C, 0x73, 0x71, 0xDD, 0x76, 0xF8, 0x58, 0x84, 0xE7, 0xBB, 0xD4, 0x4A, 0x4F, 0x51, 0xF5,
0x8C, 0x87, 0xAA, 0xAC, 0xCE, 0x5E, 0xFB, 0xD3, 0x1F, 0xA2, 0x49, 0xF2, 0x40, 0xAB, 0xB8, 0x76
######################
# sha_hmac_buff_2048 #
######################
[sha1_hmac_buff_2048]
digest =
0x56, 0xE7, 0x86, 0x23, 0x2C, 0x77, 0xBE, 0x2B, 0xE6, 0x76, 0xA1, 0xE9, 0xB1, 0x0F, 0x25, 0x15,
0x1D, 0x59, 0x7F, 0x4A
[sha224_hmac_buff_2048]
digest =
0xFD, 0xEB, 0x9E, 0x04, 0x53, 0xC7, 0xEA, 0x56, 0x21, 0x91, 0x6D, 0x8B, 0xDC, 0xA1, 0x0A, 0x2F,
0x73, 0x4D, 0x05, 0x36, 0x43, 0x58, 0x71, 0xB2, 0x74, 0x6E, 0x7B, 0xAF
[sha256_hmac_buff_2048]
digest =
0x25, 0x76, 0xA5, 0x64, 0x00, 0x13, 0xF7, 0xE7, 0x2D, 0x6D, 0x17, 0x36, 0x13, 0xF3, 0xC7, 0x57,
0x70, 0x30, 0xB2, 0x76, 0x7A, 0xF4, 0x8F, 0xAF, 0x6B, 0x8C, 0x26, 0x88, 0x73, 0x2E, 0x49, 0xC0
[sha384_hmac_buff_2048]
digest =
0xF0, 0x69, 0x78, 0x9A, 0x34, 0x88, 0x25, 0x3C, 0x3D, 0xF5, 0x42, 0x65, 0x25, 0x79, 0xB2, 0xFC,
0x3B, 0x92, 0x46, 0xF9, 0x0D, 0x6D, 0xC1, 0x8E, 0x45, 0xBE, 0x8B, 0x70, 0x7D, 0x1B, 0x7E, 0xDE,
0x93, 0x04, 0xC8, 0x59, 0x4B, 0x37, 0x2C, 0x20, 0x51, 0xB1, 0x91, 0x4F, 0xA4, 0x30, 0x09, 0xED
[sha512_hmac_buff_2048]
digest =
0xAE, 0x8A, 0x42, 0x03, 0x11, 0x25, 0xE8, 0xC3, 0x4B, 0x4B, 0xC0, 0x29, 0x27, 0xE0, 0x0D, 0x27,
0x13, 0x8F, 0x7D, 0x82, 0x72, 0x94, 0x4B, 0xF8, 0xC3, 0x1A, 0xE1, 0x5A, 0xF3, 0x8E, 0x23, 0x27,
0x76, 0xE4, 0xF5, 0x3E, 0x24, 0x5B, 0xA3, 0xFA, 0x49, 0x8E, 0x57, 0xE3, 0x88, 0x15, 0x1D, 0xF6,
0x27, 0xA5, 0xC8, 0xFB, 0x34, 0x44, 0x18, 0x6A, 0x64, 0xBE, 0xFB, 0x1E, 0x87, 0xA8, 0x36, 0x1E

View File

@ -0,0 +1,504 @@
# List of tests for AES-256 CBC:
# 1) [sha1_hmac_buff_x]
# 2) [sha224_hmac_buff_x]
# 3) [sha256_hmac_buff_x]
# 4) [sha384_hmac_buff_x]
# 5) [sha512_hmac_buff_x]
# where x is one of the values: 32, 64, 128, 256, 512, 1024, 2048
##########
# GLOBAL #
##########
plaintext =
0xff, 0xca, 0xfb, 0xf1, 0x38, 0x20, 0x2f, 0x7b, 0x24, 0x98, 0x26, 0x7d, 0x1d, 0x9f, 0xb3, 0x93,
0xd9, 0xef, 0xbd, 0xad, 0x4e, 0x40, 0xbd, 0x60, 0xe9, 0x48, 0x59, 0x90, 0x67, 0xd7, 0x2b, 0x7b,
0x8a, 0xe0, 0x4d, 0xb0, 0x70, 0x38, 0xcc, 0x48, 0x61, 0x7d, 0xee, 0xd6, 0x35, 0x49, 0xae, 0xb4,
0xaf, 0x6b, 0xdd, 0xe6, 0x21, 0xc0, 0x60, 0xce, 0x0a, 0xf4, 0x1c, 0x2e, 0x1c, 0x8d, 0xe8, 0x7b,
0x59, 0xda, 0x19, 0x4f, 0xec, 0x07, 0x8e, 0xe2, 0xf0, 0x61, 0xf9, 0x27, 0x61, 0x6f, 0xf8, 0xdf,
0x62, 0x4d, 0xaf, 0x06, 0xfe, 0x41, 0xa6, 0xa6, 0xf9, 0xa2, 0x06, 0x40, 0xb3, 0x04, 0xbd, 0xe6,
0xc8, 0x17, 0xfb, 0x56, 0x6f, 0xa9, 0x3b, 0x8e, 0xa6, 0x58, 0xdc, 0x91, 0x17, 0x58, 0x42, 0x95,
0xa3, 0x7c, 0x81, 0x78, 0xa6, 0x3d, 0x3f, 0x75, 0x74, 0x17, 0x1a, 0xd3, 0x6c, 0x2f, 0x48, 0x39,
0x20, 0x20, 0xc1, 0x9a, 0x29, 0x84, 0x7d, 0x2d, 0x52, 0xa1, 0xf9, 0x5c, 0xf3, 0x4f, 0x91, 0xfc,
0x75, 0xcf, 0xd6, 0x2d, 0xe7, 0x9a, 0x59, 0x6e, 0x00, 0x0e, 0x8d, 0x22, 0x17, 0xbd, 0xa0, 0xdd,
0x79, 0x1f, 0x71, 0xe6, 0xcd, 0x2f, 0xb1, 0xb6, 0xbc, 0xc3, 0xdb, 0x02, 0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, 0x4b, 0x9e, 0xc7, 0xef, 0xca, 0x48, 0x6f, 0x21, 0xd7, 0x51, 0xc8, 0x21, 0xc1, 0x15,
0xe8, 0x38, 0x36, 0x58, 0x39, 0xd9, 0x9a, 0xc5, 0xe7, 0x3b, 0xc4, 0x47, 0xe2, 0xbd, 0x80, 0x73,
0xf8, 0xd1, 0x9a, 0x5e, 0x4b, 0xfb, 0x52, 0x6b, 0x50, 0xaf, 0x8b, 0xb7, 0xb5, 0x2c, 0x52, 0x84
cipher_iv =
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
####################
# sha_hmac_buff_32 #
####################
[sha1_hmac_buff_32]
digest =
0x36, 0xCA, 0x49, 0x6A, 0xE3, 0x54, 0xD8, 0x4F, 0x0B, 0x76, 0xD8, 0xAA, 0x78, 0xEB, 0x9D, 0x65,
0x2C, 0xCA, 0x1F, 0x97
[sha224_hmac_buff_32]
digest =
0x48, 0xC1, 0x45, 0x25, 0x29, 0xA0, 0x8B, 0x88, 0x72, 0x7A, 0xBC, 0x00, 0x94, 0x37, 0xE1, 0x22,
0xEB, 0xFA, 0x1B, 0x7D, 0x89, 0x81, 0x31, 0xC8, 0x64, 0x76, 0x55, 0xA4
[sha256_hmac_buff_32]
digest =
0x1C, 0xB2, 0x3D, 0xD1, 0xF9, 0xC7, 0x6C, 0x49, 0x2E, 0xDA, 0x94, 0x8B, 0xF1, 0xCF, 0x96, 0x43,
0x67, 0x50, 0x39, 0x76, 0xB5, 0xA1, 0xCE, 0xA1, 0xD7, 0x77, 0x10, 0x07, 0x43, 0x37, 0x05, 0xB4
[sha384_hmac_buff_32]
digest =
0x6C, 0xBD, 0x1E, 0x2E, 0x75, 0xA7, 0x2C, 0x98, 0xC4, 0x1E, 0x03, 0x4E, 0x39, 0x4B, 0x27, 0x41,
0xFB, 0xC6, 0x56, 0x87, 0x84, 0xEB, 0xFA, 0xB1, 0x20, 0x1F, 0x11, 0x81, 0x8D, 0xDC, 0xB6, 0xA7,
0xAD, 0x1F, 0xAC, 0xA9, 0x43, 0x1D, 0x2B, 0xEB, 0x5F, 0x27, 0xC6, 0x0F, 0x9E, 0xFB, 0x1E, 0xB1
[sha512_hmac_buff_32]
digest =
0xA4, 0x60, 0x7E, 0xBE, 0x5F, 0x47, 0x58, 0x3B, 0x41, 0x5F, 0x29, 0xDF, 0xE4, 0xD2, 0xFB, 0x30,
0xF0, 0x2B, 0x09, 0x4E, 0x09, 0x50, 0xEC, 0x1C, 0x0E, 0x34, 0x79, 0xAE, 0xD8, 0x6D, 0xAC, 0xB6,
0x9B, 0x7C, 0xB9, 0x06, 0xC2, 0x4A, 0x4E, 0x22, 0x14, 0x4D, 0x42, 0x46, 0x20, 0xE0, 0x6C, 0xEE,
0x2F, 0xE1, 0x23, 0xA2, 0x7A, 0x2F, 0xDB, 0xAF, 0x78, 0x75, 0x56, 0xF7, 0x3A, 0x5E, 0x74, 0xEF
####################
# sha_hmac_buff_64 #
####################
[sha1_hmac_buff_64]
digest =
0xFC, 0x17, 0x7E, 0x0E, 0x52, 0x94, 0xE3, 0x27, 0xC0, 0x9B, 0x72, 0xAD, 0xC0, 0x5B, 0xCF, 0xFF,
0x65, 0x88, 0x43, 0xE7
[sha224_hmac_buff_64]
digest =
0xD7, 0x55, 0x25, 0xC0, 0x26, 0xDD, 0x8E, 0x14, 0x17, 0x8B, 0x89, 0x59, 0x8A, 0xBB, 0xEA, 0xD6,
0x7D, 0x85, 0x00, 0x9F, 0xC2, 0x8A, 0xCB, 0x01, 0x7F, 0x8C, 0x6E, 0x24
[sha256_hmac_buff_64]
digest =
0x8F, 0x4B, 0x3B, 0x4C, 0x58, 0x25, 0x3B, 0x07, 0xEB, 0xF8, 0x20, 0x81, 0xD9, 0xD9, 0x92, 0x8F,
0xF4, 0x32, 0x7C, 0x2A, 0xD9, 0xEC, 0x92, 0x60, 0x8F, 0xE3, 0x90, 0x7F, 0xC5, 0x75, 0x05, 0xB6
[sha384_hmac_buff_64]
digest =
0xD1, 0xC7, 0x64, 0x27, 0xF0, 0x30, 0x43, 0x8E, 0xD6, 0xA6, 0x78, 0xF7, 0xE9, 0xCC, 0x8E, 0x69,
0x6D, 0xB8, 0x3E, 0xFA, 0xA0, 0x81, 0x9C, 0x61, 0x78, 0x72, 0xF0, 0x1C, 0x29, 0x35, 0x51, 0x3E,
0x4A, 0x95, 0xDE, 0x2C, 0x6A, 0x3F, 0x56, 0xA8, 0x12, 0xBA, 0x44, 0x39, 0x1E, 0xDB, 0xF7, 0xF5
[sha512_hmac_buff_64]
digest =
0xE6, 0xE9, 0xD8, 0x1D, 0x90, 0xAE, 0x32, 0x0E, 0xBA, 0x55, 0x58, 0xD5, 0x55, 0x97, 0x40, 0xB3,
0xE9, 0x12, 0xD3, 0x08, 0xEF, 0x21, 0xED, 0xA5, 0x94, 0x8D, 0xF2, 0x4C, 0x52, 0x2C, 0x50, 0xB2,
0xD2, 0xEC, 0xB7, 0xE1, 0x95, 0x2D, 0x68, 0xDB, 0xAD, 0xB5, 0x94, 0x50, 0x67, 0xF3, 0x0A, 0x83,
0x54, 0x03, 0x33, 0x1C, 0xD5, 0x42, 0x7D, 0xB4, 0x3E, 0x69, 0x7C, 0x36, 0x7E, 0x96, 0x0D, 0x3E
#####################
# sha_hmac_buff_128 #
#####################
[sha1_hmac_buff_128]
digest =
0xAA, 0x90, 0x55, 0xA5, 0x71, 0xC4, 0x2B, 0xA3, 0x02, 0xAA, 0xB1, 0x1C, 0xB3, 0x88, 0x38, 0x6E,
0xAD, 0x26, 0x98, 0xA7
[sha224_hmac_buff_128]
digest =
0xBE, 0xCC, 0x83, 0x48, 0x4C, 0x58, 0xF9, 0x86, 0xFA, 0x93, 0x5F, 0xD1, 0x3C, 0x11, 0x8A, 0x37,
0xA6, 0xEE, 0x52, 0x4D, 0xA3, 0x98, 0x3E, 0x35, 0xF1, 0x4F, 0xD9, 0xDB
[sha256_hmac_buff_128]
digest =
0xE2, 0x9C, 0xE1, 0xDF, 0xCD, 0xAE, 0x50, 0x4B, 0x9A, 0xA6, 0x41, 0xAC, 0x0C, 0xF1, 0x66, 0xED,
0xA1, 0x22, 0x05, 0x72, 0x49, 0x97, 0xA1, 0x30, 0xB8, 0xF9, 0xED, 0x36, 0x0A, 0x19, 0xE4, 0x2A
[sha384_hmac_buff_128]
digest =
0xD9, 0x3C, 0xEB, 0xF4, 0x20, 0xC6, 0x4F, 0xC7, 0xBD, 0x34, 0xBA, 0xFD, 0x7C, 0xA9, 0xCE, 0xFF,
0x26, 0x2E, 0xB4, 0x4A, 0xB7, 0x47, 0x71, 0x2C, 0x9E, 0xCF, 0x44, 0x0B, 0xD9, 0xAF, 0x8D, 0x17,
0x0A, 0x3A, 0x02, 0xD0, 0xE9, 0xDF, 0xCF, 0x52, 0x5F, 0xDA, 0xA7, 0xB6, 0x51, 0x7C, 0x59, 0x09
[sha512_hmac_buff_128]
digest =
0xAD, 0x7E, 0xB7, 0x33, 0xFB, 0x8A, 0x17, 0xD0, 0x3C, 0xB0, 0x80, 0x19, 0xF3, 0x9A, 0x6F, 0x90,
0xDE, 0xF3, 0x53, 0xEA, 0x48, 0x75, 0x0A, 0x1E, 0x49, 0x02, 0xA0, 0x94, 0xC4, 0xE8, 0xFB, 0x87,
0x83, 0x80, 0xD3, 0xFF, 0x6B, 0x79, 0x73, 0x54, 0xF9, 0x2F, 0x2D, 0x59, 0x69, 0x0E, 0x50, 0x29,
0x2A, 0xDA, 0x59, 0x38, 0xDD, 0x62, 0xF9, 0x1A, 0x18, 0xA9, 0x51, 0x5A, 0xFE, 0x8E, 0xFD, 0xBF
#####################
# sha_hmac_buff_256 #
#####################
[sha1_hmac_buff_256]
digest =
0xB1, 0x18, 0x31, 0xBF, 0xEE, 0x81, 0x7E, 0xFC, 0x68, 0xDA, 0xB6, 0x8A, 0x5D, 0xDE, 0x39, 0x65,
0xC8, 0xF8, 0xC3, 0xE5
[sha224_hmac_buff_256]
digest =
0xCD, 0xF6, 0xC2, 0x6D, 0xFD, 0x33, 0x1A, 0xD8, 0x2F, 0x07, 0x4F, 0x1A, 0xE8, 0x18, 0xBD, 0x04,
0xB1, 0xE5, 0x8D, 0xC1, 0x21, 0x95, 0x87, 0x75, 0xC2, 0x27, 0x4B, 0xF2
[sha256_hmac_buff_256]
digest =
0xC0, 0xFA, 0x8F, 0x6F, 0x55, 0xFC, 0xF3, 0xDF, 0x8E, 0x5D, 0x93, 0x5E, 0x6B, 0x20, 0x0A, 0x9A,
0x84, 0x3D, 0xCD, 0x4B, 0x57, 0x63, 0x2D, 0x93, 0x51, 0x45, 0xF2, 0x1E, 0xC7, 0xA4, 0xD4, 0x69
[sha384_hmac_buff_256]
digest =
0x2B, 0x92, 0x9E, 0x85, 0x5A, 0x89, 0xB5, 0x12, 0x4A, 0x9B, 0x2D, 0xD2, 0xB2, 0x3E, 0xAB, 0xC1,
0x1E, 0x7F, 0x53, 0xD9, 0x88, 0xEB, 0xEE, 0xA2, 0x49, 0x14, 0xDE, 0x1A, 0x9E, 0x20, 0xCE, 0xEC,
0x7A, 0x5D, 0x25, 0xD8, 0x8F, 0xFE, 0x8B, 0xB1, 0xB1, 0x04, 0x5F, 0x46, 0x2D, 0x34, 0x2D, 0x72
[sha512_hmac_buff_256]
digest =
0x4F, 0x96, 0x89, 0x9E, 0x9D, 0x53, 0xAC, 0x05, 0xC7, 0xA0, 0x0F, 0x4D, 0xB6, 0x3E, 0x06, 0x03,
0x19, 0x68, 0x41, 0x4F, 0x11, 0x57, 0x77, 0x21, 0xBD, 0x60, 0x3E, 0xB4, 0xFE, 0x6A, 0x0D, 0xBF,
0xE0, 0x4F, 0x32, 0x5B, 0xF9, 0xDF, 0x13, 0xBD, 0x02, 0x73, 0xD4, 0x0C, 0xE9, 0x9D, 0xB7, 0xD5,
0x38, 0xA0, 0x20, 0xD9, 0xD1, 0x66, 0x17, 0x19, 0x54, 0x36, 0x18, 0xE1, 0xF5, 0x34, 0x12, 0x9E
#####################
# sha_hmac_buff_512 #
#####################
[sha1_hmac_buff_512]
digest =
0x78, 0x14, 0x01, 0xED, 0x93, 0x6F, 0x22, 0xB6, 0x96, 0x5A, 0x32, 0x05, 0xA9, 0xD3, 0x49, 0x04,
0x55, 0xB0, 0x00, 0x06
[sha224_hmac_buff_512]
digest =
0x25, 0xD4, 0x8F, 0x92, 0xE1, 0xD0, 0x4E, 0x3F, 0x34, 0x38, 0x01, 0xB8, 0xFE, 0x57, 0x3D, 0x34,
0x39, 0x98, 0x82, 0x8D, 0x68, 0x04, 0x5A, 0x74, 0x28, 0x4F, 0x18, 0xCE
[sha256_hmac_buff_512]
digest =
0x90, 0x06, 0x97, 0x8A, 0x7A, 0xEF, 0x62, 0x14, 0x4C, 0x14, 0xAA, 0x25, 0x4C, 0xE3, 0x5D, 0xE4,
0xAD, 0x6C, 0xD6, 0x82, 0x2B, 0x87, 0x53, 0x3E, 0xE9, 0xE4, 0x97, 0x82, 0x82, 0x76, 0xE7, 0xF1
[sha384_hmac_buff_512]
digest =
0xD5, 0xDA, 0x7C, 0x8A, 0x0D, 0x1B, 0xBE, 0x3E, 0x25, 0x1E, 0x6C, 0xA4, 0x50, 0x32, 0x92, 0x13,
0x91, 0x4F, 0xA2, 0x29, 0x2A, 0x0A, 0x57, 0x62, 0x3D, 0x93, 0xF2, 0x45, 0x96, 0x22, 0xF8, 0x0D,
0xA9, 0xE9, 0xAB, 0xAC, 0x7B, 0x2E, 0x42, 0xC2, 0x3E, 0x75, 0x23, 0xD0, 0xD2, 0xAA, 0x1E, 0xEE
[sha512_hmac_buff_512]
digest =
0x57, 0x34, 0x65, 0x3D, 0xDE, 0x8B, 0x7B, 0x99, 0x62, 0x24, 0xF3, 0xAF, 0xA6, 0xB1, 0xF0, 0x01,
0x23, 0xD4, 0x94, 0xC2, 0x06, 0x70, 0xA5, 0x8C, 0x80, 0x93, 0x49, 0x88, 0xB4, 0xB6, 0x45, 0xE5,
0x37, 0xC9, 0xE4, 0xA1, 0xAB, 0x6C, 0xA5, 0x23, 0xD2, 0x07, 0x9B, 0x10, 0x4D, 0xFD, 0x75, 0xC0,
0x28, 0xA1, 0x8A, 0x84, 0x03, 0x35, 0x22, 0xCC, 0xAC, 0x6C, 0x97, 0x93, 0x57, 0x08, 0x48, 0x51
######################
# sha_hmac_buff_1024 #
######################
[sha1_hmac_buff_1024]
digest =
0x74, 0xF7, 0x91, 0x04, 0x06, 0xDB, 0xA9, 0xF0, 0x08, 0x0E, 0x93, 0xCE, 0x55, 0xA8, 0x54, 0xF0,
0x4B, 0x5E, 0x3F, 0xC7
[sha224_hmac_buff_1024]
digest =
0x45, 0xDA, 0x2E, 0x83, 0xBD, 0x35, 0xA4, 0x58, 0x14, 0x74, 0xCB, 0xA4, 0x48, 0xA6, 0xBA, 0xDC,
0x7D, 0x56, 0x6A, 0x44, 0xA7, 0xE9, 0x2F, 0x75, 0x20, 0x47, 0x2A, 0x5A
[sha256_hmac_buff_1024]
digest =
0xA2, 0x81, 0xFE, 0x1A, 0x5C, 0x4F, 0x02, 0x72, 0xEF, 0x4F, 0xC6, 0xEE, 0x54, 0x71, 0x69, 0xAF,
0x5C, 0x71, 0x9F, 0xB0, 0xAC, 0x5B, 0x7F, 0x51, 0xD6, 0x0D, 0x64, 0xD2, 0x2E, 0x0E, 0x30, 0x55
[sha384_hmac_buff_1024]
digest =
0x26, 0x44, 0x13, 0x01, 0x25, 0x6E, 0xC7, 0xC3, 0x88, 0x25, 0xD5, 0xDD, 0x1D, 0xCA, 0x0C, 0xB1,
0xB8, 0x82, 0xB2, 0xB8, 0x15, 0x3F, 0xE5, 0x54, 0x43, 0x47, 0x32, 0x3B, 0xB2, 0xE0, 0xC8, 0x58,
0x64, 0xE7, 0x78, 0xC9, 0x1F, 0x81, 0x7B, 0xBD, 0x0D, 0x6D, 0x37, 0x9C, 0x01, 0x20, 0x6A, 0x8E
[sha512_hmac_buff_1024]
digest =
0xBE, 0xDA, 0x0D, 0x3B, 0x47, 0x24, 0xBA, 0x45, 0xBA, 0xCA, 0x84, 0x5F, 0xEA, 0xAC, 0x33, 0x84,
0x00, 0x62, 0xA5, 0x29, 0xB6, 0x2F, 0xB7, 0x86, 0xD0, 0x94, 0xFF, 0xFF, 0xE4, 0x1E, 0x5C, 0xFD,
0xC8, 0xD5, 0x3A, 0xD4, 0xFC, 0xA6, 0x1C, 0x66, 0x4A, 0x6D, 0xF9, 0x2B, 0x1D, 0x7F, 0xA0, 0xCF,
0x3D, 0x0F, 0x1F, 0x5B, 0xDD, 0x21, 0x12, 0xA8, 0x76, 0xB0, 0xD7, 0x30, 0x66, 0xA6, 0xA0, 0x6C
######################
# sha_hmac_buff_2048 #
######################
[sha1_hmac_buff_2048]
digest =
0x99, 0x32, 0xCD, 0xC3, 0xC9, 0x7F, 0x98, 0x1A, 0x96, 0xF6, 0x52, 0xC8, 0xA2, 0x16, 0x9C, 0x29,
0x9D, 0x6E, 0x96, 0xF5
[sha224_hmac_buff_2048]
digest =
0x1A, 0xC4, 0xDC, 0x46, 0xE5, 0x87, 0xFE, 0xE0, 0x47, 0x64, 0x53, 0xA3, 0x6A, 0x1F, 0x78, 0xC0,
0xC0, 0x02, 0x03, 0x64, 0xB1, 0x55, 0x50, 0x66, 0xDA, 0xD6, 0x9E, 0xBC
[sha256_hmac_buff_2048]
digest =
0xA6, 0xC6, 0x4B, 0x0C, 0x95, 0xDE, 0xD5, 0xE2, 0x40, 0x7D, 0x44, 0xC5, 0xBF, 0x00, 0x5A, 0xFB,
0x6F, 0x3F, 0x5E, 0x69, 0xB1, 0x32, 0x91, 0xAB, 0x6C, 0x90, 0x25, 0xAB, 0xD9, 0x1B, 0x8F, 0x80
[sha384_hmac_buff_2048]
digest =
0x16, 0xF1, 0x1B, 0xC1, 0x22, 0xDB, 0x21, 0x90, 0x08, 0xE3, 0x42, 0x0C, 0x9A, 0xF1, 0x0F, 0xF8,
0x7A, 0xE9, 0x50, 0x09, 0xC6, 0x0C, 0x71, 0x65, 0x3A, 0x40, 0xB3, 0x78, 0x11, 0xE8, 0xD2, 0xD4,
0xB0, 0x6C, 0xA9, 0x6A, 0x0C, 0xCD, 0xE1, 0x70, 0x7E, 0x90, 0x86, 0x34, 0xC1, 0x08, 0x9E, 0xFC
[sha512_hmac_buff_2048]
digest =
0xDF, 0x7F, 0xC3, 0x26, 0x3E, 0x55, 0x80, 0x7D, 0x02, 0x06, 0x5A, 0x4B, 0x8C, 0xFD, 0x2F, 0x33,
0xF8, 0x0E, 0x9C, 0x59, 0xAE, 0x56, 0xAE, 0x86, 0xA9, 0x25, 0x3F, 0xB7, 0xF7, 0x4C, 0x7A, 0xB4,
0xD8, 0x0E, 0x43, 0xC0, 0x86, 0xDF, 0xDB, 0xBA, 0xA8, 0xCB, 0x46, 0x2A, 0x92, 0x34, 0xF5, 0x3B,
0xBD, 0x59, 0x64, 0xDF, 0x30, 0x20, 0xF5, 0x13, 0xD7, 0x78, 0xB9, 0x27, 0xE6, 0xB6, 0x56, 0x19

View File

@ -0,0 +1,615 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include <rte_eal.h>
#include <rte_cryptodev.h>
#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
#include <rte_cryptodev_scheduler.h>
#endif
#include "cperf.h"
#include "cperf_options.h"
#include "cperf_test_vector_parsing.h"
#include "cperf_test_throughput.h"
#include "cperf_test_latency.h"
#include "cperf_test_verify.h"
#include "cperf_test_pmd_cyclecount.h"
#define NUM_SESSIONS 2048
#define SESS_MEMPOOL_CACHE_SIZE 64
const char *cperf_test_type_strs[] = {
[CPERF_TEST_TYPE_THROUGHPUT] = "throughput",
[CPERF_TEST_TYPE_LATENCY] = "latency",
[CPERF_TEST_TYPE_VERIFY] = "verify",
[CPERF_TEST_TYPE_PMDCC] = "pmd-cyclecount"
};
const char *cperf_op_type_strs[] = {
[CPERF_CIPHER_ONLY] = "cipher-only",
[CPERF_AUTH_ONLY] = "auth-only",
[CPERF_CIPHER_THEN_AUTH] = "cipher-then-auth",
[CPERF_AUTH_THEN_CIPHER] = "auth-then-cipher",
[CPERF_AEAD] = "aead"
};
const struct cperf_test cperf_testmap[] = {
[CPERF_TEST_TYPE_THROUGHPUT] = {
cperf_throughput_test_constructor,
cperf_throughput_test_runner,
cperf_throughput_test_destructor
},
[CPERF_TEST_TYPE_LATENCY] = {
cperf_latency_test_constructor,
cperf_latency_test_runner,
cperf_latency_test_destructor
},
[CPERF_TEST_TYPE_VERIFY] = {
cperf_verify_test_constructor,
cperf_verify_test_runner,
cperf_verify_test_destructor
},
[CPERF_TEST_TYPE_PMDCC] = {
cperf_pmd_cyclecount_test_constructor,
cperf_pmd_cyclecount_test_runner,
cperf_pmd_cyclecount_test_destructor
}
};
static int
cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs,
struct rte_mempool *session_pool_socket[])
{
uint8_t enabled_cdev_count = 0, nb_lcores, cdev_id;
unsigned int i, j;
int ret;
enabled_cdev_count = rte_cryptodev_devices_get(opts->device_type,
enabled_cdevs, RTE_CRYPTO_MAX_DEVS);
if (enabled_cdev_count == 0) {
printf("No crypto devices type %s available\n",
opts->device_type);
return -EINVAL;
}
nb_lcores = rte_lcore_count() - 1;
if (enabled_cdev_count > nb_lcores) {
printf("Number of capable crypto devices (%d) "
"has to be less or equal to number of slave "
"cores (%d)\n", enabled_cdev_count, nb_lcores);
return -EINVAL;
}
/* Create a mempool shared by all the devices */
uint32_t max_sess_size = 0, sess_size;
for (cdev_id = 0; cdev_id < rte_cryptodev_count(); cdev_id++) {
sess_size = rte_cryptodev_get_private_session_size(cdev_id);
if (sess_size > max_sess_size)
max_sess_size = sess_size;
}
/*
* Calculate number of needed queue pairs, based on the amount
* of available number of logical cores and crypto devices.
* For instance, if there are 4 cores and 2 crypto devices,
* 2 queue pairs will be set up per device.
*/
opts->nb_qps = (nb_lcores % enabled_cdev_count) ?
(nb_lcores / enabled_cdev_count) + 1 :
nb_lcores / enabled_cdev_count;
for (i = 0; i < enabled_cdev_count &&
i < RTE_CRYPTO_MAX_DEVS; i++) {
cdev_id = enabled_cdevs[i];
#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
/*
* If multi-core scheduler is used, limit the number
* of queue pairs to 1, as there is no way to know
* how many cores are being used by the PMD, and
* how many will be available for the application.
*/
if (!strcmp((const char *)opts->device_type, "crypto_scheduler") &&
rte_cryptodev_scheduler_mode_get(cdev_id) ==
CDEV_SCHED_MODE_MULTICORE)
opts->nb_qps = 1;
#endif
struct rte_cryptodev_info cdev_info;
uint8_t socket_id = rte_cryptodev_socket_id(cdev_id);
rte_cryptodev_info_get(cdev_id, &cdev_info);
if (opts->nb_qps > cdev_info.max_nb_queue_pairs) {
printf("Number of needed queue pairs is higher "
"than the maximum number of queue pairs "
"per device.\n");
printf("Lower the number of cores or increase "
"the number of crypto devices\n");
return -EINVAL;
}
struct rte_cryptodev_config conf = {
.nb_queue_pairs = opts->nb_qps,
.socket_id = socket_id
};
struct rte_cryptodev_qp_conf qp_conf = {
.nb_descriptors = opts->nb_descriptors
};
if (session_pool_socket[socket_id] == NULL) {
char mp_name[RTE_MEMPOOL_NAMESIZE];
struct rte_mempool *sess_mp;
snprintf(mp_name, RTE_MEMPOOL_NAMESIZE,
"sess_mp_%u", socket_id);
sess_mp = rte_mempool_create(mp_name,
NUM_SESSIONS,
max_sess_size,
SESS_MEMPOOL_CACHE_SIZE,
0, NULL, NULL, NULL,
NULL, socket_id,
0);
if (sess_mp == NULL) {
printf("Cannot create session pool on socket %d\n",
socket_id);
return -ENOMEM;
}
printf("Allocated session pool on socket %d\n", socket_id);
session_pool_socket[socket_id] = sess_mp;
}
ret = rte_cryptodev_configure(cdev_id, &conf);
if (ret < 0) {
printf("Failed to configure cryptodev %u", cdev_id);
return -EINVAL;
}
for (j = 0; j < opts->nb_qps; j++) {
ret = rte_cryptodev_queue_pair_setup(cdev_id, j,
&qp_conf, socket_id,
session_pool_socket[socket_id]);
if (ret < 0) {
printf("Failed to setup queue pair %u on "
"cryptodev %u", j, cdev_id);
return -EINVAL;
}
}
ret = rte_cryptodev_start(cdev_id);
if (ret < 0) {
printf("Failed to start device %u: error %d\n",
cdev_id, ret);
return -EPERM;
}
}
return enabled_cdev_count;
}
static int
cperf_verify_devices_capabilities(struct cperf_options *opts,
uint8_t *enabled_cdevs, uint8_t nb_cryptodevs)
{
struct rte_cryptodev_sym_capability_idx cap_idx;
const struct rte_cryptodev_symmetric_capability *capability;
uint8_t i, cdev_id;
int ret;
for (i = 0; i < nb_cryptodevs; i++) {
cdev_id = enabled_cdevs[i];
if (opts->op_type == CPERF_AUTH_ONLY ||
opts->op_type == CPERF_CIPHER_THEN_AUTH ||
opts->op_type == CPERF_AUTH_THEN_CIPHER) {
cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
cap_idx.algo.auth = opts->auth_algo;
capability = rte_cryptodev_sym_capability_get(cdev_id,
&cap_idx);
if (capability == NULL)
return -1;
ret = rte_cryptodev_sym_capability_check_auth(
capability,
opts->auth_key_sz,
opts->digest_sz,
opts->auth_iv_sz);
if (ret != 0)
return ret;
}
if (opts->op_type == CPERF_CIPHER_ONLY ||
opts->op_type == CPERF_CIPHER_THEN_AUTH ||
opts->op_type == CPERF_AUTH_THEN_CIPHER) {
cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cap_idx.algo.cipher = opts->cipher_algo;
capability = rte_cryptodev_sym_capability_get(cdev_id,
&cap_idx);
if (capability == NULL)
return -1;
ret = rte_cryptodev_sym_capability_check_cipher(
capability,
opts->cipher_key_sz,
opts->cipher_iv_sz);
if (ret != 0)
return ret;
}
if (opts->op_type == CPERF_AEAD) {
cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
cap_idx.algo.aead = opts->aead_algo;
capability = rte_cryptodev_sym_capability_get(cdev_id,
&cap_idx);
if (capability == NULL)
return -1;
ret = rte_cryptodev_sym_capability_check_aead(
capability,
opts->aead_key_sz,
opts->digest_sz,
opts->aead_aad_sz,
opts->aead_iv_sz);
if (ret != 0)
return ret;
}
}
return 0;
}
static int
cperf_check_test_vector(struct cperf_options *opts,
struct cperf_test_vector *test_vec)
{
if (opts->op_type == CPERF_CIPHER_ONLY) {
if (opts->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
if (test_vec->plaintext.data == NULL)
return -1;
} else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
if (test_vec->ciphertext.data == NULL)
return -1;
if (test_vec->ciphertext.length < opts->max_buffer_size)
return -1;
if (test_vec->cipher_iv.data == NULL)
return -1;
if (test_vec->cipher_iv.length != opts->cipher_iv_sz)
return -1;
if (test_vec->cipher_key.data == NULL)
return -1;
if (test_vec->cipher_key.length != opts->cipher_key_sz)
return -1;
}
} else if (opts->op_type == CPERF_AUTH_ONLY) {
if (opts->auth_algo != RTE_CRYPTO_AUTH_NULL) {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
if (test_vec->auth_key.data == NULL)
return -1;
if (test_vec->auth_key.length != opts->auth_key_sz)
return -1;
if (test_vec->auth_iv.length != opts->auth_iv_sz)
return -1;
/* Auth IV is only required for some algorithms */
if (opts->auth_iv_sz && test_vec->auth_iv.data == NULL)
return -1;
if (test_vec->digest.data == NULL)
return -1;
if (test_vec->digest.length < opts->digest_sz)
return -1;
}
} else if (opts->op_type == CPERF_CIPHER_THEN_AUTH ||
opts->op_type == CPERF_AUTH_THEN_CIPHER) {
if (opts->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
} else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
if (test_vec->ciphertext.data == NULL)
return -1;
if (test_vec->ciphertext.length < opts->max_buffer_size)
return -1;
if (test_vec->cipher_iv.data == NULL)
return -1;
if (test_vec->cipher_iv.length != opts->cipher_iv_sz)
return -1;
if (test_vec->cipher_key.data == NULL)
return -1;
if (test_vec->cipher_key.length != opts->cipher_key_sz)
return -1;
}
if (opts->auth_algo != RTE_CRYPTO_AUTH_NULL) {
if (test_vec->auth_key.data == NULL)
return -1;
if (test_vec->auth_key.length != opts->auth_key_sz)
return -1;
if (test_vec->auth_iv.length != opts->auth_iv_sz)
return -1;
/* Auth IV is only required for some algorithms */
if (opts->auth_iv_sz && test_vec->auth_iv.data == NULL)
return -1;
if (test_vec->digest.data == NULL)
return -1;
if (test_vec->digest.length < opts->digest_sz)
return -1;
}
} else if (opts->op_type == CPERF_AEAD) {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
if (test_vec->ciphertext.data == NULL)
return -1;
if (test_vec->ciphertext.length < opts->max_buffer_size)
return -1;
if (test_vec->aead_iv.data == NULL)
return -1;
if (test_vec->aead_iv.length != opts->aead_iv_sz)
return -1;
if (test_vec->aad.data == NULL)
return -1;
if (test_vec->aad.length != opts->aead_aad_sz)
return -1;
if (test_vec->digest.data == NULL)
return -1;
if (test_vec->digest.length < opts->digest_sz)
return -1;
}
return 0;
}
int
main(int argc, char **argv)
{
struct cperf_options opts = {0};
struct cperf_test_vector *t_vec = NULL;
struct cperf_op_fns op_fns;
void *ctx[RTE_MAX_LCORE] = { };
struct rte_mempool *session_pool_socket[RTE_MAX_NUMA_NODES] = { 0 };
int nb_cryptodevs = 0;
uint16_t total_nb_qps = 0;
uint8_t cdev_id, i;
uint8_t enabled_cdevs[RTE_CRYPTO_MAX_DEVS] = { 0 };
uint8_t buffer_size_idx = 0;
int ret;
uint32_t lcore_id;
/* Initialise DPDK EAL */
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid EAL arguments!\n");
argc -= ret;
argv += ret;
cperf_options_default(&opts);
ret = cperf_options_parse(&opts, argc, argv);
if (ret) {
RTE_LOG(ERR, USER1, "Parsing on or more user options failed\n");
goto err;
}
ret = cperf_options_check(&opts);
if (ret) {
RTE_LOG(ERR, USER1,
"Checking on or more user options failed\n");
goto err;
}
nb_cryptodevs = cperf_initialize_cryptodev(&opts, enabled_cdevs,
session_pool_socket);
if (!opts.silent)
cperf_options_dump(&opts);
if (nb_cryptodevs < 1) {
RTE_LOG(ERR, USER1, "Failed to initialise requested crypto "
"device type\n");
nb_cryptodevs = 0;
goto err;
}
ret = cperf_verify_devices_capabilities(&opts, enabled_cdevs,
nb_cryptodevs);
if (ret) {
RTE_LOG(ERR, USER1, "Crypto device type does not support "
"capabilities requested\n");
goto err;
}
if (opts.test_file != NULL) {
t_vec = cperf_test_vector_get_from_file(&opts);
if (t_vec == NULL) {
RTE_LOG(ERR, USER1,
"Failed to create test vector for"
" specified file\n");
goto err;
}
if (cperf_check_test_vector(&opts, t_vec)) {
RTE_LOG(ERR, USER1, "Incomplete necessary test vectors"
"\n");
goto err;
}
} else {
t_vec = cperf_test_vector_get_dummy(&opts);
if (t_vec == NULL) {
RTE_LOG(ERR, USER1,
"Failed to create test vector for"
" specified algorithms\n");
goto err;
}
}
ret = cperf_get_op_functions(&opts, &op_fns);
if (ret) {
RTE_LOG(ERR, USER1, "Failed to find function ops set for "
"specified algorithms combination\n");
goto err;
}
if (!opts.silent)
show_test_vector(t_vec);
total_nb_qps = nb_cryptodevs * opts.nb_qps;
i = 0;
uint8_t qp_id = 0, cdev_index = 0;
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (i == total_nb_qps)
break;
cdev_id = enabled_cdevs[cdev_index];
uint8_t socket_id = rte_cryptodev_socket_id(cdev_id);
ctx[i] = cperf_testmap[opts.test].constructor(
session_pool_socket[socket_id], cdev_id, qp_id,
&opts, t_vec, &op_fns);
if (ctx[i] == NULL) {
RTE_LOG(ERR, USER1, "Test run constructor failed\n");
goto err;
}
qp_id = (qp_id + 1) % opts.nb_qps;
if (qp_id == 0)
cdev_index++;
i++;
}
/* Get first size from range or list */
if (opts.inc_buffer_size != 0)
opts.test_buffer_size = opts.min_buffer_size;
else
opts.test_buffer_size = opts.buffer_size_list[0];
while (opts.test_buffer_size <= opts.max_buffer_size) {
i = 0;
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (i == total_nb_qps)
break;
rte_eal_remote_launch(cperf_testmap[opts.test].runner,
ctx[i], lcore_id);
i++;
}
i = 0;
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (i == total_nb_qps)
break;
rte_eal_wait_lcore(lcore_id);
i++;
}
/* Get next size from range or list */
if (opts.inc_buffer_size != 0)
opts.test_buffer_size += opts.inc_buffer_size;
else {
if (++buffer_size_idx == opts.buffer_size_count)
break;
opts.test_buffer_size = opts.buffer_size_list[buffer_size_idx];
}
}
i = 0;
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (i == total_nb_qps)
break;
cperf_testmap[opts.test].destructor(ctx[i]);
i++;
}
for (i = 0; i < nb_cryptodevs &&
i < RTE_CRYPTO_MAX_DEVS; i++)
rte_cryptodev_stop(enabled_cdevs[i]);
free_test_vector(t_vec, &opts);
printf("\n");
return EXIT_SUCCESS;
err:
i = 0;
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (i == total_nb_qps)
break;
cdev_id = enabled_cdevs[i];
if (ctx[i] && cperf_testmap[opts.test].destructor)
cperf_testmap[opts.test].destructor(ctx[i]);
i++;
}
for (i = 0; i < nb_cryptodevs &&
i < RTE_CRYPTO_MAX_DEVS; i++)
rte_cryptodev_stop(enabled_cdevs[i]);
free_test_vector(t_vec, &opts);
printf("\n");
return EXIT_FAILURE;
}

View File

@ -0,0 +1,54 @@
# BSD LICENSE
#
# Copyright(c) 2017 Cavium, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Cavium, Inc nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(RTE_SDK)/mk/rte.vars.mk
APP = dpdk-test-eventdev
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
#
# all source are stored in SRCS-y
#
SRCS-y := evt_main.c
SRCS-y += evt_options.c
SRCS-y += evt_test.c
SRCS-y += parser.c
SRCS-y += test_order_common.c
SRCS-y += test_order_queue.c
SRCS-y += test_order_atq.c
SRCS-y += test_perf_common.c
SRCS-y += test_perf_queue.c
SRCS-y += test_perf_atq.c
include $(RTE_SDK)/mk/rte.app.mk

View File

@ -0,0 +1,135 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _EVT_COMMON_
#define _EVT_COMMON_
#include <rte_common.h>
#include <rte_debug.h>
#include <rte_eventdev.h>
#include <rte_service.h>
#define CLNRM "\x1b[0m"
#define CLRED "\x1b[31m"
#define CLGRN "\x1b[32m"
#define CLYEL "\x1b[33m"
#define evt_err(fmt, args...) \
fprintf(stderr, CLRED"error: %s() "fmt CLNRM "\n", __func__, ## args)
#define evt_info(fmt, args...) \
fprintf(stdout, CLYEL""fmt CLNRM "\n", ## args)
#define EVT_STR_FMT 20
#define evt_dump(str, fmt, val...) \
printf("\t%-*s : "fmt"\n", EVT_STR_FMT, str, ## val)
#define evt_dump_begin(str) printf("\t%-*s : {", EVT_STR_FMT, str)
#define evt_dump_end printf("\b}\n")
#define EVT_MAX_STAGES 64
#define EVT_MAX_PORTS 256
#define EVT_MAX_QUEUES 256
static inline bool
evt_has_distributed_sched(uint8_t dev_id)
{
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(dev_id, &dev_info);
return (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED) ?
true : false;
}
static inline bool
evt_has_burst_mode(uint8_t dev_id)
{
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(dev_id, &dev_info);
return (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE) ?
true : false;
}
static inline bool
evt_has_all_types_queue(uint8_t dev_id)
{
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(dev_id, &dev_info);
return (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES) ?
true : false;
}
static inline int
evt_service_setup(uint8_t dev_id)
{
uint32_t service_id;
int32_t core_cnt;
unsigned int lcore = 0;
uint32_t core_array[RTE_MAX_LCORE];
uint8_t cnt;
uint8_t min_cnt = UINT8_MAX;
if (evt_has_distributed_sched(dev_id))
return 0;
if (!rte_service_lcore_count())
return -ENOENT;
if (!rte_event_dev_service_id_get(dev_id, &service_id)) {
core_cnt = rte_service_lcore_list(core_array,
RTE_MAX_LCORE);
if (core_cnt < 0)
return -ENOENT;
/* Get the core which has least number of services running. */
while (core_cnt--) {
/* Reset default mapping */
rte_service_map_lcore_set(service_id,
core_array[core_cnt], 0);
cnt = rte_service_lcore_count_services(
core_array[core_cnt]);
if (cnt < min_cnt) {
lcore = core_array[core_cnt];
min_cnt = cnt;
}
}
if (rte_service_map_lcore_set(service_id, lcore, 1))
return -ENOENT;
}
return 0;
}
#endif /* _EVT_COMMON_*/

View File

@ -0,0 +1,227 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <rte_atomic.h>
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_eventdev.h>
#include "evt_options.h"
#include "evt_test.h"
struct evt_options opt;
struct evt_test *test;
static void
signal_handler(int signum)
{
if (signum == SIGINT || signum == SIGTERM) {
printf("\nSignal %d received, preparing to exit...\n",
signum);
/* request all lcores to exit from the main loop */
*(int *)test->test_priv = true;
rte_wmb();
rte_eal_mp_wait_lcore();
if (test->ops.eventdev_destroy)
test->ops.eventdev_destroy(test, &opt);
if (test->ops.ethdev_destroy)
test->ops.ethdev_destroy(test, &opt);
if (test->ops.mempool_destroy)
test->ops.mempool_destroy(test, &opt);
if (test->ops.test_destroy)
test->ops.test_destroy(test, &opt);
/* exit with the expected status */
signal(signum, SIG_DFL);
kill(getpid(), signum);
}
}
static inline void
evt_options_dump_all(struct evt_test *test, struct evt_options *opts)
{
evt_options_dump(opts);
if (test->ops.opt_dump)
test->ops.opt_dump(opts);
}
int
main(int argc, char **argv)
{
uint8_t evdevs;
int ret;
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_panic("invalid EAL arguments\n");
argc -= ret;
argv += ret;
evdevs = rte_event_dev_count();
if (!evdevs)
rte_panic("no eventdev devices found\n");
/* Populate the default values of the options */
evt_options_default(&opt);
/* Parse the command line arguments */
ret = evt_options_parse(&opt, argc, argv);
if (ret) {
evt_err("parsing on or more user options failed");
goto error;
}
/* Get struct evt_test *test from name */
test = evt_test_get(opt.test_name);
if (test == NULL) {
evt_err("failed to find requested test: %s", opt.test_name);
goto error;
}
if (test->ops.test_result == NULL) {
evt_err("%s: ops.test_result not found", opt.test_name);
goto error;
}
/* Verify the command line options */
if (opt.dev_id >= rte_event_dev_count()) {
evt_err("invalid event device %d", opt.dev_id);
goto error;
}
if (test->ops.opt_check) {
if (test->ops.opt_check(&opt)) {
evt_err("invalid command line argument");
evt_options_dump_all(test, &opt);
goto error;
}
}
/* Check the eventdev capability before proceeding */
if (test->ops.cap_check) {
if (test->ops.cap_check(&opt) == false) {
evt_info("unsupported test: %s", opt.test_name);
evt_options_dump_all(test, &opt);
ret = EVT_TEST_UNSUPPORTED;
goto nocap;
}
}
/* Dump the options */
if (opt.verbose_level)
evt_options_dump_all(test, &opt);
/* Test specific setup */
if (test->ops.test_setup) {
if (test->ops.test_setup(test, &opt)) {
evt_err("failed to setup test: %s", opt.test_name);
goto error;
}
}
/* Test specific mempool setup */
if (test->ops.mempool_setup) {
if (test->ops.mempool_setup(test, &opt)) {
evt_err("%s: mempool setup failed", opt.test_name);
goto test_destroy;
}
}
/* Test specific ethdev setup */
if (test->ops.ethdev_setup) {
if (test->ops.ethdev_setup(test, &opt)) {
evt_err("%s: ethdev setup failed", opt.test_name);
goto mempool_destroy;
}
}
/* Test specific eventdev setup */
if (test->ops.eventdev_setup) {
if (test->ops.eventdev_setup(test, &opt)) {
evt_err("%s: eventdev setup failed", opt.test_name);
goto ethdev_destroy;
}
}
/* Launch lcores */
if (test->ops.launch_lcores) {
if (test->ops.launch_lcores(test, &opt)) {
evt_err("%s: failed to launch lcores", opt.test_name);
goto eventdev_destroy;
}
}
rte_eal_mp_wait_lcore();
/* Print the test result */
ret = test->ops.test_result(test, &opt);
nocap:
if (ret == EVT_TEST_SUCCESS) {
printf("Result: "CLGRN"%s"CLNRM"\n", "Success");
} else if (ret == EVT_TEST_FAILED) {
printf("Result: "CLRED"%s"CLNRM"\n", "Failed");
return EXIT_FAILURE;
} else if (ret == EVT_TEST_UNSUPPORTED) {
printf("Result: "CLYEL"%s"CLNRM"\n", "Unsupported");
}
return 0;
eventdev_destroy:
if (test->ops.eventdev_destroy)
test->ops.eventdev_destroy(test, &opt);
ethdev_destroy:
if (test->ops.ethdev_destroy)
test->ops.ethdev_destroy(test, &opt);
mempool_destroy:
if (test->ops.mempool_destroy)
test->ops.mempool_destroy(test, &opt);
test_destroy:
if (test->ops.test_destroy)
test->ops.test_destroy(test, &opt);
error:
return EXIT_FAILURE;
}

View File

@ -0,0 +1,331 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <getopt.h>
#include <rte_common.h>
#include <rte_eventdev.h>
#include <rte_lcore.h>
#include "evt_options.h"
#include "evt_test.h"
#include "parser.h"
void
evt_options_default(struct evt_options *opt)
{
memset(opt, 0, sizeof(*opt));
opt->verbose_level = 1; /* Enable minimal prints */
opt->dev_id = 0;
strncpy(opt->test_name, "order_queue", EVT_TEST_NAME_MAX_LEN);
opt->nb_flows = 1024;
opt->socket_id = SOCKET_ID_ANY;
opt->pool_sz = 16 * 1024;
opt->wkr_deq_dep = 16;
opt->nb_pkts = (1ULL << 26); /* do ~64M packets */
}
typedef int (*option_parser_t)(struct evt_options *opt,
const char *arg);
struct long_opt_parser {
const char *lgopt_name;
option_parser_t parser_fn;
};
static int
evt_parse_nb_flows(struct evt_options *opt, const char *arg)
{
int ret;
ret = parser_read_uint32(&(opt->nb_flows), arg);
return ret;
}
static int
evt_parse_dev_id(struct evt_options *opt, const char *arg)
{
int ret;
ret = parser_read_uint8(&(opt->dev_id), arg);
return ret;
}
static int
evt_parse_verbose(struct evt_options *opt, const char *arg __rte_unused)
{
opt->verbose_level = atoi(arg);
return 0;
}
static int
evt_parse_fwd_latency(struct evt_options *opt, const char *arg __rte_unused)
{
opt->fwd_latency = 1;
return 0;
}
static int
evt_parse_queue_priority(struct evt_options *opt, const char *arg __rte_unused)
{
opt->q_priority = 1;
return 0;
}
static int
evt_parse_test_name(struct evt_options *opt, const char *arg)
{
snprintf(opt->test_name, EVT_TEST_NAME_MAX_LEN, "%s", arg);
return 0;
}
static int
evt_parse_socket_id(struct evt_options *opt, const char *arg)
{
opt->socket_id = atoi(arg);
return 0;
}
static int
evt_parse_wkr_deq_dep(struct evt_options *opt, const char *arg)
{
int ret;
ret = parser_read_uint16(&(opt->wkr_deq_dep), arg);
return ret;
}
static int
evt_parse_nb_pkts(struct evt_options *opt, const char *arg)
{
int ret;
ret = parser_read_uint64(&(opt->nb_pkts), arg);
return ret;
}
static int
evt_parse_pool_sz(struct evt_options *opt, const char *arg)
{
opt->pool_sz = atoi(arg);
return 0;
}
static int
evt_parse_plcores(struct evt_options *opt, const char *corelist)
{
int ret;
ret = parse_lcores_list(opt->plcores, corelist);
if (ret == -E2BIG)
evt_err("duplicate lcores in plcores");
return ret;
}
static int
evt_parse_work_lcores(struct evt_options *opt, const char *corelist)
{
int ret;
ret = parse_lcores_list(opt->wlcores, corelist);
if (ret == -E2BIG)
evt_err("duplicate lcores in wlcores");
return ret;
}
static void
usage(char *program)
{
printf("usage : %s [EAL options] -- [application options]\n", program);
printf("application options:\n");
printf("\t--verbose : verbose level\n"
"\t--dev : device id of the event device\n"
"\t--test : name of the test application to run\n"
"\t--socket_id : socket_id of application resources\n"
"\t--pool_sz : pool size of the mempool\n"
"\t--plcores : list of lcore ids for producers\n"
"\t--wlcores : list of lcore ids for workers\n"
"\t--stlist : list of scheduled types of the stages\n"
"\t--nb_flows : number of flows to produce\n"
"\t--nb_pkts : number of packets to produce\n"
"\t--worker_deq_depth : dequeue depth of the worker\n"
"\t--fwd_latency : perform fwd_latency measurement\n"
"\t--queue_priority : enable queue priority\n"
);
printf("available tests:\n");
evt_test_dump_names();
}
static int
evt_parse_sched_type_list(struct evt_options *opt, const char *arg)
{
char c;
int i = 0, j = -1;
for (i = 0; i < EVT_MAX_STAGES; i++)
opt->sched_type_list[i] = (uint8_t)-1;
i = 0;
do {
c = arg[++j];
switch (c) {
case 'o':
case 'O':
opt->sched_type_list[i++] = RTE_SCHED_TYPE_ORDERED;
break;
case 'a':
case 'A':
opt->sched_type_list[i++] = RTE_SCHED_TYPE_ATOMIC;
break;
case 'p':
case 'P':
opt->sched_type_list[i++] = RTE_SCHED_TYPE_PARALLEL;
break;
case ',':
break;
default:
if (c != '\0') {
evt_err("invalid sched_type %c", c);
return -EINVAL;
}
}
} while (c != '\0');
opt->nb_stages = i;
return 0;
}
static struct option lgopts[] = {
{ EVT_NB_FLOWS, 1, 0, 0 },
{ EVT_DEVICE, 1, 0, 0 },
{ EVT_VERBOSE, 1, 0, 0 },
{ EVT_TEST, 1, 0, 0 },
{ EVT_PROD_LCORES, 1, 0, 0 },
{ EVT_WORK_LCORES, 1, 0, 0 },
{ EVT_SOCKET_ID, 1, 0, 0 },
{ EVT_POOL_SZ, 1, 0, 0 },
{ EVT_NB_PKTS, 1, 0, 0 },
{ EVT_WKR_DEQ_DEP, 1, 0, 0 },
{ EVT_SCHED_TYPE_LIST, 1, 0, 0 },
{ EVT_FWD_LATENCY, 0, 0, 0 },
{ EVT_QUEUE_PRIORITY, 0, 0, 0 },
{ EVT_HELP, 0, 0, 0 },
{ NULL, 0, 0, 0 }
};
static int
evt_opts_parse_long(int opt_idx, struct evt_options *opt)
{
unsigned int i;
struct long_opt_parser parsermap[] = {
{ EVT_NB_FLOWS, evt_parse_nb_flows},
{ EVT_DEVICE, evt_parse_dev_id},
{ EVT_VERBOSE, evt_parse_verbose},
{ EVT_TEST, evt_parse_test_name},
{ EVT_PROD_LCORES, evt_parse_plcores},
{ EVT_WORK_LCORES, evt_parse_work_lcores},
{ EVT_SOCKET_ID, evt_parse_socket_id},
{ EVT_POOL_SZ, evt_parse_pool_sz},
{ EVT_NB_PKTS, evt_parse_nb_pkts},
{ EVT_WKR_DEQ_DEP, evt_parse_wkr_deq_dep},
{ EVT_SCHED_TYPE_LIST, evt_parse_sched_type_list},
{ EVT_FWD_LATENCY, evt_parse_fwd_latency},
{ EVT_QUEUE_PRIORITY, evt_parse_queue_priority},
};
for (i = 0; i < RTE_DIM(parsermap); i++) {
if (strncmp(lgopts[opt_idx].name, parsermap[i].lgopt_name,
strlen(parsermap[i].lgopt_name)) == 0)
return parsermap[i].parser_fn(opt, optarg);
}
return -EINVAL;
}
int
evt_options_parse(struct evt_options *opt, int argc, char **argv)
{
int opts, retval, opt_idx;
while ((opts = getopt_long(argc, argv, "", lgopts, &opt_idx)) != EOF) {
switch (opts) {
case 0: /* long options */
if (!strcmp(lgopts[opt_idx].name, "help")) {
usage(argv[0]);
exit(EXIT_SUCCESS);
}
retval = evt_opts_parse_long(opt_idx, opt);
if (retval != 0)
return retval;
break;
default:
return -EINVAL;
}
}
return 0;
}
void
evt_options_dump(struct evt_options *opt)
{
int lcore_id;
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(opt->dev_id, &dev_info);
evt_dump("driver", "%s", dev_info.driver_name);
evt_dump("test", "%s", opt->test_name);
evt_dump("dev", "%d", opt->dev_id);
evt_dump("verbose_level", "%d", opt->verbose_level);
evt_dump("socket_id", "%d", opt->socket_id);
evt_dump("pool_sz", "%d", opt->pool_sz);
evt_dump("master lcore", "%d", rte_get_master_lcore());
evt_dump("nb_pkts", "%"PRIu64, opt->nb_pkts);
evt_dump_begin("available lcores");
RTE_LCORE_FOREACH(lcore_id)
printf("%d ", lcore_id);
evt_dump_end;
evt_dump_nb_flows(opt);
evt_dump_worker_dequeue_depth(opt);
}

View File

@ -0,0 +1,269 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _EVT_OPTIONS_
#define _EVT_OPTIONS_
#include <stdio.h>
#include <stdbool.h>
#include <rte_common.h>
#include <rte_eventdev.h>
#include <rte_lcore.h>
#include "evt_common.h"
#define EVT_BOOL_FMT(x) ((x) ? "true" : "false")
#define EVT_VERBOSE ("verbose")
#define EVT_DEVICE ("dev")
#define EVT_TEST ("test")
#define EVT_PROD_LCORES ("plcores")
#define EVT_WORK_LCORES ("wlcores")
#define EVT_NB_FLOWS ("nb_flows")
#define EVT_SOCKET_ID ("socket_id")
#define EVT_POOL_SZ ("pool_sz")
#define EVT_WKR_DEQ_DEP ("worker_deq_depth")
#define EVT_NB_PKTS ("nb_pkts")
#define EVT_NB_STAGES ("nb_stages")
#define EVT_SCHED_TYPE_LIST ("stlist")
#define EVT_FWD_LATENCY ("fwd_latency")
#define EVT_QUEUE_PRIORITY ("queue_priority")
#define EVT_HELP ("help")
struct evt_options {
#define EVT_TEST_NAME_MAX_LEN 32
char test_name[EVT_TEST_NAME_MAX_LEN];
bool plcores[RTE_MAX_LCORE];
bool wlcores[RTE_MAX_LCORE];
uint8_t sched_type_list[EVT_MAX_STAGES];
uint32_t nb_flows;
int socket_id;
int pool_sz;
int nb_stages;
int verbose_level;
uint64_t nb_pkts;
uint16_t wkr_deq_dep;
uint8_t dev_id;
uint32_t fwd_latency:1;
uint32_t q_priority:1;
};
void evt_options_default(struct evt_options *opt);
int evt_options_parse(struct evt_options *opt, int argc, char **argv);
void evt_options_dump(struct evt_options *opt);
/* options check helpers */
static inline bool
evt_lcores_has_overlap(bool lcores[], int lcore)
{
if (lcores[lcore] == true) {
evt_err("lcore overlaps at %d", lcore);
return true;
}
return false;
}
static inline bool
evt_lcores_has_overlap_multi(bool lcoresx[], bool lcoresy[])
{
int i;
for (i = 0; i < RTE_MAX_LCORE; i++) {
if (lcoresx[i] && lcoresy[i]) {
evt_err("lcores overlaps at %d", i);
return true;
}
}
return false;
}
static inline bool
evt_has_active_lcore(bool lcores[])
{
int i;
for (i = 0; i < RTE_MAX_LCORE; i++)
if (lcores[i])
return true;
return false;
}
static inline int
evt_nr_active_lcores(bool lcores[])
{
int i;
int c = 0;
for (i = 0; i < RTE_MAX_LCORE; i++)
if (lcores[i])
c++;
return c;
}
static inline int
evt_get_first_active_lcore(bool lcores[])
{
int i;
for (i = 0; i < RTE_MAX_LCORE; i++)
if (lcores[i])
return i;
return -1;
}
static inline bool
evt_has_disabled_lcore(bool lcores[])
{
int i;
for (i = 0; i < RTE_MAX_LCORE; i++)
if ((lcores[i] == true) && !(rte_lcore_is_enabled(i)))
return true;
return false;
}
static inline bool
evt_has_invalid_stage(struct evt_options *opt)
{
if (!opt->nb_stages) {
evt_err("need minimum one stage, check --stlist");
return true;
}
if (opt->nb_stages > EVT_MAX_STAGES) {
evt_err("requested changes are beyond EVT_MAX_STAGES=%d",
EVT_MAX_STAGES);
return true;
}
return false;
}
static inline bool
evt_has_invalid_sched_type(struct evt_options *opt)
{
int i;
for (i = 0; i < opt->nb_stages; i++) {
if (opt->sched_type_list[i] > RTE_SCHED_TYPE_PARALLEL) {
evt_err("invalid sched_type %d at %d",
opt->sched_type_list[i], i);
return true;
}
}
return false;
}
/* option dump helpers */
static inline void
evt_dump_worker_lcores(struct evt_options *opt)
{
int c;
evt_dump_begin("worker lcores");
for (c = 0; c < RTE_MAX_LCORE; c++) {
if (opt->wlcores[c])
printf("%d ", c);
}
evt_dump_end;
}
static inline void
evt_dump_producer_lcores(struct evt_options *opt)
{
int c;
evt_dump_begin("producer lcores");
for (c = 0; c < RTE_MAX_LCORE; c++) {
if (opt->plcores[c])
printf("%d ", c);
}
evt_dump_end;
}
static inline void
evt_dump_nb_flows(struct evt_options *opt)
{
evt_dump("nb_flows", "%d", opt->nb_flows);
}
static inline void
evt_dump_worker_dequeue_depth(struct evt_options *opt)
{
evt_dump("worker deq depth", "%d", opt->wkr_deq_dep);
}
static inline void
evt_dump_nb_stages(struct evt_options *opt)
{
evt_dump("nb_stages", "%d", opt->nb_stages);
}
static inline void
evt_dump_fwd_latency(struct evt_options *opt)
{
evt_dump("fwd_latency", "%s", EVT_BOOL_FMT(opt->fwd_latency));
}
static inline void
evt_dump_queue_priority(struct evt_options *opt)
{
evt_dump("queue_priority", "%s", EVT_BOOL_FMT(opt->q_priority));
}
static inline const char*
evt_sched_type_2_str(uint8_t sched_type)
{
if (sched_type == RTE_SCHED_TYPE_ORDERED)
return "O";
else if (sched_type == RTE_SCHED_TYPE_ATOMIC)
return "A";
else if (sched_type == RTE_SCHED_TYPE_PARALLEL)
return "P";
else
return "I";
}
static inline void
evt_dump_sched_type_list(struct evt_options *opt)
{
int i;
evt_dump_begin("sched_type_list");
for (i = 0; i < opt->nb_stages; i++)
printf("%s ", evt_sched_type_2_str(opt->sched_type_list[i]));
evt_dump_end;
}
#endif /* _EVT_OPTIONS_ */

View File

@ -0,0 +1,70 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc. 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/queue.h>
#include "evt_test.h"
static STAILQ_HEAD(, evt_test_entry) head = STAILQ_HEAD_INITIALIZER(head);
void
evt_test_register(struct evt_test_entry *entry)
{
STAILQ_INSERT_TAIL(&head, entry, next);
}
struct evt_test*
evt_test_get(const char *name)
{
struct evt_test_entry *entry;
if (!name)
return NULL;
STAILQ_FOREACH(entry, &head, next)
if (!strncmp(entry->test.name, name, strlen(name)))
return &entry->test;
return NULL;
}
void
evt_test_dump_names(void)
{
struct evt_test_entry *entry;
STAILQ_FOREACH(entry, &head, next)
if (entry->test.name)
printf("\t %s\n", entry->test.name);
}

View File

@ -0,0 +1,125 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _EVT_TEST_
#define _EVT_TEST_
#include <string.h>
#include <stdbool.h>
#include <sys/queue.h>
#include <rte_eal.h>
enum evt_test_result {
EVT_TEST_SUCCESS,
EVT_TEST_FAILED,
EVT_TEST_UNSUPPORTED,
};
struct evt_test;
struct evt_options;
typedef bool (*evt_test_capability_check_t)(struct evt_options *opt);
typedef int (*evt_test_options_check_t)(struct evt_options *opt);
typedef void (*evt_test_options_dump_t)(struct evt_options *opt);
typedef int (*evt_test_setup_t)
(struct evt_test *test, struct evt_options *opt);
typedef int (*evt_test_mempool_setup_t)
(struct evt_test *test, struct evt_options *opt);
typedef int (*evt_test_ethdev_setup_t)
(struct evt_test *test, struct evt_options *opt);
typedef int (*evt_test_eventdev_setup_t)
(struct evt_test *test, struct evt_options *opt);
typedef int (*evt_test_launch_lcores_t)
(struct evt_test *test, struct evt_options *opt);
typedef int (*evt_test_result_t)
(struct evt_test *test, struct evt_options *opt);
typedef void (*evt_test_eventdev_destroy_t)
(struct evt_test *test, struct evt_options *opt);
typedef void (*evt_test_ethdev_destroy_t)
(struct evt_test *test, struct evt_options *opt);
typedef void (*evt_test_mempool_destroy_t)
(struct evt_test *test, struct evt_options *opt);
typedef void (*evt_test_destroy_t)
(struct evt_test *test, struct evt_options *opt);
struct evt_test_ops {
evt_test_capability_check_t cap_check;
evt_test_options_check_t opt_check;
evt_test_options_dump_t opt_dump;
evt_test_setup_t test_setup;
evt_test_mempool_setup_t mempool_setup;
evt_test_ethdev_setup_t ethdev_setup;
evt_test_eventdev_setup_t eventdev_setup;
evt_test_launch_lcores_t launch_lcores;
evt_test_result_t test_result;
evt_test_eventdev_destroy_t eventdev_destroy;
evt_test_ethdev_destroy_t ethdev_destroy;
evt_test_mempool_destroy_t mempool_destroy;
evt_test_destroy_t test_destroy;
};
struct evt_test {
const char *name;
void *test_priv;
struct evt_test_ops ops;
};
struct evt_test_entry {
struct evt_test test;
STAILQ_ENTRY(evt_test_entry) next;
};
void evt_test_register(struct evt_test_entry *test);
void evt_test_dump_names(void);
#define EVT_TEST_REGISTER(nm) \
static struct evt_test_entry _evt_test_entry_ ##nm; \
RTE_INIT(evt_test_ ##nm); \
static void evt_test_ ##nm(void) \
{ \
_evt_test_entry_ ##nm.test.name = RTE_STR(nm);\
memcpy(&_evt_test_entry_ ##nm.test.ops, &nm, \
sizeof(struct evt_test_ops)); \
evt_test_register(&_evt_test_entry_ ##nm); \
}
struct evt_test *evt_test_get(const char *name);
static inline void *
evt_test_priv(struct evt_test *test)
{
return test->test_priv;
}
#endif /* _EVT_TEST_ */

View File

@ -0,0 +1,388 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2016 Intel Corporation. All rights reserved.
* Copyright(c) 2017 Cavium, Inc. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <getopt.h>
#include <errno.h>
#include <stdarg.h>
#include <string.h>
#include <libgen.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdbool.h>
#include <rte_errno.h>
#include <rte_string_fns.h>
#include "parser.h"
static uint32_t
get_hex_val(char c)
{
switch (c) {
case '0': case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
return c - '0';
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
return c - 'A' + 10;
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
return c - 'a' + 10;
default:
return 0;
}
}
int
parser_read_arg_bool(const char *p)
{
p = skip_white_spaces(p);
int result = -EINVAL;
if (((p[0] == 'y') && (p[1] == 'e') && (p[2] == 's')) ||
((p[0] == 'Y') && (p[1] == 'E') && (p[2] == 'S'))) {
p += 3;
result = 1;
}
if (((p[0] == 'o') && (p[1] == 'n')) ||
((p[0] == 'O') && (p[1] == 'N'))) {
p += 2;
result = 1;
}
if (((p[0] == 'n') && (p[1] == 'o')) ||
((p[0] == 'N') && (p[1] == 'O'))) {
p += 2;
result = 0;
}
if (((p[0] == 'o') && (p[1] == 'f') && (p[2] == 'f')) ||
((p[0] == 'O') && (p[1] == 'F') && (p[2] == 'F'))) {
p += 3;
result = 0;
}
p = skip_white_spaces(p);
if (p[0] != '\0')
return -EINVAL;
return result;
}
int
parser_read_uint64(uint64_t *value, const char *p)
{
char *next;
uint64_t val;
p = skip_white_spaces(p);
if (!isdigit(*p))
return -EINVAL;
val = strtoul(p, &next, 10);
if (p == next)
return -EINVAL;
p = next;
switch (*p) {
case 'T':
val *= 1024ULL;
/* fall through */
case 'G':
val *= 1024ULL;
/* fall through */
case 'M':
val *= 1024ULL;
/* fall through */
case 'k':
case 'K':
val *= 1024ULL;
p++;
break;
}
p = skip_white_spaces(p);
if (*p != '\0')
return -EINVAL;
*value = val;
return 0;
}
int
parser_read_int32(int32_t *value, const char *p)
{
char *next;
int32_t val;
p = skip_white_spaces(p);
if (!isdigit(*p))
return -EINVAL;
val = strtol(p, &next, 10);
if (p == next)
return -EINVAL;
*value = val;
return 0;
}
int
parser_read_uint64_hex(uint64_t *value, const char *p)
{
char *next;
uint64_t val;
p = skip_white_spaces(p);
val = strtoul(p, &next, 16);
if (p == next)
return -EINVAL;
p = skip_white_spaces(next);
if (*p != '\0')
return -EINVAL;
*value = val;
return 0;
}
int
parser_read_uint32(uint32_t *value, const char *p)
{
uint64_t val = 0;
int ret = parser_read_uint64(&val, p);
if (ret < 0)
return ret;
if (val > UINT32_MAX)
return -ERANGE;
*value = val;
return 0;
}
int
parser_read_uint32_hex(uint32_t *value, const char *p)
{
uint64_t val = 0;
int ret = parser_read_uint64_hex(&val, p);
if (ret < 0)
return ret;
if (val > UINT32_MAX)
return -ERANGE;
*value = val;
return 0;
}
int
parser_read_uint16(uint16_t *value, const char *p)
{
uint64_t val = 0;
int ret = parser_read_uint64(&val, p);
if (ret < 0)
return ret;
if (val > UINT16_MAX)
return -ERANGE;
*value = val;
return 0;
}
int
parser_read_uint16_hex(uint16_t *value, const char *p)
{
uint64_t val = 0;
int ret = parser_read_uint64_hex(&val, p);
if (ret < 0)
return ret;
if (val > UINT16_MAX)
return -ERANGE;
*value = val;
return 0;
}
int
parser_read_uint8(uint8_t *value, const char *p)
{
uint64_t val = 0;
int ret = parser_read_uint64(&val, p);
if (ret < 0)
return ret;
if (val > UINT8_MAX)
return -ERANGE;
*value = val;
return 0;
}
int
parser_read_uint8_hex(uint8_t *value, const char *p)
{
uint64_t val = 0;
int ret = parser_read_uint64_hex(&val, p);
if (ret < 0)
return ret;
if (val > UINT8_MAX)
return -ERANGE;
*value = val;
return 0;
}
int
parse_tokenize_string(char *string, char *tokens[], uint32_t *n_tokens)
{
uint32_t i;
if ((string == NULL) ||
(tokens == NULL) ||
(*n_tokens < 1))
return -EINVAL;
for (i = 0; i < *n_tokens; i++) {
tokens[i] = strtok_r(string, PARSE_DELIMITER, &string);
if (tokens[i] == NULL)
break;
}
if ((i == *n_tokens) &&
(strtok_r(string, PARSE_DELIMITER, &string) != NULL))
return -E2BIG;
*n_tokens = i;
return 0;
}
int
parse_hex_string(char *src, uint8_t *dst, uint32_t *size)
{
char *c;
uint32_t len, i;
/* Check input parameters */
if ((src == NULL) ||
(dst == NULL) ||
(size == NULL) ||
(*size == 0))
return -1;
len = strlen(src);
if (((len & 3) != 0) ||
(len > (*size) * 2))
return -1;
*size = len / 2;
for (c = src; *c != 0; c++) {
if ((((*c) >= '0') && ((*c) <= '9')) ||
(((*c) >= 'A') && ((*c) <= 'F')) ||
(((*c) >= 'a') && ((*c) <= 'f')))
continue;
return -1;
}
/* Convert chars to bytes */
for (i = 0; i < *size; i++)
dst[i] = get_hex_val(src[2 * i]) * 16 +
get_hex_val(src[2 * i + 1]);
return 0;
}
int
parse_lcores_list(bool lcores[], const char *corelist)
{
int i, idx = 0;
int min, max;
char *end = NULL;
if (corelist == NULL)
return -1;
while (isblank(*corelist))
corelist++;
i = strlen(corelist);
while ((i > 0) && isblank(corelist[i - 1]))
i--;
/* Get list of lcores */
min = RTE_MAX_LCORE;
do {
while (isblank(*corelist))
corelist++;
if (*corelist == '\0')
return -1;
idx = strtoul(corelist, &end, 10);
if (end == NULL)
return -1;
while (isblank(*end))
end++;
if (*end == '-') {
min = idx;
} else if ((*end == ',') || (*end == '\0')) {
max = idx;
if (min == RTE_MAX_LCORE)
min = idx;
for (idx = min; idx <= max; idx++) {
if (lcores[idx] == 1)
return -E2BIG;
lcores[idx] = 1;
}
min = RTE_MAX_LCORE;
} else
return -1;
corelist = end + 1;
} while (*end != '\0');
return 0;
}

View File

@ -0,0 +1,79 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __INCLUDE_PARSER_H__
#define __INCLUDE_PARSER_H__
#include <stdint.h>
#define PARSE_DELIMITER " \f\n\r\t\v"
#define skip_white_spaces(pos) \
({ \
__typeof__(pos) _p = (pos); \
for ( ; isspace(*_p); _p++) \
; \
_p; \
})
static inline size_t
skip_digits(const char *src)
{
size_t i;
for (i = 0; isdigit(src[i]); i++)
;
return i;
}
int parser_read_arg_bool(const char *p);
int parser_read_uint64(uint64_t *value, const char *p);
int parser_read_uint32(uint32_t *value, const char *p);
int parser_read_uint16(uint16_t *value, const char *p);
int parser_read_uint8(uint8_t *value, const char *p);
int parser_read_uint64_hex(uint64_t *value, const char *p);
int parser_read_uint32_hex(uint32_t *value, const char *p);
int parser_read_uint16_hex(uint16_t *value, const char *p);
int parser_read_uint8_hex(uint8_t *value, const char *p);
int parser_read_int32(int32_t *value, const char *p);
int parse_hex_string(char *src, uint8_t *dst, uint32_t *size);
int parse_tokenize_string(char *string, char *tokens[], uint32_t *n_tokens);
int parse_lcores_list(bool lcores[], const char *corelist);
#endif

View File

@ -0,0 +1,238 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include "test_order_common.h"
/* See http://dpdk.org/doc/guides/tools/testeventdev.html for test details */
static inline __attribute__((always_inline)) void
order_atq_process_stage_0(struct rte_event *const ev)
{
ev->sub_event_type = 1; /* move to stage 1 (atomic) on the same queue */
ev->op = RTE_EVENT_OP_FORWARD;
ev->sched_type = RTE_SCHED_TYPE_ATOMIC;
ev->event_type = RTE_EVENT_TYPE_CPU;
}
static int
order_atq_worker(void *arg)
{
ORDER_WORKER_INIT;
struct rte_event ev;
while (t->err == false) {
uint16_t event = rte_event_dequeue_burst(dev_id, port,
&ev, 1, 0);
if (!event) {
if (rte_atomic64_read(outstand_pkts) <= 0)
break;
rte_pause();
continue;
}
if (ev.sub_event_type == 0) { /* stage 0 from producer */
order_atq_process_stage_0(&ev);
while (rte_event_enqueue_burst(dev_id, port, &ev, 1)
!= 1)
rte_pause();
} else if (ev.sub_event_type == 1) { /* stage 1 */
order_process_stage_1(t, &ev, nb_flows,
expected_flow_seq, outstand_pkts);
} else {
order_process_stage_invalid(t, &ev);
}
}
return 0;
}
static int
order_atq_worker_burst(void *arg)
{
ORDER_WORKER_INIT;
struct rte_event ev[BURST_SIZE];
uint16_t i;
while (t->err == false) {
uint16_t const nb_rx = rte_event_dequeue_burst(dev_id, port, ev,
BURST_SIZE, 0);
if (nb_rx == 0) {
if (rte_atomic64_read(outstand_pkts) <= 0)
break;
rte_pause();
continue;
}
for (i = 0; i < nb_rx; i++) {
if (ev[i].sub_event_type == 0) { /*stage 0 */
order_atq_process_stage_0(&ev[i]);
} else if (ev[i].sub_event_type == 1) { /* stage 1 */
order_process_stage_1(t, &ev[i], nb_flows,
expected_flow_seq, outstand_pkts);
ev[i].op = RTE_EVENT_OP_RELEASE;
} else {
order_process_stage_invalid(t, &ev[i]);
}
}
uint16_t enq;
enq = rte_event_enqueue_burst(dev_id, port, ev, nb_rx);
while (enq < nb_rx) {
enq += rte_event_enqueue_burst(dev_id, port,
ev + enq, nb_rx - enq);
}
}
return 0;
}
static int
worker_wrapper(void *arg)
{
struct worker_data *w = arg;
const bool burst = evt_has_burst_mode(w->dev_id);
if (burst)
return order_atq_worker_burst(arg);
else
return order_atq_worker(arg);
}
static int
order_atq_launch_lcores(struct evt_test *test, struct evt_options *opt)
{
return order_launch_lcores(test, opt, worker_wrapper);
}
#define NB_QUEUES 1
static int
order_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
{
int ret;
const uint8_t nb_workers = evt_nr_active_lcores(opt->wlcores);
/* number of active worker cores + 1 producer */
const uint8_t nb_ports = nb_workers + 1;
const struct rte_event_dev_config config = {
.nb_event_queues = NB_QUEUES,/* one all types queue */
.nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
.nb_event_port_enqueue_depth = 128,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
if (ret) {
evt_err("failed to configure eventdev %d", opt->dev_id);
return ret;
}
/* q0 all types queue configuration */
struct rte_event_queue_conf q0_conf = {
.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ALL_TYPES,
.nb_atomic_flows = opt->nb_flows,
.nb_atomic_order_sequences = opt->nb_flows,
};
ret = rte_event_queue_setup(opt->dev_id, 0, &q0_conf);
if (ret) {
evt_err("failed to setup queue0 eventdev %d", opt->dev_id);
return ret;
}
/* setup one port per worker, linking to all queues */
ret = order_event_dev_port_setup(test, opt, nb_workers, NB_QUEUES);
if (ret)
return ret;
ret = evt_service_setup(opt->dev_id);
if (ret) {
evt_err("No service lcore found to run event dev.");
return ret;
}
ret = rte_event_dev_start(opt->dev_id);
if (ret) {
evt_err("failed to start eventdev %d", opt->dev_id);
return ret;
}
return 0;
}
static void
order_atq_opt_dump(struct evt_options *opt)
{
order_opt_dump(opt);
evt_dump("nb_evdev_queues", "%d", NB_QUEUES);
}
static bool
order_atq_capability_check(struct evt_options *opt)
{
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(opt->dev_id, &dev_info);
if (dev_info.max_event_queues < NB_QUEUES || dev_info.max_event_ports <
order_nb_event_ports(opt)) {
evt_err("not enough eventdev queues=%d/%d or ports=%d/%d",
NB_QUEUES, dev_info.max_event_queues,
order_nb_event_ports(opt), dev_info.max_event_ports);
return false;
}
if (!evt_has_all_types_queue(opt->dev_id))
return false;
return true;
}
static const struct evt_test_ops order_atq = {
.cap_check = order_atq_capability_check,
.opt_check = order_opt_check,
.opt_dump = order_atq_opt_dump,
.test_setup = order_test_setup,
.mempool_setup = order_mempool_setup,
.eventdev_setup = order_atq_eventdev_setup,
.launch_lcores = order_atq_launch_lcores,
.eventdev_destroy = order_eventdev_destroy,
.mempool_destroy = order_mempool_destroy,
.test_result = order_test_result,
.test_destroy = order_test_destroy,
};
EVT_TEST_REGISTER(order_atq);

View File

@ -0,0 +1,377 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test_order_common.h"
int
order_test_result(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(opt);
struct test_order *t = evt_test_priv(test);
return t->result;
}
static inline int
order_producer(void *arg)
{
struct prod_data *p = arg;
struct test_order *t = p->t;
struct evt_options *opt = t->opt;
const uint8_t dev_id = p->dev_id;
const uint8_t port = p->port_id;
struct rte_mempool *pool = t->pool;
const uint64_t nb_pkts = t->nb_pkts;
uint32_t *producer_flow_seq = t->producer_flow_seq;
const uint32_t nb_flows = t->nb_flows;
uint64_t count = 0;
struct rte_mbuf *m;
struct rte_event ev;
if (opt->verbose_level > 1)
printf("%s(): lcore %d dev_id %d port=%d queue=%d\n",
__func__, rte_lcore_id(), dev_id, port, p->queue_id);
ev.event = 0;
ev.op = RTE_EVENT_OP_NEW;
ev.queue_id = p->queue_id;
ev.sched_type = RTE_SCHED_TYPE_ORDERED;
ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
ev.event_type = RTE_EVENT_TYPE_CPU;
ev.sub_event_type = 0; /* stage 0 */
while (count < nb_pkts && t->err == false) {
m = rte_pktmbuf_alloc(pool);
if (m == NULL)
continue;
const uint32_t flow = (uintptr_t)m % nb_flows;
/* Maintain seq number per flow */
m->seqn = producer_flow_seq[flow]++;
ev.flow_id = flow;
ev.mbuf = m;
while (rte_event_enqueue_burst(dev_id, port, &ev, 1) != 1) {
if (t->err)
break;
rte_pause();
}
count++;
}
return 0;
}
int
order_opt_check(struct evt_options *opt)
{
/* 1 producer + N workers + 1 master */
if (rte_lcore_count() < 3) {
evt_err("test need minimum 3 lcores");
return -1;
}
/* Validate worker lcores */
if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
evt_err("worker lcores overlaps with master lcore");
return -1;
}
if (evt_nr_active_lcores(opt->plcores) == 0) {
evt_err("missing the producer lcore");
return -1;
}
if (evt_nr_active_lcores(opt->plcores) != 1) {
evt_err("only one producer lcore must be selected");
return -1;
}
int plcore = evt_get_first_active_lcore(opt->plcores);
if (plcore < 0) {
evt_err("failed to find active producer");
return plcore;
}
if (evt_lcores_has_overlap(opt->wlcores, plcore)) {
evt_err("worker lcores overlaps producer lcore");
return -1;
}
if (evt_has_disabled_lcore(opt->wlcores)) {
evt_err("one or more workers lcores are not enabled");
return -1;
}
if (!evt_has_active_lcore(opt->wlcores)) {
evt_err("minimum one worker is required");
return -1;
}
/* Validate producer lcore */
if (plcore == (int)rte_get_master_lcore()) {
evt_err("producer lcore and master lcore should be different");
return -1;
}
if (!rte_lcore_is_enabled(plcore)) {
evt_err("producer lcore is not enabled");
return -1;
}
/* Fixups */
if (opt->nb_pkts == 0)
opt->nb_pkts = INT64_MAX;
return 0;
}
int
order_test_setup(struct evt_test *test, struct evt_options *opt)
{
void *test_order;
test_order = rte_zmalloc_socket(test->name, sizeof(struct test_order),
RTE_CACHE_LINE_SIZE, opt->socket_id);
if (test_order == NULL) {
evt_err("failed to allocate test_order memory");
goto nomem;
}
test->test_priv = test_order;
struct test_order *t = evt_test_priv(test);
t->producer_flow_seq = rte_zmalloc_socket("test_producer_flow_seq",
sizeof(*t->producer_flow_seq) * opt->nb_flows,
RTE_CACHE_LINE_SIZE, opt->socket_id);
if (t->producer_flow_seq == NULL) {
evt_err("failed to allocate t->producer_flow_seq memory");
goto prod_nomem;
}
t->expected_flow_seq = rte_zmalloc_socket("test_expected_flow_seq",
sizeof(*t->expected_flow_seq) * opt->nb_flows,
RTE_CACHE_LINE_SIZE, opt->socket_id);
if (t->expected_flow_seq == NULL) {
evt_err("failed to allocate t->expected_flow_seq memory");
goto exp_nomem;
}
rte_atomic64_set(&t->outstand_pkts, opt->nb_pkts);
t->err = false;
t->nb_pkts = opt->nb_pkts;
t->nb_flows = opt->nb_flows;
t->result = EVT_TEST_FAILED;
t->opt = opt;
return 0;
exp_nomem:
rte_free(t->producer_flow_seq);
prod_nomem:
rte_free(test->test_priv);
nomem:
return -ENOMEM;
}
void
order_test_destroy(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(opt);
struct test_order *t = evt_test_priv(test);
rte_free(t->expected_flow_seq);
rte_free(t->producer_flow_seq);
rte_free(test->test_priv);
}
int
order_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
struct test_order *t = evt_test_priv(test);
t->pool = rte_pktmbuf_pool_create(test->name, opt->pool_sz,
256 /* Cache */, 0,
512, /* Use very small mbufs */
opt->socket_id);
if (t->pool == NULL) {
evt_err("failed to create mempool");
return -ENOMEM;
}
return 0;
}
void
order_mempool_destroy(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(opt);
struct test_order *t = evt_test_priv(test);
rte_mempool_free(t->pool);
}
void
order_eventdev_destroy(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(test);
rte_event_dev_stop(opt->dev_id);
rte_event_dev_close(opt->dev_id);
}
void
order_opt_dump(struct evt_options *opt)
{
evt_dump_producer_lcores(opt);
evt_dump("nb_wrker_lcores", "%d", evt_nr_active_lcores(opt->wlcores));
evt_dump_worker_lcores(opt);
evt_dump("nb_evdev_ports", "%d", order_nb_event_ports(opt));
}
int
order_launch_lcores(struct evt_test *test, struct evt_options *opt,
int (*worker)(void *))
{
int ret, lcore_id;
struct test_order *t = evt_test_priv(test);
int wkr_idx = 0;
/* launch workers */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
ret = rte_eal_remote_launch(worker, &t->worker[wkr_idx],
lcore_id);
if (ret) {
evt_err("failed to launch worker %d", lcore_id);
return ret;
}
wkr_idx++;
}
/* launch producer */
int plcore = evt_get_first_active_lcore(opt->plcores);
ret = rte_eal_remote_launch(order_producer, &t->prod, plcore);
if (ret) {
evt_err("failed to launch order_producer %d", plcore);
return ret;
}
uint64_t cycles = rte_get_timer_cycles();
int64_t old_remaining = -1;
while (t->err == false) {
uint64_t new_cycles = rte_get_timer_cycles();
int64_t remaining = rte_atomic64_read(&t->outstand_pkts);
if (remaining <= 0) {
t->result = EVT_TEST_SUCCESS;
break;
}
if (new_cycles - cycles > rte_get_timer_hz() * 1) {
printf(CLGRN"\r%"PRId64""CLNRM, remaining);
fflush(stdout);
if (old_remaining == remaining) {
rte_event_dev_dump(opt->dev_id, stdout);
evt_err("No schedules for seconds, deadlock");
t->err = true;
rte_smp_wmb();
break;
}
old_remaining = remaining;
cycles = new_cycles;
}
}
printf("\r");
return 0;
}
int
order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t nb_workers, uint8_t nb_queues)
{
int ret;
uint8_t port;
struct test_order *t = evt_test_priv(test);
/* port configuration */
const struct rte_event_port_conf wkr_p_conf = {
.dequeue_depth = opt->wkr_deq_dep,
.enqueue_depth = 64,
.new_event_threshold = 4096,
};
/* setup one port per worker, linking to all queues */
for (port = 0; port < nb_workers; port++) {
struct worker_data *w = &t->worker[port];
w->dev_id = opt->dev_id;
w->port_id = port;
w->t = t;
ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf);
if (ret) {
evt_err("failed to setup port %d", port);
return ret;
}
ret = rte_event_port_link(opt->dev_id, port, NULL, NULL, 0);
if (ret != nb_queues) {
evt_err("failed to link all queues to port %d", port);
return -EINVAL;
}
}
/* port for producer, no links */
const struct rte_event_port_conf prod_conf = {
.dequeue_depth = 8,
.enqueue_depth = 32,
.new_event_threshold = 1200,
};
struct prod_data *p = &t->prod;
p->dev_id = opt->dev_id;
p->port_id = port; /* last port */
p->queue_id = 0;
p->t = t;
ret = rte_event_port_setup(opt->dev_id, port, &prod_conf);
if (ret) {
evt_err("failed to setup producer port %d", port);
return ret;
}
return ret;
}

View File

@ -0,0 +1,153 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _TEST_ORDER_COMMON_
#define _TEST_ORDER_COMMON_
#include <stdio.h>
#include <stdbool.h>
#include <rte_cycles.h>
#include <rte_eventdev.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include "evt_common.h"
#include "evt_options.h"
#include "evt_test.h"
#define BURST_SIZE 16
struct test_order;
struct worker_data {
uint8_t dev_id;
uint8_t port_id;
struct test_order *t;
};
struct prod_data {
uint8_t dev_id;
uint8_t port_id;
uint8_t queue_id;
struct test_order *t;
};
struct test_order {
/* Don't change the offset of "err". Signal handler use this memory
* to terminate all lcores work.
*/
int err;
/*
* The atomic_* is an expensive operation,Since it is a functional test,
* We are using the atomic_ operation to reduce the code complexity.
*/
rte_atomic64_t outstand_pkts;
enum evt_test_result result;
uint32_t nb_flows;
uint64_t nb_pkts;
struct rte_mempool *pool;
struct prod_data prod;
struct worker_data worker[EVT_MAX_PORTS];
uint32_t *producer_flow_seq;
uint32_t *expected_flow_seq;
struct evt_options *opt;
} __rte_cache_aligned;
static inline int
order_nb_event_ports(struct evt_options *opt)
{
return evt_nr_active_lcores(opt->wlcores) + 1 /* producer */;
}
static inline __attribute__((always_inline)) void
order_process_stage_1(struct test_order *const t,
struct rte_event *const ev, const uint32_t nb_flows,
uint32_t *const expected_flow_seq,
rte_atomic64_t *const outstand_pkts)
{
const uint32_t flow = (uintptr_t)ev->mbuf % nb_flows;
/* compare the seqn against expected value */
if (ev->mbuf->seqn != expected_flow_seq[flow]) {
evt_err("flow=%x seqn mismatch got=%x expected=%x",
flow, ev->mbuf->seqn, expected_flow_seq[flow]);
t->err = true;
rte_smp_wmb();
}
/*
* Events from an atomic flow of an event queue can be scheduled only to
* a single port at a time. The port is guaranteed to have exclusive
* (atomic) access for given atomic flow.So we don't need to update
* expected_flow_seq in critical section.
*/
expected_flow_seq[flow]++;
rte_pktmbuf_free(ev->mbuf);
rte_atomic64_sub(outstand_pkts, 1);
}
static inline __attribute__((always_inline)) void
order_process_stage_invalid(struct test_order *const t,
struct rte_event *const ev)
{
evt_err("invalid queue %d", ev->queue_id);
t->err = true;
rte_smp_wmb();
}
#define ORDER_WORKER_INIT\
struct worker_data *w = arg;\
struct test_order *t = w->t;\
struct evt_options *opt = t->opt;\
const uint8_t dev_id = w->dev_id;\
const uint8_t port = w->port_id;\
const uint32_t nb_flows = t->nb_flows;\
uint32_t *expected_flow_seq = t->expected_flow_seq;\
rte_atomic64_t *outstand_pkts = &t->outstand_pkts;\
if (opt->verbose_level > 1)\
printf("%s(): lcore %d dev_id %d port=%d\n",\
__func__, rte_lcore_id(), dev_id, port)
int order_test_result(struct evt_test *test, struct evt_options *opt);
int order_opt_check(struct evt_options *opt);
int order_test_setup(struct evt_test *test, struct evt_options *opt);
int order_mempool_setup(struct evt_test *test, struct evt_options *opt);
int order_launch_lcores(struct evt_test *test, struct evt_options *opt,
int (*worker)(void *));
int order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t nb_workers, uint8_t nb_queues);
void order_test_destroy(struct evt_test *test, struct evt_options *opt);
void order_opt_dump(struct evt_options *opt);
void order_mempool_destroy(struct evt_test *test, struct evt_options *opt);
void order_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
#endif /* _TEST_ORDER_COMMON_ */

View File

@ -0,0 +1,248 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include "test_order_common.h"
/* See http://dpdk.org/doc/guides/tools/testeventdev.html for test details */
static inline __attribute__((always_inline)) void
order_queue_process_stage_0(struct rte_event *const ev)
{
ev->queue_id = 1; /* q1 atomic queue */
ev->op = RTE_EVENT_OP_FORWARD;
ev->sched_type = RTE_SCHED_TYPE_ATOMIC;
ev->event_type = RTE_EVENT_TYPE_CPU;
}
static int
order_queue_worker(void *arg)
{
ORDER_WORKER_INIT;
struct rte_event ev;
while (t->err == false) {
uint16_t event = rte_event_dequeue_burst(dev_id, port,
&ev, 1, 0);
if (!event) {
if (rte_atomic64_read(outstand_pkts) <= 0)
break;
rte_pause();
continue;
}
if (ev.queue_id == 0) { /* from ordered queue */
order_queue_process_stage_0(&ev);
while (rte_event_enqueue_burst(dev_id, port, &ev, 1)
!= 1)
rte_pause();
} else if (ev.queue_id == 1) { /* from atomic queue */
order_process_stage_1(t, &ev, nb_flows,
expected_flow_seq, outstand_pkts);
} else {
order_process_stage_invalid(t, &ev);
}
}
return 0;
}
static int
order_queue_worker_burst(void *arg)
{
ORDER_WORKER_INIT;
struct rte_event ev[BURST_SIZE];
uint16_t i;
while (t->err == false) {
uint16_t const nb_rx = rte_event_dequeue_burst(dev_id, port, ev,
BURST_SIZE, 0);
if (nb_rx == 0) {
if (rte_atomic64_read(outstand_pkts) <= 0)
break;
rte_pause();
continue;
}
for (i = 0; i < nb_rx; i++) {
if (ev[i].queue_id == 0) { /* from ordered queue */
order_queue_process_stage_0(&ev[i]);
} else if (ev[i].queue_id == 1) {/* from atomic queue */
order_process_stage_1(t, &ev[i], nb_flows,
expected_flow_seq, outstand_pkts);
ev[i].op = RTE_EVENT_OP_RELEASE;
} else {
order_process_stage_invalid(t, &ev[i]);
}
}
uint16_t enq;
enq = rte_event_enqueue_burst(dev_id, port, ev, nb_rx);
while (enq < nb_rx) {
enq += rte_event_enqueue_burst(dev_id, port,
ev + enq, nb_rx - enq);
}
}
return 0;
}
static int
worker_wrapper(void *arg)
{
struct worker_data *w = arg;
const bool burst = evt_has_burst_mode(w->dev_id);
if (burst)
return order_queue_worker_burst(arg);
else
return order_queue_worker(arg);
}
static int
order_queue_launch_lcores(struct evt_test *test, struct evt_options *opt)
{
return order_launch_lcores(test, opt, worker_wrapper);
}
#define NB_QUEUES 2
static int
order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
{
int ret;
const uint8_t nb_workers = evt_nr_active_lcores(opt->wlcores);
/* number of active worker cores + 1 producer */
const uint8_t nb_ports = nb_workers + 1;
const struct rte_event_dev_config config = {
.nb_event_queues = NB_QUEUES,/* q0 ordered, q1 atomic */
.nb_event_ports = nb_ports,
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
.nb_event_port_enqueue_depth = 128,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
if (ret) {
evt_err("failed to configure eventdev %d", opt->dev_id);
return ret;
}
/* q0 (ordered queue) configuration */
struct rte_event_queue_conf q0_ordered_conf = {
.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
.schedule_type = RTE_SCHED_TYPE_ORDERED,
.nb_atomic_flows = opt->nb_flows,
.nb_atomic_order_sequences = opt->nb_flows,
};
ret = rte_event_queue_setup(opt->dev_id, 0, &q0_ordered_conf);
if (ret) {
evt_err("failed to setup queue0 eventdev %d", opt->dev_id);
return ret;
}
/* q1 (atomic queue) configuration */
struct rte_event_queue_conf q1_atomic_conf = {
.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
.schedule_type = RTE_SCHED_TYPE_ATOMIC,
.nb_atomic_flows = opt->nb_flows,
.nb_atomic_order_sequences = opt->nb_flows,
};
ret = rte_event_queue_setup(opt->dev_id, 1, &q1_atomic_conf);
if (ret) {
evt_err("failed to setup queue1 eventdev %d", opt->dev_id);
return ret;
}
/* setup one port per worker, linking to all queues */
ret = order_event_dev_port_setup(test, opt, nb_workers, NB_QUEUES);
if (ret)
return ret;
ret = evt_service_setup(opt->dev_id);
if (ret) {
evt_err("No service lcore found to run event dev.");
return ret;
}
ret = rte_event_dev_start(opt->dev_id);
if (ret) {
evt_err("failed to start eventdev %d", opt->dev_id);
return ret;
}
return 0;
}
static void
order_queue_opt_dump(struct evt_options *opt)
{
order_opt_dump(opt);
evt_dump("nb_evdev_queues", "%d", NB_QUEUES);
}
static bool
order_queue_capability_check(struct evt_options *opt)
{
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(opt->dev_id, &dev_info);
if (dev_info.max_event_queues < NB_QUEUES || dev_info.max_event_ports <
order_nb_event_ports(opt)) {
evt_err("not enough eventdev queues=%d/%d or ports=%d/%d",
NB_QUEUES, dev_info.max_event_queues,
order_nb_event_ports(opt), dev_info.max_event_ports);
return false;
}
return true;
}
static const struct evt_test_ops order_queue = {
.cap_check = order_queue_capability_check,
.opt_check = order_opt_check,
.opt_dump = order_queue_opt_dump,
.test_setup = order_test_setup,
.mempool_setup = order_mempool_setup,
.eventdev_setup = order_queue_eventdev_setup,
.launch_lcores = order_queue_launch_lcores,
.eventdev_destroy = order_eventdev_destroy,
.mempool_destroy = order_mempool_destroy,
.test_result = order_test_result,
.test_destroy = order_test_destroy,
};
EVT_TEST_REGISTER(order_queue);

View File

@ -0,0 +1,283 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test_perf_common.h"
/* See http://dpdk.org/doc/guides/tools/testeventdev.html for test details */
static inline int
atq_nb_event_queues(struct evt_options *opt)
{
/* nb_queues = number of producers */
return evt_nr_active_lcores(opt->plcores);
}
static inline __attribute__((always_inline)) void
atq_mark_fwd_latency(struct rte_event *const ev)
{
if (unlikely(ev->sub_event_type == 0)) {
struct perf_elt *const m = ev->event_ptr;
m->timestamp = rte_get_timer_cycles();
}
}
static inline __attribute__((always_inline)) void
atq_fwd_event(struct rte_event *const ev, uint8_t *const sched_type_list,
const uint8_t nb_stages)
{
ev->sub_event_type++;
ev->sched_type = sched_type_list[ev->sub_event_type % nb_stages];
ev->op = RTE_EVENT_OP_FORWARD;
ev->event_type = RTE_EVENT_TYPE_CPU;
}
static int
perf_atq_worker(void *arg, const int enable_fwd_latency)
{
PERF_WORKER_INIT;
struct rte_event ev;
while (t->done == false) {
uint16_t event = rte_event_dequeue_burst(dev, port, &ev, 1, 0);
if (enable_fwd_latency)
rte_prefetch0(ev.event_ptr);
if (!event) {
rte_pause();
continue;
}
if (enable_fwd_latency)
/* first stage in pipeline, mark ts to compute fwd latency */
atq_mark_fwd_latency(&ev);
/* last stage in pipeline */
if (unlikely((ev.sub_event_type % nb_stages) == laststage)) {
if (enable_fwd_latency)
cnt = perf_process_last_stage_latency(pool,
&ev, w, bufs, sz, cnt);
else
cnt = perf_process_last_stage(pool, &ev, w,
bufs, sz, cnt);
} else {
atq_fwd_event(&ev, sched_type_list, nb_stages);
while (rte_event_enqueue_burst(dev, port, &ev, 1) != 1)
rte_pause();
}
}
return 0;
}
static int
perf_atq_worker_burst(void *arg, const int enable_fwd_latency)
{
PERF_WORKER_INIT;
uint16_t i;
/* +1 to avoid prefetch out of array check */
struct rte_event ev[BURST_SIZE + 1];
while (t->done == false) {
uint16_t const nb_rx = rte_event_dequeue_burst(dev, port, ev,
BURST_SIZE, 0);
if (!nb_rx) {
rte_pause();
continue;
}
for (i = 0; i < nb_rx; i++) {
if (enable_fwd_latency) {
rte_prefetch0(ev[i+1].event_ptr);
/* first stage in pipeline.
* mark time stamp to compute fwd latency
*/
atq_mark_fwd_latency(&ev[i]);
}
/* last stage in pipeline */
if (unlikely((ev[i].sub_event_type % nb_stages)
== laststage)) {
if (enable_fwd_latency)
cnt = perf_process_last_stage_latency(
pool, &ev[i], w, bufs, sz, cnt);
else
cnt = perf_process_last_stage(pool,
&ev[i], w, bufs, sz, cnt);
ev[i].op = RTE_EVENT_OP_RELEASE;
} else {
atq_fwd_event(&ev[i], sched_type_list,
nb_stages);
}
}
uint16_t enq;
enq = rte_event_enqueue_burst(dev, port, ev, nb_rx);
while (enq < nb_rx) {
enq += rte_event_enqueue_burst(dev, port,
ev + enq, nb_rx - enq);
}
}
return 0;
}
static int
worker_wrapper(void *arg)
{
struct worker_data *w = arg;
struct evt_options *opt = w->t->opt;
const bool burst = evt_has_burst_mode(w->dev_id);
const int fwd_latency = opt->fwd_latency;
/* allow compiler to optimize */
if (!burst && !fwd_latency)
return perf_atq_worker(arg, 0);
else if (!burst && fwd_latency)
return perf_atq_worker(arg, 1);
else if (burst && !fwd_latency)
return perf_atq_worker_burst(arg, 0);
else if (burst && fwd_latency)
return perf_atq_worker_burst(arg, 1);
rte_panic("invalid worker\n");
}
static int
perf_atq_launch_lcores(struct evt_test *test, struct evt_options *opt)
{
return perf_launch_lcores(test, opt, worker_wrapper);
}
static int
perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
{
int ret;
uint8_t queue;
const struct rte_event_dev_config config = {
.nb_event_queues = atq_nb_event_queues(opt),
.nb_event_ports = perf_nb_event_ports(opt),
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
.nb_event_port_enqueue_depth = 128,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
if (ret) {
evt_err("failed to configure eventdev %d", opt->dev_id);
return ret;
}
struct rte_event_queue_conf q_conf = {
.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ALL_TYPES,
.nb_atomic_flows = opt->nb_flows,
.nb_atomic_order_sequences = opt->nb_flows,
};
/* queue configurations */
for (queue = 0; queue < atq_nb_event_queues(opt); queue++) {
ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf);
if (ret) {
evt_err("failed to setup queue=%d", queue);
return ret;
}
}
ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
atq_nb_event_queues(opt));
if (ret)
return ret;
ret = evt_service_setup(opt->dev_id);
if (ret) {
evt_err("No service lcore found to run event dev.");
return ret;
}
ret = rte_event_dev_start(opt->dev_id);
if (ret) {
evt_err("failed to start eventdev %d", opt->dev_id);
return ret;
}
return 0;
}
static void
perf_atq_opt_dump(struct evt_options *opt)
{
perf_opt_dump(opt, atq_nb_event_queues(opt));
}
static int
perf_atq_opt_check(struct evt_options *opt)
{
return perf_opt_check(opt, atq_nb_event_queues(opt));
}
static bool
perf_atq_capability_check(struct evt_options *opt)
{
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(opt->dev_id, &dev_info);
if (dev_info.max_event_queues < atq_nb_event_queues(opt) ||
dev_info.max_event_ports < perf_nb_event_ports(opt)) {
evt_err("not enough eventdev queues=%d/%d or ports=%d/%d",
atq_nb_event_queues(opt), dev_info.max_event_queues,
perf_nb_event_ports(opt), dev_info.max_event_ports);
}
if (!evt_has_all_types_queue(opt->dev_id))
return false;
return true;
}
static const struct evt_test_ops perf_atq = {
.cap_check = perf_atq_capability_check,
.opt_check = perf_atq_opt_check,
.opt_dump = perf_atq_opt_dump,
.test_setup = perf_test_setup,
.mempool_setup = perf_mempool_setup,
.eventdev_setup = perf_atq_eventdev_setup,
.launch_lcores = perf_atq_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
EVT_TEST_REGISTER(perf_atq);

View File

@ -0,0 +1,454 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test_perf_common.h"
int
perf_test_result(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(opt);
struct test_perf *t = evt_test_priv(test);
return t->result;
}
static inline int
perf_producer(void *arg)
{
struct prod_data *p = arg;
struct test_perf *t = p->t;
struct evt_options *opt = t->opt;
const uint8_t dev_id = p->dev_id;
const uint8_t port = p->port_id;
struct rte_mempool *pool = t->pool;
const uint64_t nb_pkts = t->nb_pkts;
const uint32_t nb_flows = t->nb_flows;
uint32_t flow_counter = 0;
uint64_t count = 0;
struct perf_elt *m;
struct rte_event ev;
if (opt->verbose_level > 1)
printf("%s(): lcore %d dev_id %d port=%d queue %d\n", __func__,
rte_lcore_id(), dev_id, port, p->queue_id);
ev.event = 0;
ev.op = RTE_EVENT_OP_NEW;
ev.queue_id = p->queue_id;
ev.sched_type = t->opt->sched_type_list[0];
ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
ev.event_type = RTE_EVENT_TYPE_CPU;
ev.sub_event_type = 0; /* stage 0 */
while (count < nb_pkts && t->done == false) {
if (rte_mempool_get(pool, (void **)&m) < 0)
continue;
ev.flow_id = flow_counter++ % nb_flows;
ev.event_ptr = m;
m->timestamp = rte_get_timer_cycles();
while (rte_event_enqueue_burst(dev_id, port, &ev, 1) != 1) {
if (t->done)
break;
rte_pause();
m->timestamp = rte_get_timer_cycles();
}
count++;
}
return 0;
}
static inline uint64_t
processed_pkts(struct test_perf *t)
{
uint8_t i;
uint64_t total = 0;
rte_smp_rmb();
for (i = 0; i < t->nb_workers; i++)
total += t->worker[i].processed_pkts;
return total;
}
static inline uint64_t
total_latency(struct test_perf *t)
{
uint8_t i;
uint64_t total = 0;
rte_smp_rmb();
for (i = 0; i < t->nb_workers; i++)
total += t->worker[i].latency;
return total;
}
int
perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
int (*worker)(void *))
{
int ret, lcore_id;
struct test_perf *t = evt_test_priv(test);
int port_idx = 0;
/* launch workers */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
ret = rte_eal_remote_launch(worker,
&t->worker[port_idx], lcore_id);
if (ret) {
evt_err("failed to launch worker %d", lcore_id);
return ret;
}
port_idx++;
}
/* launch producers */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (!(opt->plcores[lcore_id]))
continue;
ret = rte_eal_remote_launch(perf_producer, &t->prod[port_idx],
lcore_id);
if (ret) {
evt_err("failed to launch perf_producer %d", lcore_id);
return ret;
}
port_idx++;
}
const uint64_t total_pkts = opt->nb_pkts *
evt_nr_active_lcores(opt->plcores);
uint64_t dead_lock_cycles = rte_get_timer_cycles();
int64_t dead_lock_remaining = total_pkts;
const uint64_t dead_lock_sample = rte_get_timer_hz() * 5;
uint64_t perf_cycles = rte_get_timer_cycles();
int64_t perf_remaining = total_pkts;
const uint64_t perf_sample = rte_get_timer_hz();
static float total_mpps;
static uint64_t samples;
const uint64_t freq_mhz = rte_get_timer_hz() / 1000000;
int64_t remaining = t->outstand_pkts - processed_pkts(t);
while (t->done == false) {
const uint64_t new_cycles = rte_get_timer_cycles();
if ((new_cycles - perf_cycles) > perf_sample) {
const uint64_t latency = total_latency(t);
const uint64_t pkts = processed_pkts(t);
remaining = t->outstand_pkts - pkts;
float mpps = (float)(perf_remaining-remaining)/1000000;
perf_remaining = remaining;
perf_cycles = new_cycles;
total_mpps += mpps;
++samples;
if (opt->fwd_latency && pkts > 0) {
printf(CLGRN"\r%.3f mpps avg %.3f mpps [avg fwd latency %.3f us] "CLNRM,
mpps, total_mpps/samples,
(float)(latency/pkts)/freq_mhz);
} else {
printf(CLGRN"\r%.3f mpps avg %.3f mpps"CLNRM,
mpps, total_mpps/samples);
}
fflush(stdout);
if (remaining <= 0) {
t->done = true;
t->result = EVT_TEST_SUCCESS;
rte_smp_wmb();
break;
}
}
if (new_cycles - dead_lock_cycles > dead_lock_sample) {
remaining = t->outstand_pkts - processed_pkts(t);
if (dead_lock_remaining == remaining) {
rte_event_dev_dump(opt->dev_id, stdout);
evt_err("No schedules for seconds, deadlock");
t->done = true;
rte_smp_wmb();
break;
}
dead_lock_remaining = remaining;
dead_lock_cycles = new_cycles;
}
}
printf("\n");
return 0;
}
int
perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues)
{
struct test_perf *t = evt_test_priv(test);
uint8_t port, prod;
int ret = -1;
/* port configuration */
const struct rte_event_port_conf wkr_p_conf = {
.dequeue_depth = opt->wkr_deq_dep,
.enqueue_depth = 64,
.new_event_threshold = 4096,
};
/* setup one port per worker, linking to all queues */
for (port = 0; port < evt_nr_active_lcores(opt->wlcores);
port++) {
struct worker_data *w = &t->worker[port];
w->dev_id = opt->dev_id;
w->port_id = port;
w->t = t;
w->processed_pkts = 0;
w->latency = 0;
ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf);
if (ret) {
evt_err("failed to setup port %d", port);
return ret;
}
ret = rte_event_port_link(opt->dev_id, port, NULL, NULL, 0);
if (ret != nb_queues) {
evt_err("failed to link all queues to port %d", port);
return -EINVAL;
}
}
/* port for producers, no links */
const struct rte_event_port_conf prod_conf = {
.dequeue_depth = 8,
.enqueue_depth = 32,
.new_event_threshold = 1200,
};
prod = 0;
for ( ; port < perf_nb_event_ports(opt); port++) {
struct prod_data *p = &t->prod[port];
p->dev_id = opt->dev_id;
p->port_id = port;
p->queue_id = prod * stride;
p->t = t;
ret = rte_event_port_setup(opt->dev_id, port, &prod_conf);
if (ret) {
evt_err("failed to setup port %d", port);
return ret;
}
prod++;
}
return ret;
}
int
perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
{
unsigned int lcores;
/* N producer + N worker + 1 master */
lcores = 3;
if (rte_lcore_count() < lcores) {
evt_err("test need minimum %d lcores", lcores);
return -1;
}
/* Validate worker lcores */
if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
evt_err("worker lcores overlaps with master lcore");
return -1;
}
if (evt_lcores_has_overlap_multi(opt->wlcores, opt->plcores)) {
evt_err("worker lcores overlaps producer lcores");
return -1;
}
if (evt_has_disabled_lcore(opt->wlcores)) {
evt_err("one or more workers lcores are not enabled");
return -1;
}
if (!evt_has_active_lcore(opt->wlcores)) {
evt_err("minimum one worker is required");
return -1;
}
/* Validate producer lcores */
if (evt_lcores_has_overlap(opt->plcores, rte_get_master_lcore())) {
evt_err("producer lcores overlaps with master lcore");
return -1;
}
if (evt_has_disabled_lcore(opt->plcores)) {
evt_err("one or more producer lcores are not enabled");
return -1;
}
if (!evt_has_active_lcore(opt->plcores)) {
evt_err("minimum one producer is required");
return -1;
}
if (evt_has_invalid_stage(opt))
return -1;
if (evt_has_invalid_sched_type(opt))
return -1;
if (nb_queues > EVT_MAX_QUEUES) {
evt_err("number of queues exceeds %d", EVT_MAX_QUEUES);
return -1;
}
if (perf_nb_event_ports(opt) > EVT_MAX_PORTS) {
evt_err("number of ports exceeds %d", EVT_MAX_PORTS);
return -1;
}
/* Fixups */
if (opt->nb_stages == 1 && opt->fwd_latency) {
evt_info("fwd_latency is valid when nb_stages > 1, disabling");
opt->fwd_latency = 0;
}
if (opt->fwd_latency && !opt->q_priority) {
evt_info("enabled queue priority for latency measurement");
opt->q_priority = 1;
}
if (opt->nb_pkts == 0)
opt->nb_pkts = INT64_MAX/evt_nr_active_lcores(opt->plcores);
return 0;
}
void
perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)
{
evt_dump("nb_prod_lcores", "%d", evt_nr_active_lcores(opt->plcores));
evt_dump_producer_lcores(opt);
evt_dump("nb_worker_lcores", "%d", evt_nr_active_lcores(opt->wlcores));
evt_dump_worker_lcores(opt);
evt_dump_nb_stages(opt);
evt_dump("nb_evdev_ports", "%d", perf_nb_event_ports(opt));
evt_dump("nb_evdev_queues", "%d", nb_queues);
evt_dump_queue_priority(opt);
evt_dump_sched_type_list(opt);
}
void
perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(test);
rte_event_dev_stop(opt->dev_id);
rte_event_dev_close(opt->dev_id);
}
static inline void
perf_elt_init(struct rte_mempool *mp, void *arg __rte_unused,
void *obj, unsigned i __rte_unused)
{
memset(obj, 0, mp->elt_size);
}
int
perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
{
struct test_perf *t = evt_test_priv(test);
t->pool = rte_mempool_create(test->name, /* mempool name */
opt->pool_sz, /* number of elements*/
sizeof(struct perf_elt), /* element size*/
512, /* cache size*/
0, NULL, NULL,
perf_elt_init, /* obj constructor */
NULL, opt->socket_id, 0); /* flags */
if (t->pool == NULL) {
evt_err("failed to create mempool");
return -ENOMEM;
}
return 0;
}
void
perf_mempool_destroy(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(opt);
struct test_perf *t = evt_test_priv(test);
rte_mempool_free(t->pool);
}
int
perf_test_setup(struct evt_test *test, struct evt_options *opt)
{
void *test_perf;
test_perf = rte_zmalloc_socket(test->name, sizeof(struct test_perf),
RTE_CACHE_LINE_SIZE, opt->socket_id);
if (test_perf == NULL) {
evt_err("failed to allocate test_perf memory");
goto nomem;
}
test->test_priv = test_perf;
struct test_perf *t = evt_test_priv(test);
t->outstand_pkts = opt->nb_pkts * evt_nr_active_lcores(opt->plcores);
t->nb_workers = evt_nr_active_lcores(opt->wlcores);
t->done = false;
t->nb_pkts = opt->nb_pkts;
t->nb_flows = opt->nb_flows;
t->result = EVT_TEST_FAILED;
t->opt = opt;
memcpy(t->sched_type_list, opt->sched_type_list,
sizeof(opt->sched_type_list));
return 0;
nomem:
return -ENOMEM;
}
void
perf_test_destroy(struct evt_test *test, struct evt_options *opt)
{
RTE_SET_USED(opt);
rte_free(test->test_priv);
}

View File

@ -0,0 +1,170 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _TEST_PERF_COMMON_
#define _TEST_PERF_COMMON_
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include <rte_cycles.h>
#include <rte_eventdev.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
#include <rte_prefetch.h>
#include "evt_common.h"
#include "evt_options.h"
#include "evt_test.h"
struct test_perf;
struct worker_data {
uint64_t processed_pkts;
uint64_t latency;
uint8_t dev_id;
uint8_t port_id;
struct test_perf *t;
} __rte_cache_aligned;
struct prod_data {
uint8_t dev_id;
uint8_t port_id;
uint8_t queue_id;
struct test_perf *t;
} __rte_cache_aligned;
struct test_perf {
/* Don't change the offset of "done". Signal handler use this memory
* to terminate all lcores work.
*/
int done;
uint64_t outstand_pkts;
uint8_t nb_workers;
enum evt_test_result result;
uint32_t nb_flows;
uint64_t nb_pkts;
struct rte_mempool *pool;
struct prod_data prod[EVT_MAX_PORTS];
struct worker_data worker[EVT_MAX_PORTS];
struct evt_options *opt;
uint8_t sched_type_list[EVT_MAX_STAGES] __rte_cache_aligned;
} __rte_cache_aligned;
struct perf_elt {
uint64_t timestamp;
} __rte_cache_aligned;
#define BURST_SIZE 16
#define PERF_WORKER_INIT\
struct worker_data *w = arg;\
struct test_perf *t = w->t;\
struct evt_options *opt = t->opt;\
const uint8_t dev = w->dev_id;\
const uint8_t port = w->port_id;\
uint8_t *const sched_type_list = &t->sched_type_list[0];\
struct rte_mempool *const pool = t->pool;\
const uint8_t nb_stages = t->opt->nb_stages;\
const uint8_t laststage = nb_stages - 1;\
uint8_t cnt = 0;\
void *bufs[16] __rte_cache_aligned;\
int const sz = RTE_DIM(bufs);\
if (opt->verbose_level > 1)\
printf("%s(): lcore %d dev_id %d port=%d\n", __func__,\
rte_lcore_id(), dev, port)
static inline __attribute__((always_inline)) int
perf_process_last_stage(struct rte_mempool *const pool,
struct rte_event *const ev, struct worker_data *const w,
void *bufs[], int const buf_sz, uint8_t count)
{
bufs[count++] = ev->event_ptr;
w->processed_pkts++;
rte_smp_wmb();
if (unlikely(count == buf_sz)) {
count = 0;
rte_mempool_put_bulk(pool, bufs, buf_sz);
}
return count;
}
static inline __attribute__((always_inline)) uint8_t
perf_process_last_stage_latency(struct rte_mempool *const pool,
struct rte_event *const ev, struct worker_data *const w,
void *bufs[], int const buf_sz, uint8_t count)
{
uint64_t latency;
struct perf_elt *const m = ev->event_ptr;
bufs[count++] = ev->event_ptr;
w->processed_pkts++;
if (unlikely(count == buf_sz)) {
count = 0;
latency = rte_get_timer_cycles() - m->timestamp;
rte_mempool_put_bulk(pool, bufs, buf_sz);
} else {
latency = rte_get_timer_cycles() - m->timestamp;
}
w->latency += latency;
rte_smp_wmb();
return count;
}
static inline int
perf_nb_event_ports(struct evt_options *opt)
{
return evt_nr_active_lcores(opt->wlcores) +
evt_nr_active_lcores(opt->plcores);
}
int perf_test_result(struct evt_test *test, struct evt_options *opt);
int perf_opt_check(struct evt_options *opt, uint64_t nb_queues);
int perf_test_setup(struct evt_test *test, struct evt_options *opt);
int perf_mempool_setup(struct evt_test *test, struct evt_options *opt);
int perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
uint8_t stride, uint8_t nb_queues);
int perf_event_dev_service_setup(uint8_t dev_id);
int perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
int (*worker)(void *));
void perf_opt_dump(struct evt_options *opt, uint8_t nb_queues);
void perf_test_destroy(struct evt_test *test, struct evt_options *opt);
void perf_eventdev_destroy(struct evt_test *test, struct evt_options *opt);
void perf_mempool_destroy(struct evt_test *test, struct evt_options *opt);
#endif /* _TEST_PERF_COMMON_ */

View File

@ -0,0 +1,294 @@
/*
* BSD LICENSE
*
* Copyright (C) Cavium, Inc 2017.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Cavium, Inc nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test_perf_common.h"
/* See http://dpdk.org/doc/guides/tools/testeventdev.html for test details */
static inline int
perf_queue_nb_event_queues(struct evt_options *opt)
{
/* nb_queues = number of producers * number of stages */
return evt_nr_active_lcores(opt->plcores) * opt->nb_stages;
}
static inline __attribute__((always_inline)) void
mark_fwd_latency(struct rte_event *const ev,
const uint8_t nb_stages)
{
if (unlikely((ev->queue_id % nb_stages) == 0)) {
struct perf_elt *const m = ev->event_ptr;
m->timestamp = rte_get_timer_cycles();
}
}
static inline __attribute__((always_inline)) void
fwd_event(struct rte_event *const ev, uint8_t *const sched_type_list,
const uint8_t nb_stages)
{
ev->queue_id++;
ev->sched_type = sched_type_list[ev->queue_id % nb_stages];
ev->op = RTE_EVENT_OP_FORWARD;
ev->event_type = RTE_EVENT_TYPE_CPU;
}
static int
perf_queue_worker(void *arg, const int enable_fwd_latency)
{
PERF_WORKER_INIT;
struct rte_event ev;
while (t->done == false) {
uint16_t event = rte_event_dequeue_burst(dev, port, &ev, 1, 0);
if (!event) {
rte_pause();
continue;
}
if (enable_fwd_latency)
/* first q in pipeline, mark timestamp to compute fwd latency */
mark_fwd_latency(&ev, nb_stages);
/* last stage in pipeline */
if (unlikely((ev.queue_id % nb_stages) == laststage)) {
if (enable_fwd_latency)
cnt = perf_process_last_stage_latency(pool,
&ev, w, bufs, sz, cnt);
else
cnt = perf_process_last_stage(pool,
&ev, w, bufs, sz, cnt);
} else {
fwd_event(&ev, sched_type_list, nb_stages);
while (rte_event_enqueue_burst(dev, port, &ev, 1) != 1)
rte_pause();
}
}
return 0;
}
static int
perf_queue_worker_burst(void *arg, const int enable_fwd_latency)
{
PERF_WORKER_INIT;
uint16_t i;
/* +1 to avoid prefetch out of array check */
struct rte_event ev[BURST_SIZE + 1];
while (t->done == false) {
uint16_t const nb_rx = rte_event_dequeue_burst(dev, port, ev,
BURST_SIZE, 0);
if (!nb_rx) {
rte_pause();
continue;
}
for (i = 0; i < nb_rx; i++) {
if (enable_fwd_latency) {
rte_prefetch0(ev[i+1].event_ptr);
/* first queue in pipeline.
* mark time stamp to compute fwd latency
*/
mark_fwd_latency(&ev[i], nb_stages);
}
/* last stage in pipeline */
if (unlikely((ev[i].queue_id % nb_stages) ==
laststage)) {
if (enable_fwd_latency)
cnt = perf_process_last_stage_latency(
pool, &ev[i], w, bufs, sz, cnt);
else
cnt = perf_process_last_stage(pool,
&ev[i], w, bufs, sz, cnt);
ev[i].op = RTE_EVENT_OP_RELEASE;
} else {
fwd_event(&ev[i], sched_type_list, nb_stages);
}
}
uint16_t enq;
enq = rte_event_enqueue_burst(dev, port, ev, nb_rx);
while (enq < nb_rx) {
enq += rte_event_enqueue_burst(dev, port,
ev + enq, nb_rx - enq);
}
}
return 0;
}
static int
worker_wrapper(void *arg)
{
struct worker_data *w = arg;
struct evt_options *opt = w->t->opt;
const bool burst = evt_has_burst_mode(w->dev_id);
const int fwd_latency = opt->fwd_latency;
/* allow compiler to optimize */
if (!burst && !fwd_latency)
return perf_queue_worker(arg, 0);
else if (!burst && fwd_latency)
return perf_queue_worker(arg, 1);
else if (burst && !fwd_latency)
return perf_queue_worker_burst(arg, 0);
else if (burst && fwd_latency)
return perf_queue_worker_burst(arg, 1);
rte_panic("invalid worker\n");
}
static int
perf_queue_launch_lcores(struct evt_test *test, struct evt_options *opt)
{
return perf_launch_lcores(test, opt, worker_wrapper);
}
static int
perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
{
uint8_t queue;
int nb_stages = opt->nb_stages;
int ret;
const struct rte_event_dev_config config = {
.nb_event_queues = perf_queue_nb_event_queues(opt),
.nb_event_ports = perf_nb_event_ports(opt),
.nb_events_limit = 4096,
.nb_event_queue_flows = opt->nb_flows,
.nb_event_port_dequeue_depth = 128,
.nb_event_port_enqueue_depth = 128,
};
ret = rte_event_dev_configure(opt->dev_id, &config);
if (ret) {
evt_err("failed to configure eventdev %d", opt->dev_id);
return ret;
}
struct rte_event_queue_conf q_conf = {
.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
.nb_atomic_flows = opt->nb_flows,
.nb_atomic_order_sequences = opt->nb_flows,
};
/* queue configurations */
for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) {
q_conf.schedule_type =
(opt->sched_type_list[queue % nb_stages]);
if (opt->q_priority) {
uint8_t stage_pos = queue % nb_stages;
/* Configure event queues(stage 0 to stage n) with
* RTE_EVENT_DEV_PRIORITY_LOWEST to
* RTE_EVENT_DEV_PRIORITY_HIGHEST.
*/
uint8_t step = RTE_EVENT_DEV_PRIORITY_LOWEST /
(nb_stages - 1);
/* Higher prio for the queues closer to last stage */
q_conf.priority = RTE_EVENT_DEV_PRIORITY_LOWEST -
(step * stage_pos);
}
ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf);
if (ret) {
evt_err("failed to setup queue=%d", queue);
return ret;
}
}
ret = perf_event_dev_port_setup(test, opt, nb_stages /* stride */,
perf_queue_nb_event_queues(opt));
if (ret)
return ret;
ret = evt_service_setup(opt->dev_id);
if (ret) {
evt_err("No service lcore found to run event dev.");
return ret;
}
ret = rte_event_dev_start(opt->dev_id);
if (ret) {
evt_err("failed to start eventdev %d", opt->dev_id);
return ret;
}
return 0;
}
static void
perf_queue_opt_dump(struct evt_options *opt)
{
evt_dump_fwd_latency(opt);
perf_opt_dump(opt, perf_queue_nb_event_queues(opt));
}
static int
perf_queue_opt_check(struct evt_options *opt)
{
return perf_opt_check(opt, perf_queue_nb_event_queues(opt));
}
static bool
perf_queue_capability_check(struct evt_options *opt)
{
struct rte_event_dev_info dev_info;
rte_event_dev_info_get(opt->dev_id, &dev_info);
if (dev_info.max_event_queues < perf_queue_nb_event_queues(opt) ||
dev_info.max_event_ports < perf_nb_event_ports(opt)) {
evt_err("not enough eventdev queues=%d/%d or ports=%d/%d",
perf_queue_nb_event_queues(opt),
dev_info.max_event_queues,
perf_nb_event_ports(opt), dev_info.max_event_ports);
}
return true;
}
static const struct evt_test_ops perf_queue = {
.cap_check = perf_queue_capability_check,
.opt_check = perf_queue_opt_check,
.opt_dump = perf_queue_opt_dump,
.test_setup = perf_test_setup,
.mempool_setup = perf_mempool_setup,
.eventdev_setup = perf_queue_eventdev_setup,
.launch_lcores = perf_queue_launch_lcores,
.eventdev_destroy = perf_eventdev_destroy,
.mempool_destroy = perf_mempool_destroy,
.test_result = perf_test_result,
.test_destroy = perf_test_destroy,
};
EVT_TEST_REGISTER(perf_queue);

View File

@ -1,64 +0,0 @@
# BSD LICENSE
#
# Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(RTE_SDK)/mk/rte.vars.mk
ifeq ($(CONFIG_RTE_LIBRTE_PIPELINE),y)
#
# library name
#
APP = testpipeline
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
#
# all source are stored in SRCS-y
#
SRCS-y := main.c
SRCS-y += config.c
SRCS-y += init.c
SRCS-y += runtime.c
SRCS-y += pipeline_stub.c
SRCS-y += pipeline_hash.c
SRCS-y += pipeline_lpm.c
SRCS-y += pipeline_lpm_ipv6.c
# include ACL lib if available
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += pipeline_acl.c
# this application needs libraries first
DEPDIRS-y += lib drivers
include $(RTE_SDK)/mk/rte.app.mk
endif

View File

@ -1,247 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>
#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_ip.h>
#include <rte_tcp.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include <rte_string_fns.h>
#include "main.h"
struct app_params app;
static const char usage[] = "\n";
void
app_print_usage(void)
{
printf(usage);
}
static int
app_parse_port_mask(const char *arg)
{
char *end = NULL;
uint64_t port_mask;
uint32_t i;
if (arg[0] == '\0')
return -1;
port_mask = strtoul(arg, &end, 16);
if ((end == NULL) || (*end != '\0'))
return -2;
if (port_mask == 0)
return -3;
app.n_ports = 0;
for (i = 0; i < 64; i++) {
if ((port_mask & (1LLU << i)) == 0)
continue;
if (app.n_ports >= APP_MAX_PORTS)
return -4;
app.ports[app.n_ports] = i;
app.n_ports++;
}
if (!rte_is_power_of_2(app.n_ports))
return -5;
return 0;
}
struct {
const char *name;
uint32_t value;
} app_args_table[] = {
{"none", e_APP_PIPELINE_NONE},
{"stub", e_APP_PIPELINE_STUB},
{"hash-8-ext", e_APP_PIPELINE_HASH_KEY8_EXT},
{"hash-8-lru", e_APP_PIPELINE_HASH_KEY8_LRU},
{"hash-16-ext", e_APP_PIPELINE_HASH_KEY16_EXT},
{"hash-16-lru", e_APP_PIPELINE_HASH_KEY16_LRU},
{"hash-32-ext", e_APP_PIPELINE_HASH_KEY32_EXT},
{"hash-32-lru", e_APP_PIPELINE_HASH_KEY32_LRU},
{"hash-spec-8-ext", e_APP_PIPELINE_HASH_SPEC_KEY8_EXT},
{"hash-spec-8-lru", e_APP_PIPELINE_HASH_SPEC_KEY8_LRU},
{"hash-spec-16-ext", e_APP_PIPELINE_HASH_SPEC_KEY16_EXT},
{"hash-spec-16-lru", e_APP_PIPELINE_HASH_SPEC_KEY16_LRU},
{"hash-spec-32-ext", e_APP_PIPELINE_HASH_SPEC_KEY32_EXT},
{"hash-spec-32-lru", e_APP_PIPELINE_HASH_SPEC_KEY32_LRU},
{"acl", e_APP_PIPELINE_ACL},
{"lpm", e_APP_PIPELINE_LPM},
{"lpm-ipv6", e_APP_PIPELINE_LPM_IPV6},
};
int
app_parse_args(int argc, char **argv)
{
int opt, ret;
char **argvopt;
int option_index;
char *prgname = argv[0];
static struct option lgopts[] = {
{"none", 0, 0, 0},
{"stub", 0, 0, 0},
{"hash-8-ext", 0, 0, 0},
{"hash-8-lru", 0, 0, 0},
{"hash-16-ext", 0, 0, 0},
{"hash-16-lru", 0, 0, 0},
{"hash-32-ext", 0, 0, 0},
{"hash-32-lru", 0, 0, 0},
{"hash-spec-8-ext", 0, 0, 0},
{"hash-spec-8-lru", 0, 0, 0},
{"hash-spec-16-ext", 0, 0, 0},
{"hash-spec-16-lru", 0, 0, 0},
{"hash-spec-32-ext", 0, 0, 0},
{"hash-spec-32-lru", 0, 0, 0},
{"acl", 0, 0, 0},
{"lpm", 0, 0, 0},
{"lpm-ipv6", 0, 0, 0},
{NULL, 0, 0, 0}
};
uint32_t lcores[3], n_lcores, lcore_id, pipeline_type_provided;
/* EAL args */
n_lcores = 0;
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
if (rte_lcore_is_enabled(lcore_id) == 0)
continue;
if (n_lcores >= 3) {
RTE_LOG(ERR, USER1, "Number of cores must be 3\n");
app_print_usage();
return -1;
}
lcores[n_lcores] = lcore_id;
n_lcores++;
}
if (n_lcores != 3) {
RTE_LOG(ERR, USER1, "Number of cores must be 3\n");
app_print_usage();
return -1;
}
app.core_rx = lcores[0];
app.core_worker = lcores[1];
app.core_tx = lcores[2];
/* Non-EAL args */
argvopt = argv;
app.pipeline_type = e_APP_PIPELINE_HASH_KEY16_LRU;
pipeline_type_provided = 0;
while ((opt = getopt_long(argc, argvopt, "p:",
lgopts, &option_index)) != EOF) {
switch (opt) {
case 'p':
if (app_parse_port_mask(optarg) < 0) {
app_print_usage();
return -1;
}
break;
case 0: /* long options */
if (!pipeline_type_provided) {
uint32_t i;
for (i = 0; i < e_APP_PIPELINES; i++) {
if (!strcmp(lgopts[option_index].name,
app_args_table[i].name)) {
app.pipeline_type =
app_args_table[i].value;
pipeline_type_provided = 1;
break;
}
}
break;
}
app_print_usage();
return -1;
default:
return -1;
}
}
if (optind >= 0)
argv[optind - 1] = prgname;
ret = optind - 1;
optind = 0; /* reset getopt lib */
return ret;
}

View File

@ -1,280 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>
#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
#include <rte_ip.h>
#include <rte_tcp.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include "main.h"
struct app_params app = {
/* Ports*/
.n_ports = APP_MAX_PORTS,
.port_rx_ring_size = 128,
.port_tx_ring_size = 512,
/* Rings */
.ring_rx_size = 128,
.ring_tx_size = 128,
/* Buffer pool */
.pool_buffer_size = 2048 + RTE_PKTMBUF_HEADROOM,
.pool_size = 32 * 1024,
.pool_cache_size = 256,
/* Burst sizes */
.burst_size_rx_read = 64,
.burst_size_rx_write = 64,
.burst_size_worker_read = 64,
.burst_size_worker_write = 64,
.burst_size_tx_read = 64,
.burst_size_tx_write = 64,
};
static struct rte_eth_conf port_conf = {
.rxmode = {
.split_hdr_size = 0,
.header_split = 0, /* Header Split disabled */
.hw_ip_checksum = 1, /* IP checksum offload enabled */
.hw_vlan_filter = 0, /* VLAN filtering disabled */
.jumbo_frame = 0, /* Jumbo Frame Support disabled */
.hw_strip_crc = 0, /* CRC stripped by hardware */
},
.rx_adv_conf = {
.rss_conf = {
.rss_key = NULL,
.rss_hf = ETH_RSS_IP,
},
},
.txmode = {
.mq_mode = ETH_MQ_TX_NONE,
},
};
static struct rte_eth_rxconf rx_conf = {
.rx_thresh = {
.pthresh = 8,
.hthresh = 8,
.wthresh = 4,
},
.rx_free_thresh = 64,
.rx_drop_en = 0,
};
static struct rte_eth_txconf tx_conf = {
.tx_thresh = {
.pthresh = 36,
.hthresh = 0,
.wthresh = 0,
},
.tx_free_thresh = 0,
.tx_rs_thresh = 0,
};
static void
app_init_mbuf_pools(void)
{
/* Init the buffer pool */
RTE_LOG(INFO, USER1, "Creating the mbuf pool ...\n");
app.pool = rte_pktmbuf_pool_create("mempool", app.pool_size,
app.pool_cache_size, 0, app.pool_buffer_size, rte_socket_id());
if (app.pool == NULL)
rte_panic("Cannot create mbuf pool\n");
}
static void
app_init_rings(void)
{
uint32_t i;
for (i = 0; i < app.n_ports; i++) {
char name[32];
snprintf(name, sizeof(name), "app_ring_rx_%u", i);
app.rings_rx[i] = rte_ring_create(
name,
app.ring_rx_size,
rte_socket_id(),
RING_F_SP_ENQ | RING_F_SC_DEQ);
if (app.rings_rx[i] == NULL)
rte_panic("Cannot create RX ring %u\n", i);
}
for (i = 0; i < app.n_ports; i++) {
char name[32];
snprintf(name, sizeof(name), "app_ring_tx_%u", i);
app.rings_tx[i] = rte_ring_create(
name,
app.ring_tx_size,
rte_socket_id(),
RING_F_SP_ENQ | RING_F_SC_DEQ);
if (app.rings_tx[i] == NULL)
rte_panic("Cannot create TX ring %u\n", i);
}
}
static void
app_ports_check_link(void)
{
uint32_t all_ports_up, i;
all_ports_up = 1;
for (i = 0; i < app.n_ports; i++) {
struct rte_eth_link link;
uint8_t port;
port = (uint8_t) app.ports[i];
memset(&link, 0, sizeof(link));
rte_eth_link_get_nowait(port, &link);
RTE_LOG(INFO, USER1, "Port %u (%u Gbps) %s\n",
port,
link.link_speed / 1000,
link.link_status ? "UP" : "DOWN");
if (link.link_status == ETH_LINK_DOWN)
all_ports_up = 0;
}
if (all_ports_up == 0)
rte_panic("Some NIC ports are DOWN\n");
}
static void
app_init_ports(void)
{
uint32_t i;
/* Init NIC ports, then start the ports */
for (i = 0; i < app.n_ports; i++) {
uint8_t port;
int ret;
port = (uint8_t) app.ports[i];
RTE_LOG(INFO, USER1, "Initializing NIC port %u ...\n", port);
/* Init port */
ret = rte_eth_dev_configure(
port,
1,
1,
&port_conf);
if (ret < 0)
rte_panic("Cannot init NIC port %u (%d)\n", port, ret);
rte_eth_promiscuous_enable(port);
/* Init RX queues */
ret = rte_eth_rx_queue_setup(
port,
0,
app.port_rx_ring_size,
rte_eth_dev_socket_id(port),
&rx_conf,
app.pool);
if (ret < 0)
rte_panic("Cannot init RX for port %u (%d)\n",
(uint32_t) port, ret);
/* Init TX queues */
ret = rte_eth_tx_queue_setup(
port,
0,
app.port_tx_ring_size,
rte_eth_dev_socket_id(port),
&tx_conf);
if (ret < 0)
rte_panic("Cannot init TX for port %u (%d)\n",
(uint32_t) port, ret);
/* Start port */
ret = rte_eth_dev_start(port);
if (ret < 0)
rte_panic("Cannot start port %u (%d)\n", port, ret);
}
app_ports_check_link();
}
void
app_init(void)
{
app_init_mbuf_pools();
app_init_rings();
app_init_ports();
RTE_LOG(INFO, USER1, "Initialization completed\n");
}

View File

@ -1,179 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>
#include <unistd.h>
#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_ip.h>
#include <rte_tcp.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include "main.h"
int
main(int argc, char **argv)
{
uint32_t lcore;
int ret;
/* Init EAL */
ret = rte_eal_init(argc, argv);
if (ret < 0)
return -1;
argc -= ret;
argv += ret;
/* Parse application arguments (after the EAL ones) */
ret = app_parse_args(argc, argv);
if (ret < 0) {
app_print_usage();
return -1;
}
/* Init */
app_init();
/* Launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(app_lcore_main_loop, NULL, CALL_MASTER);
RTE_LCORE_FOREACH_SLAVE(lcore) {
if (rte_eal_wait_lcore(lcore) < 0)
return -1;
}
return 0;
}
int
app_lcore_main_loop(__attribute__((unused)) void *arg)
{
unsigned lcore;
lcore = rte_lcore_id();
if (lcore == app.core_rx) {
switch (app.pipeline_type) {
case e_APP_PIPELINE_ACL:
app_main_loop_rx();
return 0;
default:
app_main_loop_rx_metadata();
return 0;
}
}
if (lcore == app.core_worker) {
switch (app.pipeline_type) {
case e_APP_PIPELINE_STUB:
app_main_loop_worker_pipeline_stub();
return 0;
case e_APP_PIPELINE_HASH_KEY8_EXT:
case e_APP_PIPELINE_HASH_KEY8_LRU:
case e_APP_PIPELINE_HASH_KEY16_EXT:
case e_APP_PIPELINE_HASH_KEY16_LRU:
case e_APP_PIPELINE_HASH_KEY32_EXT:
case e_APP_PIPELINE_HASH_KEY32_LRU:
case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT:
case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU:
case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT:
case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU:
case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT:
case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU:
app_main_loop_worker_pipeline_hash();
return 0;
case e_APP_PIPELINE_ACL:
#ifndef RTE_LIBRTE_ACL
rte_exit(EXIT_FAILURE, "ACL not present in build\n");
#else
app_main_loop_worker_pipeline_acl();
return 0;
#endif
case e_APP_PIPELINE_LPM:
app_main_loop_worker_pipeline_lpm();
return 0;
case e_APP_PIPELINE_LPM_IPV6:
app_main_loop_worker_pipeline_lpm_ipv6();
return 0;
case e_APP_PIPELINE_NONE:
default:
app_main_loop_worker();
return 0;
}
}
if (lcore == app.core_tx) {
app_main_loop_tx();
return 0;
}
return 0;
}

View File

@ -1,142 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MAIN_H_
#define _MAIN_H_
#ifndef APP_MBUF_ARRAY_SIZE
#define APP_MBUF_ARRAY_SIZE 256
#endif
struct app_mbuf_array {
struct rte_mbuf *array[APP_MBUF_ARRAY_SIZE];
uint16_t n_mbufs;
};
#ifndef APP_MAX_PORTS
#define APP_MAX_PORTS 4
#endif
struct app_params {
/* CPU cores */
uint32_t core_rx;
uint32_t core_worker;
uint32_t core_tx;
/* Ports*/
uint32_t ports[APP_MAX_PORTS];
uint32_t n_ports;
uint32_t port_rx_ring_size;
uint32_t port_tx_ring_size;
/* Rings */
struct rte_ring *rings_rx[APP_MAX_PORTS];
struct rte_ring *rings_tx[APP_MAX_PORTS];
uint32_t ring_rx_size;
uint32_t ring_tx_size;
/* Internal buffers */
struct app_mbuf_array mbuf_rx;
struct app_mbuf_array mbuf_tx[APP_MAX_PORTS];
/* Buffer pool */
struct rte_mempool *pool;
uint32_t pool_buffer_size;
uint32_t pool_size;
uint32_t pool_cache_size;
/* Burst sizes */
uint32_t burst_size_rx_read;
uint32_t burst_size_rx_write;
uint32_t burst_size_worker_read;
uint32_t burst_size_worker_write;
uint32_t burst_size_tx_read;
uint32_t burst_size_tx_write;
/* App behavior */
uint32_t pipeline_type;
} __rte_cache_aligned;
extern struct app_params app;
int app_parse_args(int argc, char **argv);
void app_print_usage(void);
void app_init(void);
int app_lcore_main_loop(void *arg);
/* Pipeline */
enum {
e_APP_PIPELINE_NONE = 0,
e_APP_PIPELINE_STUB,
e_APP_PIPELINE_HASH_KEY8_EXT,
e_APP_PIPELINE_HASH_KEY8_LRU,
e_APP_PIPELINE_HASH_KEY16_EXT,
e_APP_PIPELINE_HASH_KEY16_LRU,
e_APP_PIPELINE_HASH_KEY32_EXT,
e_APP_PIPELINE_HASH_KEY32_LRU,
e_APP_PIPELINE_HASH_SPEC_KEY8_EXT,
e_APP_PIPELINE_HASH_SPEC_KEY8_LRU,
e_APP_PIPELINE_HASH_SPEC_KEY16_EXT,
e_APP_PIPELINE_HASH_SPEC_KEY16_LRU,
e_APP_PIPELINE_HASH_SPEC_KEY32_EXT,
e_APP_PIPELINE_HASH_SPEC_KEY32_LRU,
e_APP_PIPELINE_ACL,
e_APP_PIPELINE_LPM,
e_APP_PIPELINE_LPM_IPV6,
e_APP_PIPELINES
};
void app_main_loop_rx(void);
void app_main_loop_rx_metadata(void);
uint64_t test_hash(void *key, uint32_t key_size, uint64_t seed);
void app_main_loop_worker(void);
void app_main_loop_worker_pipeline_stub(void);
void app_main_loop_worker_pipeline_hash(void);
void app_main_loop_worker_pipeline_acl(void);
void app_main_loop_worker_pipeline_lpm(void);
void app_main_loop_worker_pipeline_lpm_ipv6(void);
void app_main_loop_tx(void);
#define APP_FLUSH 0
#ifndef APP_FLUSH
#define APP_FLUSH 0x3FF
#endif
#define APP_METADATA_OFFSET(offset) (sizeof(struct rte_mbuf) + (offset))
#endif /* _MAIN_H_ */

View File

@ -1,493 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <rte_log.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
#include <rte_ip.h>
#include <rte_byteorder.h>
#include <rte_port_ring.h>
#include <rte_table_hash.h>
#include <rte_pipeline.h>
#include "main.h"
static void
translate_options(uint32_t *special, uint32_t *ext, uint32_t *key_size)
{
switch (app.pipeline_type) {
case e_APP_PIPELINE_HASH_KEY8_EXT:
*special = 0; *ext = 1; *key_size = 8; return;
case e_APP_PIPELINE_HASH_KEY8_LRU:
*special = 0; *ext = 0; *key_size = 8; return;
case e_APP_PIPELINE_HASH_KEY16_EXT:
*special = 0; *ext = 1; *key_size = 16; return;
case e_APP_PIPELINE_HASH_KEY16_LRU:
*special = 0; *ext = 0; *key_size = 16; return;
case e_APP_PIPELINE_HASH_KEY32_EXT:
*special = 0; *ext = 1; *key_size = 32; return;
case e_APP_PIPELINE_HASH_KEY32_LRU:
*special = 0; *ext = 0; *key_size = 32; return;
case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT:
*special = 1; *ext = 1; *key_size = 8; return;
case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU:
*special = 1; *ext = 0; *key_size = 8; return;
case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT:
*special = 1; *ext = 1; *key_size = 16; return;
case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU:
*special = 1; *ext = 0; *key_size = 16; return;
case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT:
*special = 1; *ext = 1; *key_size = 32; return;
case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU:
*special = 1; *ext = 0; *key_size = 32; return;
default:
rte_panic("Invalid hash table type or key size\n");
}
}
void
app_main_loop_worker_pipeline_hash(void) {
struct rte_pipeline_params pipeline_params = {
.name = "pipeline",
.socket_id = rte_socket_id(),
};
struct rte_pipeline *p;
uint32_t port_in_id[APP_MAX_PORTS];
uint32_t port_out_id[APP_MAX_PORTS];
uint32_t table_id;
uint32_t i;
uint32_t special, ext, key_size;
translate_options(&special, &ext, &key_size);
RTE_LOG(INFO, USER1, "Core %u is doing work "
"(pipeline with hash table, %s, %s, %d-byte key)\n",
rte_lcore_id(),
special ? "specialized" : "non-specialized",
ext ? "extendible bucket" : "LRU",
key_size);
/* Pipeline configuration */
p = rte_pipeline_create(&pipeline_params);
if (p == NULL)
rte_panic("Unable to configure the pipeline\n");
/* Input port configuration */
for (i = 0; i < app.n_ports; i++) {
struct rte_port_ring_reader_params port_ring_params = {
.ring = app.rings_rx[i],
};
struct rte_pipeline_port_in_params port_params = {
.ops = &rte_port_ring_reader_ops,
.arg_create = (void *) &port_ring_params,
.f_action = NULL,
.arg_ah = NULL,
.burst_size = app.burst_size_worker_read,
};
if (rte_pipeline_port_in_create(p, &port_params,
&port_in_id[i]))
rte_panic("Unable to configure input port for "
"ring %d\n", i);
}
/* Output port configuration */
for (i = 0; i < app.n_ports; i++) {
struct rte_port_ring_writer_params port_ring_params = {
.ring = app.rings_tx[i],
.tx_burst_sz = app.burst_size_worker_write,
};
struct rte_pipeline_port_out_params port_params = {
.ops = &rte_port_ring_writer_ops,
.arg_create = (void *) &port_ring_params,
.f_action = NULL,
.arg_ah = NULL,
};
if (rte_pipeline_port_out_create(p, &port_params,
&port_out_id[i]))
rte_panic("Unable to configure output port for "
"ring %d\n", i);
}
/* Table configuration */
switch (app.pipeline_type) {
case e_APP_PIPELINE_HASH_KEY8_EXT:
case e_APP_PIPELINE_HASH_KEY16_EXT:
case e_APP_PIPELINE_HASH_KEY32_EXT:
{
struct rte_table_hash_ext_params table_hash_params = {
.key_size = key_size,
.n_keys = 1 << 24,
.n_buckets = 1 << 22,
.n_buckets_ext = 1 << 21,
.f_hash = test_hash,
.seed = 0,
.signature_offset = APP_METADATA_OFFSET(0),
.key_offset = APP_METADATA_OFFSET(32),
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_ext_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table\n");
}
break;
case e_APP_PIPELINE_HASH_KEY8_LRU:
case e_APP_PIPELINE_HASH_KEY16_LRU:
case e_APP_PIPELINE_HASH_KEY32_LRU:
{
struct rte_table_hash_lru_params table_hash_params = {
.key_size = key_size,
.n_keys = 1 << 24,
.n_buckets = 1 << 22,
.f_hash = test_hash,
.seed = 0,
.signature_offset = 0,
.key_offset = 32,
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_lru_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table\n");
}
break;
case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT:
{
struct rte_table_hash_key8_ext_params table_hash_params = {
.n_entries = 1 << 24,
.n_entries_ext = 1 << 23,
.signature_offset = APP_METADATA_OFFSET(0),
.key_offset = APP_METADATA_OFFSET(32),
.key_mask = NULL,
.f_hash = test_hash,
.seed = 0,
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_key8_ext_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table\n");
}
break;
case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU:
{
struct rte_table_hash_key8_lru_params table_hash_params = {
.n_entries = 1 << 24,
.signature_offset = APP_METADATA_OFFSET(0),
.key_offset = APP_METADATA_OFFSET(32),
.key_mask = NULL,
.f_hash = test_hash,
.seed = 0,
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_key8_lru_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table\n");
}
break;
case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT:
{
struct rte_table_hash_key16_ext_params table_hash_params = {
.n_entries = 1 << 24,
.n_entries_ext = 1 << 23,
.signature_offset = APP_METADATA_OFFSET(0),
.key_offset = APP_METADATA_OFFSET(32),
.f_hash = test_hash,
.seed = 0,
.key_mask = NULL,
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_key16_ext_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table)\n");
}
break;
case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU:
{
struct rte_table_hash_key16_lru_params table_hash_params = {
.n_entries = 1 << 24,
.signature_offset = APP_METADATA_OFFSET(0),
.key_offset = APP_METADATA_OFFSET(32),
.f_hash = test_hash,
.seed = 0,
.key_mask = NULL,
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_key16_lru_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table\n");
}
break;
case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT:
{
struct rte_table_hash_key32_ext_params table_hash_params = {
.n_entries = 1 << 24,
.n_entries_ext = 1 << 23,
.signature_offset = APP_METADATA_OFFSET(0),
.key_offset = APP_METADATA_OFFSET(32),
.f_hash = test_hash,
.seed = 0,
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_key32_ext_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table\n");
}
break;
case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU:
{
struct rte_table_hash_key32_lru_params table_hash_params = {
.n_entries = 1 << 24,
.signature_offset = APP_METADATA_OFFSET(0),
.key_offset = APP_METADATA_OFFSET(32),
.f_hash = test_hash,
.seed = 0,
};
struct rte_pipeline_table_params table_params = {
.ops = &rte_table_hash_key32_lru_ops,
.arg_create = &table_hash_params,
.f_action_hit = NULL,
.f_action_miss = NULL,
.arg_ah = NULL,
.action_data_size = 0,
};
if (rte_pipeline_table_create(p, &table_params, &table_id))
rte_panic("Unable to configure the hash table\n");
}
break;
default:
rte_panic("Invalid hash table type or key size\n");
}
/* Interconnecting ports and tables */
for (i = 0; i < app.n_ports; i++)
if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i],
table_id))
rte_panic("Unable to connect input port %u to "
"table %u\n", port_in_id[i], table_id);
/* Add entries to tables */
for (i = 0; i < (1 << 24); i++) {
struct rte_pipeline_table_entry entry = {
.action = RTE_PIPELINE_ACTION_PORT,
{.port_id = port_out_id[i & (app.n_ports - 1)]},
};
struct rte_pipeline_table_entry *entry_ptr;
uint8_t key[32];
uint32_t *k32 = (uint32_t *) key;
int key_found, status;
memset(key, 0, sizeof(key));
k32[0] = rte_be_to_cpu_32(i);
status = rte_pipeline_table_entry_add(p, table_id, key, &entry,
&key_found, &entry_ptr);
if (status < 0)
rte_panic("Unable to add entry to table %u (%d)\n",
table_id, status);
}
/* Enable input ports */
for (i = 0; i < app.n_ports; i++)
if (rte_pipeline_port_in_enable(p, port_in_id[i]))
rte_panic("Unable to enable input port %u\n",
port_in_id[i]);
/* Check pipeline consistency */
if (rte_pipeline_check(p) < 0)
rte_panic("Pipeline consistency check failed\n");
/* Run-time */
#if APP_FLUSH == 0
for ( ; ; )
rte_pipeline_run(p);
#else
for (i = 0; ; i++) {
rte_pipeline_run(p);
if ((i & APP_FLUSH) == 0)
rte_pipeline_flush(p);
}
#endif
}
uint64_t test_hash(
void *key,
__attribute__((unused)) uint32_t key_size,
__attribute__((unused)) uint64_t seed)
{
uint32_t *k32 = (uint32_t *) key;
uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
uint64_t signature = (ip_dst >> 2) | ((ip_dst & 0x3) << 30);
return signature;
}
void
app_main_loop_rx_metadata(void) {
uint32_t i, j;
int ret;
RTE_LOG(INFO, USER1, "Core %u is doing RX (with meta-data)\n",
rte_lcore_id());
for (i = 0; ; i = ((i + 1) & (app.n_ports - 1))) {
uint16_t n_mbufs;
n_mbufs = rte_eth_rx_burst(
app.ports[i],
0,
app.mbuf_rx.array,
app.burst_size_rx_read);
if (n_mbufs == 0)
continue;
for (j = 0; j < n_mbufs; j++) {
struct rte_mbuf *m;
uint8_t *m_data, *key;
struct ipv4_hdr *ip_hdr;
struct ipv6_hdr *ipv6_hdr;
uint32_t ip_dst;
uint8_t *ipv6_dst;
uint32_t *signature, *k32;
m = app.mbuf_rx.array[j];
m_data = rte_pktmbuf_mtod(m, uint8_t *);
signature = RTE_MBUF_METADATA_UINT32_PTR(m,
APP_METADATA_OFFSET(0));
key = RTE_MBUF_METADATA_UINT8_PTR(m,
APP_METADATA_OFFSET(32));
if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
ip_hdr = (struct ipv4_hdr *)
&m_data[sizeof(struct ether_hdr)];
ip_dst = ip_hdr->dst_addr;
k32 = (uint32_t *) key;
k32[0] = ip_dst & 0xFFFFFF00;
} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
ipv6_hdr = (struct ipv6_hdr *)
&m_data[sizeof(struct ether_hdr)];
ipv6_dst = ipv6_hdr->dst_addr;
memcpy(key, ipv6_dst, 16);
} else
continue;
*signature = test_hash(key, 0, 0);
}
do {
ret = rte_ring_sp_enqueue_bulk(
app.rings_rx[i],
(void **) app.mbuf_rx.array,
n_mbufs);
} while (ret < 0);
}
}

View File

@ -1,184 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include <string.h>
#include <sys/queue.h>
#include <stdarg.h>
#include <errno.h>
#include <getopt.h>
#include <rte_common.h>
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
#include <rte_branch_prediction.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_random.h>
#include <rte_debug.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_ip.h>
#include <rte_tcp.h>
#include <rte_lpm.h>
#include <rte_lpm6.h>
#include <rte_malloc.h>
#include "main.h"
void
app_main_loop_rx(void) {
uint32_t i;
int ret;
RTE_LOG(INFO, USER1, "Core %u is doing RX\n", rte_lcore_id());
for (i = 0; ; i = ((i + 1) & (app.n_ports - 1))) {
uint16_t n_mbufs;
n_mbufs = rte_eth_rx_burst(
app.ports[i],
0,
app.mbuf_rx.array,
app.burst_size_rx_read);
if (n_mbufs == 0)
continue;
do {
ret = rte_ring_sp_enqueue_bulk(
app.rings_rx[i],
(void **) app.mbuf_rx.array,
n_mbufs);
} while (ret < 0);
}
}
void
app_main_loop_worker(void) {
struct app_mbuf_array *worker_mbuf;
uint32_t i;
RTE_LOG(INFO, USER1, "Core %u is doing work (no pipeline)\n",
rte_lcore_id());
worker_mbuf = rte_malloc_socket(NULL, sizeof(struct app_mbuf_array),
RTE_CACHE_LINE_SIZE, rte_socket_id());
if (worker_mbuf == NULL)
rte_panic("Worker thread: cannot allocate buffer space\n");
for (i = 0; ; i = ((i + 1) & (app.n_ports - 1))) {
int ret;
ret = rte_ring_sc_dequeue_bulk(
app.rings_rx[i],
(void **) worker_mbuf->array,
app.burst_size_worker_read);
if (ret == -ENOENT)
continue;
do {
ret = rte_ring_sp_enqueue_bulk(
app.rings_tx[i ^ 1],
(void **) worker_mbuf->array,
app.burst_size_worker_write);
} while (ret < 0);
}
}
void
app_main_loop_tx(void) {
uint32_t i;
RTE_LOG(INFO, USER1, "Core %u is doing TX\n", rte_lcore_id());
for (i = 0; ; i = ((i + 1) & (app.n_ports - 1))) {
uint16_t n_mbufs, n_pkts;
int ret;
n_mbufs = app.mbuf_tx[i].n_mbufs;
ret = rte_ring_sc_dequeue_bulk(
app.rings_tx[i],
(void **) &app.mbuf_tx[i].array[n_mbufs],
app.burst_size_tx_read);
if (ret == -ENOENT)
continue;
n_mbufs += app.burst_size_tx_read;
if (n_mbufs < app.burst_size_tx_write) {
app.mbuf_tx[i].n_mbufs = n_mbufs;
continue;
}
n_pkts = rte_eth_tx_burst(
app.ports[i],
0,
app.mbuf_tx[i].array,
n_mbufs);
if (n_pkts < n_mbufs) {
uint16_t k;
for (k = n_pkts; k < n_mbufs; k++) {
struct rte_mbuf *pkt_to_free;
pkt_to_free = app.mbuf_tx[i].array[k];
rte_pktmbuf_free(pkt_to_free);
}
}
app.mbuf_tx[i].n_mbufs = 0;
}
}

View File

@ -47,6 +47,9 @@ CFLAGS += $(WERROR_FLAGS)
SRCS-y := testpmd.c
SRCS-y += parameters.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_flow.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_mtr.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_tm.c
SRCS-y += config.c
SRCS-y += iofwd.c
SRCS-y += macfwd.c
@ -58,10 +61,35 @@ SRCS-y += csumonly.c
SRCS-y += icmpecho.c
SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
CFLAGS_cmdline.o := -D_GNU_SOURCE
ifeq ($(CONFIG_RTE_LIBRTE_PMD_SOFTNIC)$(CONFIG_RTE_LIBRTE_SCHED),yy)
SRCS-y += tm.c
endif
# this application needs libraries first
DEPDIRS-y += lib drivers
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y)
LDLIBS += -lrte_pmd_bond
endif
ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
LDLIBS += -lrte_pmd_ixgbe
endif
ifeq ($(CONFIG_RTE_LIBRTE_I40E_PMD),y)
LDLIBS += -lrte_pmd_i40e
endif
ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD),y)
LDLIBS += -lrte_pmd_bnxt
endif
ifeq ($(CONFIG_RTE_LIBRTE_PMD_SOFTNIC),y)
LDLIBS += -lrte_pmd_softnic
endif
endif
CFLAGS_cmdline.o := -D_GNU_SOURCE
include $(RTE_SDK)/mk/rte.app.mk

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CMDLINE_MTR_H_
#define _CMDLINE_MTR_H_
/* Traffic Metering and Policing */
extern cmdline_parse_inst_t cmd_add_port_meter_profile_srtcm;
extern cmdline_parse_inst_t cmd_add_port_meter_profile_trtcm;
extern cmdline_parse_inst_t cmd_add_port_meter_profile_trtcm_rfc4115;
extern cmdline_parse_inst_t cmd_del_port_meter_profile;
extern cmdline_parse_inst_t cmd_set_port_meter;
extern cmdline_parse_inst_t cmd_del_port_meter;
extern cmdline_parse_inst_t cmd_set_port_meter_profile;
extern cmdline_parse_inst_t cmd_set_port_meter_policer_action;
extern cmdline_parse_inst_t cmd_set_port_meter_stats_mask;
extern cmdline_parse_inst_t cmd_show_port_meter_stats;
#endif /* _CMDLINE_MTR_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CMDLINE_TM_H_
#define _CMDLINE_TM_H_
/* Traffic Management CLI */
extern cmdline_parse_inst_t cmd_show_port_tm_cap;
extern cmdline_parse_inst_t cmd_show_port_tm_level_cap;
extern cmdline_parse_inst_t cmd_show_port_tm_node_cap;
extern cmdline_parse_inst_t cmd_show_port_tm_node_type;
extern cmdline_parse_inst_t cmd_show_port_tm_node_stats;
extern cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile;
extern cmdline_parse_inst_t cmd_del_port_tm_node_shaper_profile;
extern cmdline_parse_inst_t cmd_add_port_tm_node_shared_shaper;
extern cmdline_parse_inst_t cmd_del_port_tm_node_shared_shaper;
extern cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile;
extern cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile;
extern cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile;
extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node;
extern cmdline_parse_inst_t cmd_add_port_tm_leaf_node;
extern cmdline_parse_inst_t cmd_del_port_tm_node;
extern cmdline_parse_inst_t cmd_set_port_tm_node_parent;
extern cmdline_parse_inst_t cmd_port_tm_hierarchy_commit;
#endif /* _CMDLINE_TM_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -49,18 +49,14 @@
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_memcpy.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_ether.h>
@ -71,6 +67,10 @@
#include <rte_sctp.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_flow.h>
#include <rte_gro.h>
#include <rte_gso.h>
#include "testpmd.h"
#define IP_DEFTTL 64 /* from RFC 1340. */
@ -92,6 +92,7 @@
/* structure that caches offload info for the current packet */
struct testpmd_offload_info {
uint16_t ethertype;
uint8_t gso_enable;
uint16_t l2_len;
uint16_t l3_len;
uint16_t l4_len;
@ -102,6 +103,8 @@ struct testpmd_offload_info {
uint16_t outer_l3_len;
uint8_t outer_l4_proto;
uint16_t tso_segsz;
uint16_t tunnel_tso_segsz;
uint32_t pkt_len;
};
/* simplified GRE header */
@ -110,15 +113,6 @@ struct simple_gre_hdr {
uint16_t proto;
} __attribute__((__packed__));
static uint16_t
get_psd_sum(void *l3_hdr, uint16_t ethertype, uint64_t ol_flags)
{
if (ethertype == _htons(ETHER_TYPE_IPv4))
return rte_ipv4_phdr_cksum(l3_hdr, ol_flags);
else /* assume ethertype == ETHER_TYPE_IPv6 */
return rte_ipv6_phdr_cksum(l3_hdr, ol_flags);
}
static uint16_t
get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)
{
@ -318,21 +312,6 @@ parse_encap_ip(void *encap_ip, struct testpmd_offload_info *info)
info->l2_len = 0;
}
/* modify the IPv4 or IPv4 source address of a packet */
static void
change_ip_addresses(void *l3_hdr, uint16_t ethertype)
{
struct ipv4_hdr *ipv4_hdr = l3_hdr;
struct ipv6_hdr *ipv6_hdr = l3_hdr;
if (ethertype == _htons(ETHER_TYPE_IPv4)) {
ipv4_hdr->src_addr =
rte_cpu_to_be_32(rte_be_to_cpu_32(ipv4_hdr->src_addr) + 1);
} else if (ethertype == _htons(ETHER_TYPE_IPv6)) {
ipv6_hdr->src_addr[15] = ipv6_hdr->src_addr[15] + 1;
}
}
/* if possible, calculate the checksum of a packet in hw or sw,
* depending on the testpmd command line configuration */
static uint64_t
@ -344,13 +323,28 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
struct tcp_hdr *tcp_hdr;
struct sctp_hdr *sctp_hdr;
uint64_t ol_flags = 0;
uint32_t max_pkt_len, tso_segsz = 0;
/* ensure packet is large enough to require tso */
if (!info->is_tunnel) {
max_pkt_len = info->l2_len + info->l3_len + info->l4_len +
info->tso_segsz;
if (info->tso_segsz != 0 && info->pkt_len > max_pkt_len)
tso_segsz = info->tso_segsz;
} else {
max_pkt_len = info->outer_l2_len + info->outer_l3_len +
info->l2_len + info->l3_len + info->l4_len +
info->tunnel_tso_segsz;
if (info->tunnel_tso_segsz != 0 && info->pkt_len > max_pkt_len)
tso_segsz = info->tunnel_tso_segsz;
}
if (info->ethertype == _htons(ETHER_TYPE_IPv4)) {
ipv4_hdr = l3_hdr;
ipv4_hdr->hdr_checksum = 0;
ol_flags |= PKT_TX_IPV4;
if (info->tso_segsz != 0 && info->l4_proto == IPPROTO_TCP) {
if (info->l4_proto == IPPROTO_TCP && tso_segsz) {
ol_flags |= PKT_TX_IP_CKSUM;
} else {
if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_IP_CKSUM)
@ -369,11 +363,9 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
/* do not recalculate udp cksum if it was 0 */
if (udp_hdr->dgram_cksum != 0) {
udp_hdr->dgram_cksum = 0;
if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_UDP_CKSUM) {
if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_UDP_CKSUM)
ol_flags |= PKT_TX_UDP_CKSUM;
udp_hdr->dgram_cksum = get_psd_sum(l3_hdr,
info->ethertype, ol_flags);
} else {
else {
udp_hdr->dgram_cksum =
get_udptcp_checksum(l3_hdr, udp_hdr,
info->ethertype);
@ -382,19 +374,17 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
} else if (info->l4_proto == IPPROTO_TCP) {
tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len);
tcp_hdr->cksum = 0;
if (info->tso_segsz != 0) {
if (tso_segsz)
ol_flags |= PKT_TX_TCP_SEG;
tcp_hdr->cksum = get_psd_sum(l3_hdr, info->ethertype,
ol_flags);
} else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM) {
else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM)
ol_flags |= PKT_TX_TCP_CKSUM;
tcp_hdr->cksum = get_psd_sum(l3_hdr, info->ethertype,
ol_flags);
} else {
else {
tcp_hdr->cksum =
get_udptcp_checksum(l3_hdr, tcp_hdr,
info->ethertype);
}
if (info->gso_enable)
ol_flags |= PKT_TX_TCP_SEG;
} else if (info->l4_proto == IPPROTO_SCTP) {
sctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len);
sctp_hdr->cksum = 0;
@ -412,12 +402,10 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
return ol_flags;
}
/* Calculate the checksum of outer header (only vxlan is supported,
* meaning IP + UDP). The caller already checked that it's a vxlan
* packet */
/* Calculate the checksum of outer header */
static uint64_t
process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
uint16_t testpmd_ol_flags)
uint16_t testpmd_ol_flags, int tso_enabled)
{
struct ipv4_hdr *ipv4_hdr = outer_l3_hdr;
struct ipv6_hdr *ipv6_hdr = outer_l3_hdr;
@ -432,16 +420,26 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
ol_flags |= PKT_TX_OUTER_IP_CKSUM;
else
ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
} else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)
} else
ol_flags |= PKT_TX_OUTER_IPV6;
if (info->outer_l4_proto != IPPROTO_UDP)
return ol_flags;
/* outer UDP checksum is always done in software as we have no
* hardware supporting it today, and no API for it. */
udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
/* outer UDP checksum is done in software as we have no hardware
* supporting it today, and no API for it. In the other side, for
* UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
* set to zero.
*
* If a packet will be TSOed into small packets by NIC, we cannot
* set/calculate a non-zero checksum, because it will be a wrong
* value after the packet be split into several small packets.
*/
if (tso_enabled)
udp_hdr->dgram_cksum = 0;
/* do not recalculate udp cksum if it was 0 */
if (udp_hdr->dgram_cksum != 0) {
udp_hdr->dgram_cksum = 0;
@ -588,7 +586,7 @@ pkt_copy_split(const struct rte_mbuf *pkt)
rc = mbuf_copy_split(pkt, md, seglen, nb_seg);
if (rc < 0)
RTE_LOG(ERR, USER1,
"mbuf_copy_split for %p(len=%u, nb_seg=%hhu) "
"mbuf_copy_split for %p(len=%u, nb_seg=%u) "
"into %u segments failed with error code: %d\n",
pkt, pkt->pkt_len, pkt->nb_segs, nb_seg, rc);
@ -609,7 +607,6 @@ pkt_copy_split(const struct rte_mbuf *pkt)
* Receive a burst of packets, and for each packet:
* - parse packet, and try to recognize a supported packet type (1)
* - if it's not a supported packet type, don't touch the packet, else:
* - modify the IPs in inner headers and in outer headers if any
* - reprocess the checksum of all supported layers. This is done in SW
* or HW, depending on testpmd command line configuration
* - if TSO is enabled in testpmd command line, also flag the mbuf for TCP
@ -634,19 +631,28 @@ static void
pkt_burst_checksum_forward(struct fwd_stream *fs)
{
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
struct rte_mbuf *gso_segments[GSO_MAX_PKT_BURST];
struct rte_gso_ctx *gso_ctx;
struct rte_mbuf **tx_pkts_burst;
struct rte_port *txp;
struct rte_mbuf *m, *p;
struct ether_hdr *eth_hdr;
void *l3_hdr = NULL, *outer_l3_hdr = NULL; /* can be IPv4 or IPv6 */
void **gro_ctx;
uint16_t gro_pkts_num;
uint8_t gro_enable;
uint16_t nb_rx;
uint16_t nb_tx;
uint16_t nb_prep;
uint16_t i;
uint64_t ol_flags;
uint64_t rx_ol_flags, tx_ol_flags;
uint16_t testpmd_ol_flags;
uint32_t retry;
uint32_t rx_bad_ip_csum;
uint32_t rx_bad_l4_csum;
struct testpmd_offload_info info;
uint16_t nb_segments = 0;
int ret;
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
uint64_t start_tsc;
@ -663,31 +669,38 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
nb_pkt_per_burst);
if (unlikely(nb_rx == 0))
return;
#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
fs->rx_burst_stats.pkt_burst_spread[nb_rx]++;
#endif
fs->rx_packets += nb_rx;
rx_bad_ip_csum = 0;
rx_bad_l4_csum = 0;
gro_enable = gro_ports[fs->rx_port].enable;
txp = &ports[fs->tx_port];
testpmd_ol_flags = txp->tx_ol_flags;
memset(&info, 0, sizeof(info));
info.tso_segsz = txp->tso_segsz;
info.tunnel_tso_segsz = txp->tunnel_tso_segsz;
if (gso_ports[fs->tx_port].enable)
info.gso_enable = 1;
for (i = 0; i < nb_rx; i++) {
if (likely(i < nb_rx - 1))
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
void *));
ol_flags = 0;
info.is_tunnel = 0;
m = pkts_burst[i];
info.is_tunnel = 0;
info.pkt_len = rte_pktmbuf_pkt_len(m);
tx_ol_flags = 0;
rx_ol_flags = m->ol_flags;
/* Update the L3/L4 checksum error packet statistics */
rx_bad_ip_csum += ((m->ol_flags & PKT_RX_IP_CKSUM_BAD) != 0);
rx_bad_l4_csum += ((m->ol_flags & PKT_RX_L4_CKSUM_BAD) != 0);
if ((rx_ol_flags & PKT_RX_IP_CKSUM_MASK) == PKT_RX_IP_CKSUM_BAD)
rx_bad_ip_csum += 1;
if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD)
rx_bad_l4_csum += 1;
/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
* and inner headers */
@ -704,18 +717,27 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_PARSE_TUNNEL) {
if (info.l4_proto == IPPROTO_UDP) {
struct udp_hdr *udp_hdr;
udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
info.l3_len);
parse_vxlan(udp_hdr, &info, m->packet_type);
if (info.is_tunnel)
tx_ol_flags |= PKT_TX_TUNNEL_VXLAN;
} else if (info.l4_proto == IPPROTO_GRE) {
struct simple_gre_hdr *gre_hdr;
gre_hdr = (struct simple_gre_hdr *)
((char *)l3_hdr + info.l3_len);
parse_gre(gre_hdr, &info);
if (info.is_tunnel)
tx_ol_flags |= PKT_TX_TUNNEL_GRE;
} else if (info.l4_proto == IPPROTO_IPIP) {
void *encap_ip_hdr;
encap_ip_hdr = (char *)l3_hdr + info.l3_len;
parse_encap_ip(encap_ip_hdr, &info);
if (info.is_tunnel)
tx_ol_flags |= PKT_TX_TUNNEL_IPIP;
}
}
@ -725,38 +747,37 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
l3_hdr = (char *)l3_hdr + info.outer_l3_len + info.l2_len;
}
/* step 2: change all source IPs (v4 or v6) so we need
* to recompute the chksums even if they were correct */
change_ip_addresses(l3_hdr, info.ethertype);
if (info.is_tunnel == 1)
change_ip_addresses(outer_l3_hdr, info.outer_ethertype);
/* step 3: depending on user command line configuration,
/* step 2: depending on user command line configuration,
* recompute checksum either in software or flag the
* mbuf to offload the calculation to the NIC. If TSO
* is configured, prepare the mbuf for TCP segmentation. */
/* process checksums of inner headers first */
ol_flags |= process_inner_cksums(l3_hdr, &info, testpmd_ol_flags);
tx_ol_flags |= process_inner_cksums(l3_hdr, &info,
testpmd_ol_flags);
/* Then process outer headers if any. Note that the software
* checksum will be wrong if one of the inner checksums is
* processed in hardware. */
if (info.is_tunnel == 1) {
ol_flags |= process_outer_cksums(outer_l3_hdr, &info,
testpmd_ol_flags);
tx_ol_flags |= process_outer_cksums(outer_l3_hdr, &info,
testpmd_ol_flags,
!!(tx_ol_flags & PKT_TX_TCP_SEG));
}
/* step 4: fill the mbuf meta data (flags and header lengths) */
/* step 3: fill the mbuf meta data (flags and header lengths) */
if (info.is_tunnel == 1) {
if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {
if (info.tunnel_tso_segsz ||
(testpmd_ol_flags &
TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) ||
(tx_ol_flags & PKT_TX_OUTER_IPV6)) {
m->outer_l2_len = info.outer_l2_len;
m->outer_l3_len = info.outer_l3_len;
m->l2_len = info.l2_len;
m->l3_len = info.l3_len;
m->l4_len = info.l4_len;
m->tso_segsz = info.tunnel_tso_segsz;
}
else {
/* if there is a outer UDP cksum
@ -776,9 +797,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
m->l2_len = info.l2_len;
m->l3_len = info.l3_len;
m->l4_len = info.l4_len;
m->tso_segsz = info.tso_segsz;
}
m->tso_segsz = info.tso_segsz;
m->ol_flags = ol_flags;
m->ol_flags = tx_ol_flags;
/* Do split & copy for the packet. */
if (tx_pkt_split != TX_PKT_SPLIT_OFF) {
@ -792,32 +813,19 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
/* if verbose mode is enabled, dump debug info */
if (verbose_level > 0) {
struct {
uint64_t flag;
uint64_t mask;
} tx_flags[] = {
{ PKT_TX_IP_CKSUM, PKT_TX_IP_CKSUM },
{ PKT_TX_UDP_CKSUM, PKT_TX_L4_MASK },
{ PKT_TX_TCP_CKSUM, PKT_TX_L4_MASK },
{ PKT_TX_SCTP_CKSUM, PKT_TX_L4_MASK },
{ PKT_TX_IPV4, PKT_TX_IPV4 },
{ PKT_TX_IPV6, PKT_TX_IPV6 },
{ PKT_TX_OUTER_IP_CKSUM, PKT_TX_OUTER_IP_CKSUM },
{ PKT_TX_OUTER_IPV4, PKT_TX_OUTER_IPV4 },
{ PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV6 },
{ PKT_TX_TCP_SEG, PKT_TX_TCP_SEG },
};
unsigned j;
const char *name;
char buf[256];
printf("-----------------\n");
printf("mbuf=%p, pkt_len=%u, nb_segs=%hhu:\n",
m, m->pkt_len, m->nb_segs);
printf("port=%u, mbuf=%p, pkt_len=%u, nb_segs=%u:\n",
fs->rx_port, m, m->pkt_len, m->nb_segs);
/* dump rx parsed packet info */
rte_get_rx_ol_flag_list(rx_ol_flags, buf, sizeof(buf));
printf("rx: l2_len=%d ethertype=%x l3_len=%d "
"l4_proto=%d l4_len=%d\n",
"l4_proto=%d l4_len=%d flags=%s\n",
info.l2_len, rte_be_to_cpu_16(info.ethertype),
info.l3_len, info.l4_proto, info.l4_len);
info.l3_len, info.l4_proto, info.l4_len, buf);
if (rx_ol_flags & PKT_RX_LRO)
printf("rx: m->lro_segsz=%u\n", m->tso_segsz);
if (info.is_tunnel == 1)
printf("rx: outer_l2_len=%d outer_ethertype=%x "
"outer_l3_len=%d\n", info.outer_l2_len,
@ -832,23 +840,80 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
printf("tx: m->l2_len=%d m->l3_len=%d "
"m->l4_len=%d\n",
m->l2_len, m->l3_len, m->l4_len);
if ((info.is_tunnel == 1) &&
(testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM))
printf("tx: m->outer_l2_len=%d m->outer_l3_len=%d\n",
m->outer_l2_len, m->outer_l3_len);
if (info.tso_segsz != 0)
if (info.is_tunnel == 1) {
if ((testpmd_ol_flags &
TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) ||
(tx_ol_flags & PKT_TX_OUTER_IPV6))
printf("tx: m->outer_l2_len=%d "
"m->outer_l3_len=%d\n",
m->outer_l2_len,
m->outer_l3_len);
if (info.tunnel_tso_segsz != 0 &&
(m->ol_flags & PKT_TX_TCP_SEG))
printf("tx: m->tso_segsz=%d\n",
m->tso_segsz);
} else if (info.tso_segsz != 0 &&
(m->ol_flags & PKT_TX_TCP_SEG))
printf("tx: m->tso_segsz=%d\n", m->tso_segsz);
printf("tx: flags=");
for (j = 0; j < sizeof(tx_flags)/sizeof(*tx_flags); j++) {
name = rte_get_tx_ol_flag_name(tx_flags[j].flag);
if ((m->ol_flags & tx_flags[j].mask) ==
tx_flags[j].flag)
printf("%s ", name);
}
rte_get_tx_ol_flag_list(m->ol_flags, buf, sizeof(buf));
printf("tx: flags=%s", buf);
printf("\n");
}
}
nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);
if (unlikely(gro_enable)) {
if (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) {
nb_rx = rte_gro_reassemble_burst(pkts_burst, nb_rx,
&(gro_ports[fs->rx_port].param));
} else {
gro_ctx = current_fwd_lcore()->gro_ctx;
nb_rx = rte_gro_reassemble(pkts_burst, nb_rx, gro_ctx);
if (++fs->gro_times >= gro_flush_cycles) {
gro_pkts_num = rte_gro_get_pkt_count(gro_ctx);
if (gro_pkts_num > MAX_PKT_BURST - nb_rx)
gro_pkts_num = MAX_PKT_BURST - nb_rx;
nb_rx += rte_gro_timeout_flush(gro_ctx, 0,
RTE_GRO_TCP_IPV4,
&pkts_burst[nb_rx],
gro_pkts_num);
fs->gro_times = 0;
}
}
}
if (gso_ports[fs->tx_port].enable == 0)
tx_pkts_burst = pkts_burst;
else {
gso_ctx = &(current_fwd_lcore()->gso_ctx);
gso_ctx->gso_size = gso_max_segment_size;
for (i = 0; i < nb_rx; i++) {
ret = rte_gso_segment(pkts_burst[i], gso_ctx,
&gso_segments[nb_segments],
GSO_MAX_PKT_BURST - nb_segments);
if (ret >= 0)
nb_segments += ret;
else {
RTE_LOG(DEBUG, USER1,
"Unable to segment packet");
rte_pktmbuf_free(pkts_burst[i]);
}
}
tx_pkts_burst = gso_segments;
nb_rx = nb_segments;
}
nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,
tx_pkts_burst, nb_rx);
if (nb_prep != nb_rx)
printf("Preparing packet burst to transmit failed: %s\n",
rte_strerror(rte_errno));
nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, tx_pkts_burst,
nb_prep);
/*
* Retry if necessary
*/
@ -857,7 +922,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
rte_delay_us(burst_tx_delay_time);
nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
&pkts_burst[nb_tx], nb_rx - nb_tx);
&tx_pkts_burst[nb_tx], nb_rx - nb_tx);
}
}
fs->tx_packets += nb_tx;
@ -870,9 +935,10 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
if (unlikely(nb_tx < nb_rx)) {
fs->fwd_dropped += (nb_rx - nb_tx);
do {
rte_pktmbuf_free(pkts_burst[nb_tx]);
rte_pktmbuf_free(tx_pkts_burst[nb_tx]);
} while (++nb_tx < nb_rx);
}
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
end_tsc = rte_rdtsc();
core_cycles = (end_tsc - start_tsc);

View File

@ -50,15 +50,12 @@
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
@ -69,12 +66,12 @@
#include <rte_tcp.h>
#include <rte_udp.h>
#include <rte_string_fns.h>
#include <rte_flow.h>
#include "testpmd.h"
/* hardcoded configuration (for now) */
static unsigned cfg_n_flows = 1024;
static unsigned cfg_pkt_size = 300;
static uint32_t cfg_ip_src = IPv4(10, 254, 0, 0);
static uint32_t cfg_ip_dst = IPv4(10, 253, 0, 0);
static uint16_t cfg_udp_src = 1000;
@ -118,7 +115,7 @@ ip_sum(const unaligned_uint16_t *hdr, int hdr_len)
static void
pkt_burst_flow_gen(struct fwd_stream *fs)
{
unsigned pkt_size = cfg_pkt_size - 4; /* Adjust FCS */
unsigned pkt_size = tx_pkt_length - 4; /* Adjust FCS */
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
struct rte_mempool *mbp;
struct rte_mbuf *pkt;
@ -126,7 +123,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
struct ipv4_hdr *ip_hdr;
struct udp_hdr *udp_hdr;
uint16_t vlan_tci, vlan_tci_outer;
uint16_t ol_flags;
uint64_t ol_flags;
uint16_t nb_rx;
uint16_t nb_tx;
uint16_t nb_pkt;
@ -154,7 +151,13 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
mbp = current_fwd_lcore()->mbp;
vlan_tci = ports[fs->tx_port].tx_vlan_id;
vlan_tci_outer = ports[fs->tx_port].tx_vlan_id_outer;
ol_flags = ports[fs->tx_port].tx_ol_flags;
if (ports[fs->tx_port].tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_VLAN)
ol_flags = PKT_TX_VLAN_PKT;
if (ports[fs->tx_port].tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ)
ol_flags |= PKT_TX_QINQ_PKT;
if (ports[fs->tx_port].tx_ol_flags & TESTPMD_TX_OFFLOAD_MACSEC)
ol_flags |= PKT_TX_MACSEC;
for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
pkt = rte_mbuf_raw_alloc(mbp);

View File

@ -52,7 +52,6 @@
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
@ -62,6 +61,7 @@
#include <rte_ip.h>
#include <rte_icmp.h>
#include <rte_string_fns.h>
#include <rte_flow.h>
#include "testpmd.h"
@ -200,7 +200,7 @@ ip_proto_name(uint16_t ip_proto)
"OSPFIGP", /**< OSPFIGP */
"SRPC", /**< Strite RPC protocol */
"LARP", /**< Locus Address Resoloution */
"LARP", /**< Locus Address Resolution */
"MTP", /**< Multicast Transport */
"AX25", /**< AX.25 Frames */
"4IN4", /**< IP encapsulated in IP */
@ -297,7 +297,7 @@ ipv4_hdr_cksum(struct ipv4_hdr *ip_h)
(((rte_be_to_cpu_32((ipv4_addr)) >> 24) & 0x000000FF) == 0xE0)
/*
* Receive a burst of packets, lookup for ICMP echo requets, and, if any,
* Receive a burst of packets, lookup for ICMP echo requests, and, if any,
* send back ICMP echo replies.
*/
static void

View File

@ -34,6 +34,7 @@
#include <rte_cycles.h>
#include <rte_ethdev.h>
#include <rte_flow.h>
#include "testpmd.h"
@ -85,12 +86,11 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index)
struct timespec timestamp = {0, 0};
if (rte_eth_timesync_read_rx_timestamp(pi, &timestamp, index) < 0) {
printf("Port %u RX timestamp registers not valid\n",
(unsigned) pi);
printf("Port %u RX timestamp registers not valid\n", pi);
return;
}
printf("Port %u RX timestamp value %lu s %lu ns\n",
(unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec);
pi, timestamp.tv_sec, timestamp.tv_nsec);
}
#define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */
@ -109,12 +109,12 @@ port_ieee1588_tx_timestamp_check(portid_t pi)
if (wait_us >= MAX_TX_TMST_WAIT_MICROSECS) {
printf("Port %u TX timestamp registers not valid after "
"%u micro-seconds\n",
(unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS);
pi, MAX_TX_TMST_WAIT_MICROSECS);
return;
}
printf("Port %u TX timestamp value %lu s %lu ns validated after "
"%u micro-second%s\n",
(unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us,
pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us,
(wait_us == 1) ? "" : "s");
}
@ -147,11 +147,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
if (eth_type == ETHER_TYPE_1588) {
printf("Port %u Received PTP packet not filtered"
" by hardware\n",
(unsigned) fs->rx_port);
fs->rx_port);
} else {
printf("Port %u Received non PTP packet type=0x%4x "
"len=%u\n",
(unsigned) fs->rx_port, eth_type,
fs->rx_port, eth_type,
(unsigned) mb->pkt_len);
}
rte_pktmbuf_free(mb);
@ -160,7 +160,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
if (eth_type != ETHER_TYPE_1588) {
printf("Port %u Received NON PTP packet incorrectly"
" detected by hardware\n",
(unsigned) fs->rx_port);
fs->rx_port);
rte_pktmbuf_free(mb);
return;
}
@ -174,19 +174,19 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
if (ptp_hdr->version != 0x02) {
printf("Port %u Received PTP V2 Ethernet frame with wrong PTP"
" protocol version 0x%x (should be 0x02)\n",
(unsigned) fs->rx_port, ptp_hdr->version);
fs->rx_port, ptp_hdr->version);
rte_pktmbuf_free(mb);
return;
}
if (ptp_hdr->msg_id != PTP_SYNC_MESSAGE) {
printf("Port %u Received PTP V2 Ethernet frame with unexpected"
" message ID 0x%x (expected 0x0 - PTP_SYNC_MESSAGE)\n",
(unsigned) fs->rx_port, ptp_hdr->msg_id);
fs->rx_port, ptp_hdr->msg_id);
rte_pktmbuf_free(mb);
return;
}
printf("Port %u IEEE1588 PTP V2 SYNC Message filtered by hardware\n",
(unsigned) fs->rx_port);
fs->rx_port);
/*
* Check that the received PTP packet has been timestamped by the
@ -195,7 +195,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
if (! (mb->ol_flags & PKT_RX_IEEE1588_TMST)) {
printf("Port %u Received PTP packet not timestamped"
" by hardware\n",
(unsigned) fs->rx_port);
fs->rx_port);
rte_pktmbuf_free(mb);
return;
}
@ -215,8 +215,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
mb->ol_flags |= PKT_TX_IEEE1588_TMST;
fs->tx_packets += 1;
if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) {
printf("Port %u sent PTP packet dropped\n",
(unsigned) fs->rx_port);
printf("Port %u sent PTP packet dropped\n", fs->rx_port);
fs->fwd_dropped += 1;
rte_pktmbuf_free(mb);
return;

View File

@ -48,15 +48,12 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
@ -65,6 +62,7 @@
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_string_fns.h>
#include <rte_flow.h>
#include "testpmd.h"

View File

@ -49,15 +49,12 @@
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
@ -66,6 +63,7 @@
#include <rte_ethdev.h>
#include <rte_ip.h>
#include <rte_string_fns.h>
#include <rte_flow.h>
#include "testpmd.h"
@ -113,6 +111,8 @@ pkt_burst_mac_forward(struct fwd_stream *fs)
ol_flags = PKT_TX_VLAN_PKT;
if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ)
ol_flags |= PKT_TX_QINQ_PKT;
if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_MACSEC)
ol_flags |= PKT_TX_MACSEC;
for (i = 0; i < nb_rx; i++) {
if (likely(i < nb_rx - 1))
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],

View File

@ -49,15 +49,12 @@
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
@ -66,6 +63,7 @@
#include <rte_ethdev.h>
#include <rte_ip.h>
#include <rte_string_fns.h>
#include <rte_flow.h>
#include "testpmd.h"
@ -113,6 +111,8 @@ pkt_burst_mac_swap(struct fwd_stream *fs)
ol_flags = PKT_TX_VLAN_PKT;
if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ)
ol_flags |= PKT_TX_QINQ_PKT;
if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_MACSEC)
ol_flags |= PKT_TX_MACSEC;
for (i = 0; i < nb_rx; i++) {
if (likely(i < nb_rx - 1))
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],

View File

@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
#include <time.h>
#include <fcntl.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/queue.h>
#include <sys/stat.h>
@ -56,14 +55,12 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
@ -77,6 +74,7 @@
#ifdef RTE_LIBRTE_PMD_BOND
#include <rte_eth_bond.h>
#endif
#include <rte_flow.h>
#include "testpmd.h"
@ -86,8 +84,10 @@ usage(char* progname)
printf("usage: %s "
#ifdef RTE_LIBRTE_CMDLINE
"[--interactive|-i] "
"[--cmdline-file=FILENAME] "
#endif
"[--help|-h] | [--auto-start|-a] | ["
"--tx-first | --stats-period=PERIOD | "
"--coremask=COREMASK --portmask=PORTMASK --numa "
"--mbuf-size= | --total-num-mbufs= | "
"--nb-cores= | --nb-ports= | "
@ -103,10 +103,15 @@ usage(char* progname)
progname);
#ifdef RTE_LIBRTE_CMDLINE
printf(" --interactive: run in interactive mode.\n");
printf(" --cmdline-file: execute cli commands before startup.\n");
#endif
printf(" --auto-start: start forwarding on init "
"[always when non-interactive].\n");
printf(" --help: display this message and quit.\n");
printf(" --tx-first: start forwarding sending a burst first "
"(only if interactive is disabled).\n");
printf(" --stats-period=PERIOD: statistics will be shown "
"every PERIOD seconds (only if interactive is disabled).\n");
printf(" --nb-cores=N: set the number of forwarding cores "
"(1 <= N <= %d).\n", nb_lcores);
printf(" --nb-ports=N: set the number of forwarding ports "
@ -149,8 +154,14 @@ usage(char* progname)
"the packet will be enqueued into the rx drop-queue. "
"If the drop-queue doesn't exist, the packet is dropped. "
"By default drop-queue=127.\n");
printf(" --crc-strip: enable CRC stripping by hardware.\n");
#ifdef RTE_LIBRTE_LATENCY_STATS
printf(" --latencystats=N: enable latency and jitter statistcs "
"monitoring on forwarding lcore id N.\n");
#endif
printf(" --disable-crc-strip: disable CRC stripping by hardware.\n");
printf(" --enable-lro: enable large receive offload.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf(" --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
printf(" --disable-hw-vlan: disable hardware vlan.\n");
printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
@ -191,9 +202,20 @@ usage(char* progname)
"(0 <= mapping <= %d).\n", RTE_ETHDEV_QUEUE_STAT_CNTRS - 1);
printf(" --no-flush-rx: Don't flush RX streams before forwarding."
" Used mainly with PCAP drivers.\n");
printf(" --txpkts=X[,Y]*: set TX segment sizes.\n");
printf(" --txpkts=X[,Y]*: set TX segment sizes"
" or total packet length.\n");
printf(" --disable-link-check: disable check on link status when "
"starting/stopping ports.\n");
printf(" --no-lsc-interrupt: disable link status change interrupt.\n");
printf(" --no-rmv-interrupt: disable device removal interrupt.\n");
printf(" --bitrate-stats=N: set the logical core N to perform "
"bit-rate calculation.\n");
printf(" --print-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|all>: "
"enable print of designated event or all of them.\n");
printf(" --mask-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|all>: "
"disable print of designated event or all of them.\n");
printf(" --flow-isolate-all: "
"requests flow API isolated mode on all ports at initialization time.\n");
}
#ifdef RTE_LIBRTE_CMDLINE
@ -353,13 +375,26 @@ parse_queue_stats_mapping_config(const char *q_arg, int is_rx)
return 0;
}
static void
print_invalid_socket_id_error(void)
{
unsigned int i = 0;
printf("Invalid socket id, options are: ");
for (i = 0; i < num_sockets; i++) {
printf("%u%s", socket_ids[i],
(i == num_sockets - 1) ? "\n" : ",");
}
}
static int
parse_portnuma_config(const char *q_arg)
{
char s[256];
const char *p, *p0 = q_arg;
char *end;
uint8_t i,port_id,socket_id;
uint8_t i, socket_id;
portid_t port_id;
unsigned size;
enum fieldnames {
FLD_PORT = 0,
@ -389,18 +424,18 @@ parse_portnuma_config(const char *q_arg)
if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
return -1;
}
port_id = (uint8_t)int_fld[FLD_PORT];
if (port_id_is_invalid(port_id, ENABLED_WARN)) {
port_id = (portid_t)int_fld[FLD_PORT];
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
port_id == (portid_t)RTE_PORT_ALL) {
printf("Valid port range is [0");
FOREACH_PORT(pid, ports)
RTE_ETH_FOREACH_DEV(pid)
printf(", %d", pid);
printf("]\n");
return -1;
}
socket_id = (uint8_t)int_fld[FLD_SOCKET];
if(socket_id >= max_socket) {
printf("Invalid socket id, range is [0, %d]\n",
max_socket - 1);
if (new_socket_id(socket_id)) {
print_invalid_socket_id_error();
return -1;
}
port_numa[port_id] = socket_id;
@ -415,7 +450,8 @@ parse_ringnuma_config(const char *q_arg)
char s[256];
const char *p, *p0 = q_arg;
char *end;
uint8_t i,port_id,ring_flag,socket_id;
uint8_t i, ring_flag, socket_id;
portid_t port_id;
unsigned size;
enum fieldnames {
FLD_PORT = 0,
@ -449,18 +485,18 @@ parse_ringnuma_config(const char *q_arg)
if (errno != 0 || end == str_fld[i] || int_fld[i] > 255)
return -1;
}
port_id = (uint8_t)int_fld[FLD_PORT];
if (port_id_is_invalid(port_id, ENABLED_WARN)) {
port_id = (portid_t)int_fld[FLD_PORT];
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
port_id == (portid_t)RTE_PORT_ALL) {
printf("Valid port range is [0");
FOREACH_PORT(pid, ports)
RTE_ETH_FOREACH_DEV(pid)
printf(", %d", pid);
printf("]\n");
return -1;
}
socket_id = (uint8_t)int_fld[FLD_SOCKET];
if (socket_id >= max_socket) {
printf("Invalid socket id, range is [0, %d]\n",
max_socket - 1);
if (new_socket_id(socket_id)) {
print_invalid_socket_id_error();
return -1;
}
ring_flag = (uint8_t)int_fld[FLD_FLAG];
@ -491,28 +527,65 @@ parse_ringnuma_config(const char *q_arg)
return 0;
}
static int
parse_event_printing_config(const char *optarg, int enable)
{
uint32_t mask = 0;
if (!strcmp(optarg, "unknown"))
mask = UINT32_C(1) << RTE_ETH_EVENT_UNKNOWN;
else if (!strcmp(optarg, "intr_lsc"))
mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_LSC;
else if (!strcmp(optarg, "queue_state"))
mask = UINT32_C(1) << RTE_ETH_EVENT_QUEUE_STATE;
else if (!strcmp(optarg, "intr_reset"))
mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_RESET;
else if (!strcmp(optarg, "vf_mbox"))
mask = UINT32_C(1) << RTE_ETH_EVENT_VF_MBOX;
else if (!strcmp(optarg, "macsec"))
mask = UINT32_C(1) << RTE_ETH_EVENT_MACSEC;
else if (!strcmp(optarg, "intr_rmv"))
mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_RMV;
else if (!strcmp(optarg, "all"))
mask = ~UINT32_C(0);
else {
fprintf(stderr, "Invalid event: %s\n", optarg);
return -1;
}
if (enable)
event_print_mask |= mask;
else
event_print_mask &= ~mask;
return 0;
}
void
launch_args_parse(int argc, char** argv)
{
int n, opt;
char **argvopt;
int opt_idx;
portid_t pid;
enum { TX, RX };
static struct option lgopts[] = {
{ "help", 0, 0, 0 },
#ifdef RTE_LIBRTE_CMDLINE
{ "interactive", 0, 0, 0 },
{ "cmdline-file", 1, 0, 0 },
{ "auto-start", 0, 0, 0 },
{ "eth-peers-configfile", 1, 0, 0 },
{ "eth-peer", 1, 0, 0 },
#endif
{ "tx-first", 0, 0, 0 },
{ "stats-period", 1, 0, 0 },
{ "ports", 1, 0, 0 },
{ "nb-cores", 1, 0, 0 },
{ "nb-ports", 1, 0, 0 },
{ "coremask", 1, 0, 0 },
{ "portmask", 1, 0, 0 },
{ "numa", 0, 0, 0 },
{ "no-numa", 0, 0, 0 },
{ "mp-anon", 0, 0, 0 },
{ "port-numa-config", 1, 0, 0 },
{ "ring-numa-config", 1, 0, 0 },
@ -524,8 +597,16 @@ launch_args_parse(int argc, char** argv)
{ "pkt-filter-report-hash", 1, 0, 0 },
{ "pkt-filter-size", 1, 0, 0 },
{ "pkt-filter-drop-queue", 1, 0, 0 },
{ "crc-strip", 0, 0, 0 },
#ifdef RTE_LIBRTE_LATENCY_STATS
{ "latencystats", 1, 0, 0 },
#endif
#ifdef RTE_LIBRTE_BITRATE
{ "bitrate-stats", 1, 0, 0 },
#endif
{ "disable-crc-strip", 0, 0, 0 },
{ "enable-lro", 0, 0, 0 },
{ "enable-rx-cksum", 0, 0, 0 },
{ "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
{ "disable-hw-vlan", 0, 0, 0 },
{ "disable-hw-vlan-filter", 0, 0, 0 },
@ -556,8 +637,13 @@ launch_args_parse(int argc, char** argv)
{ "tx-queue-stats-mapping", 1, 0, 0 },
{ "rx-queue-stats-mapping", 1, 0, 0 },
{ "no-flush-rx", 0, 0, 0 },
{ "flow-isolate-all", 0, 0, 0 },
{ "txpkts", 1, 0, 0 },
{ "disable-link-check", 0, 0, 0 },
{ "no-lsc-interrupt", 0, 0, 0 },
{ "no-rmv-interrupt", 0, 0, 0 },
{ "print-event", 1, 0, 0 },
{ "mask-event", 1, 0, 0 },
{ 0, 0, 0, 0 },
};
@ -592,10 +678,34 @@ launch_args_parse(int argc, char** argv)
printf("Interactive-mode selected\n");
interactive = 1;
}
if (!strcmp(lgopts[opt_idx].name, "cmdline-file")) {
printf("CLI commands to be read from %s\n",
optarg);
snprintf(cmdline_filename,
sizeof(cmdline_filename), "%s",
optarg);
}
if (!strcmp(lgopts[opt_idx].name, "auto-start")) {
printf("Auto-start selected\n");
auto_start = 1;
}
if (!strcmp(lgopts[opt_idx].name, "tx-first")) {
printf("Ports to start sending a burst of "
"packets first\n");
tx_first = 1;
}
if (!strcmp(lgopts[opt_idx].name, "stats-period")) {
char *end = NULL;
unsigned int n;
n = strtoul(optarg, &end, 10);
if ((optarg[0] == '\0') || (end == NULL) ||
(*end != '\0'))
break;
stats_period = n;
break;
}
if (!strcmp(lgopts[opt_idx].name,
"eth-peers-configfile")) {
if (init_peer_eth_addrs(optarg) != 0)
@ -630,7 +740,7 @@ launch_args_parse(int argc, char** argv)
if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
n = atoi(optarg);
if (n > 0 && n <= nb_ports)
nb_fwd_ports = (uint8_t) n;
nb_fwd_ports = n;
else
rte_exit(EXIT_FAILURE,
"Invalid port %d\n", n);
@ -648,12 +758,10 @@ launch_args_parse(int argc, char** argv)
parse_fwd_coremask(optarg);
if (!strcmp(lgopts[opt_idx].name, "portmask"))
parse_fwd_portmask(optarg);
if (!strcmp(lgopts[opt_idx].name, "numa")) {
if (!strcmp(lgopts[opt_idx].name, "no-numa"))
numa_support = 0;
if (!strcmp(lgopts[opt_idx].name, "numa"))
numa_support = 1;
memset(port_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
memset(rxring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
memset(txring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS);
}
if (!strcmp(lgopts[opt_idx].name, "mp-anon")) {
mp_anon = 1;
}
@ -668,12 +776,13 @@ launch_args_parse(int argc, char** argv)
"invalid ring-numa configuration\n");
if (!strcmp(lgopts[opt_idx].name, "socket-num")) {
n = atoi(optarg);
if((uint8_t)n < max_socket)
if (!new_socket_id((uint8_t)n)) {
socket_num = (uint8_t)n;
else
} else {
print_invalid_socket_id_error();
rte_exit(EXIT_FAILURE,
"The socket number should be < %d\n",
max_socket);
"Invalid socket id");
}
}
if (!strcmp(lgopts[opt_idx].name, "mbuf-size")) {
n = atoi(optarg);
@ -763,12 +872,42 @@ launch_args_parse(int argc, char** argv)
"drop queue %d invalid - must"
"be >= 0 \n", n);
}
if (!strcmp(lgopts[opt_idx].name, "crc-strip"))
rx_mode.hw_strip_crc = 1;
#ifdef RTE_LIBRTE_LATENCY_STATS
if (!strcmp(lgopts[opt_idx].name,
"latencystats")) {
n = atoi(optarg);
if (n >= 0) {
latencystats_lcore_id = (lcoreid_t) n;
latencystats_enabled = 1;
} else
rte_exit(EXIT_FAILURE,
"invalid lcore id %d for latencystats"
" must be >= 0\n", n);
}
#endif
#ifdef RTE_LIBRTE_BITRATE
if (!strcmp(lgopts[opt_idx].name, "bitrate-stats")) {
n = atoi(optarg);
if (n >= 0) {
bitrate_lcore_id = (lcoreid_t) n;
bitrate_enabled = 1;
} else
rte_exit(EXIT_FAILURE,
"invalid lcore id %d for bitrate stats"
" must be >= 0\n", n);
}
#endif
if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip"))
rx_mode.hw_strip_crc = 0;
if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
rx_mode.enable_lro = 1;
if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
rx_mode.enable_scatter = 1;
if (!strcmp(lgopts[opt_idx].name, "enable-rx-cksum"))
rx_mode.hw_ip_checksum = 1;
if (!strcmp(lgopts[opt_idx].name,
"enable-rx-timestamp"))
rx_mode.hw_timestamp = 1;
if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan")) {
rx_mode.hw_vlan_filter = 0;
@ -802,7 +941,7 @@ launch_args_parse(int argc, char** argv)
port_topology = PORT_TOPOLOGY_LOOP;
else
rte_exit(EXIT_FAILURE, "port-topology %s invalid -"
" must be: paired or chained \n",
" must be: paired, chained or loop\n",
optarg);
}
if (!strcmp(lgopts[opt_idx].name, "forward-mode"))
@ -813,21 +952,21 @@ launch_args_parse(int argc, char** argv)
rss_hf = ETH_RSS_UDP;
if (!strcmp(lgopts[opt_idx].name, "rxq")) {
n = atoi(optarg);
if (n >= 0 && n <= (int) MAX_QUEUE_ID)
if (n >= 0 && check_nb_rxq((queueid_t)n) == 0)
nb_rxq = (queueid_t) n;
else
rte_exit(EXIT_FAILURE, "rxq %d invalid - must be"
" >= 0 && <= %d\n", n,
(int) MAX_QUEUE_ID);
" >= 0 && <= %u\n", n,
get_allowed_max_nb_rxq(&pid));
}
if (!strcmp(lgopts[opt_idx].name, "txq")) {
n = atoi(optarg);
if (n >= 0 && n <= (int) MAX_QUEUE_ID)
if (n >= 0 && check_nb_txq((queueid_t)n) == 0)
nb_txq = (queueid_t) n;
else
rte_exit(EXIT_FAILURE, "txq %d invalid - must be"
" >= 0 && <= %d\n", n,
(int) MAX_QUEUE_ID);
" >= 0 && <= %u\n", n,
get_allowed_max_nb_txq(&pid));
}
if (!nb_rxq && !nb_txq) {
rte_exit(EXIT_FAILURE, "Either rx or tx queues should "
@ -973,6 +1112,22 @@ launch_args_parse(int argc, char** argv)
no_flush_rx = 1;
if (!strcmp(lgopts[opt_idx].name, "disable-link-check"))
no_link_check = 1;
if (!strcmp(lgopts[opt_idx].name, "no-lsc-interrupt"))
lsc_interrupt = 0;
if (!strcmp(lgopts[opt_idx].name, "no-rmv-interrupt"))
rmv_interrupt = 0;
if (!strcmp(lgopts[opt_idx].name, "flow-isolate-all"))
flow_isolate_all = 1;
if (!strcmp(lgopts[opt_idx].name, "print-event"))
if (parse_event_printing_config(optarg, 1)) {
rte_exit(EXIT_FAILURE,
"invalid print-event argument\n");
}
if (!strcmp(lgopts[opt_idx].name, "mask-event"))
if (parse_event_printing_config(optarg, 0)) {
rte_exit(EXIT_FAILURE,
"invalid mask-event argument\n");
}
break;
case 'h':

View File

@ -49,15 +49,12 @@
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
@ -67,6 +64,8 @@
#include <rte_string_fns.h>
#include <rte_ip.h>
#include <rte_udp.h>
#include <rte_net.h>
#include <rte_flow.h>
#include "testpmd.h"
@ -92,14 +91,15 @@ pkt_burst_receive(struct fwd_stream *fs)
uint16_t nb_rx;
uint16_t i, packet_type;
uint16_t is_encapsulation;
char buf[256];
struct rte_net_hdr_lens hdr_lens;
uint32_t sw_packet_type;
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
uint64_t start_tsc;
uint64_t end_tsc;
uint64_t core_cycles;
#endif
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
start_tsc = rte_rdtsc();
#endif
@ -121,7 +121,7 @@ pkt_burst_receive(struct fwd_stream *fs)
*/
if (verbose_level > 0)
printf("port %u/queue %u: received %u packets\n",
(unsigned) fs->rx_port,
fs->rx_port,
(unsigned) fs->rx_queue,
(unsigned) nb_rx);
for (i = 0; i < nb_rx; i++) {
@ -144,7 +144,8 @@ pkt_burst_receive(struct fwd_stream *fs)
if (ol_flags & PKT_RX_RSS_HASH) {
printf(" - RSS hash=0x%x", (unsigned) mb->hash.rss);
printf(" - RSS queue=0x%x",(unsigned) fs->rx_queue);
} else if (ol_flags & PKT_RX_FDIR) {
}
if (ol_flags & PKT_RX_FDIR) {
printf(" - FDIR matched ");
if (ol_flags & PKT_RX_FDIR_ID)
printf("ID=0x%x",
@ -156,183 +157,35 @@ pkt_burst_receive(struct fwd_stream *fs)
printf("hash=0x%x ID=0x%x ",
mb->hash.fdir.hash, mb->hash.fdir.id);
}
if (ol_flags & PKT_RX_TIMESTAMP)
printf(" - timestamp %"PRIu64" ", mb->timestamp);
if (ol_flags & PKT_RX_VLAN_STRIPPED)
printf(" - VLAN tci=0x%x", mb->vlan_tci);
if (ol_flags & PKT_RX_QINQ_STRIPPED)
printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x",
mb->vlan_tci, mb->vlan_tci_outer);
if (mb->packet_type) {
uint32_t ptype;
/* (outer) L2 packet type */
ptype = mb->packet_type & RTE_PTYPE_L2_MASK;
switch (ptype) {
case RTE_PTYPE_L2_ETHER:
printf(" - (outer) L2 type: ETHER");
break;
case RTE_PTYPE_L2_ETHER_TIMESYNC:
printf(" - (outer) L2 type: ETHER_Timesync");
break;
case RTE_PTYPE_L2_ETHER_ARP:
printf(" - (outer) L2 type: ETHER_ARP");
break;
case RTE_PTYPE_L2_ETHER_LLDP:
printf(" - (outer) L2 type: ETHER_LLDP");
break;
case RTE_PTYPE_L2_ETHER_NSH:
printf(" - (outer) L2 type: ETHER_NSH");
break;
default:
printf(" - (outer) L2 type: Unknown");
break;
}
/* (outer) L3 packet type */
ptype = mb->packet_type & RTE_PTYPE_L3_MASK;
switch (ptype) {
case RTE_PTYPE_L3_IPV4:
printf(" - (outer) L3 type: IPV4");
break;
case RTE_PTYPE_L3_IPV4_EXT:
printf(" - (outer) L3 type: IPV4_EXT");
break;
case RTE_PTYPE_L3_IPV6:
printf(" - (outer) L3 type: IPV6");
break;
case RTE_PTYPE_L3_IPV4_EXT_UNKNOWN:
printf(" - (outer) L3 type: IPV4_EXT_UNKNOWN");
break;
case RTE_PTYPE_L3_IPV6_EXT:
printf(" - (outer) L3 type: IPV6_EXT");
break;
case RTE_PTYPE_L3_IPV6_EXT_UNKNOWN:
printf(" - (outer) L3 type: IPV6_EXT_UNKNOWN");
break;
default:
printf(" - (outer) L3 type: Unknown");
break;
}
/* (outer) L4 packet type */
ptype = mb->packet_type & RTE_PTYPE_L4_MASK;
switch (ptype) {
case RTE_PTYPE_L4_TCP:
printf(" - (outer) L4 type: TCP");
break;
case RTE_PTYPE_L4_UDP:
printf(" - (outer) L4 type: UDP");
break;
case RTE_PTYPE_L4_FRAG:
printf(" - (outer) L4 type: L4_FRAG");
break;
case RTE_PTYPE_L4_SCTP:
printf(" - (outer) L4 type: SCTP");
break;
case RTE_PTYPE_L4_ICMP:
printf(" - (outer) L4 type: ICMP");
break;
case RTE_PTYPE_L4_NONFRAG:
printf(" - (outer) L4 type: L4_NONFRAG");
break;
default:
printf(" - (outer) L4 type: Unknown");
break;
}
/* packet tunnel type */
ptype = mb->packet_type & RTE_PTYPE_TUNNEL_MASK;
switch (ptype) {
case RTE_PTYPE_TUNNEL_IP:
printf(" - Tunnel type: IP");
break;
case RTE_PTYPE_TUNNEL_GRE:
printf(" - Tunnel type: GRE");
break;
case RTE_PTYPE_TUNNEL_VXLAN:
printf(" - Tunnel type: VXLAN");
break;
case RTE_PTYPE_TUNNEL_NVGRE:
printf(" - Tunnel type: NVGRE");
break;
case RTE_PTYPE_TUNNEL_GENEVE:
printf(" - Tunnel type: GENEVE");
break;
case RTE_PTYPE_TUNNEL_GRENAT:
printf(" - Tunnel type: GRENAT");
break;
default:
printf(" - Tunnel type: Unknown");
break;
}
/* inner L2 packet type */
ptype = mb->packet_type & RTE_PTYPE_INNER_L2_MASK;
switch (ptype) {
case RTE_PTYPE_INNER_L2_ETHER:
printf(" - Inner L2 type: ETHER");
break;
case RTE_PTYPE_INNER_L2_ETHER_VLAN:
printf(" - Inner L2 type: ETHER_VLAN");
break;
default:
printf(" - Inner L2 type: Unknown");
break;
}
/* inner L3 packet type */
ptype = mb->packet_type & RTE_PTYPE_INNER_L3_MASK;
switch (ptype) {
case RTE_PTYPE_INNER_L3_IPV4:
printf(" - Inner L3 type: IPV4");
break;
case RTE_PTYPE_INNER_L3_IPV4_EXT:
printf(" - Inner L3 type: IPV4_EXT");
break;
case RTE_PTYPE_INNER_L3_IPV6:
printf(" - Inner L3 type: IPV6");
break;
case RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN:
printf(" - Inner L3 type: IPV4_EXT_UNKNOWN");
break;
case RTE_PTYPE_INNER_L3_IPV6_EXT:
printf(" - Inner L3 type: IPV6_EXT");
break;
case RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN:
printf(" - Inner L3 type: IPV6_EXT_UNKNOWN");
break;
default:
printf(" - Inner L3 type: Unknown");
break;
}
/* inner L4 packet type */
ptype = mb->packet_type & RTE_PTYPE_INNER_L4_MASK;
switch (ptype) {
case RTE_PTYPE_INNER_L4_TCP:
printf(" - Inner L4 type: TCP");
break;
case RTE_PTYPE_INNER_L4_UDP:
printf(" - Inner L4 type: UDP");
break;
case RTE_PTYPE_INNER_L4_FRAG:
printf(" - Inner L4 type: L4_FRAG");
break;
case RTE_PTYPE_INNER_L4_SCTP:
printf(" - Inner L4 type: SCTP");
break;
case RTE_PTYPE_INNER_L4_ICMP:
printf(" - Inner L4 type: ICMP");
break;
case RTE_PTYPE_INNER_L4_NONFRAG:
printf(" - Inner L4 type: L4_NONFRAG");
break;
default:
printf(" - Inner L4 type: Unknown");
break;
}
printf("\n");
} else
printf("Unknown packet type\n");
rte_get_ptype_name(mb->packet_type, buf, sizeof(buf));
printf(" - hw ptype: %s", buf);
}
sw_packet_type = rte_net_get_ptype(mb, &hdr_lens,
RTE_PTYPE_ALL_MASK);
rte_get_ptype_name(sw_packet_type, buf, sizeof(buf));
printf(" - sw ptype: %s", buf);
if (sw_packet_type & RTE_PTYPE_L2_MASK)
printf(" - l2_len=%d", hdr_lens.l2_len);
if (sw_packet_type & RTE_PTYPE_L3_MASK)
printf(" - l3_len=%d", hdr_lens.l3_len);
if (sw_packet_type & RTE_PTYPE_L4_MASK)
printf(" - l4_len=%d", hdr_lens.l4_len);
if (sw_packet_type & RTE_PTYPE_TUNNEL_MASK)
printf(" - tunnel_len=%d", hdr_lens.tunnel_len);
if (sw_packet_type & RTE_PTYPE_INNER_L2_MASK)
printf(" - inner_l2_len=%d", hdr_lens.inner_l2_len);
if (sw_packet_type & RTE_PTYPE_INNER_L3_MASK)
printf(" - inner_l3_len=%d", hdr_lens.inner_l3_len);
if (sw_packet_type & RTE_PTYPE_INNER_L4_MASK)
printf(" - inner_l4_len=%d", hdr_lens.inner_l4_len);
if (is_encapsulation) {
struct ipv4_hdr *ipv4_hdr;
struct ipv6_hdr *ipv6_hdr;
@ -376,19 +229,8 @@ pkt_burst_receive(struct fwd_stream *fs)
}
printf(" - Receive queue=0x%x", (unsigned) fs->rx_queue);
printf("\n");
if (ol_flags != 0) {
unsigned rxf;
const char *name;
for (rxf = 0; rxf < sizeof(mb->ol_flags) * 8; rxf++) {
if ((ol_flags & (1ULL << rxf)) == 0)
continue;
name = rte_get_rx_ol_flag_name(1ULL << rxf);
if (name == NULL)
continue;
printf(" %s\n", name);
}
}
rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
printf(" ol_flags: %s\n", buf);
rte_pktmbuf_free(mb);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
* Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -34,6 +34,11 @@
#ifndef _TESTPMD_H_
#define _TESTPMD_H_
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_gro.h>
#include <rte_gso.h>
#define RTE_PORT_ALL (~(portid_t)0x0)
#define RTE_TEST_RX_DESC_MAX 2048
@ -75,12 +80,18 @@
#define UMA_NO_CONFIG 0xFF
typedef uint8_t lcoreid_t;
typedef uint8_t portid_t;
typedef uint16_t portid_t;
typedef uint16_t queueid_t;
typedef uint16_t streamid_t;
#define MAX_QUEUE_ID ((1 << (sizeof(queueid_t) * 8)) - 1)
#if defined RTE_LIBRTE_PMD_SOFTNIC && defined RTE_LIBRTE_SCHED
#define TM_MODE 1
#else
#define TM_MODE 0
#endif
enum {
PORT_TOPOLOGY_PAIRED,
PORT_TOPOLOGY_CHAINED,
@ -117,6 +128,7 @@ struct fwd_stream {
unsigned int fwd_dropped; /**< received packets not forwarded */
unsigned int rx_bad_ip_csum ; /**< received packets has bad ip checksum */
unsigned int rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
unsigned int gro_times; /**< GRO operation times */
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
uint64_t core_cycles; /**< used for RX and TX processing */
#endif
@ -143,12 +155,58 @@ struct fwd_stream {
#define TESTPMD_TX_OFFLOAD_INSERT_VLAN 0x0040
/** Insert double VLAN header in forward engine */
#define TESTPMD_TX_OFFLOAD_INSERT_QINQ 0x0080
/** Offload MACsec in forward engine */
#define TESTPMD_TX_OFFLOAD_MACSEC 0x0100
/** Descriptor for a single flow. */
struct port_flow {
size_t size; /**< Allocated space including data[]. */
struct port_flow *next; /**< Next flow in list. */
struct port_flow *tmp; /**< Temporary linking. */
uint32_t id; /**< Flow rule ID. */
struct rte_flow *flow; /**< Opaque flow object returned by PMD. */
struct rte_flow_attr attr; /**< Attributes. */
struct rte_flow_item *pattern; /**< Pattern. */
struct rte_flow_action *actions; /**< Actions. */
uint8_t data[]; /**< Storage for pattern/actions. */
};
#ifdef TM_MODE
/**
* Soft port tm related parameters
*/
struct softnic_port_tm {
uint32_t default_hierarchy_enable; /**< def hierarchy enable flag */
uint32_t hierarchy_config; /**< set to 1 if hierarchy configured */
uint32_t n_subports_per_port; /**< Num of subport nodes per port */
uint32_t n_pipes_per_subport; /**< Num of pipe nodes per subport */
uint64_t tm_pktfield0_slabpos; /**< Pkt field position for subport */
uint64_t tm_pktfield0_slabmask; /**< Pkt field mask for the subport */
uint64_t tm_pktfield0_slabshr;
uint64_t tm_pktfield1_slabpos; /**< Pkt field position for the pipe */
uint64_t tm_pktfield1_slabmask; /**< Pkt field mask for the pipe */
uint64_t tm_pktfield1_slabshr;
uint64_t tm_pktfield2_slabpos; /**< Pkt field position table index */
uint64_t tm_pktfield2_slabmask; /**< Pkt field mask for tc table idx */
uint64_t tm_pktfield2_slabshr;
uint64_t tm_tc_table[64]; /**< TC translation table */
};
/**
* The data structure associate with softnic port
*/
struct softnic_port {
unsigned int tm_flag; /**< set to 1 if tm feature is enabled */
struct softnic_port_tm tm; /**< softnic port tm parameters */
};
#endif
/**
* The data structure associated with each port.
*/
struct rte_port {
uint8_t enabled; /**< Port enabled or not */
struct rte_eth_dev_info dev_info; /**< PCI info + driver name */
struct rte_eth_conf dev_conf; /**< Port configuration. */
struct ether_addr eth_addr; /**< Port ethernet address */
@ -158,7 +216,8 @@ struct rte_port {
struct fwd_stream *tx_stream; /**< Port TX stream, if unique */
unsigned int socket_id; /**< For NUMA support */
uint16_t tx_ol_flags;/**< TX Offload Flags (TESTPMD_TX_OFFLOAD...). */
uint16_t tso_segsz; /**< MSS for segmentation offload. */
uint16_t tso_segsz; /**< Segmentation offload MSS for non-tunneled packets. */
uint16_t tunnel_tso_segsz; /**< Segmentation offload MSS for tunneled pkts. */
uint16_t tx_vlan_id;/**< The tag ID */
uint16_t tx_vlan_id_outer;/**< The outer tag ID */
void *fwd_ctx; /**< Forwarding mode context */
@ -176,16 +235,13 @@ struct rte_port {
struct ether_addr *mc_addr_pool; /**< pool of multicast addrs */
uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool */
uint8_t slave_flag; /**< bonding slave port */
struct port_flow *flow_list; /**< Associated flows. */
#ifdef TM_MODE
unsigned int softnic_enable; /**< softnic flag */
struct softnic_port softport; /**< softnic port params */
#endif
};
extern portid_t __rte_unused
find_next_port(portid_t p, struct rte_port *ports, int size);
#define FOREACH_PORT(p, ports) \
for (p = find_next_port(0, ports, RTE_MAX_ETHPORTS); \
p < RTE_MAX_ETHPORTS; \
p = find_next_port(p + 1, ports, RTE_MAX_ETHPORTS))
/**
* The data structure associated with each forwarding logical core.
* The logical cores are internally numbered by a core index from 0 to
@ -194,7 +250,9 @@ find_next_port(portid_t p, struct rte_port *ports, int size);
* CPU id. configuration table.
*/
struct fwd_lcore {
struct rte_gso_ctx gso_ctx; /**< GSO context */
struct rte_mempool *mbp; /**< The mbuf pool to use by this core */
void *gro_ctx; /**< GRO context */
streamid_t stream_idx; /**< index of 1st stream in "fwd_streams" */
streamid_t stream_nb; /**< number of streams in "fwd_streams" */
lcoreid_t cpuid_idx; /**< index of logical core in CPU id table */
@ -242,6 +300,10 @@ extern struct fwd_engine rx_only_engine;
extern struct fwd_engine tx_only_engine;
extern struct fwd_engine csum_fwd_engine;
extern struct fwd_engine icmp_echo_engine;
#ifdef TM_MODE
extern struct fwd_engine softnic_tm_engine;
extern struct fwd_engine softnic_tm_bypass_engine;
#endif
#ifdef RTE_LIBRTE_IEEE1588
extern struct fwd_engine ieee1588_fwd_engine;
#endif
@ -272,7 +334,7 @@ enum dcb_mode_enable
#define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */
struct queue_stats_mappings {
uint8_t port_id;
portid_t port_id;
uint16_t queue_id;
uint8_t stats_counter_id;
} __rte_cache_aligned;
@ -287,18 +349,27 @@ extern struct queue_stats_mappings *rx_queue_stats_mappings;
extern uint16_t nb_tx_queue_stats_mappings;
extern uint16_t nb_rx_queue_stats_mappings;
extern uint8_t xstats_hide_zero; /**< Hide zero values for xstats display */
/* globals used for configuration */
extern uint16_t verbose_level; /**< Drives messages being displayed, if any. */
extern uint8_t interactive;
extern uint8_t auto_start;
extern uint8_t tx_first;
extern char cmdline_filename[PATH_MAX]; /**< offline commands file */
extern uint8_t numa_support; /**< set by "--numa" parameter */
extern uint16_t port_topology; /**< set by "--port-topology" parameter */
extern uint8_t no_flush_rx; /**<set by "--no-flush-rx" parameter */
extern uint8_t flow_isolate_all; /**< set by "--flow-isolate-all */
extern uint8_t mp_anon; /**< set by "--mp-anon" parameter */
extern uint8_t no_link_check; /**<set by "--disable-link-check" parameter */
extern volatile int test_done; /* stop packet forwarding when set to 1. */
extern uint8_t lsc_interrupt; /**< disabled by "--no-lsc-interrupt" parameter */
extern uint8_t rmv_interrupt; /**< disabled by "--no-rmv-interrupt" parameter */
extern uint32_t event_print_mask;
/**< set by "--print-event xxxx" and "--mask-event xxxx parameters */
#ifdef RTE_NIC_BYPASS
#ifdef RTE_LIBRTE_IXGBE_BYPASS
extern uint32_t bypass_timeout; /**< Store the NIC bypass watchdog timeout */
#endif
@ -330,7 +401,8 @@ extern lcoreid_t nb_lcores; /**< Number of logical cores probed at init time. */
extern lcoreid_t nb_cfg_lcores; /**< Number of configured logical cores. */
extern lcoreid_t nb_fwd_lcores; /**< Number of forwarding logical cores. */
extern unsigned int fwd_lcores_cpuids[RTE_MAX_LCORE];
extern unsigned max_socket;
extern unsigned int num_sockets;
extern unsigned int socket_ids[RTE_MAX_NUMA_NODES];
/*
* Configuration of Ethernet ports:
@ -364,6 +436,18 @@ extern enum dcb_queue_mapping_mode dcb_q_mapping;
extern uint16_t mbuf_data_size; /**< Mbuf data space size. */
extern uint32_t param_total_num_mbufs;
extern uint16_t stats_period;
#ifdef RTE_LIBRTE_LATENCY_STATS
extern uint8_t latencystats_enabled;
extern lcoreid_t latencystats_lcore_id;
#endif
#ifdef RTE_LIBRTE_BITRATE
extern lcoreid_t bitrate_lcore_id;
extern uint8_t bitrate_enabled;
#endif
extern struct rte_fdir_conf fdir_conf;
/*
@ -403,6 +487,27 @@ extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS];
extern uint32_t burst_tx_delay_time; /**< Burst tx delay time(us) for mac-retry. */
extern uint32_t burst_tx_retry_num; /**< Burst tx retry number for mac-retry. */
#define GRO_DEFAULT_ITEM_NUM_PER_FLOW 32
#define GRO_DEFAULT_FLOW_NUM (RTE_GRO_MAX_BURST_ITEM_NUM / \
GRO_DEFAULT_ITEM_NUM_PER_FLOW)
#define GRO_DEFAULT_FLUSH_CYCLES 1
#define GRO_MAX_FLUSH_CYCLES 4
struct gro_status {
struct rte_gro_param param;
uint8_t enable;
};
extern struct gro_status gro_ports[RTE_MAX_ETHPORTS];
extern uint8_t gro_flush_cycles;
#define GSO_MAX_PKT_BURST 2048
struct gso_status {
uint8_t enable;
};
extern struct gso_status gso_ports[RTE_MAX_ETHPORTS];
extern uint16_t gso_max_segment_size;
static inline unsigned int
lcore_num(void)
{
@ -475,6 +580,7 @@ unsigned int parse_item_list(char* str, const char* item_name,
unsigned int max_items,
unsigned int *parsed_items, int check_unique_values);
void launch_args_parse(int argc, char** argv);
void cmdline_read_from_file(const char *filename);
void prompt(void);
void prompt_exit(void);
void nic_stats_display(portid_t port_id);
@ -483,6 +589,7 @@ void nic_xstats_display(portid_t port_id);
void nic_xstats_clear(portid_t port_id);
void nic_stats_mapping_display(portid_t port_id);
void port_infos_display(portid_t port_id);
void port_offload_cap_display(portid_t port_id);
void rx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
void tx_queue_infos_display(portid_t port_idi, uint16_t queue_id);
void fwd_lcores_config_display(void);
@ -503,6 +610,20 @@ void port_reg_bit_field_set(portid_t port_id, uint32_t reg_off,
uint8_t bit1_pos, uint8_t bit2_pos, uint32_t value);
void port_reg_display(portid_t port_id, uint32_t reg_off);
void port_reg_set(portid_t port_id, uint32_t reg_off, uint32_t value);
int port_flow_validate(portid_t port_id,
const struct rte_flow_attr *attr,
const struct rte_flow_item *pattern,
const struct rte_flow_action *actions);
int port_flow_create(portid_t port_id,
const struct rte_flow_attr *attr,
const struct rte_flow_item *pattern,
const struct rte_flow_action *actions);
int port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule);
int port_flow_flush(portid_t port_id);
int port_flow_query(portid_t port_id, uint32_t rule,
enum rte_flow_action_type action);
void port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group);
int port_flow_isolate(portid_t port_id, int set);
void rx_ring_desc_display(portid_t port_id, queueid_t rxq_id, uint16_t rxd_id);
void tx_ring_desc_display(portid_t port_id, queueid_t txq_id, uint16_t txd_id);
@ -532,6 +653,8 @@ void tx_vlan_pvid_set(portid_t port_id, uint16_t vlan_id, int on);
void set_qmap(portid_t port_id, uint8_t is_rx, uint16_t queue_id, uint8_t map_value);
void set_xstats_hide_zero(uint8_t on_off);
void set_verbose_level(uint16_t vb_level);
void set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs);
void show_tx_pkt_segments(void);
@ -555,8 +678,9 @@ int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode,
int start_port(portid_t pid);
void stop_port(portid_t pid);
void close_port(portid_t pid);
void reset_port(portid_t pid);
void attach_port(char *identifier);
void detach_port(uint8_t port_id);
void detach_port(portid_t port_id);
int all_ports_stopped(void);
int port_is_started(portid_t port_id);
void pmd_test_exit(void);
@ -570,8 +694,6 @@ void port_rss_reta_info(portid_t port_id,
uint16_t nb_entries);
void set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on);
void set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id,
uint64_t vf_mask, uint8_t on);
int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
@ -581,23 +703,35 @@ void port_rss_hash_conf_show(portid_t port_id, char rss_info[],
int show_rss_key);
void port_rss_hash_key_update(portid_t port_id, char rss_type[],
uint8_t *hash_key, uint hash_key_len);
void get_syn_filter(uint8_t port_id);
void get_ethertype_filter(uint8_t port_id, uint16_t index);
void get_2tuple_filter(uint8_t port_id, uint16_t index);
void get_5tuple_filter(uint8_t port_id, uint16_t index);
int rx_queue_id_is_invalid(queueid_t rxq_id);
int tx_queue_id_is_invalid(queueid_t txq_id);
void setup_gro(const char *onoff, portid_t port_id);
void setup_gro_flush_cycles(uint8_t cycles);
void show_gro(portid_t port_id);
void setup_gso(const char *mode, portid_t port_id);
/* Functions to manage the set of filtered Multicast MAC addresses */
void mcast_addr_add(uint8_t port_id, struct ether_addr *mc_addr);
void mcast_addr_remove(uint8_t port_id, struct ether_addr *mc_addr);
void port_dcb_info_display(uint8_t port_id);
void mcast_addr_add(portid_t port_id, struct ether_addr *mc_addr);
void mcast_addr_remove(portid_t port_id, struct ether_addr *mc_addr);
void port_dcb_info_display(portid_t port_id);
uint8_t *open_ddp_package_file(const char *file_path, uint32_t *size);
int save_ddp_package_file(const char *file_path, uint8_t *buf, uint32_t size);
int close_ddp_package_file(uint8_t *buf);
void port_queue_region_info_display(portid_t port_id, void *buf);
enum print_warning {
ENABLED_WARN = 0,
DISABLED_WARN
};
int port_id_is_invalid(portid_t port_id, enum print_warning warning);
int new_socket_id(unsigned int socket_id);
queueid_t get_allowed_max_nb_rxq(portid_t *pid);
int check_nb_rxq(queueid_t rxq);
queueid_t get_allowed_max_nb_txq(portid_t *pid);
int check_nb_txq(queueid_t txq);
/*
* Work-around of a compilation error with ICC on invocations of the

865
dpdk/app/test-pmd/tm.c Normal file
View File

@ -0,0 +1,865 @@
/*-
* BSD LICENSE
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <sys/stat.h>
#include <rte_cycles.h>
#include <rte_mbuf.h>
#include <rte_ethdev.h>
#include <rte_flow.h>
#include <rte_meter.h>
#include <rte_eth_softnic.h>
#include <rte_tm.h>
#include "testpmd.h"
#define SUBPORT_NODES_PER_PORT 1
#define PIPE_NODES_PER_SUBPORT 4096
#define TC_NODES_PER_PIPE 4
#define QUEUE_NODES_PER_TC 4
#define NUM_PIPE_NODES \
(SUBPORT_NODES_PER_PORT * PIPE_NODES_PER_SUBPORT)
#define NUM_TC_NODES \
(NUM_PIPE_NODES * TC_NODES_PER_PIPE)
#define ROOT_NODE_ID 1000000
#define SUBPORT_NODES_START_ID 900000
#define PIPE_NODES_START_ID 800000
#define TC_NODES_START_ID 700000
#define STATS_MASK_DEFAULT \
(RTE_TM_STATS_N_PKTS | \
RTE_TM_STATS_N_BYTES | \
RTE_TM_STATS_N_PKTS_GREEN_DROPPED | \
RTE_TM_STATS_N_BYTES_GREEN_DROPPED)
#define STATS_MASK_QUEUE \
(STATS_MASK_DEFAULT | \
RTE_TM_STATS_N_PKTS_QUEUED)
#define BYTES_IN_MBPS (1000 * 1000 / 8)
#define TOKEN_BUCKET_SIZE 1000000
/* TM Hierarchy Levels */
enum tm_hierarchy_level {
TM_NODE_LEVEL_PORT = 0,
TM_NODE_LEVEL_SUBPORT,
TM_NODE_LEVEL_PIPE,
TM_NODE_LEVEL_TC,
TM_NODE_LEVEL_QUEUE,
TM_NODE_LEVEL_MAX,
};
struct tm_hierarchy {
/* TM Nodes */
uint32_t root_node_id;
uint32_t subport_node_id[SUBPORT_NODES_PER_PORT];
uint32_t pipe_node_id[SUBPORT_NODES_PER_PORT][PIPE_NODES_PER_SUBPORT];
uint32_t tc_node_id[NUM_PIPE_NODES][TC_NODES_PER_PIPE];
uint32_t queue_node_id[NUM_TC_NODES][QUEUE_NODES_PER_TC];
/* TM Hierarchy Nodes Shaper Rates */
uint32_t root_node_shaper_rate;
uint32_t subport_node_shaper_rate;
uint32_t pipe_node_shaper_rate;
uint32_t tc_node_shaper_rate;
uint32_t tc_node_shared_shaper_rate;
uint32_t n_shapers;
};
#define BITFIELD(byte_array, slab_pos, slab_mask, slab_shr) \
({ \
uint64_t slab = *((uint64_t *) &byte_array[slab_pos]); \
uint64_t val = \
(rte_be_to_cpu_64(slab) & slab_mask) >> slab_shr; \
val; \
})
#define RTE_SCHED_PORT_HIERARCHY(subport, pipe, \
traffic_class, queue, color) \
((((uint64_t) (queue)) & 0x3) | \
((((uint64_t) (traffic_class)) & 0x3) << 2) | \
((((uint64_t) (color)) & 0x3) << 4) | \
((((uint64_t) (subport)) & 0xFFFF) << 16) | \
((((uint64_t) (pipe)) & 0xFFFFFFFF) << 32))
static void
pkt_metadata_set(struct rte_port *p, struct rte_mbuf **pkts,
uint32_t n_pkts)
{
struct softnic_port_tm *tm = &p->softport.tm;
uint32_t i;
for (i = 0; i < (n_pkts & (~0x3)); i += 4) {
struct rte_mbuf *pkt0 = pkts[i];
struct rte_mbuf *pkt1 = pkts[i + 1];
struct rte_mbuf *pkt2 = pkts[i + 2];
struct rte_mbuf *pkt3 = pkts[i + 3];
uint8_t *pkt0_data = rte_pktmbuf_mtod(pkt0, uint8_t *);
uint8_t *pkt1_data = rte_pktmbuf_mtod(pkt1, uint8_t *);
uint8_t *pkt2_data = rte_pktmbuf_mtod(pkt2, uint8_t *);
uint8_t *pkt3_data = rte_pktmbuf_mtod(pkt3, uint8_t *);
uint64_t pkt0_subport = BITFIELD(pkt0_data,
tm->tm_pktfield0_slabpos,
tm->tm_pktfield0_slabmask,
tm->tm_pktfield0_slabshr);
uint64_t pkt0_pipe = BITFIELD(pkt0_data,
tm->tm_pktfield1_slabpos,
tm->tm_pktfield1_slabmask,
tm->tm_pktfield1_slabshr);
uint64_t pkt0_dscp = BITFIELD(pkt0_data,
tm->tm_pktfield2_slabpos,
tm->tm_pktfield2_slabmask,
tm->tm_pktfield2_slabshr);
uint32_t pkt0_tc = tm->tm_tc_table[pkt0_dscp & 0x3F] >> 2;
uint32_t pkt0_tc_q = tm->tm_tc_table[pkt0_dscp & 0x3F] & 0x3;
uint64_t pkt1_subport = BITFIELD(pkt1_data,
tm->tm_pktfield0_slabpos,
tm->tm_pktfield0_slabmask,
tm->tm_pktfield0_slabshr);
uint64_t pkt1_pipe = BITFIELD(pkt1_data,
tm->tm_pktfield1_slabpos,
tm->tm_pktfield1_slabmask,
tm->tm_pktfield1_slabshr);
uint64_t pkt1_dscp = BITFIELD(pkt1_data,
tm->tm_pktfield2_slabpos,
tm->tm_pktfield2_slabmask,
tm->tm_pktfield2_slabshr);
uint32_t pkt1_tc = tm->tm_tc_table[pkt1_dscp & 0x3F] >> 2;
uint32_t pkt1_tc_q = tm->tm_tc_table[pkt1_dscp & 0x3F] & 0x3;
uint64_t pkt2_subport = BITFIELD(pkt2_data,
tm->tm_pktfield0_slabpos,
tm->tm_pktfield0_slabmask,
tm->tm_pktfield0_slabshr);
uint64_t pkt2_pipe = BITFIELD(pkt2_data,
tm->tm_pktfield1_slabpos,
tm->tm_pktfield1_slabmask,
tm->tm_pktfield1_slabshr);
uint64_t pkt2_dscp = BITFIELD(pkt2_data,
tm->tm_pktfield2_slabpos,
tm->tm_pktfield2_slabmask,
tm->tm_pktfield2_slabshr);
uint32_t pkt2_tc = tm->tm_tc_table[pkt2_dscp & 0x3F] >> 2;
uint32_t pkt2_tc_q = tm->tm_tc_table[pkt2_dscp & 0x3F] & 0x3;
uint64_t pkt3_subport = BITFIELD(pkt3_data,
tm->tm_pktfield0_slabpos,
tm->tm_pktfield0_slabmask,
tm->tm_pktfield0_slabshr);
uint64_t pkt3_pipe = BITFIELD(pkt3_data,
tm->tm_pktfield1_slabpos,
tm->tm_pktfield1_slabmask,
tm->tm_pktfield1_slabshr);
uint64_t pkt3_dscp = BITFIELD(pkt3_data,
tm->tm_pktfield2_slabpos,
tm->tm_pktfield2_slabmask,
tm->tm_pktfield2_slabshr);
uint32_t pkt3_tc = tm->tm_tc_table[pkt3_dscp & 0x3F] >> 2;
uint32_t pkt3_tc_q = tm->tm_tc_table[pkt3_dscp & 0x3F] & 0x3;
uint64_t pkt0_sched = RTE_SCHED_PORT_HIERARCHY(pkt0_subport,
pkt0_pipe,
pkt0_tc,
pkt0_tc_q,
0);
uint64_t pkt1_sched = RTE_SCHED_PORT_HIERARCHY(pkt1_subport,
pkt1_pipe,
pkt1_tc,
pkt1_tc_q,
0);
uint64_t pkt2_sched = RTE_SCHED_PORT_HIERARCHY(pkt2_subport,
pkt2_pipe,
pkt2_tc,
pkt2_tc_q,
0);
uint64_t pkt3_sched = RTE_SCHED_PORT_HIERARCHY(pkt3_subport,
pkt3_pipe,
pkt3_tc,
pkt3_tc_q,
0);
pkt0->hash.sched.lo = pkt0_sched & 0xFFFFFFFF;
pkt0->hash.sched.hi = pkt0_sched >> 32;
pkt1->hash.sched.lo = pkt1_sched & 0xFFFFFFFF;
pkt1->hash.sched.hi = pkt1_sched >> 32;
pkt2->hash.sched.lo = pkt2_sched & 0xFFFFFFFF;
pkt2->hash.sched.hi = pkt2_sched >> 32;
pkt3->hash.sched.lo = pkt3_sched & 0xFFFFFFFF;
pkt3->hash.sched.hi = pkt3_sched >> 32;
}
for (; i < n_pkts; i++) {
struct rte_mbuf *pkt = pkts[i];
uint8_t *pkt_data = rte_pktmbuf_mtod(pkt, uint8_t *);
uint64_t pkt_subport = BITFIELD(pkt_data,
tm->tm_pktfield0_slabpos,
tm->tm_pktfield0_slabmask,
tm->tm_pktfield0_slabshr);
uint64_t pkt_pipe = BITFIELD(pkt_data,
tm->tm_pktfield1_slabpos,
tm->tm_pktfield1_slabmask,
tm->tm_pktfield1_slabshr);
uint64_t pkt_dscp = BITFIELD(pkt_data,
tm->tm_pktfield2_slabpos,
tm->tm_pktfield2_slabmask,
tm->tm_pktfield2_slabshr);
uint32_t pkt_tc = tm->tm_tc_table[pkt_dscp & 0x3F] >> 2;
uint32_t pkt_tc_q = tm->tm_tc_table[pkt_dscp & 0x3F] & 0x3;
uint64_t pkt_sched = RTE_SCHED_PORT_HIERARCHY(pkt_subport,
pkt_pipe,
pkt_tc,
pkt_tc_q,
0);
pkt->hash.sched.lo = pkt_sched & 0xFFFFFFFF;
pkt->hash.sched.hi = pkt_sched >> 32;
}
}
/*
* Soft port packet forward
*/
static void
softport_packet_fwd(struct fwd_stream *fs)
{
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
struct rte_port *rte_tx_port = &ports[fs->tx_port];
uint16_t nb_rx;
uint16_t nb_tx;
uint32_t retry;
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
uint64_t start_tsc;
uint64_t end_tsc;
uint64_t core_cycles;
#endif
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
start_tsc = rte_rdtsc();
#endif
/* Packets Receive */
nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue,
pkts_burst, nb_pkt_per_burst);
fs->rx_packets += nb_rx;
#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
fs->rx_burst_stats.pkt_burst_spread[nb_rx]++;
#endif
if (rte_tx_port->softnic_enable) {
/* Set packet metadata if tm flag enabled */
if (rte_tx_port->softport.tm_flag)
pkt_metadata_set(rte_tx_port, pkts_burst, nb_rx);
/* Softport run */
rte_pmd_softnic_run(fs->tx_port);
}
nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
pkts_burst, nb_rx);
/* Retry if necessary */
if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
retry = 0;
while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
rte_delay_us(burst_tx_delay_time);
nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
&pkts_burst[nb_tx], nb_rx - nb_tx);
}
}
fs->tx_packets += nb_tx;
#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
fs->tx_burst_stats.pkt_burst_spread[nb_tx]++;
#endif
if (unlikely(nb_tx < nb_rx)) {
fs->fwd_dropped += (nb_rx - nb_tx);
do {
rte_pktmbuf_free(pkts_burst[nb_tx]);
} while (++nb_tx < nb_rx);
}
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
end_tsc = rte_rdtsc();
core_cycles = (end_tsc - start_tsc);
fs->core_cycles = (uint64_t) (fs->core_cycles + core_cycles);
#endif
}
static void
set_tm_hiearchy_nodes_shaper_rate(portid_t port_id, struct tm_hierarchy *h)
{
struct rte_eth_link link_params;
uint64_t tm_port_rate;
memset(&link_params, 0, sizeof(link_params));
rte_eth_link_get(port_id, &link_params);
tm_port_rate = (uint64_t)link_params.link_speed * BYTES_IN_MBPS;
if (tm_port_rate > UINT32_MAX)
tm_port_rate = UINT32_MAX;
/* Set tm hierarchy shapers rate */
h->root_node_shaper_rate = tm_port_rate;
h->subport_node_shaper_rate =
tm_port_rate / SUBPORT_NODES_PER_PORT;
h->pipe_node_shaper_rate
= h->subport_node_shaper_rate / PIPE_NODES_PER_SUBPORT;
h->tc_node_shaper_rate = h->pipe_node_shaper_rate;
h->tc_node_shared_shaper_rate = h->subport_node_shaper_rate;
}
static int
softport_tm_root_node_add(portid_t port_id, struct tm_hierarchy *h,
struct rte_tm_error *error)
{
struct rte_tm_node_params rnp;
struct rte_tm_shaper_params rsp;
uint32_t priority, weight, level_id, shaper_profile_id;
memset(&rsp, 0, sizeof(struct rte_tm_shaper_params));
memset(&rnp, 0, sizeof(struct rte_tm_node_params));
/* Shaper profile Parameters */
rsp.peak.rate = h->root_node_shaper_rate;
rsp.peak.size = TOKEN_BUCKET_SIZE;
rsp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
shaper_profile_id = 0;
if (rte_tm_shaper_profile_add(port_id, shaper_profile_id,
&rsp, error)) {
printf("%s ERROR(%d)-%s!(shaper_id %u)\n ",
__func__, error->type, error->message,
shaper_profile_id);
return -1;
}
/* Root Node Parameters */
h->root_node_id = ROOT_NODE_ID;
weight = 1;
priority = 0;
level_id = TM_NODE_LEVEL_PORT;
rnp.shaper_profile_id = shaper_profile_id;
rnp.nonleaf.n_sp_priorities = 1;
rnp.stats_mask = STATS_MASK_DEFAULT;
/* Add Node to TM Hierarchy */
if (rte_tm_node_add(port_id, h->root_node_id, RTE_TM_NODE_ID_NULL,
priority, weight, level_id, &rnp, error)) {
printf("%s ERROR(%d)-%s!(node_id %u, parent_id %u, level %u)\n",
__func__, error->type, error->message,
h->root_node_id, RTE_TM_NODE_ID_NULL,
level_id);
return -1;
}
/* Update */
h->n_shapers++;
printf(" Root node added (Start id %u, Count %u, level %u)\n",
h->root_node_id, 1, level_id);
return 0;
}
static int
softport_tm_subport_node_add(portid_t port_id, struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t subport_parent_node_id, subport_node_id = 0;
struct rte_tm_node_params snp;
struct rte_tm_shaper_params ssp;
uint32_t priority, weight, level_id, shaper_profile_id;
uint32_t i;
memset(&ssp, 0, sizeof(struct rte_tm_shaper_params));
memset(&snp, 0, sizeof(struct rte_tm_node_params));
shaper_profile_id = h->n_shapers;
/* Add Shaper Profile to TM Hierarchy */
for (i = 0; i < SUBPORT_NODES_PER_PORT; i++) {
ssp.peak.rate = h->subport_node_shaper_rate;
ssp.peak.size = TOKEN_BUCKET_SIZE;
ssp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
if (rte_tm_shaper_profile_add(port_id, shaper_profile_id,
&ssp, error)) {
printf("%s ERROR(%d)-%s!(shaper_id %u)\n ",
__func__, error->type, error->message,
shaper_profile_id);
return -1;
}
/* Node Parameters */
h->subport_node_id[i] = SUBPORT_NODES_START_ID + i;
subport_parent_node_id = h->root_node_id;
weight = 1;
priority = 0;
level_id = TM_NODE_LEVEL_SUBPORT;
snp.shaper_profile_id = shaper_profile_id;
snp.nonleaf.n_sp_priorities = 1;
snp.stats_mask = STATS_MASK_DEFAULT;
/* Add Node to TM Hiearchy */
if (rte_tm_node_add(port_id,
h->subport_node_id[i],
subport_parent_node_id,
priority, weight,
level_id,
&snp,
error)) {
printf("%s ERROR(%d)-%s!(node %u,parent %u,level %u)\n",
__func__,
error->type,
error->message,
h->subport_node_id[i],
subport_parent_node_id,
level_id);
return -1;
}
shaper_profile_id++;
subport_node_id++;
}
/* Update */
h->n_shapers = shaper_profile_id;
printf(" Subport nodes added (Start id %u, Count %u, level %u)\n",
h->subport_node_id[0], SUBPORT_NODES_PER_PORT, level_id);
return 0;
}
static int
softport_tm_pipe_node_add(portid_t port_id, struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t pipe_parent_node_id;
struct rte_tm_node_params pnp;
struct rte_tm_shaper_params psp;
uint32_t priority, weight, level_id, shaper_profile_id;
uint32_t i, j;
memset(&psp, 0, sizeof(struct rte_tm_shaper_params));
memset(&pnp, 0, sizeof(struct rte_tm_node_params));
shaper_profile_id = h->n_shapers;
/* Shaper Profile Parameters */
psp.peak.rate = h->pipe_node_shaper_rate;
psp.peak.size = TOKEN_BUCKET_SIZE;
psp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
/* Pipe Node Parameters */
weight = 1;
priority = 0;
level_id = TM_NODE_LEVEL_PIPE;
pnp.nonleaf.n_sp_priorities = 4;
pnp.stats_mask = STATS_MASK_DEFAULT;
/* Add Shaper Profiles and Nodes to TM Hierarchy */
for (i = 0; i < SUBPORT_NODES_PER_PORT; i++) {
for (j = 0; j < PIPE_NODES_PER_SUBPORT; j++) {
if (rte_tm_shaper_profile_add(port_id,
shaper_profile_id, &psp, error)) {
printf("%s ERROR(%d)-%s!(shaper_id %u)\n ",
__func__, error->type, error->message,
shaper_profile_id);
return -1;
}
pnp.shaper_profile_id = shaper_profile_id;
pipe_parent_node_id = h->subport_node_id[i];
h->pipe_node_id[i][j] = PIPE_NODES_START_ID +
(i * PIPE_NODES_PER_SUBPORT) + j;
if (rte_tm_node_add(port_id,
h->pipe_node_id[i][j],
pipe_parent_node_id,
priority, weight, level_id,
&pnp,
error)) {
printf("%s ERROR(%d)-%s!(node %u,parent %u )\n",
__func__,
error->type,
error->message,
h->pipe_node_id[i][j],
pipe_parent_node_id);
return -1;
}
shaper_profile_id++;
}
}
/* Update */
h->n_shapers = shaper_profile_id;
printf(" Pipe nodes added (Start id %u, Count %u, level %u)\n",
h->pipe_node_id[0][0], NUM_PIPE_NODES, level_id);
return 0;
}
static int
softport_tm_tc_node_add(portid_t port_id, struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t tc_parent_node_id;
struct rte_tm_node_params tnp;
struct rte_tm_shaper_params tsp, tssp;
uint32_t shared_shaper_profile_id[TC_NODES_PER_PIPE];
uint32_t priority, weight, level_id, shaper_profile_id;
uint32_t pos, n_tc_nodes, i, j, k;
memset(&tsp, 0, sizeof(struct rte_tm_shaper_params));
memset(&tssp, 0, sizeof(struct rte_tm_shaper_params));
memset(&tnp, 0, sizeof(struct rte_tm_node_params));
shaper_profile_id = h->n_shapers;
/* Private Shaper Profile (TC) Parameters */
tsp.peak.rate = h->tc_node_shaper_rate;
tsp.peak.size = TOKEN_BUCKET_SIZE;
tsp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
/* Shared Shaper Profile (TC) Parameters */
tssp.peak.rate = h->tc_node_shared_shaper_rate;
tssp.peak.size = TOKEN_BUCKET_SIZE;
tssp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
/* TC Node Parameters */
weight = 1;
level_id = TM_NODE_LEVEL_TC;
tnp.n_shared_shapers = 1;
tnp.nonleaf.n_sp_priorities = 1;
tnp.stats_mask = STATS_MASK_DEFAULT;
/* Add Shared Shaper Profiles to TM Hierarchy */
for (i = 0; i < TC_NODES_PER_PIPE; i++) {
shared_shaper_profile_id[i] = shaper_profile_id;
if (rte_tm_shaper_profile_add(port_id,
shared_shaper_profile_id[i], &tssp, error)) {
printf("%s ERROR(%d)-%s!(Shared shaper profileid %u)\n",
__func__, error->type, error->message,
shared_shaper_profile_id[i]);
return -1;
}
if (rte_tm_shared_shaper_add_update(port_id, i,
shared_shaper_profile_id[i], error)) {
printf("%s ERROR(%d)-%s!(Shared shaper id %u)\n",
__func__, error->type, error->message, i);
return -1;
}
shaper_profile_id++;
}
/* Add Shaper Profiles and Nodes to TM Hierarchy */
n_tc_nodes = 0;
for (i = 0; i < SUBPORT_NODES_PER_PORT; i++) {
for (j = 0; j < PIPE_NODES_PER_SUBPORT; j++) {
for (k = 0; k < TC_NODES_PER_PIPE ; k++) {
priority = k;
tc_parent_node_id = h->pipe_node_id[i][j];
tnp.shared_shaper_id =
(uint32_t *)calloc(1, sizeof(uint32_t));
tnp.shared_shaper_id[0] = k;
pos = j + (i * PIPE_NODES_PER_SUBPORT);
h->tc_node_id[pos][k] =
TC_NODES_START_ID + n_tc_nodes;
if (rte_tm_shaper_profile_add(port_id,
shaper_profile_id, &tsp, error)) {
printf("%s ERROR(%d)-%s!(shaper %u)\n",
__func__, error->type,
error->message,
shaper_profile_id);
return -1;
}
tnp.shaper_profile_id = shaper_profile_id;
if (rte_tm_node_add(port_id,
h->tc_node_id[pos][k],
tc_parent_node_id,
priority, weight,
level_id,
&tnp, error)) {
printf("%s ERROR(%d)-%s!(node id %u)\n",
__func__,
error->type,
error->message,
h->tc_node_id[pos][k]);
return -1;
}
shaper_profile_id++;
n_tc_nodes++;
}
}
}
/* Update */
h->n_shapers = shaper_profile_id;
printf(" TC nodes added (Start id %u, Count %u, level %u)\n",
h->tc_node_id[0][0], n_tc_nodes, level_id);
return 0;
}
static int
softport_tm_queue_node_add(portid_t port_id, struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t queue_parent_node_id;
struct rte_tm_node_params qnp;
uint32_t priority, weight, level_id, pos;
uint32_t n_queue_nodes, i, j, k;
memset(&qnp, 0, sizeof(struct rte_tm_node_params));
/* Queue Node Parameters */
priority = 0;
weight = 1;
level_id = TM_NODE_LEVEL_QUEUE;
qnp.shaper_profile_id = RTE_TM_SHAPER_PROFILE_ID_NONE;
qnp.leaf.cman = RTE_TM_CMAN_TAIL_DROP;
qnp.stats_mask = STATS_MASK_QUEUE;
/* Add Queue Nodes to TM Hierarchy */
n_queue_nodes = 0;
for (i = 0; i < NUM_PIPE_NODES; i++) {
for (j = 0; j < TC_NODES_PER_PIPE; j++) {
queue_parent_node_id = h->tc_node_id[i][j];
for (k = 0; k < QUEUE_NODES_PER_TC; k++) {
pos = j + (i * TC_NODES_PER_PIPE);
h->queue_node_id[pos][k] = n_queue_nodes;
if (rte_tm_node_add(port_id,
h->queue_node_id[pos][k],
queue_parent_node_id,
priority,
weight,
level_id,
&qnp, error)) {
printf("%s ERROR(%d)-%s!(node %u)\n",
__func__,
error->type,
error->message,
h->queue_node_id[pos][k]);
return -1;
}
n_queue_nodes++;
}
}
}
printf(" Queue nodes added (Start id %u, Count %u, level %u)\n",
h->queue_node_id[0][0], n_queue_nodes, level_id);
return 0;
}
/*
* TM Packet Field Setup
*/
static void
softport_tm_pktfield_setup(portid_t port_id)
{
struct rte_port *p = &ports[port_id];
uint64_t pktfield0_mask = 0;
uint64_t pktfield1_mask = 0x0000000FFF000000LLU;
uint64_t pktfield2_mask = 0x00000000000000FCLLU;
p->softport.tm = (struct softnic_port_tm) {
.n_subports_per_port = SUBPORT_NODES_PER_PORT,
.n_pipes_per_subport = PIPE_NODES_PER_SUBPORT,
/* Packet field to identify subport
*
* Default configuration assumes only one subport, thus
* the subport ID is hardcoded to 0
*/
.tm_pktfield0_slabpos = 0,
.tm_pktfield0_slabmask = pktfield0_mask,
.tm_pktfield0_slabshr =
__builtin_ctzll(pktfield0_mask),
/* Packet field to identify pipe.
*
* Default value assumes Ethernet/IPv4/UDP packets,
* UDP payload bits 12 .. 23
*/
.tm_pktfield1_slabpos = 40,
.tm_pktfield1_slabmask = pktfield1_mask,
.tm_pktfield1_slabshr =
__builtin_ctzll(pktfield1_mask),
/* Packet field used as index into TC translation table
* to identify the traffic class and queue.
*
* Default value assumes Ethernet/IPv4 packets, IPv4
* DSCP field
*/
.tm_pktfield2_slabpos = 8,
.tm_pktfield2_slabmask = pktfield2_mask,
.tm_pktfield2_slabshr =
__builtin_ctzll(pktfield2_mask),
.tm_tc_table = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
}, /**< TC translation table */
};
}
static int
softport_tm_hierarchy_specify(portid_t port_id, struct rte_tm_error *error)
{
struct tm_hierarchy h;
int status;
memset(&h, 0, sizeof(struct tm_hierarchy));
/* TM hierarchy shapers rate */
set_tm_hiearchy_nodes_shaper_rate(port_id, &h);
/* Add root node (level 0) */
status = softport_tm_root_node_add(port_id, &h, error);
if (status)
return status;
/* Add subport node (level 1) */
status = softport_tm_subport_node_add(port_id, &h, error);
if (status)
return status;
/* Add pipe nodes (level 2) */
status = softport_tm_pipe_node_add(port_id, &h, error);
if (status)
return status;
/* Add traffic class nodes (level 3) */
status = softport_tm_tc_node_add(port_id, &h, error);
if (status)
return status;
/* Add queue nodes (level 4) */
status = softport_tm_queue_node_add(port_id, &h, error);
if (status)
return status;
/* TM packet fields setup */
softport_tm_pktfield_setup(port_id);
return 0;
}
/*
* Soft port Init
*/
static void
softport_tm_begin(portid_t pi)
{
struct rte_port *port = &ports[pi];
/* Soft port TM flag */
if (port->softport.tm_flag == 1) {
printf("\n\n TM feature available on port %u\n", pi);
/* Soft port TM hierarchy configuration */
if ((port->softport.tm.hierarchy_config == 0) &&
(port->softport.tm.default_hierarchy_enable == 1)) {
struct rte_tm_error error;
int status;
/* Stop port */
rte_eth_dev_stop(pi);
/* TM hierarchy specification */
status = softport_tm_hierarchy_specify(pi, &error);
if (status) {
printf(" TM Hierarchy built error(%d) - %s\n",
error.type, error.message);
return;
}
printf("\n TM Hierarchy Specified!\n\v");
/* TM hierarchy commit */
status = rte_tm_hierarchy_commit(pi, 0, &error);
if (status) {
printf(" Hierarchy commit error(%d) - %s\n",
error.type, error.message);
return;
}
printf(" Hierarchy Committed (port %u)!", pi);
port->softport.tm.hierarchy_config = 1;
/* Start port */
status = rte_eth_dev_start(pi);
if (status) {
printf("\n Port %u start error!\n", pi);
return;
}
printf("\n Port %u started!\n", pi);
return;
}
}
printf("\n TM feature not available on port %u", pi);
}
struct fwd_engine softnic_tm_engine = {
.fwd_mode_name = "tm",
.port_fwd_begin = softport_tm_begin,
.port_fwd_end = NULL,
.packet_fwd = softport_packet_fwd,
};
struct fwd_engine softnic_tm_bypass_engine = {
.fwd_mode_name = "tm-bypass",
.port_fwd_begin = NULL,
.port_fwd_end = NULL,
.packet_fwd = softport_packet_fwd,
};

View File

@ -49,18 +49,14 @@
#include <rte_cycles.h>
#include <rte_memory.h>
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_memcpy.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_ether.h>
@ -69,6 +65,7 @@
#include <rte_tcp.h>
#include <rte_udp.h>
#include <rte_string_fns.h>
#include <rte_flow.h>
#include "testpmd.h"
@ -107,6 +104,7 @@ copy_buf_to_pkt_segs(void* buf, unsigned len, struct rte_mbuf *pkt,
buf = ((char*) buf + copy_len);
seg = seg->next;
seg_buf = rte_pktmbuf_mtod(seg, char *);
copy_len = seg->data_len;
}
rte_memcpy(seg_buf, buf, (size_t) len);
}
@ -215,6 +213,8 @@ pkt_burst_transmit(struct fwd_stream *fs)
ol_flags = PKT_TX_VLAN_PKT;
if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ)
ol_flags |= PKT_TX_QINQ_PKT;
if (txp->tx_ol_flags & TESTPMD_TX_OFFLOAD_MACSEC)
ol_flags |= PKT_TX_MACSEC;
for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
pkt = rte_mbuf_raw_alloc(mbp);
if (pkt == NULL) {
@ -223,6 +223,14 @@ pkt_burst_transmit(struct fwd_stream *fs)
return;
break;
}
/*
* Using raw alloc is good to improve performance,
* but some consumers may use the headroom and so
* decrement data_off. We need to make sure it is
* reset to default value.
*/
rte_pktmbuf_reset_headroom(pkt);
pkt->data_len = tx_pkt_seg_lengths[0];
pkt_seg = pkt;
if (tx_pkt_split == TX_PKT_SPLIT_RND)

View File

@ -0,0 +1,136 @@
#!/bin/sh
#
# BSD LICENSE
#
# Copyright 2014-2015 6WIND S.A.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of 6WIND S.A. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Crude script to detect whether particular types, macros and functions are
# defined by trying to compile a file with a given header. Can be used to
# perform cross-platform checks since the resulting object file is not
# executed.
#
# Set VERBOSE=1 in the environment to display compiler output and errors.
#
# CC, CPPFLAGS, CFLAGS, EXTRA_CPPFLAGS and EXTRA_CFLAGS are taken from the
# environment.
#
# AUTO_CONFIG_CFLAGS may append additional CFLAGS without modifying the
# above variables.
file=${1:?output file name required (config.h)}
macro=${2:?output macro name required (HAVE_*)}
include=${3:?include name required (foo.h)}
type=${4:?object type required (define, enum, type, field, func)}
name=${5:?define/type/function name required}
: ${CC:=cc}
temp=/tmp/${0##*/}.$$.c
case $type in
define)
code="\
#ifndef $name
#error $name not defined
#endif
"
;;
enum)
code="\
long test____ = $name;
"
;;
type)
code="\
$name test____;
"
;;
field)
code="\
void test____(void)
{
${name%%.*} test_____;
(void)test_____.${name#*.};
}
"
;;
func)
code="\
void (*test____)() = (void (*)())$name;
"
;;
*)
unset error
: ${error:?unknown object type \"$type\"}
exit
esac
if [ "${VERBOSE}" = 1 ]
then
err=2
out=1
eol='
'
else
exec 3> /dev/null ||
exit
err=3
out=3
eol=' '
fi &&
printf 'Looking for %s %s in %s.%s' \
"${name}" "${type}" "${include}" "${eol}" &&
printf "\
#include <%s>
%s
" "$include" "$code" > "${temp}" &&
if ${CC} ${CPPFLAGS} ${EXTRA_CPPFLAGS} ${CFLAGS} ${EXTRA_CFLAGS} \
${AUTO_CONFIG_CFLAGS} \
-c -o ${temp}.o "${temp}" 1>&${out} 2>&${err}
then
rm -f "${temp}" "${temp}.o"
printf "\
#ifndef %s
#define %s 1
#endif /* %s */
" "${macro}" "${macro}" "${macro}" >> "${file}" &&
printf 'Defining %s.\n' "${macro}"
else
rm -f "${temp}" "${temp}.o"
printf "\
/* %s is not defined. */
" "${macro}" >> "${file}" &&
printf 'Not defining %s.\n' "${macro}"
fi
exit

View File

View File

View File

@ -44,6 +44,4 @@ SRCS-y += pmdinfogen.c
HOST_CFLAGS += $(WERROR_FLAGS) -g
HOST_CFLAGS += -I$(RTE_OUTPUT)/include
DEPDIRS-y += lib/librte_eal
include $(RTE_SDK)/mk/rte.hostapp.mk

View File

@ -158,7 +158,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
* There are more than 64k sections,
* read count from .sh_size.
*/
info->num_sections = TO_NATIVE(endian, 32, sechdrs[0].sh_size);
info->num_sections =
TO_NATIVE(endian, ADDR_SIZE, sechdrs[0].sh_size);
} else {
info->num_sections = hdr->e_shnum;
}
@ -181,7 +182,7 @@ static int parse_elf(struct elf_info *info, const char *filename)
sechdrs[i].sh_offset =
TO_NATIVE(endian, ADDR_SIZE, sechdrs[i].sh_offset);
sechdrs[i].sh_size =
TO_NATIVE(endian, 32, sechdrs[i].sh_size);
TO_NATIVE(endian, ADDR_SIZE, sechdrs[i].sh_size);
sechdrs[i].sh_link =
TO_NATIVE(endian, 32, sechdrs[i].sh_link);
sechdrs[i].sh_info =
@ -226,13 +227,14 @@ static int parse_elf(struct elf_info *info, const char *filename)
}
if (!info->symtab_start)
fprintf(stderr, "%s has no symtab?\n", filename);
/* Fix endianness in symbols */
for (sym = info->symtab_start; sym < info->symtab_stop; sym++) {
sym->st_shndx = TO_NATIVE(endian, 16, sym->st_shndx);
sym->st_name = TO_NATIVE(endian, 32, sym->st_name);
sym->st_value = TO_NATIVE(endian, ADDR_SIZE, sym->st_value);
sym->st_size = TO_NATIVE(endian, ADDR_SIZE, sym->st_size);
else {
/* Fix endianness in symbols */
for (sym = info->symtab_start; sym < info->symtab_stop; sym++) {
sym->st_shndx = TO_NATIVE(endian, 16, sym->st_shndx);
sym->st_name = TO_NATIVE(endian, 32, sym->st_name);
sym->st_value = TO_NATIVE(endian, ADDR_SIZE, sym->st_value);
sym->st_size = TO_NATIVE(endian, ADDR_SIZE, sym->st_size);
}
}
if (symtab_shndx_idx != ~0U) {
@ -269,6 +271,7 @@ struct opt_tag {
static const struct opt_tag opt_tags[] = {
{"_param_string_export", "params"},
{"_kmod_dep_export", "kmod"},
};
static int complete_pmd_entry(struct elf_info *info, struct pmd_driver *drv)
@ -325,6 +328,10 @@ static int locate_pmd_entries(struct elf_info *info)
do {
new = calloc(sizeof(struct pmd_driver), 1);
if (new == NULL) {
fprintf(stderr, "Failed to calloc memory\n");
return -1;
}
new->name_sym = find_sym_in_symtab(info, "this_pmd_name", last);
last = new->name_sym;
if (!new->name_sym)
@ -395,7 +402,7 @@ static void output_pmd_info_string(struct elf_info *info, char *outfile)
int main(int argc, char **argv)
{
struct elf_info info;
struct elf_info info = {0};
int rc = 1;
if (argc < 3) {
@ -406,7 +413,8 @@ int main(int argc, char **argv)
}
parse_elf(&info, argv[1]);
locate_pmd_entries(&info);
if (locate_pmd_entries(&info) < 0)
exit(1);
if (info.drivers) {
output_pmd_info_string(&info, argv[2]);

View File

@ -16,12 +16,16 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#ifdef __linux__
#include <endian.h>
#else
#include <sys/endian.h>
#endif
#include <fcntl.h>
#include <unistd.h>
#include <elf.h>
#include <rte_config.h>
#include <rte_pci.h>
#include <rte_byteorder.h>
/* On BSD-alike OSes elf.h defines these according to host's word size */
#undef ELF_ST_BIND
@ -75,9 +79,9 @@
#define CONVERT_NATIVE(fend, width, x) ({ \
typeof(x) ___x; \
if ((fend) == ELFDATA2LSB) \
___x = rte_le_to_cpu_##width(x); \
___x = le##width##toh(x); \
else \
___x = rte_be_to_cpu_##width(x); \
___x = be##width##toh(x); \
___x; \
})
@ -85,6 +89,7 @@ else \
enum opt_params {
PMD_PARAM_STRING = 0,
PMD_KMOD_DEP,
PMD_OPT_MAX
};

105
dpdk/buildtools/relpath.sh Normal file
View File

@ -0,0 +1,105 @@
#!/bin/sh
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# print the relative path of $1 from $2 directory
# $1 and $2 MUST be absolute paths
#
if [ $# -ne 2 ]; then
echo "Bad arguments"
echo "Usage:"
echo " $0 path1 path2"
exit 1
fi
# get the real absolute path, derefencing symlinks
ABS1="$(dirname $(readlink -f $1))/$(basename $1)"
ABS2=$(readlink -f $2)
# remove leading slash
REL1=${ABS1#/}
REL2=${ABS2#/}
left1=${REL1%%/*}
right1=${REL1#*/}
prev_right1=$REL1
prev_left1=
left2=${REL2%%/*}
right2=${REL2#*/}
prev_right2=$REL2
prev_left2=
prefix=
while [ "${right1}" != "" -a "${right2}" != "" ]; do
if [ "$left1" != "$left2" ]; then
break
fi
prev_left1=$left1
left1=$left1/${right1%%/*}
prev_right1=$right1
right1=${prev_right1#*/}
if [ "$right1" = "$prev_right1" ]; then
right1=""
fi
prev_left2=$left2
left2=$left2/${right2%%/*}
prev_right2=$right2
right2=${prev_right2#*/}
if [ "$right2" = "$prev_right2" ]; then
right2=""
fi
done
if [ "${left1}" != "${left2}" ]; then
right2=${prev_right2}
right1=${prev_right1}
fi
while [ "${right2}" != "" ]; do
prefix=${prefix}../
prev_right2=$right2
right2=${right2#*/}
if [ "$right2" = "$prev_right2" ]; then
right2=""
fi
done
echo ${prefix}${right1}
exit 0

View File

@ -0,0 +1,51 @@
# BSD LICENSE
#
# Copyright (C) Cavium, Inc 2017. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Cavium, Inc nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#include "common_linuxapp"
CONFIG_RTE_MACHINE="armv8a"
CONFIG_RTE_ARCH="arm64"
CONFIG_RTE_ARCH_ARM64=y
CONFIG_RTE_ARCH_64=y
CONFIG_RTE_FORCE_INTRINSICS=y
# Maximum available cache line size in arm64 implementations.
# Setting to maximum available cache line size in generic config
# to address minimum DMA alignment across all arm64 implementations.
CONFIG_RTE_CACHE_LINE_SIZE=128
CONFIG_RTE_LIBRTE_FM10K_PMD=n
CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n
CONFIG_RTE_LIBRTE_AVP_PMD=n
CONFIG_RTE_SCHED_VECTOR=n

View File

@ -1,6 +1,6 @@
# BSD LICENSE
#
# Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
# Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -74,6 +74,11 @@ CONFIG_RTE_BUILD_SHARED_LIB=n
#
CONFIG_RTE_NEXT_ABI=y
#
# Major ABI to overwrite library specific LIBABIVER
#
CONFIG_RTE_MAJOR_ABI=
#
# Machine's cache line size
#
@ -88,14 +93,26 @@ CONFIG_RTE_MAX_NUMA_NODES=8
CONFIG_RTE_MAX_MEMSEG=256
CONFIG_RTE_MAX_MEMZONE=2560
CONFIG_RTE_MAX_TAILQ=32
CONFIG_RTE_ENABLE_ASSERT=n
CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
CONFIG_RTE_LOG_HISTORY=256
CONFIG_RTE_BACKTRACE=y
CONFIG_RTE_LIBEAL_USE_HPET=n
CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
CONFIG_RTE_EAL_IGB_UIO=n
CONFIG_RTE_EAL_VFIO=n
CONFIG_RTE_MALLOC_DEBUG=n
CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n
#
# Recognize/ignore the AVX/AVX512 CPU flags for performance/power testing.
# AVX512 is marked as experimental for now, will enable it after enough
# field test and possible optimization.
#
CONFIG_RTE_ENABLE_AVX=y
CONFIG_RTE_ENABLE_AVX512=n
# Default driver path (or "" to disable)
CONFIG_RTE_EAL_PMD_PATH=""
@ -105,6 +122,11 @@ CONFIG_RTE_EAL_PMD_PATH=""
#
CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=y
#
# Compile the PCI library
#
CONFIG_RTE_LIBRTE_PCI=y
#
# Compile the argument parser library
#
@ -120,11 +142,25 @@ CONFIG_RTE_MAX_QUEUES_PER_PORT=1024
CONFIG_RTE_LIBRTE_IEEE1588=n
CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16
CONFIG_RTE_ETHDEV_RXTX_CALLBACKS=y
CONFIG_RTE_ETHDEV_PROFILE_ITT_WASTED_RX_ITERATIONS=n
#
# Support NIC bypass logic
# Turn off Tx preparation stage
#
CONFIG_RTE_NIC_BYPASS=n
# Warning: rte_eth_tx_prepare() can be safely disabled only if using a
# driver which do not implement any Tx preparation.
#
CONFIG_RTE_ETHDEV_TX_PREPARE_NOOP=n
#
# Compile PCI bus driver
#
CONFIG_RTE_LIBRTE_PCI_BUS=y
#
# Compile the vdev bus
#
CONFIG_RTE_LIBRTE_VDEV_BUS=y
#
# Compile burst-oriented Amazon ENA PMD driver
@ -159,20 +195,17 @@ CONFIG_RTE_LIBRTE_IXGBE_DEBUG_TX_FREE=n
CONFIG_RTE_LIBRTE_IXGBE_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_IXGBE_PF_DISABLE_STRIP_CRC=n
CONFIG_RTE_IXGBE_INC_VECTOR=y
CONFIG_RTE_IXGBE_RX_OLFLAGS_ENABLE=y
CONFIG_RTE_LIBRTE_IXGBE_BYPASS=n
#
# Compile burst-oriented I40E PMD driver
#
CONFIG_RTE_LIBRTE_I40E_PMD=y
CONFIG_RTE_LIBRTE_I40E_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n
CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n
CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n
CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC=y
CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
CONFIG_RTE_LIBRTE_I40E_RX_OLFLAGS_ENABLE=y
CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF=64
CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4
@ -197,13 +230,10 @@ CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR=y
#
CONFIG_RTE_LIBRTE_MLX4_PMD=n
CONFIG_RTE_LIBRTE_MLX4_DEBUG=n
CONFIG_RTE_LIBRTE_MLX4_SGE_WR_N=4
CONFIG_RTE_LIBRTE_MLX4_MAX_INLINE=0
CONFIG_RTE_LIBRTE_MLX4_TX_MP_CACHE=8
CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1
#
# Compile burst-oriented Mellanox ConnectX-4 (MLX5) PMD
# Compile burst-oriented Mellanox ConnectX-4 & ConnectX-5 (MLX5) PMD
#
CONFIG_RTE_LIBRTE_MLX5_PMD=n
CONFIG_RTE_LIBRTE_MLX5_DEBUG=n
@ -221,7 +251,7 @@ CONFIG_RTE_LIBRTE_BNX2X_MF_SUPPORT=n
CONFIG_RTE_LIBRTE_BNX2X_DEBUG_PERIODIC=n
#
# Compile burst-oriented Chelsio Terminator 10GbE/40GbE (CXGBE) PMD
# Compile burst-oriented Chelsio Terminator (CXGBE) PMD
#
CONFIG_RTE_LIBRTE_CXGBE_PMD=y
CONFIG_RTE_LIBRTE_CXGBE_DEBUG=n
@ -229,12 +259,14 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_REG=n
CONFIG_RTE_LIBRTE_CXGBE_DEBUG_MBOX=n
CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n
CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n
CONFIG_RTE_LIBRTE_CXGBE_TPUT=y
#
# Compile burst-oriented Cisco ENIC PMD driver
#
CONFIG_RTE_LIBRTE_ENIC_PMD=y
CONFIG_RTE_LIBRTE_ENIC_DEBUG=n
CONFIG_RTE_LIBRTE_ENIC_DEBUG_FLOW=n
#
# Compile burst-oriented Netronome NFP PMD driver
@ -242,35 +274,94 @@ CONFIG_RTE_LIBRTE_ENIC_DEBUG=n
CONFIG_RTE_LIBRTE_NFP_PMD=n
CONFIG_RTE_LIBRTE_NFP_DEBUG=n
#
# Compile Marvell PMD driver
#
CONFIG_RTE_LIBRTE_MRVL_PMD=n
#
# Compile burst-oriented Broadcom BNXT PMD driver
#
CONFIG_RTE_LIBRTE_BNXT_PMD=y
#
# Compile burst-oriented Solarflare libefx-based PMD
#
CONFIG_RTE_LIBRTE_SFC_EFX_PMD=y
CONFIG_RTE_LIBRTE_SFC_EFX_DEBUG=n
#
# Compile SOFTNIC PMD
#
CONFIG_RTE_LIBRTE_PMD_SOFTNIC=y
#
# Compile software PMD backed by SZEDATA2 device
#
CONFIG_RTE_LIBRTE_PMD_SZEDATA2=n
#
# Defines firmware type address space.
# RTE_LIBRTE_PMD_SZEDATA2_AS can be:
# 0 - for firmwares:
# NIC_100G1_LR4
# HANIC_100G1_LR4
# HANIC_100G1_SR10
# Other values raise compile time error
# See documentation for supported values.
# Other values raise compile time error.
CONFIG_RTE_LIBRTE_PMD_SZEDATA2_AS=0
#
# Compile burst-oriented Cavium Thunderx NICVF PMD driver
#
CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=n
CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=y
CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX=n
CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX=n
CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=n
#
# Compile burst-oriented Cavium LiquidIO PMD driver
#
CONFIG_RTE_LIBRTE_LIO_PMD=y
CONFIG_RTE_LIBRTE_LIO_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_LIO_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_LIO_DEBUG_RX=n
CONFIG_RTE_LIBRTE_LIO_DEBUG_TX=n
CONFIG_RTE_LIBRTE_LIO_DEBUG_MBOX=n
CONFIG_RTE_LIBRTE_LIO_DEBUG_REGS=n
# NXP DPAA Bus
CONFIG_RTE_LIBRTE_DPAA_BUS=n
CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n
CONFIG_RTE_LIBRTE_DPAA_PMD=n
#
# Compile burst-oriented Cavium OCTEONTX network PMD driver
#
CONFIG_RTE_LIBRTE_OCTEONTX_PMD=y
CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_RX=n
CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_TX=n
CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_MBOX=n
#
# Compile NXP DPAA2 FSL-MC Bus
#
CONFIG_RTE_LIBRTE_FSLMC_BUS=n
#
# Compile Support Libraries for NXP DPAA2
#
CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n
CONFIG_RTE_LIBRTE_DPAA2_USE_PHYS_IOVA=y
#
# Compile burst-oriented NXP DPAA2 PMD driver
#
CONFIG_RTE_LIBRTE_DPAA2_PMD=n
CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_DPAA2_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_DPAA2_DEBUG_RX=n
CONFIG_RTE_LIBRTE_DPAA2_DEBUG_TX=n
CONFIG_RTE_LIBRTE_DPAA2_DEBUG_TX_FREE=n
#
# Compile burst-oriented VIRTIO PMD driver
#
@ -315,9 +406,9 @@ CONFIG_RTE_LIBRTE_PMD_BOND=y
CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB=n
CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1=n
# QLogic 25G/40G/100G PMD
# QLogic 10G/25G/40G/50G/100G PMD
#
CONFIG_RTE_LIBRTE_QEDE_PMD=n
CONFIG_RTE_LIBRTE_QEDE_PMD=y
CONFIG_RTE_LIBRTE_QEDE_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_QEDE_DEBUG_INFO=n
CONFIG_RTE_LIBRTE_QEDE_DEBUG_DRIVER=n
@ -333,15 +424,40 @@ CONFIG_RTE_LIBRTE_QEDE_FW=""
CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n
#
# Compile Xen PMD
# Compile ARK PMD
#
CONFIG_RTE_LIBRTE_PMD_XENVIRT=n
CONFIG_RTE_LIBRTE_ARK_PMD=y
CONFIG_RTE_LIBRTE_ARK_PAD_TX=y
CONFIG_RTE_LIBRTE_ARK_DEBUG_RX=n
CONFIG_RTE_LIBRTE_ARK_DEBUG_TX=n
CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS=n
CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n
#
# Compile WRS accelerated virtual port (AVP) guest PMD driver
#
CONFIG_RTE_LIBRTE_AVP_PMD=n
CONFIG_RTE_LIBRTE_AVP_DEBUG_RX=n
CONFIG_RTE_LIBRTE_AVP_DEBUG_TX=n
CONFIG_RTE_LIBRTE_AVP_DEBUG_DRIVER=y
CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n
#
# Compile the TAP PMD
# It is enabled by default for Linux only.
#
CONFIG_RTE_LIBRTE_PMD_TAP=n
#
# Compile null PMD
#
CONFIG_RTE_LIBRTE_PMD_NULL=y
#
# Compile fail-safe PMD
#
CONFIG_RTE_LIBRTE_PMD_FAILSAFE=y
#
# Do prefetch of packet data within PMD driver receive function
#
@ -355,6 +471,28 @@ CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
CONFIG_RTE_CRYPTO_MAX_DEVS=64
CONFIG_RTE_CRYPTODEV_NAME_LEN=64
#
# Compile PMD for ARMv8 Crypto device
#
CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO=n
CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO_DEBUG=n
#
# Compile NXP DPAA2 crypto sec driver for CAAM HW
#
CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n
CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_DPAA2_SEC_DEBUG_RX=n
#
# NXP DPAA caam - crypto driver
#
CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n
CONFIG_RTE_LIBRTE_DPAA_SEC_DEBUG_INIT=n
CONFIG_RTE_LIBRTE_DPAA_SEC_DEBUG_DRIVER=n
CONFIG_RTE_LIBRTE_DPAA_SEC_DEBUG_RX=n
#
# Compile PMD for QuickAssist based devices
#
@ -375,6 +513,12 @@ CONFIG_RTE_QAT_PMD_MAX_NB_SESSIONS=2048
CONFIG_RTE_LIBRTE_PMD_AESNI_MB=n
CONFIG_RTE_LIBRTE_PMD_AESNI_MB_DEBUG=n
#
# Compile PMD for Software backed device
#
CONFIG_RTE_LIBRTE_PMD_OPENSSL=n
CONFIG_RTE_LIBRTE_PMD_OPENSSL_DEBUG=n
#
# Compile PMD for AESNI GCM device
#
@ -393,18 +537,64 @@ CONFIG_RTE_LIBRTE_PMD_SNOW3G_DEBUG=n
CONFIG_RTE_LIBRTE_PMD_KASUMI=n
CONFIG_RTE_LIBRTE_PMD_KASUMI_DEBUG=n
#
# Compile PMD for ZUC device
#
CONFIG_RTE_LIBRTE_PMD_ZUC=n
CONFIG_RTE_LIBRTE_PMD_ZUC_DEBUG=n
#
# Compile PMD for Crypto Scheduler device
#
CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER=y
CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n
#
# Compile PMD for NULL Crypto device
#
CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
#
# Compile PMD for Marvell Crypto device
#
CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO=n
CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO_DEBUG=n
#
# Compile generic security library
#
CONFIG_RTE_LIBRTE_SECURITY=y
#
# Compile generic event device library
#
CONFIG_RTE_LIBRTE_EVENTDEV=y
CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=n
CONFIG_RTE_EVENT_MAX_DEVS=16
CONFIG_RTE_EVENT_MAX_QUEUES_PER_DEV=64
#
# Compile PMD for skeleton event device
#
CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV=y
CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG=n
#
# Compile PMD for software event device
#
CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV=y
CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV_DEBUG=n
#
# Compile PMD for octeontx sso event device
#
CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=y
CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF_DEBUG=n
#
# Compile librte_ring
#
CONFIG_RTE_LIBRTE_RING=y
CONFIG_RTE_LIBRTE_RING_DEBUG=n
CONFIG_RTE_RING_SPLIT_PROD_CONS=n
CONFIG_RTE_RING_PAUSE_REP_COUNT=0
#
# Compile librte_mempool
@ -413,6 +603,18 @@ CONFIG_RTE_LIBRTE_MEMPOOL=y
CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE=512
CONFIG_RTE_LIBRTE_MEMPOOL_DEBUG=n
#
# Compile Mempool drivers
#
CONFIG_RTE_DRIVER_MEMPOOL_RING=y
CONFIG_RTE_DRIVER_MEMPOOL_STACK=y
#
# Compile PMD for octeontx fpa mempool device
#
CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL=y
CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL_DEBUG=n
#
# Compile librte_mbuf
#
@ -445,11 +647,36 @@ CONFIG_RTE_LIBRTE_CMDLINE_DEBUG=n
CONFIG_RTE_LIBRTE_HASH=y
CONFIG_RTE_LIBRTE_HASH_DEBUG=n
#
# Compile librte_efd
#
CONFIG_RTE_LIBRTE_EFD=y
#
# Compile librte_member
#
CONFIG_RTE_LIBRTE_MEMBER=y
#
# Compile librte_jobstats
#
CONFIG_RTE_LIBRTE_JOBSTATS=y
#
# Compile the device metrics library
#
CONFIG_RTE_LIBRTE_METRICS=y
#
# Compile the bitrate statistics library
#
CONFIG_RTE_LIBRTE_BITRATE=y
#
# Compile the latency statistics library
#
CONFIG_RTE_LIBRTE_LATENCY_STATS=y
#
# Compile librte_lpm
#
@ -482,11 +709,26 @@ CONFIG_RTE_LIBRTE_IP_FRAG_DEBUG=n
CONFIG_RTE_LIBRTE_IP_FRAG_MAX_FRAG=4
CONFIG_RTE_LIBRTE_IP_FRAG_TBL_STAT=n
#
# Compile GRO library
#
CONFIG_RTE_LIBRTE_GRO=y
#
# Compile GSO library
#
CONFIG_RTE_LIBRTE_GSO=y
#
# Compile librte_meter
#
CONFIG_RTE_LIBRTE_METER=y
#
# Compile librte_classify
#
CONFIG_RTE_LIBRTE_FLOW_CLASSIFY=y
#
# Compile librte_sched
#
@ -531,14 +773,10 @@ CONFIG_RTE_PIPELINE_STATS_COLLECT=n
# Compile librte_kni
#
CONFIG_RTE_LIBRTE_KNI=n
CONFIG_RTE_LIBRTE_PMD_KNI=n
CONFIG_RTE_KNI_KMOD=n
CONFIG_RTE_KNI_KMOD_ETHTOOL=n
CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
CONFIG_RTE_KNI_KO_DEBUG=n
CONFIG_RTE_KNI_VHOST=n
CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024
CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=n
CONFIG_RTE_KNI_VHOST_DEBUG_RX=n
CONFIG_RTE_KNI_VHOST_DEBUG_TX=n
#
# Compile the pdump library
@ -546,13 +784,9 @@ CONFIG_RTE_KNI_VHOST_DEBUG_TX=n
CONFIG_RTE_LIBRTE_PDUMP=y
#
# Compile vhost library
# fuse-devel is needed to run vhost-cuse.
# fuse-devel enables user space char driver development
# vhost-user is turned on by default.
# Compile vhost user library
#
CONFIG_RTE_LIBRTE_VHOST=n
CONFIG_RTE_LIBRTE_VHOST_USER=y
CONFIG_RTE_LIBRTE_VHOST_NUMA=n
CONFIG_RTE_LIBRTE_VHOST_DEBUG=n
@ -562,25 +796,30 @@ CONFIG_RTE_LIBRTE_VHOST_DEBUG=n
#
CONFIG_RTE_LIBRTE_PMD_VHOST=n
#
#Compile Xen domain0 support
#
CONFIG_RTE_LIBRTE_XEN_DOM0=n
#
# Enable warning directives
#
CONFIG_RTE_INSECURE_FUNCTION_WARNING=n
#
# Compile the test application
#
CONFIG_RTE_APP_TEST=n
CONFIG_RTE_APP_TEST=y
CONFIG_RTE_APP_TEST_RESOURCE_TAR=n
#
# Compile the procinfo application
#
CONFIG_RTE_PROC_INFO=n
#
# Compile the PMD test application
#
CONFIG_RTE_TEST_PMD=y
CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES=n
CONFIG_RTE_TEST_PMD_RECORD_BURST_STATS=n
#
# Compile the crypto performance application
#
CONFIG_RTE_APP_CRYPTO_PERF=y
#
# Compile the eventdev application
#
CONFIG_RTE_APP_EVENTDEV=y

View File

@ -35,12 +35,19 @@
CONFIG_RTE_EXEC_ENV="linuxapp"
CONFIG_RTE_EXEC_ENV_LINUXAPP=y
CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=y
CONFIG_RTE_EAL_IGB_UIO=y
CONFIG_RTE_EAL_VFIO=y
CONFIG_RTE_KNI_KMOD=y
CONFIG_RTE_LIBRTE_KNI=y
CONFIG_RTE_LIBRTE_PMD_KNI=y
CONFIG_RTE_LIBRTE_VHOST=y
CONFIG_RTE_LIBRTE_VHOST_NUMA=y
CONFIG_RTE_LIBRTE_PMD_VHOST=y
CONFIG_RTE_LIBRTE_PMD_AF_PACKET=y
CONFIG_RTE_LIBRTE_PMD_TAP=y
CONFIG_RTE_LIBRTE_AVP_PMD=y
CONFIG_RTE_LIBRTE_NFP_PMD=y
CONFIG_RTE_LIBRTE_POWER=y
CONFIG_RTE_VIRTIO_USER=y
CONFIG_RTE_PROC_INFO=y

Some files were not shown because too many files have changed in this diff Show More