Fix: Poll correctly for downlink acknowlege, to prevent window stalling
This commit is contained in:
parent
a3c12fb6c5
commit
5f14bd9410
|
@ -33,7 +33,7 @@ int bssgp_tx_llc_discarded(struct bssgp_bvc_ctx *bctx, uint32_t tlli,
|
||||||
#define SEND_ACK_AFTER_FRAMES 20
|
#define SEND_ACK_AFTER_FRAMES 20
|
||||||
|
|
||||||
/* After sending these frames, we poll for ack/nack. */
|
/* After sending these frames, we poll for ack/nack. */
|
||||||
#define POLL_ACK_AFTER_FRAMES 10
|
#define POLL_ACK_AFTER_FRAMES 20
|
||||||
|
|
||||||
/* If acknowledgement to uplink/downlink assignmentshould be polled */
|
/* If acknowledgement to uplink/downlink assignmentshould be polled */
|
||||||
#define POLLING_ASSIGNMENT_DL 1
|
#define POLLING_ASSIGNMENT_DL 1
|
||||||
|
@ -1212,6 +1212,7 @@ struct msgb *gprs_rlcmac_send_data_block_acknowledged(
|
||||||
uint8_t *delimiter, *data, *e_pointer;
|
uint8_t *delimiter, *data, *e_pointer;
|
||||||
uint8_t len;
|
uint8_t len;
|
||||||
uint16_t space, chunk;
|
uint16_t space, chunk;
|
||||||
|
int first_fin_ack;
|
||||||
|
|
||||||
LOGP(DRLCMACDL, LOGL_DEBUG, "DL DATA TBF=%d downlink (V(A)==%d .. "
|
LOGP(DRLCMACDL, LOGL_DEBUG, "DL DATA TBF=%d downlink (V(A)==%d .. "
|
||||||
"V(S)==%d)\n", tbf->tfi, tbf->dir.dl.v_a, tbf->dir.dl.v_s);
|
"V(S)==%d)\n", tbf->tfi, tbf->dir.dl.v_a, tbf->dir.dl.v_s);
|
||||||
|
@ -1428,7 +1429,7 @@ do_resend:
|
||||||
"done.\n");
|
"done.\n");
|
||||||
li->e = 1; /* we cannot extend */
|
li->e = 1; /* we cannot extend */
|
||||||
rh->fbi = 1; /* we indicate final block */
|
rh->fbi = 1; /* we indicate final block */
|
||||||
tbf->dir.dl.tx_counter = POLL_ACK_AFTER_FRAMES + 1;
|
first_fin_ack = 1;
|
||||||
/* + 1 indicates: first final ack */
|
/* + 1 indicates: first final ack */
|
||||||
tbf_new_state(tbf, GPRS_RLCMAC_FINISHED);
|
tbf_new_state(tbf, GPRS_RLCMAC_FINISHED);
|
||||||
break;
|
break;
|
||||||
|
@ -1459,18 +1460,15 @@ tx_block:
|
||||||
|
|
||||||
/* poll after POLL_ACK_AFTER_FRAMES frames, or when final block is tx.
|
/* poll after POLL_ACK_AFTER_FRAMES frames, or when final block is tx.
|
||||||
*/
|
*/
|
||||||
if (tbf->dir.dl.tx_counter >= POLL_ACK_AFTER_FRAMES) {
|
if (tbf->dir.dl.tx_counter >= POLL_ACK_AFTER_FRAMES || first_fin_ack) {
|
||||||
if (tbf->dir.dl.tx_counter > POLL_ACK_AFTER_FRAMES) {
|
if (first_fin_ack) {
|
||||||
/* if rx_counter is POLL_ACK_AFTER_FRAMES + 1, this
|
|
||||||
* indicates: poll caused by final ack. */
|
|
||||||
LOGP(DRLCMACDL, LOGL_DEBUG, "- Scheduling Ack/Nack "
|
LOGP(DRLCMACDL, LOGL_DEBUG, "- Scheduling Ack/Nack "
|
||||||
"polling, because final block sent.\n");
|
"polling, because first final block sent.\n");
|
||||||
} else {
|
} else {
|
||||||
LOGP(DRLCMACDL, LOGL_DEBUG, "- Scheduling Ack/Nack "
|
LOGP(DRLCMACDL, LOGL_DEBUG, "- Scheduling Ack/Nack "
|
||||||
"polling, because %d blocks sent.\n",
|
"polling, because %d blocks sent.\n",
|
||||||
POLL_ACK_AFTER_FRAMES);
|
POLL_ACK_AFTER_FRAMES);
|
||||||
}
|
}
|
||||||
tbf->dir.dl.tx_counter = 0;
|
|
||||||
/* scheduling not possible, because: */
|
/* scheduling not possible, because: */
|
||||||
if (tbf->poll_state != GPRS_RLCMAC_POLL_NONE)
|
if (tbf->poll_state != GPRS_RLCMAC_POLL_NONE)
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG, "Polling is already "
|
LOGP(DRLCMAC, LOGL_DEBUG, "Polling is already "
|
||||||
|
@ -1487,6 +1485,7 @@ tx_block:
|
||||||
else {
|
else {
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG, "Polling sheduled in this "
|
LOGP(DRLCMAC, LOGL_DEBUG, "Polling sheduled in this "
|
||||||
"TS %d\n", ts);
|
"TS %d\n", ts);
|
||||||
|
tbf->dir.dl.tx_counter = 0;
|
||||||
/* start timer whenever we send the final block */
|
/* start timer whenever we send the final block */
|
||||||
if (rh->fbi == 1)
|
if (rh->fbi == 1)
|
||||||
tbf_timer_start(tbf, 3191, bts->t3191, 0);
|
tbf_timer_start(tbf, 3191, bts->t3191, 0);
|
||||||
|
|
Loading…
Reference in New Issue