summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/test
diff options
context:
space:
mode:
authorElias Rudberg <elias.rudberg@bahnhof.net>2021-01-26 13:56:45 +0100
committerOle Tr�an <otroan@employees.org>2021-02-05 11:54:14 +0000
commite345ee5cb94cb28cac4ba62af67c2c540916a429 (patch)
treef5653c0f78888281710869907b049720853d8ede /src/plugins/nat/test
parent839dcc0fb7313638d9b8f52a9db81350dddfe461 (diff)
nat: configurable handoff frame queue size
Make number of worker handoff frame queue elements configurable as a set nat frame-queue-nelts command. The default value is 64 which is the same value that was previously hard-coded. The idea is that allowing larger values can be useful in some cases, to avoid congestion drops. Also add nat_set_fq_options API support and a corresponding test case. Type: improvement Change-Id: I5c321eb2d7997f76fac2703d9c4a5b2516375db3 Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net>
Diffstat (limited to 'src/plugins/nat/test')
-rw-r--r--src/plugins/nat/test/test_nat44_ei.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/plugins/nat/test/test_nat44_ei.py b/src/plugins/nat/test/test_nat44_ei.py
index 16a3376e9b2..e69e24b2911 100644
--- a/src/plugins/nat/test/test_nat44_ei.py
+++ b/src/plugins/nat/test/test_nat44_ei.py
@@ -858,6 +858,33 @@ class MethodHolder(VppTestCase):
self.assertEqual(data, p[Raw].load)
+class TestNAT44EIAPI(MethodHolder):
+ """ NAT44EI API Test Cases """
+
+ fq_nelts = 512
+
+ def setUp(self):
+ super(TestNAT44EIAPI, self).setUp()
+ self.vapi.nat_set_fq_options(frame_queue_nelts=self.fq_nelts)
+ self.vapi.nat44_plugin_enable_disable(enable=1)
+
+ def tearDown(self):
+ super(TestNAT44EIAPI, self).tearDown()
+ if not self.vpp_dead:
+ self.vapi.nat44_plugin_enable_disable(enable=0)
+ self.vapi.cli("clear logging")
+
+ def test_show_frame_queue_nelts(self):
+ """ API test - worker handoff frame queue elements """
+ nat_config = self.vapi.nat_show_fq_options()
+ self.assertEqual(self.fq_nelts, nat_config.frame_queue_nelts)
+ self.vapi.nat44_plugin_enable_disable(enable=0)
+ self.vapi.cli("set nat frame-queue-nelts 256")
+ self.vapi.nat44_plugin_enable_disable(enable=1)
+ nat_config = self.vapi.nat_show_fq_options()
+ self.assertEqual(256, nat_config.frame_queue_nelts)
+
+
class TestNAT44EI(MethodHolder):
""" NAT44EI Test Cases """