aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2020-01-09 17:22:06 +0100
committerJan Gelety <jgelety@cisco.com>2020-01-13 10:45:38 +0000
commitb313ae4177b708afcd7f4cbb0289316b2d7fc9c8 (patch)
treee2879f8df99048263ff6f0b9175a60c4ba72824e /resources/libraries
parent6c913634f0d70d64b2c88122bbe9eb911f29e417 (diff)
CSIT-1597 API cleanup: rdma
- cover API changes in VPP: https://gerrit.fd.io/r/c/vpp/+/24225 - update vpp stable to version 20.01-rc0~1011 Change-Id: Ibbfdbe867cf89715619efc5c5507859983025ece Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/python/InterfaceUtil.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 2921f7d10d..552d0004ee 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
# 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:
@@ -103,6 +103,13 @@ class LinkBondMode(IntEnum):
BOND_API_MODE_LACP = 5
+class RdmaMode(IntEnum):
+ """RDMA interface mode."""
+ RDMA_API_MODE_AUTO = 0
+ RDMA_API_MODE_IBV = 1
+ RDMA_API_MODE_DV = 2
+
+
class InterfaceUtil:
"""General utilities for managing interfaces"""
@@ -1214,16 +1221,19 @@ class InterfaceUtil:
return if_key
@staticmethod
- def vpp_create_rdma_interface(node, if_key, num_rx_queues=None):
+ def vpp_create_rdma_interface(
+ node, if_key, num_rx_queues=None, mode=u"auto"):
"""Create RDMA interface on VPP node.
:param node: DUT node from topology.
:param if_key: Physical interface key from topology file of interface
to be bound to rdma-core driver.
:param num_rx_queues: Number of RX queues.
+ :param mode: RDMA interface mode - auto/ibv/dv.
:type node: dict
:type if_key: str
:type num_rx_queues: int
+ :type mode: str
:returns: Interface key (name) in topology file.
:rtype: str
:raises RuntimeError: If it is not possible to create RDMA interface on
@@ -1235,8 +1245,9 @@ class InterfaceUtil:
name=InterfaceUtil.pci_to_eth(node, pci_addr),
host_if=InterfaceUtil.pci_to_eth(node, pci_addr),
rxq_num=int(num_rx_queues) if num_rx_queues else 0,
- rxq_size=0,
- txq_size=0
+ rxq_size=1024,
+ txq_size=1024,
+ mode=getattr(RdmaMode,f"RDMA_API_MODE_{mode.upper()}").value,
)
err_msg = f"Failed to create RDMA interface on host {node[u'host']}"
with PapiSocketExecutor(node) as papi_exec: