diff --git a/lib/include/srslte/upper/rlc_common.h b/lib/include/srslte/upper/rlc_common.h index 71fe934df..3b1cec6a2 100644 --- a/lib/include/srslte/upper/rlc_common.h +++ b/lib/include/srslte/upper/rlc_common.h @@ -37,7 +37,7 @@ namespace srslte { ***************************************************************************/ #define RLC_AM_WINDOW_SIZE 512 - +#define RLC_MAX_SDU_SIZE ((1<<11)-1) // Length of LI field is 11bits typedef enum{ diff --git a/lib/include/srslte/upper/rlc_um.h b/lib/include/srslte/upper/rlc_um.h index 92a7822d5..b0fb2c13d 100644 --- a/lib/include/srslte/upper/rlc_um.h +++ b/lib/include/srslte/upper/rlc_um.h @@ -39,8 +39,6 @@ namespace srslte { -#define RLC_UM_MAX_SDU_SIZE (2048-1) // Length of LI field is 11bits - struct rlc_umd_pdu_t{ rlc_umd_pdu_header_t header; byte_buffer_t *buf; diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index 5cf561415..886de474a 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -210,6 +210,13 @@ void rlc::empty_queue() void rlc::write_sdu(uint32_t lcid, byte_buffer_t *sdu, bool blocking) { + // FIXME: rework build PDU logic to allow large SDUs (without concatenation) + if (sdu->N_bytes > RLC_MAX_SDU_SIZE) { + rlc_log->warning("Dropping too long SDU of size %d B (Max. size %d B).\n", sdu->N_bytes, RLC_MAX_SDU_SIZE); + pool->deallocate(sdu); + return; + } + pthread_rwlock_rdlock(&rwlock); if (valid_lcid(lcid)) { rlc_array.at(lcid)->write_sdu(sdu, blocking); diff --git a/lib/src/upper/rlc_am.cc b/lib/src/upper/rlc_am.cc index 7c2e18b0f..bd0acbeff 100644 --- a/lib/src/upper/rlc_am.cc +++ b/lib/src/upper/rlc_am.cc @@ -920,7 +920,7 @@ int rlc_am::rlc_am_tx::build_data_pdu(uint8_t *payload, uint32_t nof_bytes) } // Pull SDUs from queue - while (pdu_space > head_len + 1 && tx_sdu_queue.size() > 0) { + while (pdu_space > head_len + 1 && tx_sdu_queue.size() > 0 && header.N_li < RLC_AM_WINDOW_SIZE) { if (last_li > 0) { header.li[header.N_li] = last_li; header.N_li++; diff --git a/lib/src/upper/rlc_um.cc b/lib/src/upper/rlc_um.cc index 7145a8b66..4fee0e7b6 100644 --- a/lib/src/upper/rlc_um.cc +++ b/lib/src/upper/rlc_um.cc @@ -151,11 +151,6 @@ uint32_t rlc_um::get_bearer() ***************************************************************************/ void rlc_um::write_sdu(byte_buffer_t *sdu, bool blocking) { - if (sdu->N_bytes > RLC_UM_MAX_SDU_SIZE) { - log->warning("Dropping too long SDU of size %d B (Max. size %d B).", sdu->N_bytes, RLC_UM_MAX_SDU_SIZE); - pool->deallocate(sdu); - } - if (blocking) { tx.write_sdu(sdu); } else {