enb - decreased default enb.conf mac.max_nof_ues to 8 to avoid large memory pool preallocations

master
Francisco 4 years ago committed by Francisco Paisana
parent 71f1f1b556
commit 8fe27a72d0

@ -32,6 +32,14 @@
} \ } \
} while (0) } while (0)
#define ASSERT_VALID_CFG(cond, msg_fmt, ...) \
do { \
if (not(cond)) { \
fprintf(stderr, "Error: Invalid configuration - " msg_fmt, ##__VA_ARGS__); \
return SRSRAN_ERROR; \
} \
} while (0)
using namespace asn1::rrc; using namespace asn1::rrc;
namespace srsenb { namespace srsenb {
@ -893,11 +901,12 @@ int parse_cfg_files(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_)
int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_, const srsran_cell_t& cell_cfg_) int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_, const srsran_cell_t& cell_cfg_)
{ {
// Sanity check // Sanity checks
if (rrc_cfg_->cell_list.empty()) { ASSERT_VALID_CFG(not rrc_cfg_->cell_list.empty(), "No cell specified in rr.conf.");
ERROR("No cell specified in RR config."); ASSERT_VALID_CFG(args_->stack.mac.max_nof_ues <= SRSENB_MAX_UES and args_->stack.mac.max_nof_ues > 0,
return SRSRAN_ERROR; "mac.max_nof_ues=%d must be within [0, %d]",
} args_->stack.mac.max_nof_ues,
SRSENB_MAX_UES);
// Check for a forced DL EARFCN or frequency (only valid for a single cell config (Xico's favorite feature)) // Check for a forced DL EARFCN or frequency (only valid for a single cell config (Xico's favorite feature))
if (rrc_cfg_->cell_list.size() == 1) { if (rrc_cfg_->cell_list.size() == 1) {

@ -213,7 +213,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("expert.print_buffer_state", bpo::value<bool>(&args->general.print_buffer_state)->default_value(false), "Prints on the console the buffer state every 10 seconds") ("expert.print_buffer_state", bpo::value<bool>(&args->general.print_buffer_state)->default_value(false), "Prints on the console the buffer state every 10 seconds")
("expert.eea_pref_list", bpo::value<string>(&args->general.eea_pref_list)->default_value("EEA0, EEA2, EEA1"), "Ordered preference list for the selection of encryption algorithm (EEA) (default: EEA0, EEA2, EEA1).") ("expert.eea_pref_list", bpo::value<string>(&args->general.eea_pref_list)->default_value("EEA0, EEA2, EEA1"), "Ordered preference list for the selection of encryption algorithm (EEA) (default: EEA0, EEA2, EEA1).")
("expert.eia_pref_list", bpo::value<string>(&args->general.eia_pref_list)->default_value("EIA2, EIA1, EIA0"), "Ordered preference list for the selection of integrity algorithm (EIA) (default: EIA2, EIA1, EIA0).") ("expert.eia_pref_list", bpo::value<string>(&args->general.eia_pref_list)->default_value("EIA2, EIA1, EIA0"), "Ordered preference list for the selection of integrity algorithm (EIA) (default: EIA2, EIA1, EIA0).")
("expert.max_nof_ues", bpo::value<uint32_t>(&args->stack.mac.max_nof_ues)->default_value(64), "Maximum number of connected UEs") ("expert.max_nof_ues", bpo::value<uint32_t>(&args->stack.mac.max_nof_ues)->default_value(8), "Maximum number of connected UEs")
("expert.max_mac_dl_kos", bpo::value<uint32_t>(&args->general.max_mac_dl_kos)->default_value(100), "Maximum number of consecutive KOs before triggering the UE's release") ("expert.max_mac_dl_kos", bpo::value<uint32_t>(&args->general.max_mac_dl_kos)->default_value(100), "Maximum number of consecutive KOs before triggering the UE's release")
// eMBMS section // eMBMS section

@ -466,8 +466,7 @@ uint16_t mac::allocate_ue()
logger.error("UE pool empty. Ignoring RACH attempt."); logger.error("UE pool empty. Ignoring RACH attempt.");
return SRSRAN_INVALID_RNTI; return SRSRAN_INVALID_RNTI;
} }
uint16_t rnti = ue_ptr->get_rnti(); uint16_t rnti = ue_ptr->get_rnti();
size_t max_ues = std::min((size_t)args.max_nof_ues, ue_db.capacity());
// Add UE to map // Add UE to map
{ {
@ -477,7 +476,7 @@ uint16_t mac::allocate_ue()
return SRSRAN_INVALID_RNTI; return SRSRAN_INVALID_RNTI;
} }
if (ue_db.size() >= args.max_nof_ues) { if (ue_db.size() >= args.max_nof_ues) {
logger.warning("Maximum number of connected UEs %zd connected to the eNB. Ignoring PRACH", max_ues); logger.warning("Maximum number of connected UEs %zd connected to the eNB. Ignoring PRACH", args.max_nof_ues);
return SRSRAN_INVALID_RNTI; return SRSRAN_INVALID_RNTI;
} }
auto ret = ue_db.insert(rnti, std::move(ue_ptr)); auto ret = ue_db.insert(rnti, std::move(ue_ptr));

Loading…
Cancel
Save