aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/python/DUTSetup.py28
-rw-r--r--resources/libraries/robot/performance/performance_setup.robot20
-rw-r--r--resources/libraries/robot/shared/default.robot14
3 files changed, 39 insertions, 23 deletions
diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py
index 69594ef36a..67edefb930 100644
--- a/resources/libraries/python/DUTSetup.py
+++ b/resources/libraries/python/DUTSetup.py
@@ -206,17 +206,19 @@ class DUTSetup(object):
return pids
@staticmethod
- def crypto_device_verify(node, force_init=False, numvfs=32):
+ def crypto_device_verify(node, crypto_type, numvfs, force_init=False):
"""Verify if Crypto QAT device virtual functions are initialized on all
DUTs. If parameter force initialization is set to True, then try to
initialize or remove VFs on QAT.
:param node: DUT node.
- :param force_init: If True then try to initialize to specific value.
+ :crypto_type: Crypto device type - HW_DH895xcc or HW_C3xxx.
:param numvfs: Number of VFs to initialize, 0 - disable the VFs.
+ :param force_init: If True then try to initialize to specific value.
:type node: dict
- :type force_init: bool
+ :type crypto_type: string
:type numvfs: int
+ :type force_init: bool
:returns: nothing
:raises RuntimeError: If QAT VFs are not created and force init is set
to False.
@@ -227,26 +229,38 @@ class DUTSetup(object):
if sriov_numvfs != numvfs:
if force_init:
# QAT is not initialized and we want to initialize with numvfs
- DUTSetup.crypto_device_init(node, numvfs)
+ DUTSetup.crypto_device_init(node, crypto_type, numvfs)
else:
raise RuntimeError('QAT device failed to create VFs on {host}'.
format(host=node['host']))
@staticmethod
- def crypto_device_init(node, numvfs):
+ def crypto_device_init(node, crypto_type, numvfs):
"""Init Crypto QAT device virtual functions on DUT.
:param node: DUT node.
+ :crypto_type: Crypto device type - HW_DH895xcc or HW_C3xxx.
:param numvfs: Number of VFs to initialize, 0 - disable the VFs.
:type node: dict
+ :type crypto_type: string
:type numvfs: int
:returns: nothing
:raises RuntimeError: If failed to stop VPP or QAT failed to initialize.
"""
+ if crypto_type == "HW_DH895xcc":
+ kernel_mod = "qat_dh895xcc"
+ kernel_drv = "dh895xcc"
+ elif crypto_type == "HW_C3xxx":
+ kernel_mod = "qat_c3xxx"
+ kernel_drv = "c3xxx"
+ else:
+ raise RuntimeError('Unsupported crypto device type on {host}'.
+ format(host=node['host']))
+
pci_addr = Topology.get_cryptodev(node)
# QAT device must be re-bound to kernel driver before initialization.
- DUTSetup.verify_kernel_module(node, 'qat_dh895xcc', force_load=True)
+ DUTSetup.verify_kernel_module(node, kernel_mod, force_load=True)
# Stop VPP to prevent deadlock.
DUTSetup.stop_service(node, Constants.VPP_UNIT)
@@ -257,7 +271,7 @@ class DUTSetup(object):
DUTSetup.pci_driver_unbind(node, pci_addr)
# Bind to kernel driver.
- DUTSetup.pci_driver_bind(node, pci_addr, 'dh895xcc')
+ DUTSetup.pci_driver_bind(node, pci_addr, kernel_drv)
# Initialize QAT VFs.
if numvfs > 0:
diff --git a/resources/libraries/robot/performance/performance_setup.robot b/resources/libraries/robot/performance/performance_setup.robot
index ae3e03a64d..f484eeb71f 100644
--- a/resources/libraries/robot/performance/performance_setup.robot
+++ b/resources/libraries/robot/performance/performance_setup.robot
@@ -447,25 +447,25 @@
| | ... | *Arguments:*
| | ... | - topology_type - Topology type. Type: string
| | ... | - nic_model - Interface model. Type: string
-| | ... | - crypto_type - Crypto device type - HW_cryptodev or SW_cryptodev
-| | ... | (Optional). Type: string, default value: HW_cryptodev
+| | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx or
+| | ... | SW_cryptodev. Type: string, default value: HW_DH895xcc
| | ...
| | ... | *Example:*
| | ...
| | ... | \| Set up IPSec performance test suite \| L2 \
-| | ... | \| Intel-X520-DA2 \|
+| | ... | \| Intel-X520-DA2 \| HW_DH895xcc \|
| | ...
-| | [Arguments] | ${topology_type} | ${nic_model} | ${crypto_type}=HW_cryptodev
+| | [Arguments] | ${topology_type} | ${nic_model} | ${crypto_type}=HW_DH895xcc
| | ...
| | Set up 3-node performance topology with DUT's NIC model
| | ... | ${topology_type} | ${nic_model}
+| | Return From Keyword If | '${crypto_type}' == 'SW_cryptodev'
| | ${numvfs}= | Set Variable If
-| | ... | '${crypto_type}' == 'HW_cryptodev' | ${32}
-| | Run Keyword If | '${crypto_type}' == 'HW_cryptodev'
-| | ... | Configure crypto device on all DUTs | force_init=${True}
-| | ... | numvfs=${numvfs}
-| | Run Keyword If | '${crypto_type}' == 'HW_cryptodev'
-| | ... | Configure kernel module on all DUTs | vfio_pci | force_load=${True}
+| | ... | '${crypto_type}' == 'HW_DH895xcc' | ${32}
+| | ... | '${crypto_type}' == 'HW_C3xxx' | ${16}
+| | Configure crypto device on all DUTs | ${crypto_type} | numvfs=${numvfs}
+| | ... | force_init=${True}
+| | Configure kernel module on all DUTs | vfio_pci | force_load=${True}
| Set up performance test suite with MEMIF
| | [Documentation]
diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot
index 954f88109a..70f5da837b 100644
--- a/resources/libraries/robot/shared/default.robot
+++ b/resources/libraries/robot/shared/default.robot
@@ -82,20 +82,22 @@
| | ... | try to initialize/disable.
| | ...
| | ... | *Arguments:*
-| | ... | - force_init - Force to initialize. Type: boolean
+| | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx.
+| | ... | Type: string, default value: HW_DH895xcc
| | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs
-| | ... | (Optional). Type: integer, default value: ${32}
+| | ... | Type: integer, default value: ${32}
+| | ... | - force_init - Force to initialize. Type: boolean
| | ...
| | ... | *Example:*
| | ...
-| | ... | \| Configure crypto device on all DUTs \| ${True} \|
+| | ... | \| Configure crypto device on all DUTs \| HW_DH895xcc \| ${32} \|
| | ...
-| | [Arguments] | ${force_init}=${False} | ${numvfs}=${32}
+| | [Arguments] | ${crypto_type} | ${numvfs} | ${force_init}=${False}
| | ...
| | ${duts}= | Get Matches | ${nodes} | DUT*
| | :FOR | ${dut} | IN | @{duts}
-| | | Crypto Device Verify | ${nodes['${dut}']} | force_init=${force_init}
-| | | ... | numvfs=${numvfs}
+| | | Crypto Device Verify | ${nodes['${dut}']} | ${crypto_type}
+| | | ... | ${numvfs} | force_init=${force_init}
| Configure AVF interfaces on all DUTs
| | [Documentation] | Configure virtual functions for AVF interfaces on PCI