summaryrefslogtreecommitdiff
path: root/zebra/dpdk
diff options
context:
space:
mode:
authorEasyNetDev <devel@easynet.dev>2024-05-13 17:30:45 +0300
committerEasyNet <devel@easynet.dev>2024-05-16 14:26:26 +0300
commit0e040960d76f4098ca829910c3a0c51a5cd9476c (patch)
treeeb20cf8f1744291311a6667a1d69a6faa34f5925 /zebra/dpdk
parentb6f1b32c8a2423e3fbc5537cb8b53c065197b931 (diff)
zebra: Update Zebra for DPDK >=22.11 API
* Starting from version DPDK 22.11 we have API changes: The rte_driver and rte_device objects are now opaque and must be manipulated through added accessors. We need to update Zebra DPDK sources to DPDK version >=22.11 * Fix clang-format Signed-off-by: EasyNet <devel@easynet.dev>
Diffstat (limited to 'zebra/dpdk')
-rw-r--r--zebra/dpdk/zebra_dplane_dpdk.c31
-rw-r--r--zebra/dpdk/zebra_dplane_dpdk.h2
2 files changed, 19 insertions, 14 deletions
diff --git a/zebra/dpdk/zebra_dplane_dpdk.c b/zebra/dpdk/zebra_dplane_dpdk.c
index 7a5388c57b..411155167f 100644
--- a/zebra/dpdk/zebra_dplane_dpdk.c
+++ b/zebra/dpdk/zebra_dplane_dpdk.c
@@ -52,7 +52,7 @@ void zd_dpdk_stat_show(struct vty *vty)
static void zd_dpdk_flow_stat_show(struct vty *vty, int in_ifindex,
intptr_t dp_flow_ptr)
{
- struct rte_flow_action_count count = {.shared = 0, .id = 0};
+ struct rte_flow_action_count count = { .id = 0 };
const struct rte_flow_action actions[] = {
{
.type = RTE_FLOW_ACTION_TYPE_COUNT,
@@ -498,9 +498,11 @@ static void zd_dpdk_port_show_entry(struct zd_dpdk_port *dport, struct vty *vty,
if (detail) {
vty_out(vty, "DPDK port: %u\n", dport->port_id);
vty_out(vty, " Device: %s\n",
- dev_info->device ? dev_info->device->name : "-");
+ dev_info->device ? rte_dev_name(dev_info->device) : "-");
vty_out(vty, " Driver: %s\n",
- dev_info->driver_name ? dev_info->driver_name : "-");
+ dev_info->driver_name ? rte_driver_name(rte_dev_driver(
+ dev_info->device))
+ : "-");
vty_out(vty, " Interface: %s (%d)\n",
ifindex2ifname(dev_info->if_index, VRF_DEFAULT),
dev_info->if_index);
@@ -510,9 +512,8 @@ static void zd_dpdk_port_show_entry(struct zd_dpdk_port *dport, struct vty *vty,
dev_info->switch_info.port_id);
vty_out(vty, "\n");
} else {
- vty_out(vty, "%-4u %-16s %-16s %-16d %s,%u,%u\n",
- dport->port_id,
- dev_info->device ? dev_info->device->name : "-",
+ vty_out(vty, "%-4u %-16s %-16s %-16d %s,%u,%u\n", dport->port_id,
+ dev_info->device ? rte_dev_name(dev_info->device) : "-",
ifindex2ifname(dev_info->if_index, VRF_DEFAULT),
dev_info->if_index, dev_info->switch_info.name,
dev_info->switch_info.domain_id,
@@ -595,13 +596,15 @@ static void zd_dpdk_port_init(void)
}
SET_FLAG(dport->flags, ZD_DPDK_PORT_FLAG_INITED);
if (IS_ZEBRA_DEBUG_DPLANE_DPDK)
- zlog_debug(
- "port %u, dev %s, ifI %d, sw_name %s, sw_domain %u, sw_port %u",
- port_id,
- dev_info->device ? dev_info->device->name : "-",
- dev_info->if_index, dev_info->switch_info.name,
- dev_info->switch_info.domain_id,
- dev_info->switch_info.port_id);
+ zlog_debug("port %u, dev %s, ifI %d, sw_name %s, sw_domain %u, sw_port %u",
+ port_id,
+ dev_info->device
+ ? rte_dev_name(dev_info->device)
+ : "-",
+ dev_info->if_index,
+ dev_info->switch_info.name,
+ dev_info->switch_info.domain_id,
+ dev_info->switch_info.port_id);
if (rte_flow_isolate(port_id, 1, &error)) {
if (IS_ZEBRA_DEBUG_DPLANE_DPDK)
zlog_debug(
@@ -635,7 +638,7 @@ static int zd_dpdk_init(void)
zd_dpdk_vty_init();
frr_with_privs (&zserv_privs) {
- rc = rte_eal_init(array_size(argv), argv);
+ rc = rte_eal_init(array_size(argv), (char **)argv);
}
if (rc < 0) {
zlog_warn("EAL init failed %s", rte_strerror(rte_errno));
diff --git a/zebra/dpdk/zebra_dplane_dpdk.h b/zebra/dpdk/zebra_dplane_dpdk.h
index e5a3dbebab..ece72d9efb 100644
--- a/zebra/dpdk/zebra_dplane_dpdk.h
+++ b/zebra/dpdk/zebra_dplane_dpdk.h
@@ -20,4 +20,6 @@ extern void zd_dpdk_port_show(struct vty *vty, uint16_t port_id, bool uj,
extern void zd_dpdk_stat_show(struct vty *vty);
extern void zd_dpdk_vty_init(void);
+extern struct zebra_privs_t zserv_privs;
+
#endif