Allocate a different PDU buffer for each carrier in MAC eNodeB (#1069)

master
Ismael Gomez 5 years ago committed by GitHub
parent 73447972d8
commit 858165f177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,8 @@ public:
rrc_interface_mac* rrc_, rrc_interface_mac* rrc_,
rlc_interface_mac* rlc, rlc_interface_mac* rlc,
srslte::log* log_h); srslte::log* log_h);
uint8_t* generate_pdu(uint32_t harq_pid, uint8_t* generate_pdu(uint32_t ue_cc_idx,
uint32_t harq_pid,
uint32_t tb_idx, uint32_t tb_idx,
sched_interface::dl_sched_pdu_t pdu[sched_interface::MAX_RLC_PDU_LIST], sched_interface::dl_sched_pdu_t pdu[sched_interface::MAX_RLC_PDU_LIST],
uint32_t nof_pdu_elems, uint32_t nof_pdu_elems,
@ -71,8 +72,9 @@ public:
uint8_t* uint8_t*
generate_mch_pdu(uint32_t harq_pid, sched_interface::dl_pdu_mch_t sched, uint32_t nof_pdu_elems, uint32_t grant_size); generate_mch_pdu(uint32_t harq_pid, sched_interface::dl_pdu_mch_t sched, uint32_t nof_pdu_elems, uint32_t grant_size);
srslte_softbuffer_tx_t* get_tx_softbuffer(const uint32_t cc_idx, const uint32_t harq_process, const uint32_t tb_idx); srslte_softbuffer_tx_t*
srslte_softbuffer_rx_t* get_rx_softbuffer(const uint32_t cc_idx, const uint32_t tti); get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, const uint32_t tb_idx);
srslte_softbuffer_rx_t* get_rx_softbuffer(const uint32_t ue_cc_idx, const uint32_t tti);
bool process_pdus(); bool process_pdus();
uint8_t* request_buffer(const uint32_t ue_cc_idx, const uint32_t tti, const uint32_t len); uint8_t* request_buffer(const uint32_t ue_cc_idx, const uint32_t tti, const uint32_t len);
@ -132,7 +134,7 @@ private:
std::vector<cc_buffer_ptr_t> pending_buffers; ///< List of buffer pointer list for Rx std::vector<cc_buffer_ptr_t> pending_buffers; ///< List of buffer pointer list for Rx
// For DL there are two buffers, one for each Transport block // For DL there are two buffers, one for each Transport block
srslte::byte_buffer_t tx_payload_buffer[SRSLTE_FDD_NOF_HARQ][SRSLTE_MAX_TB]; srslte::byte_buffer_t tx_payload_buffer[SRSLTE_MAX_CARRIERS][SRSLTE_FDD_NOF_HARQ][SRSLTE_MAX_TB];
srslte::block_queue<uint32_t> pending_ta_commands; srslte::block_queue<uint32_t> pending_ta_commands;

@ -539,7 +539,8 @@ int mac::get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res_list)
if (sched_result.data[i].nof_pdu_elems[tb] > 0) { if (sched_result.data[i].nof_pdu_elems[tb] > 0) {
/* Get PDU if it's a new transmission */ /* Get PDU if it's a new transmission */
dl_sched_res->pdsch[n].data[tb] = ue_db[rnti]->generate_pdu(sched_result.data[i].dci.pid, dl_sched_res->pdsch[n].data[tb] = ue_db[rnti]->generate_pdu(sched_result.data[i].dci.ue_cc_idx,
sched_result.data[i].dci.pid,
tb, tb,
sched_result.data[i].pdu[tb], sched_result.data[i].pdu[tb],
sched_result.data[i].nof_pdu_elems[tb], sched_result.data[i].nof_pdu_elems[tb],

@ -161,14 +161,15 @@ void ue::set_lcg(uint32_t lcid, uint32_t lcg)
lc_groups[lcg].push_back(lcid); lc_groups[lcg].push_back(lcid);
} }
srslte_softbuffer_rx_t* ue::get_rx_softbuffer(const uint32_t cc_idx, const uint32_t tti) srslte_softbuffer_rx_t* ue::get_rx_softbuffer(const uint32_t ue_cc_idx, const uint32_t tti)
{ {
return &softbuffer_rx.at(cc_idx).at(tti % nof_rx_harq_proc); return &softbuffer_rx.at(ue_cc_idx).at(tti % nof_rx_harq_proc);
} }
srslte_softbuffer_tx_t* ue::get_tx_softbuffer(const uint32_t cc_idx, const uint32_t harq_process, const uint32_t tb_idx) srslte_softbuffer_tx_t*
ue::get_tx_softbuffer(const uint32_t ue_cc_idx, const uint32_t harq_process, const uint32_t tb_idx)
{ {
return &softbuffer_tx.at(cc_idx).at((harq_process * SRSLTE_MAX_TB + tb_idx) % nof_tx_harq_proc); return &softbuffer_tx.at(ue_cc_idx).at((harq_process * SRSLTE_MAX_TB + tb_idx) % nof_tx_harq_proc);
} }
uint8_t* ue::request_buffer(const uint32_t ue_cc_idx, const uint32_t tti, const uint32_t len) uint8_t* ue::request_buffer(const uint32_t ue_cc_idx, const uint32_t tti, const uint32_t len)
@ -493,7 +494,8 @@ void ue::allocate_ce(srslte::sch_pdu* pdu, uint32_t lcid)
} }
} }
uint8_t* ue::generate_pdu(uint32_t harq_pid, uint8_t* ue::generate_pdu(uint32_t ue_cc_idx,
uint32_t harq_pid,
uint32_t tb_idx, uint32_t tb_idx,
sched_interface::dl_sched_pdu_t pdu[sched_interface::MAX_RLC_PDU_LIST], sched_interface::dl_sched_pdu_t pdu[sched_interface::MAX_RLC_PDU_LIST],
uint32_t nof_pdu_elems, uint32_t nof_pdu_elems,
@ -502,16 +504,21 @@ uint8_t* ue::generate_pdu(uint32_t harq_pid,
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
uint8_t* ret = nullptr; uint8_t* ret = nullptr;
if (rlc) { if (rlc) {
tx_payload_buffer[harq_pid][tb_idx].clear(); if (ue_cc_idx < SRSLTE_MAX_CARRIERS && harq_pid < SRSLTE_FDD_NOF_HARQ && tb_idx < SRSLTE_MAX_TB) {
mac_msg_dl.init_tx(&tx_payload_buffer[harq_pid][tb_idx], grant_size, false); tx_payload_buffer[ue_cc_idx][harq_pid][tb_idx].clear();
for (uint32_t i = 0; i < nof_pdu_elems; i++) { mac_msg_dl.init_tx(&tx_payload_buffer[ue_cc_idx][harq_pid][tb_idx], grant_size, false);
if (pdu[i].lcid <= srslte::sch_subh::PHR_REPORT) { for (uint32_t i = 0; i < nof_pdu_elems; i++) {
allocate_sdu(&mac_msg_dl, pdu[i].lcid, pdu[i].nbytes); if (pdu[i].lcid <= srslte::sch_subh::PHR_REPORT) {
} else { allocate_sdu(&mac_msg_dl, pdu[i].lcid, pdu[i].nbytes);
allocate_ce(&mac_msg_dl, pdu[i].lcid); } else {
allocate_ce(&mac_msg_dl, pdu[i].lcid);
}
} }
ret = mac_msg_dl.write_packet(log_h);
} else {
log_h->error(
"Invalid parameters calling generate_pdu: cc_idx=%d, harq_pid=%d, tb_idx=%d\n", ue_cc_idx, harq_pid, tb_idx);
} }
ret = mac_msg_dl.write_packet(log_h);
} else { } else {
std::cout << "Error ue not configured (must call config() first" << std::endl; std::cout << "Error ue not configured (must call config() first" << std::endl;
} }
@ -525,8 +532,8 @@ uint8_t* ue::generate_mch_pdu(uint32_t harq_pid,
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
uint8_t* ret = nullptr; uint8_t* ret = nullptr;
tx_payload_buffer[harq_pid][0].clear(); tx_payload_buffer[0][harq_pid][0].clear();
mch_mac_msg_dl.init_tx(&tx_payload_buffer[harq_pid][0], grant_size); mch_mac_msg_dl.init_tx(&tx_payload_buffer[0][harq_pid][0], grant_size);
for (uint32_t i = 0; i < nof_pdu_elems; i++) { for (uint32_t i = 0; i < nof_pdu_elems; i++) {
if (sched.pdu[i].lcid == srslte::sch_subh::MCH_SCHED_INFO) { if (sched.pdu[i].lcid == srslte::sch_subh::MCH_SCHED_INFO) {

Loading…
Cancel
Save