summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2019-06-14 17:12:56 +0200
committerPatrice Buriez <patrice.buriez@intel.com>2019-06-14 20:41:50 +0200
commit843ca042cad997b51390bd6156d3200de18294d2 (patch)
treeb31bc6f66ed439dff923f13f87ac64fe262256d1
parent2c99d36b1898f1163877a920e125fb51fd35b3a1 (diff)
Add support for latency task with multiple ports
Change-Id: Iaae603a7558666b5794ec4c76f447eb3260a1df9 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com> Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
-rw-r--r--VNFs/DPPD-PROX/cmd_parser.c13
-rw-r--r--VNFs/DPPD-PROX/stats_latency.c8
2 files changed, 17 insertions, 4 deletions
diff --git a/VNFs/DPPD-PROX/cmd_parser.c b/VNFs/DPPD-PROX/cmd_parser.c
index c6d683f4..7df6b163 100644
--- a/VNFs/DPPD-PROX/cmd_parser.c
+++ b/VNFs/DPPD-PROX/cmd_parser.c
@@ -1764,6 +1764,19 @@ static int parse_cmd_lat_stats(const char *str, struct input *input)
else {
struct stats_latency *stats = stats_latency_find(lcore_id, task_id);
struct stats_latency *tot = stats_latency_tot_find(lcore_id, task_id);
+ if (!stats || !tot) {
+ if (input->reply) {
+ char buf[128];
+ snprintf(buf, sizeof(buf),
+ "error: core %u task %u stats = %p tot = %p\n",
+ lcore_id, task_id, stats, tot);
+ input->reply(input, buf, strlen(buf));
+ } else {
+ plog_info("error: core %u task %u stats = %p tot = %p\n",
+ lcore_id, task_id, stats, tot);
+ }
+ continue;
+ }
uint64_t last_tsc = stats_core_task_last_tsc(lcore_id, task_id);
uint64_t lat_min_usec = time_unit_to_usec(&stats->min.time);
diff --git a/VNFs/DPPD-PROX/stats_latency.c b/VNFs/DPPD-PROX/stats_latency.c
index 59d00580..7db53f20 100644
--- a/VNFs/DPPD-PROX/stats_latency.c
+++ b/VNFs/DPPD-PROX/stats_latency.c
@@ -104,11 +104,11 @@ struct stats_latency *stats_latency_find(uint32_t lcore_id, uint32_t task_id)
static int task_runs_observable_latency(struct task_args *targ)
{
- /* TODO: make this work with multiple ports and with
- rings. Currently, only showing lat tasks which have 1 RX
- port. */
+ /* Note that multiple ports or rings are only supported
+ if they all receive packets configured in the same way
+ e.g. same timestamp pos. */
return !strcmp(targ->task_init->mode_str, "lat") &&
- (targ->nb_rxports == 1 || targ->nb_rxrings == 1);
+ (targ->nb_rxports >= 1 || targ->nb_rxrings >= 1);
}
static struct stats_latency_manager *alloc_stats_latency_manager(void)