From cc2b2b6bad0bcd17c3df129be61a67fe392cbc93 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Tue, 21 May 2019 14:17:26 -0500 Subject: lora: update packet forwarders with increased JIT peek ahead time 60ms for v1.5 and 90ms for v2.1, add additional escapes from spec scan loops --- ...ncrease-peek-and-remove-sort-from-dequeue.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch (limited to 'recipes-connectivity/lora/lora-packet-forwarder') diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch new file mode 100644 index 0000000..2b0aaf4 --- /dev/null +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch @@ -0,0 +1,36 @@ +diff --git a/lora_pkt_fwd/src/jitqueue.c b/lora_pkt_fwd/src/jitqueue.c +index dbde8d2..f1b547b 100644 +--- a/lora_pkt_fwd/src/jitqueue.c ++++ b/lora_pkt_fwd/src/jitqueue.c +@@ -37,6 +37,7 @@ Maintainer: Michael Coracin + #define TX_MARGIN_DELAY 1000 /* Packet overlap margin in microseconds */ + /* TODO: How much margin should we take? */ + #define TX_JIT_DELAY 30000 /* Pre-delay to program packet for TX in microseconds */ ++#define TX_PEEK_DELAY 60000 /* Look ahead time for TX in microseconds */ + #define TX_MAX_ADVANCE_DELAY ((JIT_NUM_BEACON_IN_QUEUE + 1) * 128 * 1E6) /* Maximum advance delay accepted for a TX packet, compared to current time */ + + #define BEACON_GUARD 3000000 /* Interval where no ping slot can be placed, +@@ -352,12 +353,12 @@ enum jit_error_e jit_dequeue(struct jit_queue_s *queue, int index, struct lgw_pk + memset(&(queue->nodes[queue->num_pkt]), 0, sizeof(struct jit_node_s)); + + /* Sort queue in ascending order of packet timestamp */ +- jit_sort_queue(queue); ++ // jit_sort_queue(queue); + + /* Done */ + pthread_mutex_unlock(&mx_jit_queue); + +- jit_print_queue(queue, false, DEBUG_JIT); ++ // jit_print_queue(queue, false, DEBUG_JIT); + + MSG_DEBUG(DEBUG_JIT, "dequeued packet with count_us=%u from index %d\n", packet->count_us, index); + +@@ -427,7 +428,7 @@ enum jit_error_e jit_peek(struct jit_queue_s *queue, struct timeval *time, int * + * Warning: unsigned arithmetic (handle roll-over) + * t_packet < t_current + TX_JIT_DELAY + */ +- if ((queue->nodes[idx_highest_priority].pkt.count_us - time_us) < TX_JIT_DELAY) { ++ if ((queue->nodes[idx_highest_priority].pkt.count_us - time_us) < TX_PEEK_DELAY) { + *pkt_idx = idx_highest_priority; + MSG_DEBUG(DEBUG_JIT, "peek packet with count_us=%u at index %d\n", + queue->nodes[idx_highest_priority].pkt.count_us, idx_highest_priority); -- cgit v1.2.3