app/testpmd: use better randomness for Tx split
[dpdk.git] / examples / ipsec-secgw / test / common_defs.sh
index 63ad541..4aac498 100644 (file)
@@ -1,4 +1,5 @@
 #! /bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
 
 #check ETH_DEV
 if [[ -z "${ETH_DEV}" ]]; then
@@ -35,10 +36,24 @@ LOCAL_IPV6=fd12:3456:789a:0031:0000:0000:0000:0092
 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}
@@ -53,8 +68,6 @@ config6_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}
 }