fix recursive call to get rb name

master
Francisco 4 years ago committed by Francisco Paisana
parent f7a8b8bf94
commit 685c971dc2

@ -24,6 +24,15 @@ const std::array<uint32_t, 6> lte_cell_nof_prbs = {6, 15, 25, 50, 75, 100};
// Radio Bearers
enum class lte_srb { srb0, srb1, srb2, count };
const uint32_t MAX_LTE_SRB_ID = 2;
enum class lte_drb { drb1 = 1, drb2, drb3, drb4, drb5, drb6, drb7, drb8, drb9, drb10, drb11, invalid };
const uint32_t MAX_LTE_DRB_ID = 11;
const uint32_t MAX_NOF_BEARERS = 14;
constexpr bool is_lte_rb(uint32_t lcid)
{
return lcid < MAX_NOF_BEARERS;
}
constexpr bool is_lte_srb(uint32_t lcid)
{
return lcid <= MAX_LTE_SRB_ID;
@ -42,11 +51,9 @@ constexpr lte_srb lte_lcid_to_srb(uint32_t lcid)
return static_cast<lte_srb>(lcid);
}
enum class lte_drb { drb1 = 1, drb2, drb3, drb4, drb5, drb6, drb7, drb8, drb9, drb10, drb11, invalid };
const uint32_t MAX_LTE_DRB_ID = 11;
constexpr bool is_lte_drb(uint32_t lcid)
{
return lcid > MAX_LTE_SRB_ID and lcid <= MAX_LTE_DRB_ID + MAX_LTE_SRB_ID;
return lcid > MAX_LTE_SRB_ID and is_lte_rb(lcid);
}
inline const char* get_drb_name(lte_drb drb_id)
{
@ -54,10 +61,6 @@ inline const char* get_drb_name(lte_drb drb_id)
"DRB1", "DRB2", "DRB3", "DRB4", "DRB5", "DRB6", "DRB7", "DRB8", "DRB9", "DRB10", "DRB11", "invalid DRB id"};
return names[(uint32_t)(drb_id < lte_drb::invalid ? drb_id : lte_drb::invalid) - 1];
}
constexpr bool is_lte_rb(uint32_t lcid)
{
return lcid <= MAX_LTE_DRB_ID + MAX_LTE_SRB_ID;
}
} // namespace srsran

@ -11,6 +11,7 @@
*/
#include "srsran/upper/rlc_tm.h"
#include "srsran/common/lte_common.h"
#include "srsran/interfaces/ue_pdcp_interfaces.h"
#include "srsran/interfaces/ue_rrc_interfaces.h"
@ -176,7 +177,7 @@ void rlc_tm::write_pdu(uint8_t* payload, uint32_t nof_bytes)
buf->set_timestamp();
metrics.num_rx_pdu_bytes += nof_bytes;
metrics.num_rx_pdus++;
if (strcmp(rrc->get_rb_name(lcid), "SRB0") == 0) {
if (srsran::srb_to_lcid(srsran::lte_srb::srb0) == lcid) {
rrc->write_pdu(lcid, std::move(buf));
} else {
pdcp->write_pdu(lcid, std::move(buf));

@ -25,8 +25,6 @@ namespace srsenb {
#define SRSENB_RRC_MAX_N_PLMN_IDENTITIES 6
#define SRSENB_N_SRB 3
#define SRSENB_N_DRB 8
#define SRSENB_N_RADIO_BEARERS 11
#define SRSENB_MAX_UES 64
using srsran::lte_drb;

@ -55,7 +55,7 @@ public:
struct tunnel {
uint16_t rnti = SRSRAN_INVALID_RNTI;
uint32_t lcid = SRSENB_N_RADIO_BEARERS;
uint32_t lcid = srsran::MAX_NOF_BEARERS;
uint32_t teid_in = 0;
uint32_t teid_out = 0;
uint32_t spgw_addr = 0;

@ -57,7 +57,7 @@ gtpu_tunnel_manager::ue_lcid_tunnel_list* gtpu_tunnel_manager::find_rnti_tunnels
srsran::span<gtpu_tunnel_manager::lcid_tunnel> gtpu_tunnel_manager::find_rnti_lcid_tunnels(uint16_t rnti, uint32_t lcid)
{
if (lcid < SRSENB_N_SRB or lcid >= SRSENB_N_RADIO_BEARERS) {
if (not is_lte_rb(lcid)) {
logger.warning("Searching for bearer with invalid lcid=%d", lcid);
return {};
}
@ -73,7 +73,7 @@ srsran::span<gtpu_tunnel_manager::lcid_tunnel> gtpu_tunnel_manager::find_rnti_lc
const gtpu_tunnel* gtpu_tunnel_manager::add_tunnel(uint16_t rnti, uint32_t lcid, uint32_t teidout, uint32_t spgw_addr)
{
if (lcid < SRSENB_N_SRB or lcid >= SRSENB_N_RADIO_BEARERS) {
if (not is_lte_rb(lcid)) {
logger.warning("Adding TEID with invalid lcid=%d", lcid);
return nullptr;
}

@ -237,7 +237,7 @@ void pdcp::user_interface_rrc::write_pdu_pcch(srsran::unique_byte_buffer_t pdu)
const char* pdcp::user_interface_rrc::get_rb_name(uint32_t lcid)
{
return get_rb_name(lcid);
return srsenb::get_rb_name(lcid);
}
void pdcp::get_metrics(pdcp_metrics_t& m, const uint32_t nof_tti)

Loading…
Cancel
Save