feat(core): octeon plugin introduction 75/42375/4
authorPeter Mikus <[email protected]>
Wed, 19 Feb 2025 13:16:33 +0000 (14:16 +0100)
committerPeter Mikus <[email protected]>
Thu, 20 Feb 2025 10:39:43 +0000 (11:39 +0100)
Signed-off-by: Peter Mikus <[email protected]>
Change-Id: I9f1193894e531a6eb946bef116d65788abb3de31

resources/libraries/python/Constants.py
resources/libraries/python/autogen/Regenerator.py
resources/libraries/python/topology.py
resources/libraries/robot/shared/interfaces.robot

index 62eb50d..297e937 100644 (file)
@@ -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",
index 69cacbd..6391ac7 100644 (file)
@@ -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(
index aacc277..838ec37 100644 (file)
@@ -1049,6 +1049,34 @@ class Topology:
         except KeyError:
             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.
index dfb6482..3938115 100644 (file)
 | | 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.