summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/handle_lat.h
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs/DPPD-PROX/handle_lat.h')
-rw-r--r--VNFs/DPPD-PROX/handle_lat.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/VNFs/DPPD-PROX/handle_lat.h b/VNFs/DPPD-PROX/handle_lat.h
index 3cc80461..475682ce 100644
--- a/VNFs/DPPD-PROX/handle_lat.h
+++ b/VNFs/DPPD-PROX/handle_lat.h
@@ -1,5 +1,5 @@
/*
-// Copyright (c) 2010-2017 Intel Corporation
+// Copyright (c) 2010-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -25,6 +25,15 @@
#include "clock.h"
#define LATENCY_ACCURACY 1
+// If ACCURACY_WINDOW is too small, the accuracy for packet N can be received by lat BEFORE
+// packet N is received (re-ordering) resulting in accuracy being unused
+// 8192 packets is equivalent to 550 micro-seconds at 10Gbps for 64 bytes packets
+#define ACCURACY_WINDOW 8192
+#define LAT_BUCKET_COUNT 128
+
+#define LAT_BUCKET_COUNT 128
+
+#define LAT_BUCKET_COUNT 128
struct lat_test {
uint64_t tot_all_pkts;
@@ -40,9 +49,12 @@ struct lat_test {
uint64_t tot_lat_error;
unsigned __int128 var_lat_error;
- uint64_t buckets[128];
+ uint64_t buckets[LAT_BUCKET_COUNT];
uint64_t bucket_size;
uint64_t lost_packets;
+ uint64_t mis_ordered;
+ uint64_t extent;
+ uint64_t duplicate;
};
static struct time_unit lat_test_get_accuracy_limit(struct lat_test *lat_test)
@@ -148,6 +160,9 @@ static void lat_test_combine(struct lat_test *dst, struct lat_test *src)
if (src->accuracy_limit_tsc > dst->accuracy_limit_tsc)
dst->accuracy_limit_tsc = src->accuracy_limit_tsc;
dst->lost_packets += src->lost_packets;
+ dst->mis_ordered += src->mis_ordered;
+ dst->extent += src->extent;
+ dst->duplicate += src->duplicate;
#ifdef LATENCY_HISTOGRAM
_lat_test_histogram_combine(dst, src);
@@ -169,6 +184,9 @@ static void lat_test_reset(struct lat_test *lat_test)
lat_test->accuracy_limit_tsc = 0;
lat_test->lost_packets = 0;
+ lat_test->mis_ordered = 0;
+ lat_test->extent = 0;
+ lat_test->duplicate = 0;
memset(lat_test->buckets, 0, sizeof(lat_test->buckets));
}
@@ -182,6 +200,7 @@ static void lat_test_copy(struct lat_test *dst, struct lat_test *src)
struct task_lat;
struct lat_test *task_lat_get_latency_meassurement(struct task_lat *task);
+uint32_t task_lat_get_latency_bucket_size(struct task_lat *task);
void task_lat_use_other_latency_meassurement(struct task_lat *task);
void task_lat_set_accuracy_limit(struct task_lat *task, uint32_t accuracy_limit_nsec);