aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-06-09 17:03:35 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-06-09 18:38:28 +0200
commitd8c38777a1464e9ada60fd06e2a7e089fca55b11 (patch)
treebf3fa885644faccabb9771a57e8ece21effbd4db /src
parent74f6dd7a008ee130a43b212d71ef92f9e4b7042b (diff)
Avoid using N3101 in DL TBFs
TS 44.060 13.4 "N3101" clearly states this counter relates to UL TBFs, since it only applies to TBFs for which USFs are set: "When the network after setting USF for a given TBF, receives a valid data block of this TBF from the mobile station in a block assigned for this USF, it will reset counter N3101. If PS Handover is not ongoing, the network will increment counter N3101 for each USF for which no data is received for this TBF." Furthermore, N3101 must only be reset for data blocks, so drop all rx CTRL block patches on UL TBF resetting the counter. Change-Id: I207f3906d13fc6feea2282e261f468a09db37d86
Diffstat (limited to 'src')
-rw-r--r--src/pdch.cpp12
-rw-r--r--src/tbf.cpp19
2 files changed, 10 insertions, 21 deletions
diff --git a/src/pdch.cpp b/src/pdch.cpp
index 9ceb9440..2cee011d 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -356,9 +356,6 @@ void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet,
tbf = poll->tbf_poll.poll_tbf;
reason = poll->tbf_poll.reason;
- /* Reset N3101 counter: */
- tbf->n_reset(N3101);
-
ms_update_announced_tlli(tbf->ms(), tlli);
/* Gather MS from TBF again, since it may be NULL or may have been merged during ms_update_announced_tlli */
ms = tbf->ms();
@@ -499,9 +496,6 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n
return;
}
- /* Reset N3101 counter: */
- tbf->n_reset(N3101);
-
pdch_ulc_release_fn(ulc, fn);
LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n");
@@ -569,8 +563,6 @@ void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nac
return;
}
- /* Reset N3101 counter: */
- tbf->n_reset(N3101);
pdch_ulc_release_fn(ulc, fn);
LOGPTBF(tbf, LOGL_DEBUG,
@@ -670,8 +662,6 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESOURCE REQ unknown downlink TFI=%d\n", tfi);
return;
}
- /* Reset N3101 counter: */
- dl_tbf->n_reset(N3101);
ms = tbf_ms(dl_tbf_as_tbf(dl_tbf));
dl_tbf = NULL;
} else { /* ID_TYPE = UL_TFI */
@@ -681,8 +671,6 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESOURCE REQ unknown uplink TFI=%d\n", tfi);
return;
}
- /* Reset N3101 counter: */
- ul_tbf->n_reset(N3101);
ms = tbf_ms(ul_tbf_as_tbf(ul_tbf));
ul_tbf = NULL;
}
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 83b3b862..bc5411ac 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -307,10 +307,14 @@ void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf)
void gprs_rlcmac_tbf::n_reset(enum tbf_counters n)
{
- if (n >= N_MAX) {
- LOGPTBF(this, LOGL_ERROR, "attempting to reset unknown counter %s\n",
- get_value_string(tbf_counters_names, n));
- return;
+ OSMO_ASSERT(n < N_MAX);
+
+ switch(n) {
+ case N3101:
+ OSMO_ASSERT(direction == GPRS_RLCMAC_UL_TBF);
+ break;
+ default:
+ break;
}
Narr[n] = 0;
@@ -321,16 +325,13 @@ bool gprs_rlcmac_tbf::n_inc(enum tbf_counters n)
{
uint8_t chk;
- if (n >= N_MAX) {
- LOGPTBF(this, LOGL_ERROR, "attempting to increment unknown counter %s\n",
- get_value_string(tbf_counters_names, n));
- return true;
- }
+ OSMO_ASSERT(n < N_MAX);
Narr[n]++;
switch(n) {
case N3101:
+ OSMO_ASSERT(direction == GPRS_RLCMAC_UL_TBF);
chk = bts->n3101;
break;
case N3103: