test: compute max_translations_per_thread based on worker threads number 50/29150/5
authorJan Gelety <jgelety@cisco.com>
Fri, 11 Sep 2020 23:25:23 +0000 (01:25 +0200)
committerJan Gelety <jgelety@cisco.com>
Wed, 30 Sep 2020 10:15:53 +0000 (10:15 +0000)
Change-Id: I1c638aef886bf37a9feb4a29e4949c7c8f19b717
Signed-off-by: Jan Gelety <jgelety@cisco.com>
16 files changed:
resources/libraries/python/NATUtil.py
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4tcp-nat44ed-h1024-p63-s64512-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4tcp-nat44ed-h16384-p63-s1032192-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4tcp-nat44ed-h262144-p63-s16515072-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4tcp-nat44ed-h4096-p63-s258048-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4tcp-nat44ed-h65536-p63-s4128768-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h1024-p63-s64512-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h1024-p63-s64512-udir-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h16384-p63-s1032192-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h16384-p63-s1032192-udir-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h262144-p63-s16515072-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h262144-p63-s16515072-udir-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h4096-p63-s258048-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h4096-p63-s258048-udir-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h65536-p63-s4128768-cps-ndrpdr.robot
tests/vpp/perf/ip4/2n1l-10ge2p1x710-ethip4udp-nat44ed-h65536-p63-s4128768-udir-ndrpdr.robot

index 8578703..aabcd36 100644 (file)
@@ -185,6 +185,22 @@ class NATUtil:
         ]
         PapiSocketExecutor.dump_and_log(node, cmds)
 
+    @staticmethod
+    def compute_max_translations_per_thread(sessions, threads):
+        """Compute value of max_translations_per_thread NAT44 parameter based on
+        total number of worker threads.
+
+        :param sessions: Required number of NAT44 sessions.
+        :param threads: Number of worker threads.
+        :type sessions: int
+        :type threads: int
+        :returns: Value of max_translations_per_thread NAT44 parameter.
+        :rtype: int
+        """
+        from math import log2, modf
+        rest, mult = modf(log2(sessions/(10*threads)))
+        return 2 ** (int(mult) + (1 if rest else 0)) * 10
+
     # DET44 PAPI calls
     # DET44 means deterministic mode of NAT44
     @staticmethod
index 35ffc3c..905c552 100644 (file)
 | ${dest_mask}= | ${22}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 81920
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${22}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.0
 | ${out_mask}= | ${32}
+# Scale settings
+| ${n_hosts}= | ${1024}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4tcp-1024h
 | ${cps}= | ${64512}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index ac9d2de..836f602 100644 (file)
 | ${dest_mask}= | ${18}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 655360
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${18}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.15
 | ${out_mask}= | ${28}
+# Scale settings
+| ${n_hosts}= | ${16384}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4tcp-16384h
 | ${cps}= | ${1032192}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index a993e57..674cab0 100644 (file)
 | ${dest_mask}= | ${14}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 10485760
 | ${in_net}= | 172.16.0.0
 | ${in_mask}= | ${14}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.255
 | ${out_mask}= | ${24}
+# Scale settings
+| ${n_hosts}= | ${262144}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4tcp-262144h
 | ${cps}= | ${16515072}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index fb1c311..873ac1a 100644 (file)
 | ${dest_mask}= | ${20}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 163840
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${20}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.3
 | ${out_mask}= | ${30}
+# Scale settings
+| ${n_hosts}= | ${4096}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4tcp-4096h
 | ${cps}= | ${258048}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index 8ee1aca..39e81ec 100644 (file)
 | ${dest_mask}= | ${16}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 2621440
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${16}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.63
 | ${out_mask}= | ${26}
+# Scale settings
+| ${n_hosts}= | ${65536}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4tcp-65536h
 | ${cps}= | ${4128768}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index 710e96f..cfdcfac 100644 (file)
 | ${dest_mask}= | ${22}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 81920
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${22}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.0
 | ${out_mask}= | ${32}
