diff options
author | Jan Gelety <jgelety@cisco.com> | 2019-09-03 13:52:44 +0200 |
---|---|---|
committer | Jan Gelety <jgelety@cisco.com> | 2019-09-04 05:08:55 +0200 |
commit | 2b67e8064904d4e43d1a9c8587b972d66ba3bf11 (patch) | |
tree | c38b5e2531e90ad9d808d861a05a39d0b28bc67f | |
parent | 34b6e0c1400ac5da26ec3589ed1d7b59bc8b24ad (diff) |
API cleanup: memif
Change-Id: I4a2d4719dfa7c993c54b278a0093ea833307bb87
Signed-off-by: Jan Gelety <jgelety@cisco.com>
-rw-r--r-- | resources/api/vpp/supported_crcs.yaml | 10 | ||||
-rw-r--r-- | resources/libraries/python/Memif.py | 13 |
2 files changed, 13 insertions, 10 deletions
diff --git a/resources/api/vpp/supported_crcs.yaml b/resources/api/vpp/supported_crcs.yaml index 0eee47eb91..b2b50b4038 100644 --- a/resources/api/vpp/supported_crcs.yaml +++ b/resources/api/vpp/supported_crcs.yaml @@ -153,11 +153,11 @@ macip_acl_interface_get_reply: '0xaccf9b05' # perf # ^^^^^^^^ tc01-64B-1c-eth-l2bdbasemaclrn-macip-iacl1sl-100flows-mrr # ^ macipANDacl1AND100_flows - memif_create: '0x6597cdb2' # dev - memif_create_reply: '0xfda5941f' # dev - memif_details: '0x4f5a3397' # dev + memif_create: '0xba720d42' # dev + memif_create_reply: '0x903324db' # dev + memif_details: '0xb1b17fa4' # dev memif_dump: '0x51077d14' # dev - memif_socket_filename_add_del: '0x30e3929d' # dev + memif_socket_filename_add_del: '0xa2ce1a10' # dev memif_socket_filename_add_del_reply: '0xe8d4e804' # dev nat_det_add_del_map: '0x04b76549' # perf nat_det_add_del_map_reply: '0xe8d4e804' # perf @@ -219,7 +219,7 @@ # ^^ see ipsec_tunnel_if_add_del sw_interface_set_vxlan_bypass: '0xe74ca095' # dev sw_interface_set_vxlan_bypass_reply: '0xe8d4e804' # dev - sw_interface_slave_details: '0xeef053c2' # perf + sw_interface_slave_details: '0xd5c58e45' # perf sw_interface_slave_dump: '0x529cb13f' # perf # ^^ see bond_* sw_interface_tap_v2_dump: '0x51077d14' # dev diff --git a/resources/libraries/python/Memif.py b/resources/libraries/python/Memif.py index 34cf6ce9c3..f60972f64d 100644 --- a/resources/libraries/python/Memif.py +++ b/resources/libraries/python/Memif.py @@ -19,7 +19,6 @@ from robot.api import logger from resources.libraries.python.topology import NodeType, Topology from resources.libraries.python.PapiExecutor import PapiSocketExecutor -from resources.libraries.python.L2Util import L2Util class MemifRole(IntEnum): @@ -47,8 +46,11 @@ class Memif(object): details = papi_exec.add("memif_dump").get_details() for memif in details: - memif["if_name"] = memif["if_name"].rstrip('\x00') - memif["hw_addr"] = L2Util.bin_to_mac(memif["hw_addr"]) + memif["hw_addr"] = str(memif["hw_addr"]) + memif["role"] = memif["role"].value + memif["mode"] = memif["mode"].value + memif["flags"] = memif["flags"].value \ + if hasattr(memif["flags"], 'value') else int(memif["flags"]) logger.debug("MEMIF details:\n{details}".format(details=details)) @@ -74,7 +76,7 @@ class Memif(object): err_msg = 'Failed to create memif socket on host {host}'.format( host=node['host']) args = dict( - is_add=int(is_add), + is_add=is_add, socket_id=int(sid), socket_filename=str('/tmp/' + filename) ) @@ -108,7 +110,8 @@ class Memif(object): rx_queues=int(rxq), tx_queues=int(txq), socket_id=int(sid), - id=int(mid) + id=int(mid), + secret="" ) with PapiSocketExecutor(node) as papi_exec: return papi_exec.add(cmd, **args).get_sw_if_index(err_msg) |