DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@intel.com>
To: dev@dpdk.org
Cc: akhil.goyal@nxp.com, Konstantin Ananyev <konstantin.ananyev@intel.com>
Subject: [dpdk-dev] [PATCH 3/3] examples/ipsec-secgw: add multi-segment test cases
Date: Mon, 27 May 2019 19:44:48 +0100	[thread overview]
Message-ID: <20190527184448.21264-4-konstantin.ananyev@intel.com> (raw)
In-Reply-To: <20190527184448.21264-1-konstantin.ananyev@intel.com>

Enhance test scripts to support fragmentation/reassemble functionality.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 examples/ipsec-secgw/test/common_defs.sh | 18 +++++++++++++++---
 examples/ipsec-secgw/test/data_rxtx.sh   | 18 ++++++++++--------
 examples/ipsec-secgw/test/linux_test4.sh | 17 ++++++++++++++++-
 examples/ipsec-secgw/test/linux_test6.sh | 17 ++++++++++++++++-
 examples/ipsec-secgw/test/run_test.sh    |  5 ++++-
 5 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/examples/ipsec-secgw/test/common_defs.sh b/examples/ipsec-secgw/test/common_defs.sh
index 8dc574b50..ec15d8685 100644
--- a/examples/ipsec-secgw/test/common_defs.sh
+++ b/examples/ipsec-secgw/test/common_defs.sh
@@ -55,10 +55,24 @@ SGW_CMD_PRM="-p 0x3 -u 1 -P --config=\"${SGW_CMD_CFG}\""
 
 SGW_CFG_FILE=$(mktemp)
 
+# 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}
@@ -73,8 +87,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}
 }
diff --git a/examples/ipsec-secgw/test/data_rxtx.sh b/examples/ipsec-secgw/test/data_rxtx.sh
index f23a6d594..9ba978a93 100644
--- a/examples/ipsec-secgw/test/data_rxtx.sh
+++ b/examples/ipsec-secgw/test/data_rxtx.sh
@@ -5,14 +5,15 @@ TCP_PORT=22222
 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
@@ -24,14 +25,15 @@ ping_test1()
 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
diff --git a/examples/ipsec-secgw/test/linux_test4.sh b/examples/ipsec-secgw/test/linux_test4.sh
index d636f5604..85efc5d90 100644
--- a/examples/ipsec-secgw/test/linux_test4.sh
+++ b/examples/ipsec-secgw/test/linux_test4.sh
@@ -15,6 +15,8 @@
 #  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.
@@ -42,6 +44,17 @@ MODE=$1
  . ${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
@@ -52,9 +65,11 @@ config_remote_xfrm
 
  . ${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
diff --git a/examples/ipsec-secgw/test/linux_test6.sh b/examples/ipsec-secgw/test/linux_test6.sh
index e30f607d8..c749dcef8 100644
--- a/examples/ipsec-secgw/test/linux_test6.sh
+++ b/examples/ipsec-secgw/test/linux_test6.sh
@@ -15,6 +15,8 @@
 #  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.
@@ -43,6 +45,17 @@ MODE=$1
  . ${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
@@ -53,9 +66,11 @@ config6_remote_xfrm
 
  . ${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
diff --git a/examples/ipsec-secgw/test/run_test.sh b/examples/ipsec-secgw/test/run_test.sh
index 3a1a7d4b4..07c4c8f91 100644
--- a/examples/ipsec-secgw/test/run_test.sh
+++ b/examples/ipsec-secgw/test/run_test.sh
@@ -11,7 +11,10 @@
 #  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:
-- 
2.17.1


  parent reply	other threads:[~2019-05-27 18:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 18:44 [dpdk-dev] [PATCH 0/3] examples/ipsec-secgw: support packet fragmentation Konstantin Ananyev
2019-05-27 18:44 ` [dpdk-dev] [PATCH 1/3] examples/ipsec-secgw: fix invalid packet length Konstantin Ananyev
2019-05-27 18:44 ` [dpdk-dev] [PATCH 2/3] examples/ipsec-secgw: support packet fragmentation and reassembly Konstantin Ananyev
2019-05-27 18:44 ` Konstantin Ananyev [this message]
2019-06-06 11:51 ` [dpdk-dev] [PATCH v2 0/5] examples/ipsec-secgw: support packet Konstantin Ananyev
2019-06-06 11:51   ` [dpdk-dev] [PATCH v2 1/5] examples/ipsec-secgw: fix invalid packet length Konstantin Ananyev
2019-06-25 13:04     ` Akhil Goyal
2019-06-25 13:07       ` Ananyev, Konstantin
2019-06-06 11:51   ` [dpdk-dev] [PATCH v2 2/5] examples/ipsec-secgw: support packet fragmentation and reassembly Konstantin Ananyev
2019-06-06 11:51   ` [dpdk-dev] [PATCH v2 3/5] examples/ipsec-secgw: add multi-segment test cases Konstantin Ananyev
2019-06-06 11:51   ` [dpdk-dev] [PATCH v2 4/5] examples/ipsec-secgw: add bypass test case Konstantin Ananyev
2019-06-06 11:51   ` [dpdk-dev] [PATCH v2 5/5] doc: update ipsec-secgw guide Konstantin Ananyev
2019-06-25 23:16   ` [dpdk-dev] [PATCH v3 0/4] examples/ipsec-secgw: support packet Konstantin Ananyev
2019-06-25 23:16     ` [dpdk-dev] [PATCH v3 1/4] examples/ipsec-secgw: fix invalid packet length Konstantin Ananyev
2019-06-25 23:16     ` [dpdk-dev] [PATCH v3 2/4] examples/ipsec-secgw: support packet fragmentation and reassembly Konstantin Ananyev
2019-06-25 23:16     ` [dpdk-dev] [PATCH v3 3/4] examples/ipsec-secgw: add multi-segment test cases Konstantin Ananyev
2019-06-25 23:16     ` [dpdk-dev] [PATCH v3 4/4] examples/ipsec-secgw: add bypass test case Konstantin Ananyev
2019-07-01 11:43     ` [dpdk-dev] [PATCH v3 0/4] examples/ipsec-secgw: support packet Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190527184448.21264-4-konstantin.ananyev@intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).