aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorPeter Mikus <peter.mikus@icloud.com>2025-02-19 14:16:33 +0100
committerPeter Mikus <peter.mikus@icloud.com>2025-02-20 11:39:43 +0100
commit006e5cc5b4ba1972d6e0f9ff9f3a5332336bad85 (patch)
tree069b420661fbce16372cae6f86f048776b04bb84 /resources/libraries/python
parent10e9ea0af978882da73800c948b9141d37c8fde3 (diff)
feat(core): octeon plugin introduction
Signed-off-by: Peter Mikus <peter.mikus@icloud.com> Change-Id: I9f1193894e531a6eb946bef116d65788abb3de31
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/Constants.py78
-rw-r--r--resources/libraries/python/autogen/Regenerator.py10
-rw-r--r--resources/libraries/python/topology.py28
3 files changed, 111 insertions, 5 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.