diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2018-12-13 13:02:36 +0100 |
---|---|---|
committer | Xavier Simonart <xavier.simonart@intel.com> | 2018-12-14 09:52:19 +0100 |
commit | d338068b8f832e23b54bf72cf4994410e88c8f60 (patch) | |
tree | c8d84c2bdb259d04528059c0ffa85459d390078e | |
parent | b14294c202c380a8520f19179d4f96bd6becc55e (diff) |
Fix handing configuration error (missing tx port or ring in gen mode)
Gen mode requires a tx ring or a tx port. A configuration without those
should gracefully report an error. This was causing a crash.
Change-Id: Ia30d4d4c87a694da1dfed86587f90b9199c493ab
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
-rw-r--r-- | VNFs/DPPD-PROX/handle_gen.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/VNFs/DPPD-PROX/handle_gen.c b/VNFs/DPPD-PROX/handle_gen.c index c3be11a8..4040b334 100644 --- a/VNFs/DPPD-PROX/handle_gen.c +++ b/VNFs/DPPD-PROX/handle_gen.c @@ -1301,7 +1301,8 @@ static void init_task_gen(struct task_base *tbase, struct task_args *targ) task_init_gen_load_pcap(task, targ); } - if ((targ->flags & DSF_KEEP_SRC_MAC) == 0 && (targ->nb_txrings || targ->nb_txports)) { + PROX_PANIC(((targ->nb_txrings == 0) && (targ->nb_txports == 0)), "Gen mode requires a tx ring or a tx port"); + if ((targ->flags & DSF_KEEP_SRC_MAC) == 0) { uint8_t *src_addr = prox_port_cfg[tbase->tx_params_hw.tx_port_queue->port].eth_addr.addr_bytes; for (uint32_t i = 0; i < task->n_pkts; ++i) { rte_memcpy(&task->pkt_template[i].buf[6], src_addr, 6); |