limit maximum allowd RLC SDU size

master
Andre Puschmann 6 years ago
parent 27df357a66
commit e06e5b8b60

@ -37,7 +37,7 @@ namespace srslte {
***************************************************************************/ ***************************************************************************/
#define RLC_AM_WINDOW_SIZE 512 #define RLC_AM_WINDOW_SIZE 512
#define RLC_MAX_SDU_SIZE ((1<<11)-1) // Length of LI field is 11bits
typedef enum{ typedef enum{

@ -39,8 +39,6 @@
namespace srslte { namespace srslte {
#define RLC_UM_MAX_SDU_SIZE (2048-1) // Length of LI field is 11bits
struct rlc_umd_pdu_t{ struct rlc_umd_pdu_t{
rlc_umd_pdu_header_t header; rlc_umd_pdu_header_t header;
byte_buffer_t *buf; byte_buffer_t *buf;

@ -210,6 +210,13 @@ void rlc::empty_queue()
void rlc::write_sdu(uint32_t lcid, byte_buffer_t *sdu, bool blocking) 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); pthread_rwlock_rdlock(&rwlock);
if (valid_lcid(lcid)) { if (valid_lcid(lcid)) {
rlc_array.at(lcid)->write_sdu(sdu, blocking); rlc_array.at(lcid)->write_sdu(sdu, blocking);

@ -920,7 +920,7 @@ int rlc_am::rlc_am_tx::build_data_pdu(uint8_t *payload, uint32_t nof_bytes)
} }
// Pull SDUs from queue // 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) { if (last_li > 0) {
header.li[header.N_li] = last_li; header.li[header.N_li] = last_li;
header.N_li++; header.N_li++;

@ -151,11 +151,6 @@ uint32_t rlc_um::get_bearer()
***************************************************************************/ ***************************************************************************/
void rlc_um::write_sdu(byte_buffer_t *sdu, bool blocking) 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) { if (blocking) {
tx.write_sdu(sdu); tx.write_sdu(sdu);
} else { } else {

Loading…
Cancel
Save