summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/prox_port_cfg.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2018-01-14 18:13:09 +0100
committerXavier Simonart <xavier.simonart@intel.com>2018-01-16 16:53:26 +0100
commitab933e9fd74d5a4e20eeb30e3fab3977e98b8743 (patch)
tree81bd77c978e4308cf51f78391397be7be6998af3 /VNFs/DPPD-PROX/prox_port_cfg.c
parentdeab1ee8197298bd7cf30d259a28206841d59383 (diff)
Integrate irq mode into PROX (support display and command line)
irq mode can be used to show how a core is interrupted by other tasks. This mode does not handle packets. It only loops reading tsc. When the difference between two consecutive calls to rdtsc() is high then it means the core was interrupted. This task implementes the display, so that we can see a histogram of interrupts as well as the maximum, per core. Command line is also supported, through "show irq buckets" (too show the intervals of each buckets, in micrcoseconds), and the stats command line (showing the number of items in each buckets and the max).. Change-Id: I153cc3deaa7b86ae2776ea44e46ef9ecfd116992 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/prox_port_cfg.c')
-rw-r--r--VNFs/DPPD-PROX/prox_port_cfg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c
index bf8dbda2..c4787b1e 100644
--- a/VNFs/DPPD-PROX/prox_port_cfg.c
+++ b/VNFs/DPPD-PROX/prox_port_cfg.c
@@ -39,6 +39,7 @@
#include "toeplitz.h"
#include "defines.h"
#include "prox_cksum.h"
+#include "stats_irq.h"
struct prox_port_cfg prox_port_cfg[PROX_MAX_PORTS];
rte_atomic32_t lsc;
@@ -54,7 +55,7 @@ int prox_nb_active_ports(void)
int prox_last_port_active(void)
{
- int ret = 0;
+ int ret = -1;
for (uint32_t i = 0; i < PROX_MAX_PORTS; ++i) {
if (prox_port_cfg[i].active) {
ret = i;
@@ -125,7 +126,8 @@ void prox_pktmbuf_reinit(void *arg, void *start, __attribute__((unused)) void *e
/* initialize rte devices and check the number of available ports */
void init_rte_dev(int use_dummy_devices)
{
- uint8_t nb_ports, port_id_max, port_id_last;
+ uint8_t nb_ports, port_id_max;
+ int port_id_last;
struct rte_eth_dev_info dev_info;
nb_ports = rte_eth_dev_count();
@@ -150,7 +152,7 @@ void init_rte_dev(int use_dummy_devices)
PROX_PANIC(use_dummy_devices, "Can't use dummy devices\n");
#endif
}
- else {
+ else if (prox_last_port_active() != -1) {
PROX_PANIC(nb_ports == 0, "\tError: DPDK could not find any port\n");
plog_info("\tDPDK has found %u ports\n", nb_ports);
}