diff options
Diffstat (limited to 'VNFs/DPPD-PROX')
-rw-r--r-- | VNFs/DPPD-PROX/main.c | 43 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/prox_args.c | 7 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/prox_port_cfg.h | 1 |
3 files changed, 51 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/main.c b/VNFs/DPPD-PROX/main.c index f6fa3e80..a863ffb3 100644 --- a/VNFs/DPPD-PROX/main.c +++ b/VNFs/DPPD-PROX/main.c @@ -315,6 +315,49 @@ static void configure_if_tx_queues(struct task_args *targ, uint8_t socket) static void configure_if_rx_queues(struct task_args *targ, uint8_t socket) { struct prox_port_cfg *port; + uint8_t port_used_counter[PROX_MAX_PORTS] = {0}; + bool multiple_port_reference = false; + uint8_t total_number_of_queues = 0; + // Check how many times a port is referenced for this task + for (uint8_t i = 0; i < targ->nb_rxports; i++) { + uint8_t if_port = targ->rx_port_queue[i].port; + port_used_counter[if_port]++; + if (port_used_counter[if_port] > 1) { + multiple_port_reference = true; + port = &prox_port_cfg[if_port]; + PROX_PANIC((port->all_rx_queues), "Multiple queues defined in rx port, but all_rx_queues also set for port %s\n", port->name); + } + } + // If only referenced once, it is possible that we want to use all queues + // Therefore we will check all_rx_queues for that port + if (!multiple_port_reference) { + for (uint8_t i = 0; i < PROX_MAX_PORTS; i++) { + uint8_t if_port = targ->rx_port_queue[i].port; + if (port_used_counter[if_port]) { + port = &prox_port_cfg[if_port]; + if (port->all_rx_queues) { + port_used_counter[if_port] = port->max_rxq; + total_number_of_queues += port->max_rxq; + plog_info("\tall_rx_queues for Port %s: %u rx_queues will be applied\n", port->name, port_used_counter[if_port]); + } + } + } + } + if (total_number_of_queues) { + PROX_PANIC((total_number_of_queues > PROX_MAX_PORTS), "%u queues using the all_rx_queues. PROX_MAX_PORTS is set to %u\n", total_number_of_queues, PROX_MAX_PORTS); + uint8_t index = 0; + for (uint8_t i = 0; i < PROX_MAX_PORTS; i++) { + if (port_used_counter[i]) { + for (uint8_t j = 0; j < port_used_counter[i]; j++) { + targ->rx_port_queue[index].port = i; + index ++; + } + port = &prox_port_cfg[i]; + plog_info("\t\tConfiguring task to use port %s with %u rx_queues\n", port->name, port_used_counter[i]); + } + } + targ->nb_rxports = index; + } for (int i = 0; i < targ->nb_rxports; i++) { uint8_t if_port = targ->rx_port_queue[i].port; diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c index d6bdf818..5af19318 100644 --- a/VNFs/DPPD-PROX/prox_args.c +++ b/VNFs/DPPD-PROX/prox_args.c @@ -541,6 +541,13 @@ static int get_port_cfg(unsigned sindex, char *str, void *data) else if (STR_EQ(str, "tx desc")) { return parse_int(&cfg->n_txd, pkey); } + else if (STR_EQ(str, "all_rx_queues")) { + uint32_t val; + if (parse_bool(&val, pkey)) { + return -1; + } + cfg->all_rx_queues = val; + } else if (STR_EQ(str, "promiscuous")) { uint32_t val; if (parse_bool(&val, pkey)) { diff --git a/VNFs/DPPD-PROX/prox_port_cfg.h b/VNFs/DPPD-PROX/prox_port_cfg.h index 9d025999..f5929a72 100644 --- a/VNFs/DPPD-PROX/prox_port_cfg.h +++ b/VNFs/DPPD-PROX/prox_port_cfg.h @@ -87,6 +87,7 @@ struct prox_port_cfg { uint32_t vlan_tag; uint8_t prefix; uint8_t is_vdev; + uint8_t all_rx_queues; }; extern rte_atomic32_t lsc; |