aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/Constants.py32
-rw-r--r--resources/libraries/python/VppConfigGenerator.py36
2 files changed, 68 insertions, 0 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index 6a7b81b70d..e98d1bb0bb 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -332,6 +332,10 @@ class Constants:
"Amazon-Nitro-50G": 10000000000,
"Amazon-Nitro-100G": 10000000000,
"Amazon-Nitro-200G": 16000000000,
+ "Cavium-A063-10G": 10000000000,
+ "Cavium-A063-40G": 40000000000,
+ "Cavium-A063-50G": 50000000000,
+ "Cavium-A063-100G": 100000000000,
"virtual": 100000000,
}
@@ -350,6 +354,10 @@ class Constants:
"Amazon-Nitro-50G": 1500000,
"Amazon-Nitro-100G": 3000000,
"Amazon-Nitro-200G": 6000000,
+ "Cavium-A063-10G": 78125000,
+ "Cavium-A063-40G": 78125000,
+ "Cavium-A063-50G": 97656250,
+ "Cavium-A063-100G": 195312500,
"virtual": 14880952,
}
@@ -369,6 +377,10 @@ class Constants:
"Mellanox-CX6DX": "100ge2p1cx6dx",
"Mellanox-CX7VEAT": "200ge2p1cx7veat",
"Mellanox-CX7VEAT": "200ge6p3cx7veat",
+ "Cavium-A063-10G": "10ge2p1a063",
+ "Cavium-A063-40G": "40ge2p1a063",
+ "Cavium-A063-50G": "50ge2p1a063",
+ "Cavium-A063-100G": "100ge2p1a063",
"virtual": "1ge1p82540em",
}
NIC_CODE_TO_NAME = {
@@ -386,6 +398,10 @@ class Constants:
"100ge2p1cx6dx": "Mellanox-CX6DX",
"200ge2p1cx7veat": "Mellanox-CX7VEAT",
"200ge6p3cx7veat": "Mellanox-CX7VEAT",
+ "10ge2p1a063":"Cavium-A063-10G",
+ "40ge2p1a063":"Cavium-A063-40G",
+ "50ge2p1a063":"Cavium-A063-50G",
+ "100ge2p1a063":"Cavium-A063-100G",
"1ge1p82540em": "virtual",
}
@@ -405,6 +421,10 @@ class Constants:
"100ge2p1cx6dx": "cx6dx",
"200ge2p1cx7veat": "cx7veat",
"200ge6p3cx7veat": "cx7veat",
+ "10ge2p1a063": "a063",
+ "40ge2p1a063": "a063",
+ "50ge2p1a063": "a063",
+ "100ge2p1a063": "a063",
"1ge1p82540em": "82540em",
}
@@ -423,6 +443,10 @@ class Constants:
"Mellanox-CX556A": ["rdma-core", "mlx5_core", "af_xdp"],
"Mellanox-CX6DX": ["rdma-core", "mlx5_core", "af_xdp"],
"Mellanox-CX7VEAT": ["rdma-core", "mlx5_core", "af_xdp"],
+ "Cavium-A063-10G": ["vfio-pci"],
+ "Cavium-A063-40G": ["vfio-pci"],
+ "Cavium-A063-50G": ["vfio-pci"],
+ "Cavium-A063-100G": ["vfio-pci"],
"virtual": ["vfio-pci"],
}
@@ -478,6 +502,10 @@ class Constants:
"100ge2p1cx6dx": "nic_pfs}= | 2",
"200ge2p1cx7veat": "nic_pfs}= | 2",
"200ge6p3cx7veat": "nic_pfs}= | 6",
+ "10ge2p1a063": "nic_pfs}= | 2",
+ "40ge2p1a063": "nic_pfs}= | 2",
+ "50ge2p1a063": "nic_pfs}= | 2",
+ "100ge2p1a063": "nic_pfs}= | 2",
"1ge1p82540em": "nic_pfs}= | 2",
}
@@ -496,6 +524,10 @@ class Constants:
"100ge2p1cx6dx": 1,
"200ge2p1cx7veat": 1,
"200ge6p3cx7veat": 3,
+ "10ge2p1a063": 1,
+ "40ge2p1a063": 1,
+ "50ge2p1a063": 1,
+ "100ge2p1a063": 1,
"1ge1p82540em": 1,
}
diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py
index 384964eae0..849a32982a 100644
--- a/resources/libraries/python/VppConfigGenerator.py
+++ b/resources/libraries/python/VppConfigGenerator.py
@@ -727,6 +727,42 @@ class VppConfigGenerator:
path = ["dsa", f"dev {device}"]
self.add_config_item(self._nodeconfig, "", path)
+ def add_octeon_dev(self, *devices):
+ """Add OCTEON PCI device configuration.
+
+ :param devices: PCI device(s) (format xxxx:xx:xx.x)
+ :type devices: tuple
+ """
+ for i, device in enumerate(devices):
+ if pci_dev_check(device):
+ path = ["devices", f"dev pci/{device}", "driver octeon"]
+ self.add_config_item(self._nodeconfig, "", path)
+ path = ["devices", f"dev pci/{device}", "port 0", f"name eth{i}"]
+ self.add_config_item(self._nodeconfig, "", path)
+ num_rx_queues = Topology.get_num_rx_queues(self._node)
+ num_tx_queues = Topology.get_num_tx_queues(self._node)
+ if num_rx_queues and num_tx_queues:
+ self.add_octeon_dev_default_rxq(device, num_rx_queues)
+ self.add_octeon_dev_default_txq(device, num_tx_queues)
+
+ def add_octeon_dev_default_rxq(self, device, value):
+ """Add OCTEON dev default rxq configuration.
+
+ :param value: Default number of rxqs.
+ :type value: str
+ """
+ path = ["devices", f"dev pci/{device}", "port 0", "num-rx-queues"]
+ self.add_config_item(self._nodeconfig, value, path)
+
+ def add_octeon_dev_default_txq(self, device, value):
+ """Add OCTEON dev default txq configuration.
+
+ :param value: Default number of txqs.
+ :type value: str
+ """
+ path = ["devices", f"dev pci/{device}", "port 0", "num-tx-queues"]
+ self.add_config_item(self._nodeconfig, value, path)
+
def add_logging_default_syslog_log_level(self, value="debug"):
"""Add default logging level for syslog.