diff options
author | 2025-02-19 14:16:33 +0100 | |
---|---|---|
committer | 2025-02-20 11:39:43 +0100 | |
commit | 006e5cc5b4ba1972d6e0f9ff9f3a5332336bad85 (patch) | |
tree | 069b420661fbce16372cae6f86f048776b04bb84 | |
parent | 10e9ea0af978882da73800c948b9141d37c8fde3 (diff) |
feat(core): octeon plugin introduction
Signed-off-by: Peter Mikus <peter.mikus@icloud.com>
Change-Id: I9f1193894e531a6eb946bef116d65788abb3de31
-rw-r--r-- | resources/libraries/python/Constants.py | 78 | ||||
-rw-r--r-- | resources/libraries/python/autogen/Regenerator.py | 10 | ||||
-rw-r--r-- | resources/libraries/python/topology.py | 28 | ||||
-rw-r--r-- | resources/libraries/robot/shared/interfaces.robot | 67 |
4 files changed, 155 insertions, 28 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py index 62eb50df13..297e937802 100644 --- a/resources/libraries/python/Constants.py +++ b/resources/libraries/python/Constants.py @@ -459,6 +459,84 @@ class Constants: "af_xdp": "af_xdp_plugin.so", } + # Each driver/nic needs different plugin to work. + NIC_NAME_TO_PLUGINS = { + "Intel-X710": { + "vfio-pci": "dpdk_plugin.so", + "avf": "dev_iavf_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Intel-XL710": { + "vfio-pci": "dpdk_plugin.so", + "avf": "dev_iavf_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Intel-XXV710": { + "vfio-pci": "dpdk_plugin.so", + "avf": "dev_iavf_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Intel-E810XXV": { + "vfio-pci": "dpdk_plugin.so", + "avf": "dev_iavf_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Intel-E822CQ": { + "vfio-pci": "dpdk_plugin.so", + "avf": "dev_iavf_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Intel-E823C": { + "vfio-pci": "dpdk_plugin.so", + "avf": "dev_iavf_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Intel-E810CQ": { + "vfio-pci": "dpdk_plugin.so", + "avf": "dev_iavf_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Amazon-Nitro-50G": { + "vfio-pci": "dpdk_plugin.so" + }, + "Amazon-Nitro-100G": { + "vfio-pci": "dpdk_plugin.so" + }, + "Amazon-Nitro-200G": { + "vfio-pci": "dpdk_plugin.so" + }, + "Mellanox-CX556A": { + "rdma-core": "rdma_plugin.so", + "mlx5_core": "dpdk_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Mellanox-CX6DX": { + "rdma-core": "rdma_plugin.so", + "mlx5_core": "dpdk_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Mellanox-CX7VEAT": { + "rdma-core": "rdma_plugin.so", + "mlx5_core": "dpdk_plugin.so", + "af_xdp": "af_xdp_plugin.so" + }, + "Cavium-A063-10G": { + "vfio-pci": "dev_octeon_plugin.so" + }, + "Cavium-A063-40G": { + "vfio-pci": "dev_octeon_plugin.so" + }, + "Cavium-A063-50G": { + "vfio-pci": "dev_octeon_plugin.so" + }, + "Cavium-A063-100G": { + "vfio-pci": "dev_octeon_plugin.so" + }, + "virtual": { + "vfio-pci": "dpdk_plugin.so" + }, + } + # Tags to differentiate tests for different NIC driver. NIC_DRIVER_TO_TAG = { "vfio-pci": "DRV_VFIO_PCI", diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py index 69cacbdb27..6391ac7dc5 100644 --- a/resources/libraries/python/autogen/Regenerator.py +++ b/resources/libraries/python/autogen/Regenerator.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Cisco and/or its affiliates. +# Copyright (c) 2025 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: @@ -352,7 +352,7 @@ def write_default_files(in_filename, in_prolog, kwargs_list): ) out_prolog = replace_defensively( out_prolog, Constants.NIC_DRIVER_TO_PLUGINS["vfio-pci"], - Constants.NIC_DRIVER_TO_PLUGINS[driver], 1, + Constants.NIC_NAME_TO_PLUGINS[nic_name][driver], 1, "Driver plugin should appear once.", in_filename ) out_prolog = replace_defensively( @@ -441,7 +441,7 @@ def write_reconf_files(in_filename, in_prolog, kwargs_list): ) out_prolog = replace_defensively( out_prolog, Constants.NIC_DRIVER_TO_PLUGINS[u"vfio-pci"], - Constants.NIC_DRIVER_TO_PLUGINS[driver], 1, + Constants.NIC_NAME_TO_PLUGINS[nic_name][driver], 1, u"Driver plugin should appear once.", in_filename ) out_prolog = replace_defensively( @@ -513,7 +513,7 @@ def write_tcp_files(in_filename, in_prolog, kwargs_list): ) out_prolog = replace_defensively( out_prolog, Constants.NIC_DRIVER_TO_PLUGINS[u"vfio-pci"], - Constants.NIC_DRIVER_TO_PLUGINS[driver], 1, + Constants.NIC_NAME_TO_PLUGINS[nic_name][driver], 1, u"Driver plugin should appear once.", in_filename ) out_prolog = replace_defensively( @@ -673,7 +673,7 @@ def write_device_files(in_filename, in_prolog, kwargs_list): ) out_prolog = replace_defensively( out_prolog, Constants.NIC_DRIVER_TO_PLUGINS[u"vfio-pci"], - Constants.NIC_DRIVER_TO_PLUGINS[driver], 1, + Constants.NIC_NAME_TO_PLUGINS[nic_name][driver], 1, u"Driver plugin should appear once.", in_filename ) out_prolog = replace_defensively( diff --git a/resources/libraries/python/topology.py b/resources/libraries/python/topology.py index aacc277ecb..838ec3701a 100644 --- a/resources/libraries/python/topology.py +++ b/resources/libraries/python/topology.py @@ -1050,6 +1050,34 @@ class Topology: return None @staticmethod + def get_num_rx_queues(node): + """Return num_rx_queues configuration of the node. + + :param node: Node created from topology. + :type node: dict + :returns: num_rx_queues configuration string. + :rtype: str + """ + try: + return node["num_rx_queues"] + except KeyError: + return None + + @staticmethod + def get_num_tx_queues(node): + """Return num_tx_queues configuration of the node. + + :param node: Node created from topology. + :type node: dict + :returns: num_tx_queues configuration string. + :rtype: str + """ + try: + return node["num_tx_queues"] + except KeyError: + return None + + @staticmethod def set_interface_numa_node(node, iface_key, numa_node_id): """Set interface numa_node location. diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot index dfb6482859..393811578e 100644 --- a/resources/libraries/robot/shared/interfaces.robot +++ b/resources/libraries/robot/shared/interfaces.robot @@ -134,31 +134,52 @@ | | Run Keyword If | ${index} >= 0 | Return From Keyword | | FOR | ${dut} | IN | @{duts} | | | Stop VPP Service | ${nodes['${dut}']} -| | | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci | -| | | ... | @{${dut}_pf_pci} -| | | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci} -| | | Run Keyword If | ${dpdk_enable_tcp_udp_checksum} -| | | ... | ${dut}.Add DPDK Enable TCP UDP Checksum -| | | Run Keyword If | ${dpdk_no_tx_checksum_offload} -| | | ... | ${dut}.Add DPDK No Tx Checksum Offload -| | | Run Keyword | ${dut}.Add DPDK Log Level | debug -| | | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci -| | | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int} -| | | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-100G' -| | | ... | ${dut}.Add DPDK Dev Default Devargs | "llq_policy=2" -| | | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-200G' -| | | ... | ${dut}.Add DPDK Dev Default Devargs | "llq_policy=2" -| | | Run Keyword If | not ${jumbo} -| | | ... | ${dut}.Add DPDK No Multi Seg -| | | Run Keyword If | ${nic_rxq_size} > 0 -| | | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size} -| | | Run Keyword If | ${nic_txq_size} > 0 -| | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size} -| | | Run Keyword If | '${crypto_type}' != '${None}' -| | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int} -| | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT} +| | | ${plugin}= | Get From List | ${plugins_to_enable} | 0 +| | | Run Keyword | Pre-initialize layer vfio-pci for ${plugin} | ${dut} | | END +| Pre-initialize layer vfio-pci for dev_octeon_plugin.so +| | [Documentation] +| | ... | Pre-initialize vfio-pci driver with dev_octeon_plugin.so to startup +| | ... | config on all DUTs. +| | [Arguments] | ${dut} +| | Run Keyword If | ${nic_vfs} +| | ... | ${dut}.Add OCTEON Dev | @{${dut}_prevf_pci} +| | Run Keyword If | not ${nic_vfs} +| | ... | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci | +| | ... | ... | @{${dut}_pf_pci} +| | Run Keyword If | not ${nic_vfs} +| | ... | ${dut}.Add OCTEON Dev | @{${dut}_pf_pci} + +| Pre-initialize layer vfio-pci for dpdk_plugin.so +| | [Documentation] +| | ... | Pre-initialize vfio-pci driver with dev_octeon_plugin.so to startup +| | ... | config on all DUTs. +| | [Arguments] | ${dut} +| | Unbind PCI Devices From Other Driver | ${nodes['${dut}']} | vfio-pci | +| | ... | @{${dut}_pf_pci} +| | Run keyword | ${dut}.Add DPDK Dev | @{${dut}_pf_pci} +| | Run Keyword If | ${dpdk_enable_tcp_udp_checksum} +| | ... | ${dut}.Add DPDK Enable TCP UDP Checksum +| | Run Keyword If | ${dpdk_no_tx_checksum_offload} +| | ... | ${dut}.Add DPDK No Tx Checksum Offload +| | Run Keyword | ${dut}.Add DPDK Log Level | debug +| | Run Keyword | ${dut}.Add DPDK Uio Driver | vfio-pci +| | Run Keyword | ${dut}.Add DPDK Dev Default RXQ | ${rxq_count_int} +| | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-100G' +| | ... | ${dut}.Add DPDK Dev Default Devargs | "llq_policy=2" +| | Run Keyword If | '${nic_name}' == 'Amazon-Nitro-200G' +| | ... | ${dut}.Add DPDK Dev Default Devargs | "llq_policy=2" +| | Run Keyword If | not ${jumbo} +| | ... | ${dut}.Add DPDK No Multi Seg +| | Run Keyword If | ${nic_rxq_size} > 0 +| | ... | ${dut}.Add DPDK Dev Default RXD | ${nic_rxq_size} +| | Run Keyword If | ${nic_txq_size} > 0 +| | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size} +| | Run Keyword If | '${crypto_type}' != '${None}' +| | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int} +| | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT} + | Pre-initialize layer avf on all DUTs | | [Documentation] | | ... | Pre-initialize avf driver. Currently no operation. |