+# Scale settings
+| ${n_hosts}= | ${1024}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4udp-1024h
 | ${cps}= | ${64512}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index 0f83b9e..c0f974e 100644 (file)
 | ${dest_mask}= | ${8}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 64512
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${8}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.0
 | ${out_mask}= | ${32}
+# Scale settings
+| ${n_hosts}= | ${1024}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-stl-ethip4udp-1024u63p-udir
 
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index fa21493..7ecdf09 100644 (file)
 | ${dest_mask}= | ${18}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 655360
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${18}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.15
 | ${out_mask}= | ${28}
+# Scale settings
+| ${n_hosts}= | ${16384}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4udp-16384h
 | ${cps}= | ${1032192}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index 3007649..ea33f8c 100644 (file)
 | ${dest_mask}= | ${8}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 1032192
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${18}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.15
 | ${out_mask}= | ${28}
+# Scale settings
+| ${n_hosts}= | ${16384}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-stl-ethip4udp-16384u63p-udir
 
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index 3749553..e375a75 100644 (file)
 | ${dest_mask}= | ${14}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 10485760
 | ${in_net}= | 172.16.0.0
 | ${in_mask}= | ${14}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.255
 | ${out_mask}= | ${24}
+# Scale settings
+| ${n_hosts}= | ${262144}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4udp-262144h
 | ${cps}= | ${16515072}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index 023604e..dd940f6 100644 (file)
 | ${dest_mask}= | ${8}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 16515072
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${8}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.255
 | ${out_mask}= | ${24}
+# Scale settings
+| ${n_hosts}= | ${262144}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-stl-ethip4udp-262144u63p-udir
 # Main heap size multiplicator
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index bccd6a7..98a00a6 100644 (file)
 | ${dest_mask}= | ${20}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 163840
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${20}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.3
 | ${out_mask}= | ${30}
+# Scale settings
+| ${n_hosts}= | ${4096}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4udp-4096h
 | ${cps}= | ${258048}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index c075fbf..a0d19bb 100644 (file)
 | ${dest_mask}= | ${8}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 258048
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${8}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.3
 | ${out_mask}= | ${30}
+# Scale settings
+| ${n_hosts}= | ${4096}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-stl-ethip4udp-4096u63p-udir
 
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index 4e2b0bf..97c68d8 100644 (file)
 | ${dest_mask}= | ${16}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 2621440
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${16}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.63
 | ${out_mask}= | ${26}
+# Scale settings
+| ${n_hosts}= | ${65536}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-astf-ethip4udp-65536h
 | ${cps}= | ${4128768}
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs
index b98c2d0..f6e6503 100644 (file)
 | ${dest_mask}= | ${8}
 # NAT settings
 | ${nat_mode}= | endpoint-dependent
-| ${max_translations_per_thread}= | 4128768
 | ${in_net}= | 192.168.0.0
 | ${in_mask}= | ${8}
 | ${out_net}= | 68.142.68.0
 | ${out_net_end}= | 68.142.68.63
 | ${out_mask}= | ${26}
+# Scale settings
+| ${n_hosts}= | ${65536}
+| ${n_ports}= | ${63}
+| ${n_sessions}= | ${${n_hosts} * ${n_ports}}
 # Traffic profile:
 | ${traffic_profile}= | trex-stl-ethip4udp-65536u63p-udir
 # Main heap size multiplicator
 | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
 | | And Pre-initialize layer driver | ${nic_driver}
 | | And Add NAT to all DUTs | nat_mode=${nat_mode}
+| | ${max_translations_per_thread}= | Compute Max Translations Per Thread
+| | ... | ${n_sessions} | ${thr_count_int}
 | | And Add NAT max translations per thread to all DUTs
 | | ... | ${max_translations_per_thread}
 | | And Apply startup configuration on all VPP DUTs