diff options
author | Naveen Joy <najoy@cisco.com> | 2023-06-27 14:28:57 -0700 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2023-07-21 13:00:05 +0000 |
commit | ae916b39049669bbada12dbcfecbb4e3f9c09c69 (patch) | |
tree | 5b7ff4bb542a7ec48358fcd9a3e015cdda59e01b /test/test_vm_vpp_interfaces.py | |
parent | 3a6bc6f1276e571b00643e4859ed193bfa76406c (diff) |
tests: Add checksum offload interface tests
Type: test
Change-Id: I6edc8858b802d3d32159d71c1e867a06cc1025d5
Signed-off-by: Naveen Joy <najoy@cisco.com>
Diffstat (limited to 'test/test_vm_vpp_interfaces.py')
-rw-r--r-- | test/test_vm_vpp_interfaces.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_vm_vpp_interfaces.py b/test/test_vm_vpp_interfaces.py index 6866c24d228..b86c51980e4 100644 --- a/test/test_vm_vpp_interfaces.py +++ b/test/test_vm_vpp_interfaces.py @@ -111,10 +111,12 @@ def generate_vpp_interface_tests(): + f"_v{test['client_if_version']}_" + f"gso_{test.get('client_if_gso', 0)}_" + f"gro_{test.get('client_if_gro', 0)}_" + + f"checksum_{test.get('client_if_checksum_offload', 0)}_" + f"to_server_{test['server_if_type']}" + f"_v{test['server_if_version']}_" + f"gso_{test.get('server_if_gso', 0)}_" + f"gro_{test.get('server_if_gro', 0)}_" + + f"checksum_{test.get('server_if_checksum_offload', 0)}_" + f"mtu_{mtu}_mode_{test['x_connect_mode']}_" + f"tcp_ipv{ip_version}" ) @@ -187,6 +189,8 @@ class TestVPPInterfacesQemu(VppTestCase): enable_server_if_gso = test.get("server_if_gso", 0) enable_client_if_gro = test.get("client_if_gro", 0) enable_server_if_gro = test.get("server_if_gro", 0) + enable_client_if_checksum_offload = test.get("client_if_checksum_offload", 0) + enable_server_if_checksum_offload = test.get("server_if_checksum_offload", 0) ## Handle client interface types if client_if_type == "af_packet": create_host_interface( @@ -240,6 +244,7 @@ class TestVPPInterfacesQemu(VppTestCase): host_if_name=f"{client_if_type}0", enable_gso=enable_client_if_gso, enable_gro=enable_client_if_gro, + enable_checksum_offload=enable_client_if_checksum_offload, ) self.vpp_interfaces.append(self.ingress_if_idx) self.linux_interfaces.append([client_namespace, f"{client_if_type}0"]) @@ -294,6 +299,7 @@ class TestVPPInterfacesQemu(VppTestCase): host_if_name=f"{server_if_type}0", enable_gso=enable_server_if_gso, enable_gro=enable_server_if_gro, + enable_checksum_offload=enable_server_if_checksum_offload, ) self.vpp_interfaces.append(self.egress_if_idx) self.linux_interfaces.append([server_namespace, f"{server_if_type}0"]) @@ -440,6 +446,7 @@ class TestVPPInterfacesQemu(VppTestCase): host_if_name=None, enable_gso=0, enable_gro=0, + enable_checksum_offload=0, ): """Create a tapv2 or tunv2 interface in VPP and attach to host. @@ -457,6 +464,7 @@ class TestVPPInterfacesQemu(VppTestCase): host_if_name -- host side interface name enable_gso -- enable GSO enable_gro -- enable GSO/GRO-Coalesce + enable_checksum_offload -- enable checksum offload without gso """ TapFlags = VppEnum.vl_api_tap_flags_t tap_flags = 0 @@ -468,6 +476,8 @@ class TestVPPInterfacesQemu(VppTestCase): ) elif enable_gso: tap_flags = tap_flags | TapFlags.TAP_API_FLAG_GSO + elif enable_checksum_offload: + tap_flags = tap_flags | TapFlags.TAP_API_FLAG_CSUM_OFFLOAD elif int_type == "tap": if enable_gro: tap_flags = ( @@ -475,6 +485,8 @@ class TestVPPInterfacesQemu(VppTestCase): ) elif enable_gso: tap_flags = TapFlags.TAP_API_FLAG_GSO + elif enable_checksum_offload: + tap_flags = tap_flags | TapFlags.TAP_API_FLAG_CSUM_OFFLOAD api_args = { "id": id, |