mirror of https://github.com/PentHertz/srsLTE.git
fix log initialization in sched_helpers.cc
This commit is contained in:
parent
afef5188a6
commit
1dd211c91c
|
@ -151,6 +151,8 @@ void log_dl_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_i
|
||||||
/// Logs PHICH contents
|
/// Logs PHICH contents
|
||||||
void log_phich_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::ul_sched_res_t& result);
|
void log_phich_cc_results(srslte::log_ref log_h, uint32_t enb_cc_idx, const sched_interface::ul_sched_res_t& result);
|
||||||
|
|
||||||
|
const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir);
|
||||||
|
|
||||||
} // namespace srsenb
|
} // namespace srsenb
|
||||||
|
|
||||||
#endif // SRSLTE_SCHED_HELPERS_H
|
#endif // SRSLTE_SCHED_HELPERS_H
|
||||||
|
|
|
@ -87,8 +87,6 @@ private:
|
||||||
cc_st cc_state_ = cc_st::idle;
|
cc_st cc_state_ = cc_st::idle;
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir);
|
|
||||||
|
|
||||||
/** This class is designed to be thread-safe because it is called from workers through scheduler thread and from
|
/** This class is designed to be thread-safe because it is called from workers through scheduler thread and from
|
||||||
* higher layers and mac threads.
|
* higher layers and mac threads.
|
||||||
*/
|
*/
|
||||||
|
@ -257,7 +255,6 @@ private:
|
||||||
bool phy_config_dedicated_enabled = false;
|
bool phy_config_dedicated_enabled = false;
|
||||||
|
|
||||||
tti_point current_tti;
|
tti_point current_tti;
|
||||||
std::array<tti_point, 4> last_ttis;
|
|
||||||
std::vector<cc_sched_ue> carriers; ///< map of UE CellIndex to carrier configuration
|
std::vector<cc_sched_ue> carriers; ///< map of UE CellIndex to carrier configuration
|
||||||
std::vector<int> enb_ue_cc_idx_map;
|
std::vector<int> enb_ue_cc_idx_map;
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
#include "srslte/srslog/bundled/fmt/format.h"
|
#include "srslte/srslog/bundled/fmt/format.h"
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
#define Info(fmt, ...) mac_log->error(fmt, ##__VA_ARGS__)
|
#define Debug(fmt, ...) srslte::logmap::get("MAC")->debug(fmt, ##__VA_ARGS__)
|
||||||
#define Error(fmt, ...) mac_log->error(fmt, ##__VA_ARGS__)
|
#define Info(fmt, ...) srslte::logmap::get("MAC")->info(fmt, ##__VA_ARGS__)
|
||||||
|
#define Warning(fmt, ...) srslte::logmap::get("MAC")->warning(fmt, ##__VA_ARGS__)
|
||||||
|
#define Error(fmt, ...) srslte::logmap::get("MAC")->error(fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
namespace srsenb {
|
namespace srsenb {
|
||||||
|
|
||||||
srslte::log_ref mac_log{"MAC"};
|
|
||||||
|
|
||||||
using dl_sched_res_t = sched_interface::dl_sched_res_t;
|
using dl_sched_res_t = sched_interface::dl_sched_res_t;
|
||||||
using dl_sched_data_t = sched_interface::dl_sched_data_t;
|
using dl_sched_data_t = sched_interface::dl_sched_data_t;
|
||||||
using custom_mem_buffer = fmt::basic_memory_buffer<char, 1024>;
|
using custom_mem_buffer = fmt::basic_memory_buffer<char, 1024>;
|
||||||
|
@ -303,6 +303,8 @@ void generate_cce_location(srslte_regs_t* regs_,
|
||||||
uint32_t
|
uint32_t
|
||||||
get_aggr_level(uint32_t nof_bits, uint32_t dl_cqi, uint32_t max_aggr_lvl, uint32_t cell_nof_prb, bool use_tbs_index_alt)
|
get_aggr_level(uint32_t nof_bits, uint32_t dl_cqi, uint32_t max_aggr_lvl, uint32_t cell_nof_prb, bool use_tbs_index_alt)
|
||||||
{
|
{
|
||||||
|
static srslte::log_ref cached_log = srslte::logmap::get("MAC");
|
||||||
|
|
||||||
uint32_t l = 0;
|
uint32_t l = 0;
|
||||||
float max_coderate = srslte_cqi_to_coderate(dl_cqi, use_tbs_index_alt);
|
float max_coderate = srslte_cqi_to_coderate(dl_cqi, use_tbs_index_alt);
|
||||||
float coderate;
|
float coderate;
|
||||||
|
@ -319,7 +321,7 @@ get_aggr_level(uint32_t nof_bits, uint32_t dl_cqi, uint32_t max_aggr_lvl, uint32
|
||||||
l++;
|
l++;
|
||||||
} while (l < l_max && factor * coderate > max_coderate);
|
} while (l < l_max && factor * coderate > max_coderate);
|
||||||
|
|
||||||
mac_log->debug("SCHED: CQI=%d, l=%d, nof_bits=%d, coderate=%.2f, max_coderate=%.2f\n",
|
cached_log->debug("SCHED: CQI=%d, l=%d, nof_bits=%d, coderate=%.2f, max_coderate=%.2f\n",
|
||||||
dl_cqi,
|
dl_cqi,
|
||||||
l,
|
l,
|
||||||
nof_bits,
|
nof_bits,
|
||||||
|
@ -328,6 +330,10 @@ get_aggr_level(uint32_t nof_bits, uint32_t dl_cqi, uint32_t max_aggr_lvl, uint32
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************
|
||||||
|
* sched_interface helper functions
|
||||||
|
*******************************************************/
|
||||||
|
|
||||||
/// sanity check the UE CC configuration
|
/// sanity check the UE CC configuration
|
||||||
int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg)
|
int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg)
|
||||||
{
|
{
|
||||||
|
@ -344,13 +350,13 @@ int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (not cc1.dl_cfg.cqi_report.periodic_configured and not cc1.dl_cfg.cqi_report.aperiodic_configured) {
|
if (not cc1.dl_cfg.cqi_report.periodic_configured and not cc1.dl_cfg.cqi_report.aperiodic_configured) {
|
||||||
mac_log->warning("SCHED: No CQI configuration was provided for UE scell index=%d \n", i);
|
Warning("SCHED: No CQI configuration was provided for UE scell index=%d \n", i);
|
||||||
ret = SRSLTE_ERROR;
|
ret = SRSLTE_ERROR;
|
||||||
} else if (cc1.dl_cfg.cqi_report.periodic_configured) {
|
} else if (cc1.dl_cfg.cqi_report.periodic_configured) {
|
||||||
for (uint32_t j = i + 1; j < cc_list.size(); ++j) {
|
for (uint32_t j = i + 1; j < cc_list.size(); ++j) {
|
||||||
if (cc_list[j].active and cc_list[j].dl_cfg.cqi_report.periodic_configured and
|
if (cc_list[j].active and cc_list[j].dl_cfg.cqi_report.periodic_configured and
|
||||||
cc_list[j].dl_cfg.cqi_report.pmi_idx == cc1.dl_cfg.cqi_report.pmi_idx) {
|
cc_list[j].dl_cfg.cqi_report.pmi_idx == cc1.dl_cfg.cqi_report.pmi_idx) {
|
||||||
mac_log->warning(
|
Warning(
|
||||||
"SCHED: The provided CQI configurations for UE scells %d and %d collide in time resources.\n", i, j);
|
"SCHED: The provided CQI configurations for UE scells %d and %d collide in time resources.\n", i, j);
|
||||||
ret = SRSLTE_ERROR;
|
ret = SRSLTE_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -361,4 +367,20 @@ int check_ue_cfg_correctness(const sched_interface::ue_cfg_t& ue_cfg)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir)
|
||||||
|
{
|
||||||
|
switch (dir) {
|
||||||
|
case sched_interface::ue_bearer_cfg_t::IDLE:
|
||||||
|
return "idle";
|
||||||
|
case sched_interface::ue_bearer_cfg_t::BOTH:
|
||||||
|
return "bi-dir";
|
||||||
|
case sched_interface::ue_bearer_cfg_t::DL:
|
||||||
|
return "DL";
|
||||||
|
case sched_interface::ue_bearer_cfg_t::UL:
|
||||||
|
return "UL";
|
||||||
|
default:
|
||||||
|
return "unrecognized direction";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace srsenb
|
} // namespace srsenb
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "srsenb/hdr/stack/mac/sched_ue_ctrl/sched_lch.h"
|
#include "srsenb/hdr/stack/mac/sched_ue_ctrl/sched_lch.h"
|
||||||
#include "srsenb/hdr/stack/mac/sched_common.h"
|
#include "srsenb/hdr/stack/mac/sched_helpers.h"
|
||||||
#include "srslte/common/log_helper.h"
|
#include "srslte/common/log_helper.h"
|
||||||
|
|
||||||
namespace srsenb {
|
namespace srsenb {
|
||||||
|
@ -54,22 +54,6 @@ uint32_t get_ul_mac_sdu_size_with_overhead(uint32_t rlc_pdu_bytes)
|
||||||
*
|
*
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
|
|
||||||
const char* to_string(sched_interface::ue_bearer_cfg_t::direction_t dir)
|
|
||||||
{
|
|
||||||
switch (dir) {
|
|
||||||
case sched_interface::ue_bearer_cfg_t::IDLE:
|
|
||||||
return "idle";
|
|
||||||
case sched_interface::ue_bearer_cfg_t::BOTH:
|
|
||||||
return "bi-dir";
|
|
||||||
case sched_interface::ue_bearer_cfg_t::DL:
|
|
||||||
return "DL";
|
|
||||||
case sched_interface::ue_bearer_cfg_t::UL:
|
|
||||||
return "UL";
|
|
||||||
default:
|
|
||||||
return "unrecognized direction";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void lch_ue_manager::set_cfg(const sched_interface::ue_cfg_t& cfg)
|
void lch_ue_manager::set_cfg(const sched_interface::ue_cfg_t& cfg)
|
||||||
{
|
{
|
||||||
for (uint32_t lcid = 0; lcid < sched_interface::MAX_LC; lcid++) {
|
for (uint32_t lcid = 0; lcid < sched_interface::MAX_LC; lcid++) {
|
||||||
|
|
Loading…
Reference in New Issue