summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX
diff options
context:
space:
mode:
authorPatrice Buriez <patrice.buriez@chenapan.org>2023-01-02 12:51:54 +0000
committerPatrice Buriez <patrice.buriez@chenapan.org>2023-01-02 12:51:54 +0000
commita085fb09d70d024413844df9d1c343fdc28ded1d (patch)
treedc3cbe28ca83b205102d4da0ad82e111a8ab0bfb /VNFs/DPPD-PROX
parent8912be9d61200a3ad8b30a33e362be963eb8c4bb (diff)
Restore rw_reg and hw_direct_stats
Note that DPDK 21.11 and above must be built with 'enable_driver_sdk' option enabled, in order to expose the rte_eth_devices array, now marked as internal. See http://doc.dpdk.org/guides-21.11/rel_notes/release_21_11.html#abi-changes for details. This is done by supplying the '-Denable_driver_sdk=true' command line parameter, either to 'meson setup', or later on to 'meson configure', before running 'ninja' and 'ninja install'. Signed-off-by: Patrice Buriez <patrice.buriez@chenapan.org> Change-Id: I20db8971818a29ec495b6d8d79cf46f2204631a5
Diffstat (limited to 'VNFs/DPPD-PROX')
-rw-r--r--VNFs/DPPD-PROX/commands.c8
-rw-r--r--VNFs/DPPD-PROX/meson.build6
-rw-r--r--VNFs/DPPD-PROX/rw_reg.c4
-rw-r--r--VNFs/DPPD-PROX/stats_port.c3
4 files changed, 7 insertions, 14 deletions
diff --git a/VNFs/DPPD-PROX/commands.c b/VNFs/DPPD-PROX/commands.c
index af76a66e..a8953a68 100644
--- a/VNFs/DPPD-PROX/commands.c
+++ b/VNFs/DPPD-PROX/commands.c
@@ -935,7 +935,6 @@ void cmd_portinfo(int port_id, char *dst, size_t max_len)
void cmd_read_reg(uint8_t port_id, unsigned int id)
{
-#if RTE_VERSION < RTE_VERSION_NUM(21,11,0,0)
unsigned int val, rc;
if (!port_is_active(port_id)) {
return ;
@@ -947,9 +946,6 @@ void cmd_read_reg(uint8_t port_id, unsigned int id)
else {
plog_info("Register 0x%08X : %08X \n", id, val);
}
-#else
- plog_err("cmd_read_reg(%d, %d) not supported on this dpdk version\n", port_id, id);
-#endif
}
void cmd_reset_port(uint8_t portid)
@@ -993,16 +989,12 @@ void cmd_multicast(uint8_t port_id, unsigned int val, prox_rte_ether_addr *mac)
void cmd_write_reg(uint8_t port_id, unsigned int id, unsigned int val)
{
-#if RTE_VERSION < RTE_VERSION_NUM(21,11,0,0)
if (!port_is_active(port_id)) {
return ;
}
plog_info("writing 0x%08X %08X\n", id, val);
write_reg(port_id, id, val);
-#else
- plog_err("cmd_write_reg(%d, %d, %d) not supported on this dpdk version\n", port_id, id, val);
-#endif
}
void cmd_set_vlan_offload(uint8_t port_id, unsigned int val)
diff --git a/VNFs/DPPD-PROX/meson.build b/VNFs/DPPD-PROX/meson.build
index 4a37ad50..15a55691 100644
--- a/VNFs/DPPD-PROX/meson.build
+++ b/VNFs/DPPD-PROX/meson.build
@@ -43,11 +43,7 @@ if get_option('prox_stats').enabled()
endif
if get_option('hw_direct_stats').enabled()
-if dpdk_version.version_compare('<21.11.0')
add_project_arguments('-DPROX_HW_DIRECT_STATS', language: 'c')
-else
- warning('hw_direct_stats not supported on this dpdk version')
-endif
endif
if get_option('dbg')
@@ -179,9 +175,7 @@ sources = files(
'stats_cons_cli.c', 'stats_parser.c', 'hash_set.c', 'prox_lua.c',
'prox_malloc.c', 'prox_ipv6.c', 'prox_compat.c', 'handle_nsh.c')
-if dpdk_version.version_compare('<21.11.0')
sources += files('rw_reg.c')
-endif
# Include a couple of source files depending on DPDK support
if cc.find_library('rte_pmd_aesni', required: false).found()
diff --git a/VNFs/DPPD-PROX/rw_reg.c b/VNFs/DPPD-PROX/rw_reg.c
index a0e59085..b4f6c214 100644
--- a/VNFs/DPPD-PROX/rw_reg.c
+++ b/VNFs/DPPD-PROX/rw_reg.c
@@ -14,6 +14,10 @@
// limitations under the License.
*/
+#include <rte_version.h>
+#if RTE_VERSION >= RTE_VERSION_NUM(21,11,0,0)
+#include <ethdev_driver.h> // Please configure DPDK with meson option -Denable_driver_sdk=true
+#endif
#include <rte_ethdev.h>
#include "rw_reg.h"
diff --git a/VNFs/DPPD-PROX/stats_port.c b/VNFs/DPPD-PROX/stats_port.c
index 3580602c..fb6cf10a 100644
--- a/VNFs/DPPD-PROX/stats_port.c
+++ b/VNFs/DPPD-PROX/stats_port.c
@@ -18,6 +18,9 @@
#include <stdio.h>
#include <rte_version.h>
+#if RTE_VERSION >= RTE_VERSION_NUM(21,11,0,0)
+#include <ethdev_driver.h> // Please configure DPDK with meson option -Denable_driver_sdk=true
+#endif
#include <rte_ethdev.h>
#include <rte_cycles.h>
#include <rte_byteorder.h>