Revert "API cleanup: tap" and bump stable_vpp 99/21999/1
authorVratko Polak <vrpolak@cisco.com>
Wed, 11 Sep 2019 16:21:56 +0000 (18:21 +0200)
committerVratko Polak <vrpolak@cisco.com>
Wed, 11 Sep 2019 16:21:56 +0000 (18:21 +0200)
The VPP change got a temporary -1,
as other change has higher priority.

Bumping stable VPP version, so this passes verify right away.

This reverts commit ae62a4348f7de53cfb91a5ae25a10723d5f9b398.

Change-Id: If2813b0e41451a3a9e7f8b1512521cf508ac92c7
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
VPP_STABLE_VER_CENTOS
VPP_STABLE_VER_UBUNTU
VPP_STABLE_VER_UBUNTU_BIONIC
resources/api/vpp/supported_crcs.yaml
resources/libraries/python/Tap.py

index e8334b4..1d70f63 100644 (file)
@@ -1 +1 @@
-20.01-rc0~163_g546f955~b7763
+20.01-rc0~174_g3d1ef87~b7781
index aa6e0ee..310de96 100644 (file)
@@ -1 +1 @@
-20.01-rc0~163-g546f955~b7955
+20.01-rc0~174-g3d1ef87~b7971
index 25a75a3..a77e67f 100644 (file)
@@ -1 +1 @@
-20.01-rc0~163-g546f955b3
+20.01-rc0~174-g3d1ef873d
index 2fd8002..720ce26 100644 (file)
     sw_interface_slave_dump: '0xd85aab0d'  # perf
     # ^^ see bond_*
     sw_interface_tap_v2_dump: '0x51077d14'  # dev
-    sw_interface_tap_v2_details: '0x547b146a'  # dev
+    sw_interface_tap_v2_details: '0x5ee87a5f'  # dev
     sw_interface_vhost_user_details: '0x91ff3307'  # dev
     sw_interface_vhost_user_dump: '0x51077d14'  # dev
-    tap_create_v2: '0x958bfdfc'  # dev
-    tap_create_v2_reply: '0x903324db'  # dev
+    tap_create_v2: '0x8fa99320'  # dev
+    tap_create_v2_reply: '0xfda5941f'  # dev
     vxlan_add_del_tunnel: '0x00f4bdd0'  # virl
     vxlan_add_del_tunnel_reply: '0xfda5941f'  # virl
     vxlan_tunnel_details: '0xce38e127'  # virl
index 50e065f..103eeff 100644 (file)
 
 """Tap utilities library."""
 
-from enum import IntEnum
-
+from ipaddress import ip_address
 from robot.api import logger
 
 from resources.libraries.python.Constants import Constants
-from resources.libraries.python.InterfaceUtil import InterfaceUtil
 from resources.libraries.python.L2Util import L2Util
+from resources.libraries.python.InterfaceUtil import InterfaceUtil
 from resources.libraries.python.PapiExecutor import PapiSocketExecutor
 from resources.libraries.python.topology import Topology
 
 
-class TapFlags(IntEnum):
-    """TAP interface flags."""
-    TAP_FLAG_GSO = 1
-
-
 class Tap(object):
     """Tap utilities."""
 
@@ -50,18 +44,17 @@ class Tap(object):
         cmd = 'tap_create_v2'
         args = dict(
             id=Constants.BITWISE_NON_ZERO,
-            use_random_mac=False if mac else True,
-            mac_address=L2Util.mac_to_bin(mac) if mac else None,
-            host_mtu_set=False,
-            host_mac_addr_set=False,
-            host_ip4_prefix_set=False,
-            host_ip6_prefix_set=False,
-            host_ip4_gw_set=False,
-            host_ip6_gw_set=False,
-            host_namespace_set=False,
-            host_if_name_set=True,
-            host_bridge_set=False,
-            host_if_name=tap_name,
+            use_random_mac=0 if mac else 1,
+            mac_address=L2Util.mac_to_bin(mac) if mac else 6 * b'\x00',
+            host_namespace=64 * b'\x00',
+            host_mac_addr=6 * b'\x00',
+            host_if_name_set=1,
+            host_if_name=tap_name + (64 - len(tap_name)) * b'\x00',
+            host_bridge=64 * b'\x00',
+            host_ip4_addr=4 * b'\x00',
+            host_ip6_addr=16 * b'\x00',
+            host_ip4_gw=4 * b'\x00',
+            host_ip6_gw=16 * b'\x00'
         )
         err_msg = 'Failed to create tap interface {tap} on host {host}'.format(
             tap=tap_name, host=node['host'])
@@ -127,19 +120,14 @@ class Tap(object):
             :returns: Processed tap interface dump.
             :rtype: dict
             """
-            tap_dump['host_mac_addr'] = str(tap_dump['host_mac_addr'])
-            tap_dump['host_ip4_prefix'] = str(tap_dump['host_ip4_prefix'])
-            tap_dump['host_ip6_prefix'] = str(tap_dump['host_ip6_prefix'])
-            tap_dump['tap_flags'] = tap_dump['tap_flags'].value \
-                if hasattr(tap_dump['tap_flags'], 'value') \
-                else int(tap_dump['tap_flags'])
-            tap_dump['host_namespace'] = None \
-                if tap_dump['host_namespace'] == '(nil)' \
-                else tap_dump['host_namespace']
-            tap_dump['host_bridge'] = None \
-                if tap_dump['host_bridge'] == '(nil)' \
-                else tap_dump['host_bridge']
-
+            tap_dump['dev_name'] = tap_dump['dev_name'].rstrip('\x00')
+            tap_dump['host_if_name'] = tap_dump['host_if_name'].rstrip('\x00')
+            tap_dump['host_namespace'] = \
+                tap_dump['host_namespace'].rstrip('\x00')
+            tap_dump['host_mac_addr'] = \
+                L2Util.bin_to_mac(tap_dump['host_mac_addr'])
+            tap_dump['host_ip4_addr'] = ip_address(tap_dump['host_ip4_addr'])
+            tap_dump['host_ip6_addr'] = ip_address(tap_dump['host_ip6_addr'])
             return tap_dump
 
         cmd = 'sw_interface_tap_v2_dump'
@@ -152,7 +140,7 @@ class Tap(object):
         for dump in details:
             if name is None:
                 data.append(process_tap_dump(dump))
-            elif dump.get('host_if_name') == name:
+            elif dump.get('host_if_name').rstrip('\x00') == name:
                 data = process_tap_dump(dump)
                 break
 

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.