X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fmain.c;h=ed578c8536fdad6fe36f8d9c619e12220cf3f720;hb=4805ad5dc114b24724b754443c2fc1e6957f6e3a;hp=499a1ab70bb5ce4f7fd3085113a3eec88ffd5180;hpb=9e5b1c09840e5536ad74b4143e31cbd04d7e966c;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/main.c b/VNFs/DPPD-PROX/main.c index 499a1ab7..ed578c85 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); } } }