dealloc SCH pdu in MAC instead of pdu_queue

- this is basically e9fcb10c9e
  but with the counterpart in the eNB's MAC
This commit is contained in:
Andre Puschmann 2018-05-10 16:36:55 +02:00
parent 9230d111ce
commit 718a15608c
4 changed files with 9 additions and 6 deletions

View File

@ -93,6 +93,10 @@ public:
#endif
}
uint32_t nof_available_pdus() {
return available.size();
}
bool is_almost_empty() {
return available.size() < capacity/20;
}

View File

@ -48,7 +48,7 @@ uint8_t* pdu_queue::request(uint32_t len)
fprintf(stderr, "Error request buffer of invalid size %d. Max bytes %d\n", len, MAX_PDU_LEN);
return NULL;
}
pdu_t *pdu = pool.allocate();
pdu_t *pdu = pool.allocate("pdu_queue::request");
if (!pdu) {
if (log_h) {
log_h->error("Not enough buffers for MAC PDU\n");
@ -96,11 +96,6 @@ bool pdu_queue::process_pdus()
if (callback) {
callback->process_pdu(pdu->ptr, pdu->len, pdu->channel, pdu->tstamp);
}
if (pdu->channel == DCH) {
if (!pool.deallocate(pdu)) {
log_h->warning("Error deallocating from buffer pool in process_pdus(): buffer not created in this pool.\n");
}
}
cnt++;
have_data = true;
}

View File

@ -152,6 +152,8 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe
pcap->write_ul_crnti(pdu, nof_bytes, rnti, true, last_tti);
}
pdus.deallocate(pdu);
uint32_t lcid_most_data = 0;
int most_data = -99;

View File

@ -148,6 +148,8 @@ void demux::process_pdu(uint8_t *mac_pdu, uint32_t nof_bytes, srslte::pdu_queue:
process_sch_pdu(&mac_msg);
//srslte_vec_fprint_byte(stdout, mac_pdu, nof_bytes);
pdus.deallocate(mac_pdu);
break;
case srslte::pdu_queue::BCH:
rlc->write_pdu_bcch_dlsch(mac_pdu, nof_bytes);