adding MAC 0 padding support

master
yagoda 4 years ago committed by Justin Tallon
parent 52ef23f40e
commit f90f6f0c7e

@ -25,6 +25,8 @@ public:
* @param gain Relative gain
*/
virtual void cmd_cell_gain(uint32_t cell_id, float gain) = 0;
virtual void toggle_padding() = 0;
};
} // namespace srsenb

@ -21,6 +21,7 @@ namespace srsenb {
struct mac_args_t {
uint32_t nof_prb; ///< Needed to dimension MAC softbuffers for all cells
sched_interface::sched_args_t sched;
int lcid_padding;
int nr_tb_size = -1;
uint32_t nof_prealloc_ues; ///< Number of UE resources to pre-allocate at eNB startup
uint32_t max_nof_kos;

@ -332,6 +332,7 @@ enable = false
#max_prach_offset_us = 30
#nof_prealloc_ues = 8
#rlf_release_timer_ms = 4000
#lcid_padding = 3
#eea_pref_list = EEA0, EEA2, EEA1
#eia_pref_list = EIA2, EIA1, EIA0
#gtpu_tunnel_timeout = 0

@ -137,6 +137,8 @@ public:
// eNodeB command interface
void cmd_cell_gain(uint32_t cell_id, float gain) override;
void toggle_padding() override;
private:
const static int ENB_POOL_SIZE = 1024 * 10;

@ -92,6 +92,7 @@ public:
virtual void stop() = 0;
virtual void toggle_padding() = 0;
// eNB metrics interface
virtual bool get_metrics(stack_metrics_t* metrics) = 0;
};

@ -91,6 +91,7 @@ public:
{
mac.set_sched_dl_tti_mask(tti_mask, nof_sfs);
}
void toggle_padding() override { mac.toggle_padding(); }
void tti_clock() override;
private:

@ -71,6 +71,8 @@ public:
// MAC interface to trigger processing of received PDUs
void process_pdus() final;
void toggle_padding() { srsran::console("padding not available for NR\n"); }
private:
void run_thread() final;
void run_tti_impl(uint32_t tti);

@ -94,6 +94,11 @@ public:
bool process_pdus();
void get_metrics(mac_metrics_t& metrics);
void toggle_padding();
void add_padding();
void write_mcch(const srsran::sib2_mbms_t* sib2_,
const srsran::sib13_t* sib13_,
const srsran::mcch_msg_t* mcch_,
@ -176,8 +181,9 @@ private:
uint8_t mtch_payload_buffer[mtch_payload_len] = {};
// pointer to MAC PCAP object
srsran::mac_pcap* pcap = nullptr;
srsran::mac_pcap_net* pcap_net = nullptr;
srsran::mac_pcap* pcap = nullptr;
srsran::mac_pcap_net* pcap_net = nullptr;
bool do_padding = false;
// Number of rach preambles detected for a cc.
std::vector<uint32_t> detected_rachs;

@ -144,6 +144,7 @@ public:
void start_ta() { ta_fsm.start(); };
uint32_t set_ta_us(float ta_us) { return ta_fsm.push_value(ta_us); };
void tic();
void trigger_padding(int lcid);
uint8_t* generate_pdu(uint32_t ue_cc_idx,
uint32_t harq_pid,

@ -227,4 +227,9 @@ std::string enb::get_build_string()
return ss.str();
}
void enb::toggle_padding()
{
stack->toggle_padding();
}
} // namespace srsenb

@ -216,6 +216,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("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.nof_prealloc_ues", bpo::value<uint32_t>(&args->stack.mac.nof_prealloc_ues)->default_value(8), "Number of UE resources to preallocate during eNB initialization")
("expert.lcid_padding", bpo::value<int>(&args->stack.mac.lcid_padding)->default_value(3), "LCID on which to put MAC padding")
("expert.max_mac_dl_kos", bpo::value<uint32_t>(&args->general.max_mac_dl_kos)->default_value(100), "Maximum number of consecutive KOs in DL before triggering the UE's release")
("expert.max_mac_ul_kos", bpo::value<uint32_t>(&args->general.max_mac_ul_kos)->default_value(100), "Maximum number of consecutive KOs in UL before triggering the UE's release")
("expert.gtpu_tunnel_timeout", bpo::value<uint32_t>(&args->stack.gtpu_indirect_tunnel_timeout_msec)->default_value(0), "Maximum time that GTPU takes to release indirect forwarding tunnel since the last received GTPU PDU. (0 for infinity)")
@ -428,6 +429,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
}
static bool do_metrics = false;
static bool do_padding = false;
static void* input_loop(metrics_stdout* metrics, srsenb::enb_command_interface* control)
{
@ -452,6 +454,14 @@ static void* input_loop(metrics_stdout* metrics, srsenb::enb_command_interface*
cout << "Enter t to restart trace." << endl;
}
metrics->toggle_print(do_metrics);
} else if (cmd[0] == "p") {
do_padding = !do_padding;
if (do_padding) {
cout << "Enter p to stop padding." << endl;
} else {
cout << "Enter p to restart padding." << endl;
}
control->toggle_padding();
} else if (cmd[0] == "q") {
raise(SIGTERM);
} else if (cmd[0] == "cell_gain") {
@ -471,6 +481,7 @@ static void* input_loop(metrics_stdout* metrics, srsenb::enb_command_interface*
cout << " t: starts console trace" << endl;
cout << " q: quit srsenb" << endl;
cout << " cell_gain: set relative cell gain" << endl;
cout << " p: starts MAC padding" << endl;
cout << endl;
}
}

@ -285,6 +285,21 @@ void mac::get_metrics(mac_metrics_t& metrics)
metrics.cc_rach_counter = detected_rachs;
}
void mac::toggle_padding()
{
do_padding = !do_padding;
}
void mac::add_padding()
{
for (auto it = ue_db.begin(); it != ue_db.end(); ++it) {
uint16_t cur_rnti = it->first;
auto ue = it;
scheduler.dl_rlc_buffer_state(ue->first, args.lcid_padding, 20e6, 0);
ue->second->trigger_padding(args.lcid_padding);
}
}
/********************************************************
*
* PHY interface
@ -594,6 +609,9 @@ int mac::get_dl_sched(uint32_t tti_tx_dl, dl_sched_list_t& dl_sched_res_list)
trace_complete_event("mac::get_dl_sched", "total_time");
logger.set_context(TTI_SUB(tti_tx_dl, FDD_HARQ_DELAY_UL_MS));
if (do_padding) {
add_padding();
}
for (uint32_t enb_cc_idx = 0; enb_cc_idx < cell_config.size(); enb_cc_idx++) {
// Run scheduler with current info

@ -732,4 +732,9 @@ void ue::tic()
}
}
void ue::trigger_padding(int lcid)
{
sched->ul_bsr(rnti, lcid, 20e6);
}
} // namespace srsenb

Loading…
Cancel
Save