diff options
Diffstat (limited to 'VNFs/DPPD-PROX/commands.c')
-rw-r--r-- | VNFs/DPPD-PROX/commands.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/VNFs/DPPD-PROX/commands.c b/VNFs/DPPD-PROX/commands.c index a66f4888..df5e69cd 100644 --- a/VNFs/DPPD-PROX/commands.c +++ b/VNFs/DPPD-PROX/commands.c @@ -246,7 +246,7 @@ static struct size_unit to_size_unit(uint64_t bytes) return ret; } -static int add_multicast_addr(uint8_t port_id, struct ether_addr *addr) +static int add_multicast_addr(uint8_t port_id, prox_rte_ether_addr *addr) { unsigned int i; int rc = 0; @@ -258,13 +258,13 @@ static int add_multicast_addr(uint8_t port_id, struct 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; } } - ether_addr_copy(addr, &port_cfg->mc_addr[port_cfg->nb_mc_addr]); + prox_rte_ether_addr_copy(addr, &port_cfg->mc_addr[port_cfg->nb_mc_addr]); if ((rc = rte_eth_dev_set_mc_addr_list(port_id, port_cfg->mc_addr, port_cfg->nb_mc_addr + 1)) != 0) { plog_err("rte_eth_dev_set_mc_addr_list returns %d on port %u\n", rc, port_id); return rc; @@ -275,7 +275,7 @@ static int add_multicast_addr(uint8_t port_id, struct ether_addr *addr) return rc; } -static int del_multicast_addr(uint8_t port_id, struct ether_addr *addr) +static int del_multicast_addr(uint8_t port_id, prox_rte_ether_addr *addr) { unsigned int i; int rc = 0; @@ -283,14 +283,14 @@ static int del_multicast_addr(uint8_t port_id, struct 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 - ether_addr_copy(&port_cfg->mc_addr[port_cfg->nb_mc_addr-1], &port_cfg->mc_addr[i]); + prox_rte_ether_addr_copy(&port_cfg->mc_addr[port_cfg->nb_mc_addr-1], &port_cfg->mc_addr[i]); if ((rc = rte_eth_dev_set_mc_addr_list(port_id, port_cfg->mc_addr, port_cfg->nb_mc_addr - 1)) != 0) { plog_err("rte_eth_dev_set_mc_addr_list returns %d on port %u\n", rc, port_id); // When set failed, let restore the situation we were before calling the function... - ether_addr_copy(addr, &port_cfg->mc_addr[i]); + prox_rte_ether_addr_copy(addr, &port_cfg->mc_addr[i]); return rc; } port_cfg->nb_mc_addr--; @@ -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) @@ -957,7 +962,7 @@ void cmd_reset_port(uint8_t portid) } } -void cmd_multicast(uint8_t port_id, unsigned int val, struct ether_addr *mac) +void cmd_multicast(uint8_t port_id, unsigned int val, prox_rte_ether_addr *mac) { if (!port_is_active(port_id)) { return; |