diff options
Diffstat (limited to 'VNFs/DPPD-PROX/commands.c')
-rw-r--r-- | VNFs/DPPD-PROX/commands.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/VNFs/DPPD-PROX/commands.c b/VNFs/DPPD-PROX/commands.c index 11b43e53..df5e69cd 100644 --- a/VNFs/DPPD-PROX/commands.c +++ b/VNFs/DPPD-PROX/commands.c @@ -258,7 +258,7 @@ static int add_multicast_addr(uint8_t port_id, prox_rte_ether_addr *addr) return -1; } for (i = 0; i < port_cfg->nb_mc_addr; i++) { - if (is_same_ether_addr(addr, &port_cfg->mc_addr[i])) { + if (prox_rte_is_same_ether_addr(addr, &port_cfg->mc_addr[i])) { plog_info("multicast address already added to port\n"); return -1; } @@ -283,7 +283,7 @@ static int del_multicast_addr(uint8_t port_id, prox_rte_ether_addr *addr) struct prox_port_cfg* port_cfg = &prox_port_cfg[port_id]; for (i = 0; i < port_cfg->nb_mc_addr; i++) { - if (is_same_ether_addr(addr, &port_cfg->mc_addr[i])) { + if (prox_rte_is_same_ether_addr(addr, &port_cfg->mc_addr[i])) { // Copy last address to the slot to be deleted prox_rte_ether_addr_copy(&port_cfg->mc_addr[port_cfg->nb_mc_addr-1], &port_cfg->mc_addr[i]); @@ -347,15 +347,17 @@ static void get_hp_sz_string(char *sz_str, uint64_t hp_sz) // Unused for now, keep for reference static int print_all_segments(const struct rte_memseg_list *memseg_list, const struct rte_memseg *memseg, void *arg) { - struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; - int memseg_list_idx, memseg_idx; + int memseg_list_idx = 0, memseg_idx; int n = (*(int *)arg)++; +#if RTE_VERSION < RTE_VERSION_NUM(19,8,0,0) + struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; memseg_list_idx = memseg_list - mcfg->memsegs; if ((memseg_list_idx < 0) || (memseg_list_idx >= RTE_MAX_MEMSEG_LISTS)) { plog_err("Invalid memseg_list_idx = %d; memseg_list = %p, mcfg->memsegs = %p\n", memseg_list_idx, memseg_list, mcfg->memsegs); return -1; } +#endif memseg_idx = rte_fbarray_find_idx(&memseg_list->memseg_arr, memseg); if (memseg_idx < 0) { plog_err("Invalid memseg_idx = %d; memseg_list = %p, memseg = %p\n", memseg_idx, memseg_list, memseg); @@ -381,15 +383,17 @@ static int print_all_segments(const struct rte_memseg_list *memseg_list, const s // Contiguous segments are shown as 1 big segment static int print_segments(const struct rte_memseg_list *memseg_list, const struct rte_memseg *memseg, size_t len, void *arg) { - struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; - int memseg_list_idx, memseg_idx; + int memseg_list_idx = 0, memseg_idx; static int n = 0; +#if RTE_VERSION < RTE_VERSION_NUM(19,8,0,0) + struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; memseg_list_idx = memseg_list - mcfg->memsegs; if ((memseg_list_idx < 0) || (memseg_list_idx >= RTE_MAX_MEMSEG_LISTS)) { plog_err("Invalid memseg_list_idx = %d; memseg_list = %p, mcfg->memsegs = %p\n", memseg_list_idx, memseg_list, mcfg->memsegs); return -1; } +#endif memseg_idx = rte_fbarray_find_idx(&memseg_list->memseg_arr, memseg); if (memseg_idx < 0) { plog_err("Invalid memseg_idx = %d; memseg_list = %p, memseg = %p\n", memseg_idx, memseg_list, memseg); @@ -412,6 +416,7 @@ static int print_segments(const struct rte_memseg_list *memseg_list, const struc } #endif + void cmd_mem_layout(void) { #if RTE_VERSION < RTE_VERSION_NUM(18,5,0,0) |