bugfix,srsenb,mac: avoid sanity check for UL PDU length if CRC=KO

master
Francisco 3 years ago committed by Francisco Paisana
parent 76004a3054
commit fd1d73666c

@ -71,7 +71,7 @@ public:
uint8_t* request_pdu(tti_point tti, uint32_t len);
srsran::unique_byte_buffer_t release_pdu(tti_point tti, uint32_t len);
srsran::unique_byte_buffer_t release_pdu(tti_point tti);
void clear_old_pdus(tti_point current_tti);
@ -157,7 +157,7 @@ public:
uint8_t* request_buffer(uint32_t tti, uint32_t ue_cc_idx, const uint32_t len);
void process_pdu(srsran::unique_byte_buffer_t pdu, uint32_t grant_nof_prbs);
srsran::unique_byte_buffer_t release_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len);
srsran::unique_byte_buffer_t release_pdu(uint32_t tti, uint32_t ue_cc_idx);
void clear_old_buffers(uint32_t tti);
void metrics_read(mac_ue_metrics_t* metrics_);

@ -363,7 +363,7 @@ int mac::push_pdu(uint32_t tti_rx,
}
uint32_t ue_cc_idx = enb_ue_cc_map[enb_cc_idx];
srsran::unique_byte_buffer_t pdu = ue_db[rnti]->release_pdu(tti_rx, ue_cc_idx, nof_bytes);
srsran::unique_byte_buffer_t pdu = ue_db[rnti]->release_pdu(tti_rx, ue_cc_idx);
if (pdu == nullptr) {
logger.warning("Could not find MAC UL PDU for rnti=0x%x, cc=%d, tti=%d", rnti, enb_cc_idx, tti_rx);
return SRSRAN_ERROR;
@ -372,6 +372,12 @@ int mac::push_pdu(uint32_t tti_rx,
// push the pdu through the queue if received correctly
if (crc) {
logger.info("Pushing PDU rnti=0x%x, tti_rx=%d, nof_bytes=%d", rnti, tti_rx, nof_bytes);
srsran_expect(nof_bytes == pdu->size(),
"Inconsistent PDU length for rnti=0x%x, tti_rx=%d (%d!=%d)",
rnti,
tti_rx,
nof_bytes,
(int)pdu->size());
auto process_pdu_task = [this, rnti, ul_nof_prbs](srsran::unique_byte_buffer_t& pdu) {
srsran::rwlock_read_guard lock(rwlock);
if (ue_db.contains(rnti)) {
@ -830,7 +836,7 @@ void mac::build_mch_sched(uint32_t tbs)
int mac::get_mch_sched(uint32_t tti, bool is_mcch, dl_sched_list_t& dl_sched_res_list)
{
srsran::rwlock_read_guard lock(rwlock);
dl_sched_t* dl_sched_res = &dl_sched_res_list[0];
dl_sched_t* dl_sched_res = &dl_sched_res_list[0];
logger.set_context(tti);
srsran_ra_tb_t mcs = {};
srsran_ra_tb_t mcs_data = {};

@ -69,7 +69,7 @@ cc_used_buffers_map::~cc_used_buffers_map()
clear();
}
srsran::unique_byte_buffer_t cc_used_buffers_map::release_pdu(tti_point tti, uint32_t len)
srsran::unique_byte_buffer_t cc_used_buffers_map::release_pdu(tti_point tti)
{
if (not has_tti(tti)) {
return nullptr;
@ -77,7 +77,6 @@ srsran::unique_byte_buffer_t cc_used_buffers_map::release_pdu(tti_point tti, uin
// Extract PDU from PDU map
srsran::unique_byte_buffer_t pdu = std::move(pdu_map[tti.to_uint()]);
srsran_expect(pdu->size() == len, "UL buffers: Inconsistent UL PDU length for tti=%d", tti.to_uint());
// clear entry in map
pdu_map.erase(tti.to_uint());
@ -378,10 +377,10 @@ void ue::process_pdu(srsran::unique_byte_buffer_t pdu, uint32_t grant_nof_prbs)
logger.debug("MAC PDU processed");
}
srsran::unique_byte_buffer_t ue::release_pdu(uint32_t tti, uint32_t ue_cc_idx, uint32_t len)
srsran::unique_byte_buffer_t ue::release_pdu(uint32_t tti, uint32_t ue_cc_idx)
{
std::lock_guard<std::mutex> lock(rx_buffers_mutex);
return cc_buffers[ue_cc_idx].get_rx_used_buffers().release_pdu(tti_point(tti), len);
return cc_buffers[ue_cc_idx].get_rx_used_buffers().release_pdu(tti_point(tti));
}
bool ue::process_ce(srsran::sch_subh* subh, uint32_t grant_nof_prbs)

Loading…
Cancel
Save