From 595ed70cae0c4fd55b7e051335321f8be46e9fe3 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 8 May 2018 21:41:33 +0200 Subject: [PATCH] Revert "Deallocate SCH pdu on demux instead of pdu_queue" This reverts commit e9fcb10c9e888dd56a7cf662092f7f1e374a61d9. --- lib/include/srslte/common/buffer_pool.h | 4 ---- lib/src/common/pdu_queue.cc | 5 +++++ srsue/src/mac/demux.cc | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/include/srslte/common/buffer_pool.h b/lib/include/srslte/common/buffer_pool.h index eee04caa8..1895c8330 100644 --- a/lib/include/srslte/common/buffer_pool.h +++ b/lib/include/srslte/common/buffer_pool.h @@ -93,10 +93,6 @@ public: #endif } - uint32_t nof_available_pdus() { - return available.size(); - } - bool is_almost_empty() { return available.size() < capacity/20; } diff --git a/lib/src/common/pdu_queue.cc b/lib/src/common/pdu_queue.cc index 8e9656116..9b5e83c7b 100644 --- a/lib/src/common/pdu_queue.cc +++ b/lib/src/common/pdu_queue.cc @@ -96,6 +96,11 @@ 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; } diff --git a/srsue/src/mac/demux.cc b/srsue/src/mac/demux.cc index dd481c76c..640b78bd5 100644 --- a/srsue/src/mac/demux.cc +++ b/srsue/src/mac/demux.cc @@ -148,8 +148,6 @@ 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);