diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2020-01-03 03:09:19 +0100 |
---|---|---|
committer | Xavier Simonart <xavier.simonart@intel.com> | 2020-05-29 23:41:49 +0200 |
commit | 7c4601f23c526b14a67674782b303663dfaa95af (patch) | |
tree | 51915ce3a919e03b67dbcc4c4dafa70bbd358eab /VNFs/DPPD-PROX/log.c | |
parent | c61fccde40dc6bb4a6ecd21c9d6dc8969df33400 (diff) |
Added support for IMIX through config and command line
In Prox configuration IMIX can be specified using the following syntax:
imix=pkt_size,pkt_size... Up to 127 different pkt sizes can be specified.
Through command line, the following syntax can be used
imix core_id task_id pkt_size,pkt_size... Up to 127 packet sizes can be specified.
When IMIX is enabled, PROX will loop through the list of packet sizes.
PROX supports two different submodes to handle pcap files.
In the 1st submode (default, no submode specified), timestamps from
the pcap file are ignored. In this submode IMIX is supported as well and each
packets in the pcap file will be generated with all IMIX sizes.
In the second submode, called pcap in gen mode, packets are generated at
the timestamp specified in the pcap file. This submode does not support IMIX.
Change-Id: I53cbf1378a5364254285b81e6848350d98561184
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/log.c')
-rw-r--r-- | VNFs/DPPD-PROX/log.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/log.c b/VNFs/DPPD-PROX/log.c index 2094c185..2fa63f34 100644 --- a/VNFs/DPPD-PROX/log.c +++ b/VNFs/DPPD-PROX/log.c @@ -25,6 +25,7 @@ #include <rte_mbuf.h> #include "log.h" +#include "quit.h" #include "display.h" #include "defaults.h" #include "etypes.h" @@ -212,6 +213,10 @@ static int vplog(int lvl, const char *format, va_list ap, const struct rte_mbuf ret--; ret += dump_pkt(buf + ret, sizeof(buf) - ret, mbuf); } + + if (lvl == PROX_LOG_PANIC) + PROX_PANIC(1, "%s", buf); + plog_buf(buf); if (lvl == PROX_LOG_WARN) { @@ -278,6 +283,23 @@ int plog_err(const char *fmt, ...) return ret; } +int plog_err_or_panic(int do_panic, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + if (do_panic) { + ret = vplog(PROX_LOG_PANIC, fmt, ap, NULL, 0); + va_end(ap); + return ret; + } else { + ret = vplog(PROX_LOG_ERR, fmt, ap, NULL, 0); + va_end(ap); + return ret; + } +} + int plogx_err(const char *fmt, ...) { va_list ap; |