mac,nr: avoid repacking NR DL retxs

master
Francisco Paisana 3 years ago
parent 01441d143d
commit b311806179

@ -139,7 +139,7 @@ private:
/* Map of active UEs */ /* Map of active UEs */
static const uint16_t FIRST_RNTI = 0x46; static const uint16_t FIRST_RNTI = 0x46;
rnti_map_t<unique_rnti_ptr<ue> > ue_db; rnti_map_t<unique_rnti_ptr<ue> > ue_db;
std::atomic<uint16_t> ue_counter; std::atomic<uint16_t> ue_counter{0};
uint8_t* assemble_rar(sched_interface::dl_sched_rar_grant_t* grants, uint8_t* assemble_rar(sched_interface::dl_sched_rar_grant_t* grants,
uint32_t enb_cc_idx, uint32_t enb_cc_idx,

@ -56,12 +56,11 @@ public:
bool new_retx(slot_point slot_tx, slot_point slot_ack, const prb_grant& grant); bool new_retx(slot_point slot_tx, slot_point slot_ack, const prb_grant& grant);
bool new_retx(slot_point slot_tx, slot_point slot_ack); bool new_retx(slot_point slot_tx, slot_point slot_ack);
const uint32_t pid;
protected:
// NOTE: Has to be used before first tx is dispatched // NOTE: Has to be used before first tx is dispatched
bool set_tbs(uint32_t tbs); bool set_tbs(uint32_t tbs);
const uint32_t pid;
private: private:
struct tb_t { struct tb_t {
bool active = false; bool active = false;
@ -87,13 +86,12 @@ public:
tx_harq_softbuffer& get_softbuffer() { return *softbuffer; } tx_harq_softbuffer& get_softbuffer() { return *softbuffer; }
srsran::unique_byte_buffer_t* get_tx_pdu() { return &pdu; } srsran::unique_byte_buffer_t* get_tx_pdu() { return &pdu; }
// clear and reset softbuffer and PDU for new tx bool new_tx(slot_point slot_tx,
bool set_tbs(uint32_t tbs) slot_point slot_ack,
{ const prb_grant& grant,
softbuffer->reset(); uint32_t mcs,
pdu->clear(); uint32_t tbs,
return harq_proc::set_tbs(tbs); uint32_t max_retx);
}
private: private:
srsran::unique_pool_ptr<tx_harq_softbuffer> softbuffer; srsran::unique_pool_ptr<tx_harq_softbuffer> softbuffer;

@ -281,7 +281,7 @@ int mac_nr::get_dl_sched(const srsran_slot_cfg_t& slot_cfg, dl_sched_t& dl_sched
continue; continue;
} }
for (auto& tb_data : pdsch.data) { for (auto& tb_data : pdsch.data) {
if (tb_data != nullptr) { if (tb_data != nullptr and tb_data->N_bytes == 0) {
// TODO: exclude retx from packing // TODO: exclude retx from packing
ue_db[rnti]->generate_pdu(tb_data, pdsch.sch.grant.tb->tbs / 8); ue_db[rnti]->generate_pdu(tb_data, pdsch.sch.grant.tb->tbs / 8);

@ -105,6 +105,21 @@ dl_harq_proc::dl_harq_proc(uint32_t id_, uint32_t nprb) :
harq_proc(id_), softbuffer(harq_softbuffer_pool::get_instance().get_tx(nprb)), pdu(srsran::make_byte_buffer()) harq_proc(id_), softbuffer(harq_softbuffer_pool::get_instance().get_tx(nprb)), pdu(srsran::make_byte_buffer())
{} {}
bool dl_harq_proc::new_tx(slot_point slot_tx,
slot_point slot_ack,
const prb_grant& grant,
uint32_t mcs,
uint32_t tbs,
uint32_t max_retx)
{
if (harq_proc::new_tx(slot_tx, slot_ack, grant, mcs, tbs, max_retx)) {
softbuffer->reset();
pdu->clear();
return true;
}
return false;
}
harq_entity::harq_entity(uint32_t nprb, uint32_t nof_harq_procs) harq_entity::harq_entity(uint32_t nprb, uint32_t nof_harq_procs)
{ {
// Create HARQs // Create HARQs

Loading…
Cancel
Save