summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/handle_lat.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2019-06-07 14:54:43 +0200
committerPatrice Buriez <patrice.buriez@intel.com>2019-06-14 20:41:50 +0200
commited14b300105eb2bde89eaece3cdb4f0d976f6bb8 (patch)
tree70027e8d48cc3e77a3a23e3adb92cd4eb2176af8 /VNFs/DPPD-PROX/handle_lat.c
parent843ca042cad997b51390bd6156d3200de18294d2 (diff)
Increase window size for latency accuracy
Accuracy of latency is obtained by writing TX accuracy for packet N in a later packet i.e. packet N + WINDOW. If this window is too small, packet N + WINDOW (conveying accuracy for packet N) might arrive before packet N, resulting in no accuracy for packet N. This change increases this window from 64 to 8K packets. This change should result in a higher number of packets used for latency measurements when packets are reordered. This change might have a performance impact as it uses more memory. Change-Id: I1016fddb66af86605c73a24050238da41cf54152 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com> Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/handle_lat.c')
-rw-r--r--VNFs/DPPD-PROX/handle_lat.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/VNFs/DPPD-PROX/handle_lat.c b/VNFs/DPPD-PROX/handle_lat.c
index b4e016ec..d3a52d7e 100644
--- a/VNFs/DPPD-PROX/handle_lat.c
+++ b/VNFs/DPPD-PROX/handle_lat.c
@@ -35,7 +35,7 @@
#include "prox_port_cfg.h"
#define DEFAULT_BUCKET_SIZE 10
-#define ACCURACY_BUFFER_SIZE 64
+#define ACCURACY_BUFFER_SIZE (2 * ACCURACY_WINDOW)
struct lat_info {
uint32_t rx_packet_index;
@@ -344,9 +344,9 @@ static void lat_write_latency_to_file(struct task_lat *task)
uint64_t rx_tsc = lat_info_get_rx_tsc(lat_info);
uint64_t tx_tsc = lat_info_get_tx_tsc(lat_info);
- /* Packet n + ACCURACY_BUFFER_SIZE delivers the TX error for packet n,
- hence the last ACCURACY_BUFFER_SIZE packets do no have TX error. */
- if (i + ACCURACY_BUFFER_SIZE >= task->latency_buffer_idx) {
+ /* Packet n + ACCURACY_WINDOW delivers the TX error for packet n,
+ hence the last ACCURACY_WINDOW packets do no have TX error. */
+ if (i + ACCURACY_WINDOW >= task->latency_buffer_idx) {
tx_err_tsc = 0;
}
@@ -616,14 +616,14 @@ static int handle_lat_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uin
}
/* If accuracy is enabled, latency is reported with a
- delay of ACCURACY_BUFFER_SIZE packets since the generator puts the
- accuracy for packet N into packet N + ACCURACY_BUFFER_SIZE. The delay
+ delay of ACCURACY_WINDOW packets since the generator puts the
+ accuracy for packet N into packet N + ACCURACY_WINDOW. The delay
ensures that all reported latencies have both rx
and tx error. */
if (task->accur_pos) {
uint32_t tx_time_err = *(uint32_t *)(hdr + task->accur_pos);
- struct delayed_latency_entry *delayed_latency_entry = delayed_latency_get(task->delayed_latency_entries, generator_id, packet_id - ACCURACY_BUFFER_SIZE);
+ struct delayed_latency_entry *delayed_latency_entry = delayed_latency_get(task->delayed_latency_entries, generator_id, packet_id - ACCURACY_WINDOW);
if (delayed_latency_entry) {
task_lat_store_lat(task,
@@ -764,11 +764,11 @@ static void init_task_lat(struct task_base *tbase, struct task_args *targ)
PROX_PANIC(task->delayed_latency_entries[i] == NULL, "Failed to allocate array for storing delayed latency entries\n");
}
if (task->unique_id_pos == 0) {
- /* When using accuracy feature, the accuracy from TX is written ACCURACY_BUFFER_SIZE packets later
+ /* When using accuracy feature, the accuracy from TX is written ACCURACY_WINDOW packets later
* We can only retrieve the good packet if a packet id is written to it.
- * Otherwise we will use the packet RECEIVED ACCURACY_BUFFER_SIZE packets ago which is OK if
+ * Otherwise we will use the packet RECEIVED ACCURACY_WINDOW packets ago which is OK if
* packets are not re-ordered. If packets are re-ordered, then the matching between
- * the tx accuracy znd the latency is wrong.
+ * the TX accuracy and the latency is wrong.
*/
plog_warn("\tWhen accuracy feature is used, a unique id should ideally also be used\n");
}