fix SIB transmission for CA

Avoid double buffering of SIBs in MAC as this would require one buffer for each CC.
Instead, use byte_buffer managed by RRC that contains packed SIBs to avoid
double memcpy for each SIB tx. Only use MAC provided buffer in error case.

Also avoid MAC calling RLC for each SIB and call RRC directly.
master
Andre Puschmann 5 years ago
parent 1314b8f653
commit 2edecea33e

@ -296,7 +296,6 @@ public:
* Segmentation happens in this function. RLC PDU is stored in payload. */ * Segmentation happens in this function. RLC PDU is stored in payload. */
virtual int read_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) = 0; virtual int read_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) = 0;
virtual void read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index, uint8_t* payload) = 0;
virtual void read_pdu_pcch(uint8_t* payload, uint32_t buffer_size) = 0; virtual void read_pdu_pcch(uint8_t* payload, uint32_t buffer_size) = 0;
/* MAC calls RLC to push an RLC PDU. This function is called from an independent MAC thread. /* MAC calls RLC to push an RLC PDU. This function is called from an independent MAC thread.
@ -371,7 +370,6 @@ public:
class rrc_interface_rlc class rrc_interface_rlc
{ {
public: public:
virtual void read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index, uint8_t* payload) = 0;
virtual void read_pdu_pcch(uint8_t* payload, uint32_t payload_size) = 0; virtual void read_pdu_pcch(uint8_t* payload, uint32_t payload_size) = 0;
virtual void max_retx_attempted(uint16_t rnti) = 0; virtual void max_retx_attempted(uint16_t rnti) = 0;
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0; virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
@ -387,6 +385,9 @@ public:
virtual void upd_user(uint16_t new_rnti, uint16_t old_rnti) = 0; virtual void upd_user(uint16_t new_rnti, uint16_t old_rnti) = 0;
virtual void set_activity_user(uint16_t rnti) = 0; virtual void set_activity_user(uint16_t rnti) = 0;
virtual bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) = 0; virtual bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) = 0;
///< Provide packed SIB to MAC (buffer is managed by RRC)
virtual uint8_t* read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index) = 0;
}; };
// SCell configuration // SCell configuration

@ -143,8 +143,9 @@ private:
std::vector<srslte::rar_pdu> rar_pdu_msg; std::vector<srslte::rar_pdu> rar_pdu_msg;
srslte::byte_buffer_t rar_payload[sched_interface::MAX_RAR_LIST]; srslte::byte_buffer_t rar_payload[sched_interface::MAX_RAR_LIST];
const static int NOF_BCCH_DLSCH_MSG = sched_interface::MAX_SIBS; const static int NOF_BCCH_DLSCH_MSG = sched_interface::MAX_SIBS;
uint8_t bcch_dlsch_payload[sched_interface::MAX_SIB_PAYLOAD_LEN] = {}; ///< Backup buffer if RRC can't provide valid SIB
uint8_t bcch_dlsch_payload[sched_interface::MAX_SIB_PAYLOAD_LEN] = {};
const static int pcch_payload_buffer_len = 1024; const static int pcch_payload_buffer_len = 1024;
uint8_t pcch_payload_buffer[pcch_payload_buffer_len] = {}; uint8_t pcch_payload_buffer[pcch_payload_buffer_len] = {};

@ -146,9 +146,9 @@ public:
void upd_user(uint16_t new_rnti, uint16_t old_rnti) override; void upd_user(uint16_t new_rnti, uint16_t old_rnti) override;
void set_activity_user(uint16_t rnti) override; void set_activity_user(uint16_t rnti) override;
bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) override; bool is_paging_opportunity(uint32_t tti, uint32_t* payload_len) override;
uint8_t* read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index) override;
// rrc_interface_rlc // rrc_interface_rlc
void read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index, uint8_t* payload) override;
void read_pdu_pcch(uint8_t* payload, uint32_t buffer_size) override; void read_pdu_pcch(uint8_t* payload, uint32_t buffer_size) override;
void max_retx_attempted(uint16_t rnti) override; void max_retx_attempted(uint16_t rnti) override;

@ -64,7 +64,6 @@ public:
// rlc_interface_mac // rlc_interface_mac
int read_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes); int read_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes);
void read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index, uint8_t* payload);
void write_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes); void write_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof_bytes);
void read_pdu_pcch(uint8_t* payload, uint32_t buffer_size); void read_pdu_pcch(uint8_t* payload, uint32_t buffer_size);

@ -739,10 +739,14 @@ uint8_t* mac::assemble_rar(sched_interface::dl_sched_rar_grant_t* grants,
} }
} }
uint8_t* mac::assemble_si(const uint8_t cc_idx, const uint32_t index) uint8_t* mac::assemble_si(const uint8_t cc_idx, const uint32_t sib_index)
{ {
rlc_h->read_pdu_bcch_dlsch(cc_idx, index, bcch_dlsch_payload); uint8_t* sib_payload = rrc_h->read_pdu_bcch_dlsch(cc_idx, sib_index);
return bcch_dlsch_payload; if (sib_payload == nullptr) {
// return MAC managed dummy buffer in this case
sib_payload = bcch_dlsch_payload;
}
return sib_payload;
} }
int mac::get_ul_sched(uint32_t tti, ul_sched_list_t& ul_sched_res_list) int mac::get_ul_sched(uint32_t tti, ul_sched_list_t& ul_sched_res_list)

@ -126,11 +126,12 @@ void rrc::get_metrics(rrc_metrics_t& m)
to the queue and process later to the queue and process later
*******************************************************************************/ *******************************************************************************/
void rrc::read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index, uint8_t* payload) uint8_t* rrc::read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index)
{ {
if (sib_index < ASN1_RRC_MAX_SIB && cc_idx < sib_buffer.size()) { if (sib_index < ASN1_RRC_MAX_SIB && cc_idx < sib_buffer.size()) {
memcpy(payload, sib_buffer.at(cc_idx).at(sib_index)->msg, sib_buffer.at(cc_idx).at(sib_index)->N_bytes); return sib_buffer.at(cc_idx).at(sib_index)->msg;
} }
return nullptr;
} }
void rrc::rl_failure(uint16_t rnti) void rrc::rl_failure(uint16_t rnti)

@ -193,12 +193,6 @@ void rlc::write_pdu(uint16_t rnti, uint32_t lcid, uint8_t* payload, uint32_t nof
pthread_rwlock_unlock(&rwlock); pthread_rwlock_unlock(&rwlock);
} }
void rlc::read_pdu_bcch_dlsch(const uint8_t cc_idx, const uint32_t sib_index, uint8_t* payload)
{
// RLC is transparent for BCCH
rrc->read_pdu_bcch_dlsch(cc_idx, sib_index, payload);
}
void rlc::write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) void rlc::write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu)
{ {
uint32_t tx_queue; uint32_t tx_queue;

Loading…
Cancel
Save