[Core] Minor Updates to the flow. 37/73337/2
authorSridhar K. N. Rao <srao@linuxfoundation.org>
Tue, 3 May 2022 18:48:03 +0000 (00:18 +0530)
committerSridhar K. N. Rao <srao@linuxfoundation.org>
Fri, 13 May 2022 06:08:51 +0000 (11:38 +0530)
This patch adds minor updates to the flow.
1. Add license Information
2. Remove spaces.

Signed-off-by: Sridhar K. N. Rao <srao@linuxfoundation.org>
Change-Id: I805ee93afc5c7b1c7c157dad643b9ddac2d4d55d

conf/12_k8s.conf
conf/kubernetes/01_testcases.conf
core/pod_controller.py
testcases/testcase.py

index 04e70de..1b51f68 100644 (file)
@@ -1,3 +1,4 @@
+# Copyright 2022 The Linux Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -45,3 +46,6 @@ APP_NAME = 'l2fwd'
 EXT_VSWITCH = True
 EXT_VSWITCH_TYPE = 'VPP'
 EXT_OVS_BRIDGE = 'br0'
+
+# Flow Control
+USCNI_INTERFACE_PAIRS = 1
index 9e23855..a6bb8d3 100644 (file)
@@ -1,3 +1,22 @@
+# Copyright 2022 Spirent Communications, The Linux Foundation, and others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Generic test configuration options are described at conf/01_testcases.conf
+#
+
+
 K8SPERFORMANCE_TESTS = [
     {
         "Name": "pcp_tput",
@@ -31,4 +50,44 @@ K8SPERFORMANCE_TESTS = [
             },
         },
     },
+    {
+        "Name": "c2c_tput",
+        "Deployment": "pcp",
+        "Description": "LTD.Throughput.RFC2544.Throughput",
+        "Parameters" : {
+            "TRAFFIC" : {
+                "traffic_type" : "rfc2544_throughput",
+            },
+        },
+    },
+    {
+        "Name": "c2c_2inf_tput",
+        "Deployment": "pcp",
+        "Description": "LTD.Throughput.RFC2544.Throughput",
+        "Parameters" : {
+            "TRAFFIC" : {
+                "traffic_type" : "rfc2544_throughput",
+            },
+        },
+    },
+    {
+        "Name": "c2c2c_tput",
+        "Deployment": "pcp",
+        "Description": "LTD.Throughput.RFC2544.Throughput",
+        "Parameters" : {
+            "TRAFFIC" : {
+                "traffic_type" : "rfc2544_throughput",
+            },
+        },
+    },
+    {
+        "Name": "c2c2c_2inf_tput",
+        "Deployment": "pcp",
+        "Description": "LTD.Throughput.RFC2544.Throughput",
+        "Parameters" : {
+            "TRAFFIC" : {
+                "traffic_type" : "rfc2544_throughput",
+            },
+        },
+    },
 ]
index e522b82..0e8e1b0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2020 Spirent Communications
+# Copyright 2022 Spirent Communications, The Linux Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -44,12 +44,14 @@ class PodController():
         self._pod_class = pod_class
         self._deployment = deployment.lower()
         self._pods = []
-        if 'pcp' in self._deployment:
+        single_pods = ['pcp', 'c2c']
+        two_pods = ['pccp', 'c2c2c']
+        if any(item in self._deployment for item in single_pods):
             pod_number = 1
-        elif 'pccp'in self._deployment:
+        elif any(item in self._deployment for item in two_pods):
             pod_number = 2
         print("POD COUNTING DONE")
-        settings.setValue('POD_COUNT', pod_number)        
+        settings.setValue('POD_COUNT', pod_number)
         # we will have single controller for all pods
         if pod_number:
             self._pods.append(pod_class())
index 13ada1c..12d71bc 100644 (file)
@@ -640,19 +640,28 @@ class TestCase(object):
         if S.getValue('K8S') and 'sriov' not in S.getValue('PLUGIN'):
             if 'Ovs' in S.getValue('VSWITCH'):
                 # Add OVS Flows
-                logging.info("Kubernetes: Adding OVS Connections")
-                flow = {'table':'0', 'in_port':'1',
-                        'idle_timeout':'0', 'actions': ['output:3']}
-                vswitch.add_flow(bridge, flow)
-                flow = {'table':'0', 'in_port':'3',
-                        'idle_timeout':'0', 'actions': ['output:1']}
-                vswitch.add_flow(bridge, flow)
-                flow = {'table':'0', 'in_port':'2',
-                        'idle_timeout':'0', 'actions': ['output:4']}
-                vswitch.add_flow(bridge, flow)
-                flow = {'table':'0', 'in_port':'4',
-                        'idle_timeout':'0', 'actions': ['output:2']}
-                vswitch.add_flow(bridge, flow)
+                if S.getValue('USCNI_INTERFACE_PAIRS') == 1:
+                    logging.info("Kubernetes: Adding 1-Pair OVS Connections")
+                    flow = {'table':'0', 'in_port':'1',
+                            'idle_timeout':'0', 'actions': ['output:2']}
+                    vswitch.add_flow(bridge, flow)
+                    flow = {'table':'0', 'in_port':'2',
+                            'idle_timeout':'0', 'actions': ['output:1']}
+                    vswitch.add_flow(bridge, flow)
+                elif S.getValue('USCNI_INTERFACE_PAIRS') == 2:
+                    logging.info("Kubernetes: Adding 2-Pairs OVS Connections")
+                    flow = {'table':'0', 'in_port':'1',
+                            'idle_timeout':'0', 'actions': ['output:3']}
+                    vswitch.add_flow(bridge, flow)
+                    flow = {'table':'0', 'in_port':'3',
+                            'idle_timeout':'0', 'actions': ['output:1']}
+                    vswitch.add_flow(bridge, flow)
+                    flow = {'table':'0', 'in_port':'2',
+                            'idle_timeout':'0', 'actions': ['output:4']}
+                    vswitch.add_flow(bridge, flow)
+                    flow = {'table':'0', 'in_port':'4',
+                            'idle_timeout':'0', 'actions': ['output:2']}
+                    vswitch.add_flow(bridge, flow)
             elif 'vpp' in S.getValue('VSWITCH'):
                 phy_ports = vswitch.get_ports()
                 virt_port0 = 'memif1/0'