pespin has uploaded this change for review.
rlcmac: Avoid discard packets when in Countdown procedure
Discarding a packet through CoDel during Countdown procedure may end up
in the transmitted CV=14..0 being incorrect, since we are not really yet
recalculating them once we enter Countdown procedure.
Hence, to make it simpler for now, avoid dropping packets when in
Countdown procedure to avoid having to recalculate them.
Change-Id: I311302b5282767dc806b1dfe053994f175390b69
---
M include/osmocom/gprs/rlcmac/llc_queue.h
M src/rlcmac/llc_queue.c
M src/rlcmac/tbf_ul.c
3 files changed, 23 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/89/33889/1
diff --git a/include/osmocom/gprs/rlcmac/llc_queue.h b/include/osmocom/gprs/rlcmac/llc_queue.h
index 842969e..331f33b 100644
--- a/include/osmocom/gprs/rlcmac/llc_queue.h
+++ b/include/osmocom/gprs/rlcmac/llc_queue.h
@@ -51,7 +51,7 @@
int gprs_rlcmac_llc_queue_enqueue(struct gprs_rlcmac_llc_queue *q, uint8_t *ll_pdu, unsigned int ll_pdu_len,
enum osmo_gprs_rlcmac_llc_sapi sapi, uint8_t radio_prio);
-struct msgb *gprs_rlcmac_llc_queue_dequeue(struct gprs_rlcmac_llc_queue *q);
+struct msgb *gprs_rlcmac_llc_queue_dequeue(struct gprs_rlcmac_llc_queue *q, bool can_discard);
uint8_t gprs_rlcmac_llc_queue_highest_radio_prio_pending(struct gprs_rlcmac_llc_queue *q);
void gprs_rlcmac_llc_queue_merge_prepend(struct gprs_rlcmac_llc_queue *q, struct gprs_rlcmac_llc_queue *old_q);
diff --git a/src/rlcmac/llc_queue.c b/src/rlcmac/llc_queue.c
index 3ff80d9..264cad0 100644
--- a/src/rlcmac/llc_queue.c
+++ b/src/rlcmac/llc_queue.c
@@ -182,7 +182,7 @@
return msg;
}
-struct msgb *gprs_rlcmac_llc_queue_dequeue(struct gprs_rlcmac_llc_queue *q)
+struct msgb *gprs_rlcmac_llc_queue_dequeue(struct gprs_rlcmac_llc_queue *q, bool can_discard)
{
struct msgb *msg;
struct timespec tv_now;
@@ -196,7 +196,7 @@
ehdr = msgb_l1(msg);
if (q->use_codel) {
int bytes = gprs_rlcmac_llc_queue_octets(q);
- if (gprs_codel_control(&prioq->codel_state, &ehdr->recv_time, &tv_now, bytes)) {
+ if (can_discard && gprs_codel_control(&prioq->codel_state, &ehdr->recv_time, &tv_now, bytes)) {
/* Drop frame: */
frames++;
octets += msg->len;
diff --git a/src/rlcmac/tbf_ul.c b/src/rlcmac/tbf_ul.c
index 86ea8bd..49100fc 100644
--- a/src/rlcmac/tbf_ul.c
+++ b/src/rlcmac/tbf_ul.c
@@ -374,7 +374,11 @@
llc_queue = gprs_rlcmac_ul_tbf_llc_queue(ul_tbf);
/* dequeue next LLC frame, if any */
- ul_tbf->llc_tx_msg = gprs_rlcmac_llc_queue_dequeue(llc_queue);
+ /* Improve: Ideally we could be able to discard as long as current CV !=0
+ * (because we must tell PCU that we are done), and if a frame is discarded probably do:
+ * ul_tbf->countdown_proc.cv = gprs_rlcmac_ul_tbf_calculate_cv(ul_tbf);
+ */
+ ul_tbf->llc_tx_msg = gprs_rlcmac_llc_queue_dequeue(llc_queue, !ul_tbf->countdown_proc.active);
if (!ul_tbf->llc_tx_msg)
return;
To view, visit change 33889. To unsubscribe, or for help writing mail filters, visit settings.