From 9b6e18d84fac5ec28412115ede38c1ab65da2112 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 30 Jan 2018 13:27:03 +0100 Subject: [PATCH] Lower srsENB priorities below UHD threads --- lib/include/srslte/common/buffer_pool.h | 8 ++++++-- lib/include/srslte/common/common.h | 2 +- srsenb/hdr/mac/mac.h | 2 +- srsenb/hdr/upper/gtpu.h | 2 +- srsenb/hdr/upper/rrc.h | 2 +- srsenb/hdr/upper/s1ap.h | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/include/srslte/common/buffer_pool.h b/lib/include/srslte/common/buffer_pool.h index 567203c75..16d21dce8 100644 --- a/lib/include/srslte/common/buffer_pool.h +++ b/lib/include/srslte/common/buffer_pool.h @@ -79,7 +79,10 @@ public: printf("%s\n", strlen(used[i]->debug_name)?used[i]->debug_name:"Undefined"); } } - + + bool is_almost_empty() { + return available.size() < capacity/20; + } buffer_t* allocate(const char *debug_name = NULL) { @@ -92,8 +95,9 @@ public: used.push_back(b); available.pop(); - if (available.size() < capacity/20) { + if (is_almost_empty()) { printf("Warning buffer pool capacity is %f %%\n", (float) 100*available.size()/capacity); + print_all_buffers(); } #ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED if (debug_name) { diff --git a/lib/include/srslte/common/common.h b/lib/include/srslte/common/common.h index 41a89fb36..ddd558016 100644 --- a/lib/include/srslte/common/common.h +++ b/lib/include/srslte/common/common.h @@ -63,7 +63,7 @@ #define SRSLTE_MAX_BUFFER_SIZE_BYTES 12756 #define SRSLTE_BUFFER_HEADER_OFFSET 1024 -//#define SRSLTE_BUFFER_POOL_LOG_ENABLED +#define SRSLTE_BUFFER_POOL_LOG_ENABLED #ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED #define pool_allocate (pool->allocate(__FUNCTION__)) diff --git a/srsenb/hdr/mac/mac.h b/srsenb/hdr/mac/mac.h index 4e37d439f..c99b733fb 100644 --- a/srsenb/hdr/mac/mac.h +++ b/srsenb/hdr/mac/mac.h @@ -121,7 +121,7 @@ private: static const uint32_t cfi = 3; srslte_dci_location_t locations[MAX_LOCATIONS]; - static const int MAC_PDU_THREAD_PRIO = 3; + static const int MAC_PDU_THREAD_PRIO = 60; diff --git a/srsenb/hdr/upper/gtpu.h b/srsenb/hdr/upper/gtpu.h index 6ec371655..6958773b6 100644 --- a/srsenb/hdr/upper/gtpu.h +++ b/srsenb/hdr/upper/gtpu.h @@ -84,7 +84,7 @@ public: private: - static const int THREAD_PRIO = 7; + static const int THREAD_PRIO = 65; static const int GTPU_PORT = 2152; srslte::byte_buffer_pool *pool; bool running; diff --git a/srsenb/hdr/upper/rrc.h b/srsenb/hdr/upper/rrc.h index 97741a670..764320cc6 100644 --- a/srsenb/hdr/upper/rrc.h +++ b/srsenb/hdr/upper/rrc.h @@ -321,7 +321,7 @@ private: const static uint32_t LCID_REM_USER = 0xffff0001; bool running; - static const int RRC_THREAD_PRIO = 7; + static const int RRC_THREAD_PRIO = 65; srslte::block_queue rx_pdu_queue; typedef struct { diff --git a/srsenb/hdr/upper/s1ap.h b/srsenb/hdr/upper/s1ap.h index 02e5e207e..714035638 100644 --- a/srsenb/hdr/upper/s1ap.h +++ b/srsenb/hdr/upper/s1ap.h @@ -85,7 +85,7 @@ public: //void ue_capabilities(uint16_t rnti, LIBLTE_RRC_UE_EUTRA_CAPABILITY_STRUCT *caps); private: - static const int S1AP_THREAD_PRIO = 7; + static const int S1AP_THREAD_PRIO = 65; static const int MME_PORT = 36412; static const int ADDR_FAMILY = AF_INET; static const int SOCK_TYPE = SOCK_STREAM;