aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-26 13:08:12 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-26 21:00:52 +0100
commit7a5f3c2153beb5f92b39a93b02ead76bcd0c6150 (patch)
tree434d90ff5e6e1cfb8702eb77d6943652d35ddf2b
parent7f3e662b3412a028254796420d7761d8c84c8fd2 (diff)
tbf/sched: We pick the _last_ entry, rotate the lists
We always pick the _last_ entry from the lists. Let's rotate so we make it a bit more fair.
-rw-r--r--src/gprs_rlcmac_sched.cpp1
-rw-r--r--src/tbf.cpp9
-rw-r--r--src/tbf.h3
3 files changed, 13 insertions, 0 deletions
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index 690be30..a3211ee 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -133,6 +133,7 @@ static struct msgb *sched_select_ctrl_msg(struct gprs_rlcmac_bts *bts,
}
/* any message */
if (msg) {
+ tbf->rotate_in_list();
LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling control "
"message at RTS for %s (TRX=%d, TS=%d)\n",
tbf_name(tbf), trx, ts);
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 88d4662..e882e1f 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -1742,3 +1742,12 @@ bool gprs_rlcmac_tbf::dl_window_stalled() const
{
return dir.dl.window.window_stalled();
}
+
+void gprs_rlcmac_tbf::rotate_in_list()
+{
+ llist_del(&list);
+ if (direction == GPRS_RLCMAC_UL_TBF)
+ llist_add(&list, &bts->bts_data()->ul_tbfs);
+ else
+ llist_add(&list, &bts->bts_data()->dl_tbfs);
+}
diff --git a/src/tbf.h b/src/tbf.h
index 4d7f64b..98b9a9b 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -135,6 +135,9 @@ struct gprs_rlcmac_tbf {
uint16_t sns() const;
+ /* attempt to make things a bit more fair */
+ void rotate_in_list();
+
struct llist_head list;
uint32_t state_flags;
enum gprs_rlcmac_tbf_direction direction;