summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-packet-forwarder
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2019-05-21 14:17:26 -0500
committerJason Reiss <jreiss@multitech.com>2019-05-21 14:17:26 -0500
commitcc2b2b6bad0bcd17c3df129be61a67fe392cbc93 (patch)
tree92b4d2d089fff86d12dbfc4aea0fc42faf64273c /recipes-connectivity/lora/lora-packet-forwarder
parent5fc68d16e845c562c262862e7cbfe49db149e2f2 (diff)
downloadmeta-mlinux-cc2b2b6bad0bcd17c3df129be61a67fe392cbc93.tar.gz
meta-mlinux-cc2b2b6bad0bcd17c3df129be61a67fe392cbc93.tar.bz2
meta-mlinux-cc2b2b6bad0bcd17c3df129be61a67fe392cbc93.zip
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
Diffstat (limited to 'recipes-connectivity/lora/lora-packet-forwarder')
-rw-r--r--recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-jit-queue-increase-peek-and-remove-sort-from-dequeue.patch36
1 files changed, 36 insertions, 0 deletions
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);