X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fmain.c;h=4a9ee8810c9096e9b81bb0710ba21f487dfc5563;hb=0d8616af8418480595a2c53e1dc7c3b809962a28;hp=499a1ab70bb5ce4f7fd3085113a3eec88ffd5180;hpb=9e5b1c09840e5536ad74b4143e31cbd04d7e966c;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/main.c b/VNFs/DPPD-PROX/main.c index 499a1ab7..4a9ee881 100644 --- a/VNFs/DPPD-PROX/main.c +++ b/VNFs/DPPD-PROX/main.c @@ -127,11 +127,33 @@ static void check_zero_rx(void) } } +static void check_nb_mbuf(void) +{ + struct lcore_cfg *lconf = NULL; + struct task_args *targ = NULL; + uint8_t port_id; + int n_txd = 0, n_rxd = 0; + + while (core_targ_next(&lconf, &targ, 0) == 0) { + for (uint8_t i = 0; i < targ->nb_txports; ++i) { + port_id = targ->tx_port_queue[i].port; + n_txd = prox_port_cfg[port_id].n_txd; + } + for (uint8_t i = 0; i < targ->nb_rxports; ++i) { + port_id = targ->rx_port_queue[i].port; + n_rxd = prox_port_cfg[port_id].n_rxd; + } + if (targ->nb_mbuf <= n_rxd + n_txd + targ->nb_cache_mbuf + MAX_PKT_BURST) { + plog_warn("Core %d, task %d might not have enough mbufs (%d) to support %d txd, %d rxd and %d cache_mbuf\n", + lconf->id, targ->id, targ->nb_mbuf, n_txd, n_rxd, targ->nb_cache_mbuf); + } + } +} + static void check_missing_rx(void) { struct lcore_cfg *lconf = NULL, *rx_lconf = NULL, *tx_lconf = NULL; struct task_args *targ, *rx_targ = NULL, *tx_targ = NULL; - struct prox_port_cfg *port; uint8_t port_id, rx_port_id, ok; while (core_targ_next(&lconf, &targ, 0) == 0) { @@ -192,6 +214,7 @@ static void check_missing_rx(void) static void check_cfg_consistent(void) { + check_nb_mbuf(); check_missing_rx(); check_zero_rx(); check_mixed_normal_pipeline(); @@ -501,7 +524,7 @@ static struct rte_ring *init_ring_between_tasks(struct lcore_cfg *lconf, struct starg->ctrl_plane_ring = ring; } - plog_info("\t\tCore %u task %u to -> core %u task %u ctrl_ring %s %p %s\n", + plog_info("\t\t\tCore %u task %u to -> core %u task %u ctrl_ring %s %p %s\n", lconf->id, starg->id, ct.core, ct.task, ct.type == CTRL_TYPE_PKT? "pkt" : "msg", ring, ring->name); ris->n_ctrl_rings++; @@ -614,7 +637,7 @@ static void init_rings(void) ct.core = lconf->id; ct.task = starg->id;; - struct rte_ring *tx_ring = init_ring_between_tasks(lcore_cfg, lcore_cfg[prox_cfg.master].targs, ct, 0, 0, &ris); + struct rte_ring *tx_ring = init_ring_between_tasks(&lcore_cfg[prox_cfg.master], lcore_cfg[prox_cfg.master].targs, ct, 0, 0, &ris); } } } @@ -1104,7 +1127,7 @@ int main(int argc, char **argv) } plog_init(prox_cfg.log_name, prox_cfg.log_name_pid); - plog_info("=== " PROGRAM_NAME " " VERSION_STR " ===\n"); + plog_info("=== " PROGRAM_NAME " %s ===\n", VERSION_STR()); plog_info("\tUsing DPDK %s\n", rte_version() + sizeof(RTE_VER_PREFIX)); read_rdt_info();