dealloc SCH pdu in MAC instead of pdu_queue

- this is basically e9fcb10c9e
  but with the counterpart in the eNB's MAC
master
Andre Puschmann 7 years ago
parent 9230d111ce
commit 718a15608c

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

@ -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); fprintf(stderr, "Error request buffer of invalid size %d. Max bytes %d\n", len, MAX_PDU_LEN);
return NULL; return NULL;
} }
pdu_t *pdu = pool.allocate(); pdu_t *pdu = pool.allocate("pdu_queue::request");
if (!pdu) { if (!pdu) {
if (log_h) { if (log_h) {
log_h->error("Not enough buffers for MAC PDU\n"); log_h->error("Not enough buffers for MAC PDU\n");
@ -96,11 +96,6 @@ bool pdu_queue::process_pdus()
if (callback) { if (callback) {
callback->process_pdu(pdu->ptr, pdu->len, pdu->channel, pdu->tstamp); 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++; cnt++;
have_data = true; have_data = true;
} }

@ -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); pcap->write_ul_crnti(pdu, nof_bytes, rnti, true, last_tti);
} }
pdus.deallocate(pdu);
uint32_t lcid_most_data = 0; uint32_t lcid_most_data = 0;
int most_data = -99; int most_data = -99;

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

Loading…
Cancel
Save