Commit f2cd6501 authored by Eurecom's avatar Eurecom

Merge remote-tracking branch 'origin/bugfix-nr-rlc-w36' into bandwidth-testing

parents 76b0aa1f 36bae67e
...@@ -218,7 +218,7 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn) ...@@ -218,7 +218,7 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn)
bad_sdu = 1; bad_sdu = 1;
} }
if (!bad_sdu && len > 0) { if (!bad_sdu && len > 0) {
memcpy(sdu + so, pdu->data, len); memcpy(sdu + so, pdu->data + so - pdu->so, len);
so += len; so += len;
} }
free(pdu->data); free(pdu->data);
......
...@@ -148,7 +148,7 @@ static void reassemble_and_deliver(nr_rlc_entity_um_t *entity, int sn) ...@@ -148,7 +148,7 @@ static void reassemble_and_deliver(nr_rlc_entity_um_t *entity, int sn)
bad_sdu = 1; bad_sdu = 1;
} }
if (!bad_sdu && len > 0) { if (!bad_sdu && len > 0) {
memcpy(sdu + so, pdu->data, len); memcpy(sdu + so, pdu->data + so - pdu->so, len);
so += len; so += len;
} }
free(pdu->data); free(pdu->data);
......
#!/bin/sh #!/bin/sh
test_count=15 test_count=17
for i in `seq $test_count` for i in `seq $test_count`
do do
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
* create the UE RLC AM entity with given parameters * create the UE RLC AM entity with given parameters
* *
* GNB_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length> * GNB_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length>
* create the eNB RLC UM entity with given parameters * create the gNB RLC UM entity with given parameters
* *
* UE_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length> * UE_UM <rx_maxsize> <tx_maxsize> <t_reassembly> <sn_field_length>
* create the UE RLC UM entity with given parameters * create the UE RLC UM entity with given parameters
* *
* GNB_TM <tx_maxsize> * GNB_TM <tx_maxsize>
* create the eNB RLC TM entity with given parameters * create the gNB RLC TM entity with given parameters
* *
* UE_UM <tx_maxsize> * UE_UM <tx_maxsize>
* create the UE RLC TM entity with given parameters * create the UE RLC TM entity with given parameters
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* You must end your test definition with a line 'TIME, -1'. * You must end your test definition with a line 'TIME, -1'.
* *
* GNB_SDU <id> <size> * GNB_SDU <id> <size>
* send an SDU to eNB with id <i> and size <size> * send an SDU to gNB with id <i> and size <size>
* the SDU is [00 01 ... ff 01 ...] * the SDU is [00 01 ... ff 01 ...]
* (ie. start byte is 00 then we increment for each byte, loop if needed) * (ie. start byte is 00 then we increment for each byte, loop if needed)
* *
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
* same as GNB_SDU but the SDU is sent to the UE * same as GNB_SDU but the SDU is sent to the UE
* *
* GNB_PDU <size> <'size' bytes> * GNB_PDU <size> <'size' bytes>
* send a custom PDU from eNB to UE (eNB does not see this PDU at all) * send a custom PDU from gNB to UE (gNB does not see this PDU at all)
* *
* UE_PDU <size> <'size' bytes> * UE_PDU <size> <'size' bytes>
* send a custom PDU from UE to eNB (UE does not see this PDU at all) * send a custom PDU from UE to gNB (UE does not see this PDU at all)
* *
* GNB_PDU_SIZE <size> * GNB_PDU_SIZE <size>
* set 'gnb_pdu_size' * set 'gnb_pdu_size'
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
* that the test must fail (ie. exit with non zero, crash not allowed) * that the test must fail (ie. exit with non zero, crash not allowed)
* *
* GNB_BUFFER_STATUS * GNB_BUFFER_STATUS
* call buffer_status for eNB and print result * call buffer_status for gNB and print result
* *
* UE_BUFFER_STATUS * UE_BUFFER_STATUS
* call buffer_status for UE and print result * call buffer_status for UE and print result
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
* discards given SDU * discards given SDU
* *
* RE_ESTABLISH * RE_ESTABLISH
* re-establish both eNB and UE * re-establish both gNB and UE
*/ */
enum action { enum action {
...@@ -368,7 +368,7 @@ int test_main(void) ...@@ -368,7 +368,7 @@ int test_main(void)
pos += 2; pos += 2;
break; break;
case RE_ESTABLISH: case RE_ESTABLISH:
printf("TEST: %d: re-establish eNB and UE\n", i); printf("TEST: %d: re-establish gNB and UE\n", i);
gnb->reestablishment(gnb); gnb->reestablishment(gnb);
ue->reestablishment(ue); ue->reestablishment(ue);
pos++; pos++;
......
/*
* am test (SN field size 18):
* there was a bug when we receive a full PDU after receiving only the
* beginning of it; the data was copied at the end but from the start of the
* full PDU instead of the correct offset. This test captures this case.
* Gnb sends the start of a PDU then the full PDU. That is the SDU is
* [00 .. 09]. First gnb sends [00 .. 08] then it sends [00 .. 09].
*/
TIME, 1,
GNB_AM, 100000, 100000, 45, 35, 0, -1, -1, 8, 18,
UE_AM, 100000, 100000, 45, 35, 0, -1, -1, 8, 18,
GNB_PDU_SIZE, 12,
UE_PDU_SIZE, 20,
GNB_PDU, 12, 0x90, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
TIME, 2,
GNB_PDU_SIZE, 20,
GNB_PDU, 13, 0xc0, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
TIME, -1
/*
* um test (SN field size 12):
* same problem as for test16, but we test by sending [00 .. 08] then
* [02 .. 09] (they overlap, the full SDU is [00 .. 09]), which probably
* never occurs in practice but triggers the bug. Doing as for test16 does
* not trigger the bug.
*/
TIME, 1,
GNB_UM, 100000, 100000, 35, 12,
UE_UM, 100000, 100000, 35, 12,
GNB_PDU_SIZE, 8,
UE_PDU_SIZE, 20,
GNB_PDU, 11, 0x40, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
TIME, 2,
GNB_PDU_SIZE, 20,
GNB_PDU, 12, 0x80, 0x00, 0x00, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
TIME, -1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment