Enhance test scripts to support fragmentation/reassemble functionality.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
DPDK_PATH=${RTE_SDK:-${PWD}}
DPDK_BUILD=${RTE_TARGET:-x86_64-native-linux-gcc}
+# by default ipsec-secgw can't deal with multi-segment packets
+# make sure our local/remote host wouldn't generate fragmented packets
+# if reassmebly option is not enabled
+DEF_MTU_LEN=1400
+DEF_PING_LEN=1200
+
+#setup mtu on local iface
+set_local_mtu()
+{
+ mtu=$1
+ ifconfig ${LOCAL_IFACE} mtu ${mtu}
+ sysctl -w net.ipv6.conf.${LOCAL_IFACE}.mtu=${mtu}
+}
+
# configure local host/ifaces
config_local_iface()
{
- ifconfig ${LOCAL_IFACE} ${LOCAL_IPV4}/24 mtu 1400 up
+ ifconfig ${LOCAL_IFACE} ${LOCAL_IPV4}/24 up
ifconfig ${LOCAL_IFACE}
ip neigh flush dev ${LOCAL_IFACE}
sysctl -w net.ipv6.conf.${LOCAL_IFACE}.disable_ipv6=0
ip addr add ${LOCAL_IPV6}/64 dev ${LOCAL_IFACE}
- sysctl -w net.ipv6.conf.${LOCAL_IFACE}.mtu=1300
-
ip -6 neigh add ${REMOTE_IPV6} dev ${LOCAL_IFACE} lladdr ${REMOTE_MAC}
ip neigh show dev ${LOCAL_IFACE}
}
ping_test1()
{
dst=$1
+ i=${2:-0}
+ end=${3:-1200}
- i=0
st=0
- while [[ $i -ne 1200 && $st -eq 0 ]];
+ while [[ $i -ne $end && $st -eq 0 ]];
do
- let i++
- ping -c 1 -s ${i} ${dst}
+ ping -c 1 -s ${i} -M dont ${dst}
st=$?
+ let i++
done
if [[ $st -ne 0 ]]; then
ping6_test1()
{
dst=$1
+ i=${2:-0}
+ end=${3:-1200}
- i=0
st=0
- while [[ $i -ne 1200 && $st -eq 0 ]];
+ while [[ $i -ne $end && $st -eq 0 ]];
do
- let i++
- ping6 -c 1 -s ${i} ${dst}
+ ping6 -c 1 -s ${i} -M dont ${dst}
st=$?
+ let i++
done
if [[ $st -ne 0 ]]; then
# SGW_LCORE - lcore to run ipsec-secgw on (default value is 0)
# CRYPTO_DEV - crypto device to be used ('-w <pci-id>')
# if none specified appropriate vdevs will be created by the scrit
+# MULTI_SEG_TEST - ipsec-secgw option to enable reassembly support and
+# specify size of reassembly table (i.e. MULTI_SEG_TEST="--reassemble 128")
#
# The purpose of the script is to automate ipsec-secgw testing
# using another system running linux as a DUT.
. ${DIR}/common_defs.sh
. ${DIR}/${MODE}_defs.sh
+#make linux to generate fragmented packets
+if [[ -n "${MULTI_SEG_TEST}" && -n "${SGW_CMD_XPRM}" ]]; then
+ echo "multi-segment test is enabled"
+ SGW_CMD_XPRM="${SGW_CMD_XPRM} ${MULTI_SEG_TEST}"
+ PING_LEN=5000
+ MTU_LEN=1500
+else
+ PING_LEN=${DEF_PING_LEN}
+ MTU_LEN=${DEF_MTU_LEN}
+fi
+
config_secgw
secgw_start
. ${DIR}/data_rxtx.sh
-ping_test1 ${REMOTE_IPV4}
+set_local_mtu ${MTU_LEN}
+ping_test1 ${REMOTE_IPV4} 0 ${PING_LEN}
st=$?
if [[ $st -eq 0 ]]; then
+ set_local_mtu ${DEF_MTU_LEN}
scp_test1 ${REMOTE_IPV4}
st=$?
fi
# SGW_LCORE - lcore to run ipsec-secgw on (default value is 0)
# CRYPTO_DEV - crypto device to be used ('-w <pci-id>')
# if none specified appropriate vdevs will be created by the scrit
+# MULTI_SEG_TEST - ipsec-secgw option to enable reassembly support and
+# specify size of reassembly table (i.e. MULTI_SEG_TEST="--reassemble 128")
#
# The purpose of the script is to automate ipsec-secgw testing
# using another system running linux as a DUT.
. ${DIR}/common_defs.sh
. ${DIR}/${MODE}_defs.sh
+#make linux to generate fragmented packets
+if [[ -n "${MULTI_SEG_TEST}" && -n "${SGW_CMD_XPRM}" ]]; then
+ echo "multi-segment test is enabled"
+ SGW_CMD_XPRM="${SGW_CMD_XPRM} ${MULTI_SEG_TEST}"
+ PING_LEN=5000
+ MTU_LEN=1500
+else
+ PING_LEN=${DEF_PING_LEN}
+ MTU_LEN=${DEF_MTU_LEN}
+fi
+
config_secgw
secgw_start
. ${DIR}/data_rxtx.sh
-ping6_test1 ${REMOTE_IPV6}
+set_local_mtu ${MTU_LEN}
+ping6_test1 ${REMOTE_IPV6} 0 ${PING_LEN}
st=$?
if [[ $st -eq 0 ]]; then
+ set_local_mtu ${DEF_MTU_LEN}
scp_test1 ${REMOTE_IPV6}
st=$?
fi
# SGW_LCORE - lcore to run ipsec-secgw on (default value is 0)
# CRYPTO_DEV - crypto device to be used ('-w <pci-id>')
# if none specified appropriate vdevs will be created by the scrit
-# refer to linux_test1.sh for more information
+# MULTI_SEG_TEST - ipsec-secgw option to enable reassembly support and
+# specify size of reassembly table (i.e. MULTI_SEG_TEST="--reassemble 128")
+# refer to linux_test[4,6].sh for more information
+
# All supported modes to test.
# naming convention: