From patchwork Fri May 30 15:58:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Willmann X-Patchwork-Id: 354250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [IPv6:2001:780:45:1d:225:90ff:fe52:c662]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CDB3E1400DA for ; Sat, 31 May 2014 02:11:01 +1000 (EST) Received: from localhost ([127.0.0.1] helo=ganesha.gnumonks.org) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1WqPOL-00016n-4z; Fri, 30 May 2014 18:10:49 +0200 Received: from isonoe.totalueberwachung.de ([2a01:198:210:100::1]) by ganesha.gnumonks.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WqPCF-0007lk-Bc; Fri, 30 May 2014 17:58:28 +0200 Received: from adrastea.totalueberwachung.de (24-134-58-61-dynip.superkabel.de [24.134.58.61]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by isonoe.totalueberwachung.de (Postfix) with ESMTPSA id A7DE960052; Fri, 30 May 2014 17:58:18 +0200 (CEST) Received: by adrastea.totalueberwachung.de (Postfix, from userid 1000) id D745D220EB; Fri, 30 May 2014 17:58:16 +0200 (CEST) From: Daniel Willmann To: OpenBSC Mailing List , Osmocom net ML Subject: [osmo-pcu 3/3] tbf: Re-send dl assignment if we can upgrade to multislot Date: Fri, 30 May 2014 17:58:01 +0200 Message-Id: X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1401465481-28566-1-git-send-email-dwillmann@sysmocom.de> References: <1401465481-28566-1-git-send-email-dwillmann@sysmocom.de> In-Reply-To: <8d1337120f7cc17da78c0a0496e6d02a94907a38.1401463598.git.daniel@totalueberwachung.de> References: <8d1337120f7cc17da78c0a0496e6d02a94907a38.1401463598.git.daniel@totalueberwachung.de> X-Spam-Score: -0.0 (/) Cc: Daniel Willmann X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openbsc-bounces@lists.osmocom.org Errors-To: openbsc-bounces@lists.osmocom.org The current code would only ever assign one PDCH for the initial assignment (from CCCH). Only if reuse_tbf is called the algorithm would actually use multiple DL PDCHs if possible. This patch introduced a tbf attribute upgrade_to_multislot that is set if we have multiple PDCH configured, and support multislot assignment, but can only assign a single PDCH (alloc_algorithm_b, parameter single is set). In this case after the assignment completes (and the MS is listening on a PDCH) we resend a DL assignment though the PACCH and this time we can assign multiple timeslots. --- src/gprs_rlcmac_ts_alloc.cpp | 9 +++++++++ src/tbf.cpp | 22 ++++++++++++++++++++-- src/tbf.h | 3 +++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 366732c..a97cc65 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -175,6 +175,8 @@ int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, /* the only one TS is the common TS */ tbf->first_ts = tbf->first_common_ts = ts; + tbf->upgrade_to_multislot = 0; + return 0; } @@ -665,10 +667,17 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, } } if (single && slotcount) { + uint8_t ts_count = 0; + for (ts = 0; ts < 8; ts++) + if ((tx_window & (1 << ts))) + ts_count++; + + tbf->upgrade_to_multislot = (ts_count > 1); LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", tbf->first_ts, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { + tbf->upgrade_to_multislot = 0; LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } diff --git a/src/tbf.cpp b/src/tbf.cpp index dd1f0fb..3a2ad73 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -574,11 +574,29 @@ void gprs_rlcmac_tbf::handle_timeout() "in assign state\n", tbf_name(this)); } if ((state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { - /* change state to FLOW, so scheduler will start transmission */ dir.dl.wait_confirm = 0; if (state_is(GPRS_RLCMAC_ASSIGN)) { - tbf_new_state(this, GPRS_RLCMAC_FLOW); tbf_assign_control_ts(this); + + if (!upgrade_to_multislot) { + /* change state to FLOW, so scheduler + * will start transmission */ + tbf_new_state(this, GPRS_RLCMAC_FLOW); + break; + } + + /* This tbf can be upgraded to use multiple DL + * timeslots and now that there is already one + * slot assigned send another DL assignment via + * PDCH. */ + + /* keep to flags */ + state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; + state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); + + update(); + + bts->trigger_dl_ass(this, this, NULL); } else LOGP(DRLCMAC, LOGL_NOTICE, "%s Continue flow after " "IMM.ASS confirm\n", tbf_name(this)); diff --git a/src/tbf.h b/src/tbf.h index 0ee9718..80e2068 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -221,6 +221,9 @@ struct gprs_rlcmac_tbf { * schedule a new dl assignment */ uint8_t was_releasing; + /* Can/should we upgrade this tbf to use multiple slots? */ + uint8_t upgrade_to_multislot; + /* store the BTS this TBF belongs to */ BTS *bts;