• Robert Schmidt's avatar
    Avoid huge calloc by alloc'ing TBs independently · 84c69e50
    Robert Schmidt authored
    Prior to this this commit, the structure NR_UE_info_t is 4881632 bytes.
    On some machines, e.g., one of the CI systems, this can lead to realtime
    problems when doing the initial calloc() of the data structure.
    
    Commit e586efb2 ("Enable 32 HARQ
    Processes in DL, UL") introduced the real-time problems by increasing
    the number of HARQ processes.
    
    The reason NR_UE_info_t is that big is that it contains buffers for DL
    HARQ data that might need to be retransmitted (the L1 is stateless, it
    cannot store this for the L2). To reduce the size, dynamically allocate
    the DL HARQ buffers when they are needed. This also reduces the size of
    NR_UE_info_t to 15840 bytes.
    
    Encapsulate transportBlock in byte_array and accessory functions, and
    allocate in big chunks of multiple of ~32kB.
    Reported-By: default avatarCedric Roux <cedric.roux@eurecom.fr>
    Fixes: e586efb2
    Closes: #875
    84c69e50
gNB_scheduler_primitives.c 153 KB