remove byte buffer pool cached member variables as they are unnecessary now.

master
Francisco 4 years ago committed by Francisco Paisana
parent 04ab4eefcd
commit 3265d940ec

@ -510,7 +510,6 @@ private:
std::unique_ptr<std::thread> tx_thread, rx_thread;
std::string tx_thread_name = "TX_PNF", rx_thread_name = "RX_PNF";
bool running = false;
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslog::basic_logger& logger = srslog::fetch_basic_logger("PNF", false);
std::mutex mutex;

@ -63,7 +63,6 @@ private:
srslog::basic_logger& logger = srslog::fetch_basic_logger("VNF", false);
srsenb::stack_interface_phy_nr* m_gnb_stack = nullptr;
srsue::stack_interface_phy_nr* m_ue_stack = nullptr;
srslte::byte_buffer_pool* m_pool = nullptr;
std::unique_ptr<basic_vnf_api::tx_request_msg_t> m_tx_req_msg;

@ -61,7 +61,6 @@ public:
void write_dl_si_rnti_nr(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t rnti, uint8_t harqid, uint32_t tti);
private:
srslte::byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
bool running = false;
srslte_rat_t rat = srslte_rat_t::nulltype;

@ -152,7 +152,6 @@ private:
// args
std::string name;
srslog::basic_logger& logger;
srslte::byte_buffer_pool* pool = nullptr;
// state
std::mutex socket_mutex;

@ -29,10 +29,7 @@ struct srslte_pnf_info_t {
struct srslte_vnf_info_t {};
srslte_basic_vnf::srslte_basic_vnf(const vnf_args_t& args_, stack_interface_phy_nr* stack_) :
m_args(args_),
thread("BASIC_VNF_P7"),
m_tx_req_msg(new basic_vnf_api::tx_request_msg_t),
m_pool(srslte::byte_buffer_pool::get_instance())
m_args(args_), thread("BASIC_VNF_P7"), m_tx_req_msg(new basic_vnf_api::tx_request_msg_t)
{
logger.set_level(srslog::str_to_basic_level(m_args.log_level));
logger.set_hex_dump_max_size(m_args.log_hex_limit);

@ -18,10 +18,7 @@
namespace srslte {
mac_pcap::mac_pcap(srslte_rat_t rat_) :
pool(srslte::byte_buffer_pool::get_instance()),
logger(srslog::fetch_basic_logger("MAC")),
thread("PCAP_WRITER_" + to_string(rat_)),
rat(rat_)
logger(srslog::fetch_basic_logger("MAC")), thread("PCAP_WRITER_" + to_string(rat_)), rat(rat_)
{}
mac_pcap::~mac_pcap()

@ -442,8 +442,8 @@ class sctp_recvmsg_pdu_task final : public rx_multisocket_handler::recv_task
public:
using callback_t = std::function<
void(srslte::unique_byte_buffer_t pdu, const sockaddr_in& from, const sctp_sndrcvinfo& sri, int flags)>;
explicit sctp_recvmsg_pdu_task(srslte::byte_buffer_pool* pool_, srslog::basic_logger& logger, callback_t func_) :
pool(pool_), logger(logger), func(std::move(func_))
explicit sctp_recvmsg_pdu_task(srslog::basic_logger& logger, callback_t func_) :
logger(logger), func(std::move(func_))
{}
bool operator()(int fd) override
@ -479,7 +479,6 @@ public:
}
private:
srslte::byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
callback_t func;
};
@ -491,7 +490,6 @@ private:
rx_multisocket_handler::rx_multisocket_handler(std::string name_, srslog::basic_logger& logger, int thread_prio) :
thread(name_), name(std::move(name_)), logger(logger)
{
pool = srslte::byte_buffer_pool::get_instance();
// register control pipe fd
if (pipe(pipefd) == -1) {
rxSockInfo("Failed to open control pipe");
@ -546,7 +544,7 @@ bool rx_multisocket_handler::add_socket_pdu_handler(int fd, recvfrom_callback_t
bool rx_multisocket_handler::add_socket_sctp_pdu_handler(int fd, sctp_recv_callback_t pdu_task)
{
srslte::rx_multisocket_handler::task_callback_t task;
task.reset(new srslte::sctp_recvmsg_pdu_task(pool, logger, std::move(pdu_task)));
task.reset(new srslte::sctp_recvmsg_pdu_task(logger, std::move(pdu_task)));
return add_socket_handler(fd, std::move(task));
}

@ -33,7 +33,6 @@ int nas_dedicated_eps_bearer_context_setup_request_test()
nas_logger.set_level(srslog::basic_levels::debug);
nas_logger.set_hex_dump_max_size(128);
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::unique_byte_buffer_t tst_msg, out_msg;
tst_msg = srslte::make_byte_buffer();
out_msg = srslte::make_byte_buffer();

@ -82,7 +82,6 @@ srslte::unique_byte_buffer_t gen_expected_pdu(const srslte::unique_byte_buffer_t
uint8_t pdcp_sn_len,
srslte::pdcp_rb_type_t rb_type,
srslte::as_security_config_t sec_cfg,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
srslte::pdcp_config_t cfg = {1,
@ -117,13 +116,12 @@ std::vector<pdcp_test_event_t> gen_expected_pdus_vector(const srslte::unique_byt
uint8_t pdcp_sn_len,
srslte::pdcp_rb_type_t rb_type,
srslte::as_security_config_t sec_cfg_,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
std::vector<pdcp_test_event_t> pdu_vec;
for (uint32_t tx_next : tx_nexts) {
pdcp_test_event_t event;
event.pkt = gen_expected_pdu(in_sdu, tx_next, pdcp_sn_len, rb_type, sec_cfg_, pool, log);
event.pkt = gen_expected_pdu(in_sdu, tx_next, pdcp_sn_len, rb_type, sec_cfg_, log);
event.ticks = 0;
pdu_vec.push_back(std::move(event));
}

@ -21,7 +21,6 @@ int test_rx(std::vector<pdcp_test_event_t> events,
srslte::pdcp_rb_type_t rb_type,
uint32_t n_sdus_exp,
const srslte::unique_byte_buffer_t& sdu_exp,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
@ -73,7 +72,7 @@ int test_rx(std::vector<pdcp_test_event_t> events,
* RX Test: PDCP Entity with SN LEN = 5 and 12.
* PDCP entity configured with EIA2 and EEA2
*/
int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
int test_rx_all(srslte::log_ref log)
{
// Test SDUs
srslte::unique_byte_buffer_t tst_sdu1 = srslte::make_byte_buffer(); // SDU 1
@ -89,18 +88,14 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
{
std::vector<uint32_t> test1_counts(2); // Test two packets
std::iota(test1_counts.begin(), test1_counts.end(), 31); // Starting at COUNT 31
std::vector<pdcp_test_event_t> test1_pdus = gen_expected_pdus_vector(
tst_sdu1, test1_counts, srslte::PDCP_SN_LEN_5, srslte::PDCP_RB_IS_SRB, sec_cfg, pool, log);
std::vector<pdcp_test_event_t> test1_pdus =
gen_expected_pdus_vector(tst_sdu1, test1_counts, srslte::PDCP_SN_LEN_5, srslte::PDCP_RB_IS_SRB, sec_cfg, log);
srslte::pdcp_lte_state_t test1_init_state = {
.next_pdcp_tx_sn = 0, .tx_hfn = 0, .rx_hfn = 0, .next_pdcp_rx_sn = 31, .last_submitted_pdcp_rx_sn = 30};
TESTASSERT(test_rx(std::move(test1_pdus),
test1_init_state,
srslte::PDCP_SN_LEN_5,
srslte::PDCP_RB_IS_SRB,
2,
tst_sdu1,
pool,
log) == 0);
TESTASSERT(
test_rx(
std::move(test1_pdus), test1_init_state, srslte::PDCP_SN_LEN_5, srslte::PDCP_RB_IS_SRB, 2, tst_sdu1, log) ==
0);
}
/*
@ -111,18 +106,14 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
{
std::vector<uint32_t> test_counts(2); // Test two packets
std::iota(test_counts.begin(), test_counts.end(), 4095); // Starting at COUNT 4095
std::vector<pdcp_test_event_t> test_pdus = gen_expected_pdus_vector(
tst_sdu1, test_counts, srslte::PDCP_SN_LEN_12, srslte::PDCP_RB_IS_DRB, sec_cfg, pool, log);
std::vector<pdcp_test_event_t> test_pdus =
gen_expected_pdus_vector(tst_sdu1, test_counts, srslte::PDCP_SN_LEN_12, srslte::PDCP_RB_IS_DRB, sec_cfg, log);
srslte::pdcp_lte_state_t test_init_state = {
.next_pdcp_tx_sn = 0, .tx_hfn = 0, .rx_hfn = 0, .next_pdcp_rx_sn = 4095, .last_submitted_pdcp_rx_sn = 4094};
TESTASSERT(test_rx(std::move(test_pdus),
test_init_state,
srslte::PDCP_SN_LEN_12,
srslte::PDCP_RB_IS_DRB,
2,
tst_sdu1,
pool,
log) == 0);
TESTASSERT(
test_rx(
std::move(test_pdus), test_init_state, srslte::PDCP_SN_LEN_12, srslte::PDCP_RB_IS_DRB, 2, tst_sdu1, log) ==
0);
}
/*
@ -132,8 +123,8 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
{
std::vector<uint32_t> test_counts(2); // Test two packets
std::iota(test_counts.begin(), test_counts.end(), 31); // Starting at COUNT 31
std::vector<pdcp_test_event_t> test_pdus = gen_expected_pdus_vector(
tst_sdu1, test_counts, srslte::PDCP_SN_LEN_12, srslte::PDCP_RB_IS_DRB, sec_cfg, pool, log);
std::vector<pdcp_test_event_t> test_pdus =
gen_expected_pdus_vector(tst_sdu1, test_counts, srslte::PDCP_SN_LEN_12, srslte::PDCP_RB_IS_DRB, sec_cfg, log);
srslte::pdcp_lte_state_t test_init_state = {
.next_pdcp_tx_sn = 0, .tx_hfn = 0, .rx_hfn = 0, .next_pdcp_rx_sn = 32, .last_submitted_pdcp_rx_sn = 31};
TESTASSERT(test_rx(std::move(test_pdus),
@ -142,7 +133,6 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
srslte::PDCP_RB_IS_DRB,
test_counts.size() - 1,
tst_sdu1,
pool,
log) == 0);
}
@ -151,7 +141,7 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
// Basic test to verify the correct handling of PDCP status PDUs on DRBs
// As long as we don't implement status reporting, the PDU shall be dropped
int test_rx_control_pdu(srslte::byte_buffer_pool* pool, srslte::log_ref log)
int test_rx_control_pdu(srslte::log_ref log)
{
const uint8_t pdcp_status_report_long[] = {0x0a, 0xc9, 0x3c};
@ -167,35 +157,30 @@ int test_rx_control_pdu(srslte::byte_buffer_pool* pool, srslte::log_ref log)
srslte::pdcp_lte_state_t test_init_state = {
.next_pdcp_tx_sn = 0, .tx_hfn = 0, .rx_hfn = 0, .next_pdcp_rx_sn = 32, .last_submitted_pdcp_rx_sn = 31};
TESTASSERT(test_rx(std::move(pdu_vec),
test_init_state,
srslte::PDCP_SN_LEN_12,
srslte::PDCP_RB_IS_DRB,
0,
tst_sdu1,
pool,
log) == 0);
TESTASSERT(
test_rx(std::move(pdu_vec), test_init_state, srslte::PDCP_SN_LEN_12, srslte::PDCP_RB_IS_DRB, 0, tst_sdu1, log) ==
0);
return SRSLTE_SUCCESS;
}
// Setup all tests
int run_all_tests(srslte::byte_buffer_pool* pool)
int run_all_tests()
{
// Setup log
srslte::log_ref log("PDCP LTE Test RX");
log->set_level(srslte::LOG_LEVEL_DEBUG);
log->set_hex_limit(128);
TESTASSERT(test_rx_all(pool, log) == 0);
TESTASSERT(test_rx_control_pdu(pool, log) == 0);
TESTASSERT(test_rx_all(log) == 0);
TESTASSERT(test_rx_control_pdu(log) == 0);
return 0;
}
int main()
{
if (run_all_tests(srslte::byte_buffer_pool::get_instance()) != SRSLTE_SUCCESS) {
if (run_all_tests() != SRSLTE_SUCCESS) {
fprintf(stderr, "pdcp_nr_tests_rx() failed\n");
return SRSLTE_ERROR;
}

@ -115,7 +115,6 @@ srslte::unique_byte_buffer_t gen_expected_pdu(const srslte::unique_byte_buffer_t
uint32_t count,
uint8_t pdcp_sn_len,
srslte::as_security_config_t sec_cfg,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
srslte::pdcp_config_t cfg = {1,
@ -148,13 +147,12 @@ std::vector<pdcp_test_event_t> gen_expected_pdus_vector(const srslte::unique_byt
const std::vector<uint32_t>& tx_nexts,
uint8_t pdcp_sn_len,
srslte::as_security_config_t sec_cfg_,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
std::vector<pdcp_test_event_t> pdu_vec;
for (uint32_t tx_next : tx_nexts) {
pdcp_test_event_t event;
event.pkt = gen_expected_pdu(in_sdu, tx_next, pdcp_sn_len, sec_cfg_, pool, log);
event.pkt = gen_expected_pdu(in_sdu, tx_next, pdcp_sn_len, sec_cfg_, log);
event.ticks = 0;
pdu_vec.push_back(std::move(event));
}

@ -18,7 +18,6 @@
int test_tx_sdu_discard(const pdcp_initial_state& init_state,
srslte::pdcp_discard_timer_t discard_timeout,
bool imediate_notify,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
srslte::pdcp_config_t cfg = {1,
@ -73,37 +72,37 @@ int test_tx_sdu_discard(const pdcp_initial_state& init_state,
* TX Test: PDCP Entity with SN LEN = 12 and 18.
* PDCP entity configured with EIA2 and EEA2
*/
int test_tx_discard_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
int test_tx_discard_all(srslte::log_ref log)
{
/*
* TX Test 1: PDCP Entity with SN LEN = 12
* Test TX PDU discard.
*/
TESTASSERT(test_tx_sdu_discard(normal_init_state, srslte::pdcp_discard_timer_t::ms50, false, pool, log) == 0);
TESTASSERT(test_tx_sdu_discard(normal_init_state, srslte::pdcp_discard_timer_t::ms50, false, log) == 0);
/*
* TX Test 2: PDCP Entity with SN LEN = 12
* Test TX PDU discard.
*/
// TESTASSERT(test_tx_sdu_discard(normal_init_state, srslte::pdcp_discard_timer_t::ms50, true, pool, log) == 0);
// TESTASSERT(test_tx_sdu_discard(normal_init_state, srslte::pdcp_discard_timer_t::ms50, true, log) == 0);
return 0;
}
// Setup all tests
int run_all_tests(srslte::byte_buffer_pool* pool)
int run_all_tests()
{
// Setup log
srslte::log_ref log("PDCP NR Test");
log->set_level(srslte::LOG_LEVEL_DEBUG);
log->set_hex_limit(128);
TESTASSERT(test_tx_discard_all(pool, log) == 0);
TESTASSERT(test_tx_discard_all(log) == 0);
return 0;
}
int main()
{
if (run_all_tests(srslte::byte_buffer_pool::get_instance()) != SRSLTE_SUCCESS) {
if (run_all_tests() != SRSLTE_SUCCESS) {
fprintf(stderr, "pdcp_nr_tests() failed\n");
return SRSLTE_ERROR;
}

@ -20,7 +20,6 @@ int test_rx(std::vector<pdcp_test_event_t> events,
uint8_t pdcp_sn_len,
uint32_t n_sdus_exp,
const srslte::unique_byte_buffer_t& sdu_exp,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
@ -59,7 +58,7 @@ int test_rx(std::vector<pdcp_test_event_t> events,
* RX Test: PDCP Entity with SN LEN = 12 and 18.
* PDCP entity configured with EIA2 and EEA2
*/
int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
int test_rx_all(srslte::log_ref log)
{
// Test SDUs
srslte::unique_byte_buffer_t tst_sdu1 = srslte::make_byte_buffer(); // SDU 1
@ -76,9 +75,9 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
std::vector<uint32_t> test1_counts(2); // Test two packets
std::iota(test1_counts.begin(), test1_counts.end(), 4095); // Starting at COUNT 4095
std::vector<pdcp_test_event_t> test1_pdus =
gen_expected_pdus_vector(tst_sdu1, test1_counts, srslte::PDCP_SN_LEN_12, sec_cfg, pool, log);
gen_expected_pdus_vector(tst_sdu1, test1_counts, srslte::PDCP_SN_LEN_12, sec_cfg, log);
pdcp_initial_state test1_init_state = {.tx_next = 4095, .rx_next = 4095, .rx_deliv = 4095, .rx_reord = 0};
TESTASSERT(test_rx(std::move(test1_pdus), test1_init_state, srslte::PDCP_SN_LEN_12, 2, tst_sdu1, pool, log) == 0);
TESTASSERT(test_rx(std::move(test1_pdus), test1_init_state, srslte::PDCP_SN_LEN_12, 2, tst_sdu1, log) == 0);
}
/*
* RX Test 2: PDCP Entity with SN LEN = 12
@ -90,10 +89,10 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
std::vector<uint32_t> test2_counts(2); // Test two packets
std::iota(test2_counts.begin(), test2_counts.end(), 4294967295); // Starting at COUNT 4294967295
std::vector<pdcp_test_event_t> test2_pdus =
gen_expected_pdus_vector(tst_sdu1, test2_counts, srslte::PDCP_SN_LEN_12, sec_cfg, pool, log);
gen_expected_pdus_vector(tst_sdu1, test2_counts, srslte::PDCP_SN_LEN_12, sec_cfg, log);
pdcp_initial_state test2_init_state = {
.tx_next = 4294967295, .rx_next = 4294967295, .rx_deliv = 4294967295, .rx_reord = 0};
TESTASSERT(test_rx(std::move(test2_pdus), test2_init_state, srslte::PDCP_SN_LEN_12, 1, tst_sdu1, pool, log) == 0);
TESTASSERT(test_rx(std::move(test2_pdus), test2_init_state, srslte::PDCP_SN_LEN_12, 1, tst_sdu1, log) == 0);
}
/*
* RX Test 3: PDCP Entity with SN LEN = 18
@ -104,9 +103,9 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
std::vector<uint32_t> test3_counts(2); // Test two packets
std::iota(test3_counts.begin(), test3_counts.end(), 262144); // Starting at COUNT 262144
std::vector<pdcp_test_event_t> test3_pdus =
gen_expected_pdus_vector(tst_sdu1, test3_counts, srslte::PDCP_SN_LEN_18, sec_cfg, pool, log);
gen_expected_pdus_vector(tst_sdu1, test3_counts, srslte::PDCP_SN_LEN_18, sec_cfg, log);
pdcp_initial_state test3_init_state = {.tx_next = 262144, .rx_next = 262144, .rx_deliv = 262144, .rx_reord = 0};
TESTASSERT(test_rx(std::move(test3_pdus), test3_init_state, srslte::PDCP_SN_LEN_18, 2, tst_sdu1, pool, log) == 0);
TESTASSERT(test_rx(std::move(test3_pdus), test3_init_state, srslte::PDCP_SN_LEN_18, 2, tst_sdu1, log) == 0);
}
/*
@ -118,10 +117,10 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
std::vector<uint32_t> test4_counts(2); // Test two packets
std::iota(test4_counts.begin(), test4_counts.end(), 4294967295); // Starting at COUNT 4294967295
std::vector<pdcp_test_event_t> test4_pdus =
gen_expected_pdus_vector(tst_sdu1, test4_counts, srslte::PDCP_SN_LEN_18, sec_cfg, pool, log);
gen_expected_pdus_vector(tst_sdu1, test4_counts, srslte::PDCP_SN_LEN_18, sec_cfg, log);
pdcp_initial_state test4_init_state = {
.tx_next = 4294967295, .rx_next = 4294967295, .rx_deliv = 4294967295, .rx_reord = 0};
TESTASSERT(test_rx(std::move(test4_pdus), test4_init_state, srslte::PDCP_SN_LEN_18, 1, tst_sdu1, pool, log) == 0);
TESTASSERT(test_rx(std::move(test4_pdus), test4_init_state, srslte::PDCP_SN_LEN_18, 1, tst_sdu1, log) == 0);
}
/*
@ -145,7 +144,7 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
// Write PDUs out of order (first the pdu with COUNT 1 and COUNT 0 after)
test5_pdus.push_back(std::move(event_pdu2));
test5_pdus.push_back(std::move(event_pdu1));
TESTASSERT(test_rx(std::move(test5_pdus), test5_init_state, srslte::PDCP_SN_LEN_12, 2, tst_sdu2, pool, log) == 0);
TESTASSERT(test_rx(std::move(test5_pdus), test5_init_state, srslte::PDCP_SN_LEN_12, 2, tst_sdu2, log) == 0);
}
/*
@ -169,7 +168,7 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
// Write PDUs out of order (first the pdu with COUNT 1 and COUNT 0 after)
test6_pdus.push_back(std::move(event_pdu2));
test6_pdus.push_back(std::move(event_pdu1));
TESTASSERT(test_rx(std::move(test6_pdus), test6_init_state, srslte::PDCP_SN_LEN_18, 2, tst_sdu2, pool, log) == 0);
TESTASSERT(test_rx(std::move(test6_pdus), test6_init_state, srslte::PDCP_SN_LEN_18, 2, tst_sdu2, log) == 0);
}
/*
@ -188,7 +187,7 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
// Write PDUs out of order (first the pdu with COUNT 1 and COUNT 0 after)
test7_pdus.push_back(std::move(event_pdu1));
TESTASSERT(test_rx(std::move(test7_pdus), test7_init_state, srslte::PDCP_SN_LEN_12, 1, tst_sdu2, pool, log) == 0);
TESTASSERT(test_rx(std::move(test7_pdus), test7_init_state, srslte::PDCP_SN_LEN_12, 1, tst_sdu2, log) == 0);
}
/*
@ -212,26 +211,26 @@ int test_rx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
// Write PDUs out of order (first the pdu with COUNT 1 and COUNT 0 after)
test8_pdus.push_back(std::move(event_pdu1));
test8_pdus.push_back(std::move(event_pdu2));
TESTASSERT(test_rx(std::move(test8_pdus), test8_init_state, srslte::PDCP_SN_LEN_12, 1, tst_sdu1, pool, log) == 0);
TESTASSERT(test_rx(std::move(test8_pdus), test8_init_state, srslte::PDCP_SN_LEN_12, 1, tst_sdu1, log) == 0);
}
return 0;
}
// Setup all tests
int run_all_tests(srslte::byte_buffer_pool* pool)
int run_all_tests()
{
// Setup log
srslte::log_ref log("PDCP NR Test RX");
log->set_level(srslte::LOG_LEVEL_DEBUG);
log->set_hex_limit(128);
TESTASSERT(test_rx_all(pool, log) == 0);
TESTASSERT(test_rx_all(log) == 0);
return 0;
}
int main()
{
if (run_all_tests(srslte::byte_buffer_pool::get_instance()) != SRSLTE_SUCCESS) {
if (run_all_tests() != SRSLTE_SUCCESS) {
fprintf(stderr, "pdcp_nr_tests_rx() failed\n");
return SRSLTE_ERROR;
}

@ -20,7 +20,6 @@ int test_tx(uint32_t n_packets,
uint8_t pdcp_sn_len,
uint64_t n_pdus_exp,
srslte::unique_byte_buffer_t pdu_exp,
srslte::byte_buffer_pool* pool,
srslte::log_ref log)
{
srslte::pdcp_config_t cfg = {1,
@ -57,7 +56,7 @@ int test_tx(uint32_t n_packets,
* TX Test: PDCP Entity with SN LEN = 12 and 18.
* PDCP entity configured with EIA2 and EEA2
*/
int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
int test_tx_all(srslte::log_ref log)
{
uint64_t n_packets;
/*
@ -69,13 +68,9 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
n_packets = 1;
srslte::unique_byte_buffer_t pdu_exp_count0_len12 = srslte::make_byte_buffer();
pdu_exp_count0_len12->append_bytes(pdu1_count0_snlen12, sizeof(pdu1_count0_snlen12));
TESTASSERT(test_tx(n_packets,
normal_init_state,
srslte::PDCP_SN_LEN_12,
n_packets,
std::move(pdu_exp_count0_len12),
pool,
log) == 0);
TESTASSERT(
test_tx(n_packets, normal_init_state, srslte::PDCP_SN_LEN_12, n_packets, std::move(pdu_exp_count0_len12), log) ==
0);
/*
* TX Test 2: PDCP Entity with SN LEN = 12
@ -86,13 +81,10 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
n_packets = 2049;
srslte::unique_byte_buffer_t pdu_exp_count2048_len12 = srslte::make_byte_buffer();
pdu_exp_count2048_len12->append_bytes(pdu1_count2048_snlen12, sizeof(pdu1_count2048_snlen12));
TESTASSERT(test_tx(n_packets,
normal_init_state,
srslte::PDCP_SN_LEN_12,
n_packets,
std::move(pdu_exp_count2048_len12),
pool,
log) == 0);
TESTASSERT(
test_tx(
n_packets, normal_init_state, srslte::PDCP_SN_LEN_12, n_packets, std::move(pdu_exp_count2048_len12), log) ==
0);
/*
* TX Test 3: PDCP Entity with SN LEN = 12
@ -103,13 +95,10 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
n_packets = 4097;
srslte::unique_byte_buffer_t pdu_exp_count4096_len12 = srslte::make_byte_buffer();
pdu_exp_count4096_len12->append_bytes(pdu1_count4096_snlen12, sizeof(pdu1_count4096_snlen12));
TESTASSERT(test_tx(n_packets,
normal_init_state,
srslte::PDCP_SN_LEN_12,
n_packets,
std::move(pdu_exp_count4096_len12),
pool,
log) == 0);
TESTASSERT(
test_tx(
n_packets, normal_init_state, srslte::PDCP_SN_LEN_12, n_packets, std::move(pdu_exp_count4096_len12), log) ==
0);
/*
* TX Test 4: PDCP Entity with SN LEN = 18
@ -120,13 +109,9 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
n_packets = 1;
srslte::unique_byte_buffer_t pdu_exp_count0_len18 = srslte::make_byte_buffer();
pdu_exp_count0_len18->append_bytes(pdu1_count0_snlen18, sizeof(pdu1_count0_snlen18));
TESTASSERT(test_tx(n_packets,
normal_init_state,
srslte::PDCP_SN_LEN_18,
n_packets,
std::move(pdu_exp_count0_len18),
pool,
log) == 0);
TESTASSERT(
test_tx(n_packets, normal_init_state, srslte::PDCP_SN_LEN_18, n_packets, std::move(pdu_exp_count0_len18), log) ==
0);
/*
* TX Test 5: PDCP Entity with SN LEN = 18
@ -137,13 +122,10 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
n_packets = 131073;
srslte::unique_byte_buffer_t pdu_exp_sn131072_len18 = srslte::make_byte_buffer();
pdu_exp_sn131072_len18->append_bytes(pdu1_count131072_snlen18, sizeof(pdu1_count131072_snlen18));
TESTASSERT(test_tx(n_packets,
normal_init_state,
srslte::PDCP_SN_LEN_18,
n_packets,
std::move(pdu_exp_sn131072_len18),
pool,
log) == 0);
TESTASSERT(
test_tx(
n_packets, normal_init_state, srslte::PDCP_SN_LEN_18, n_packets, std::move(pdu_exp_sn131072_len18), log) ==
0);
/*
* TX Test 6: PDCP Entity with SN LEN = 18
@ -154,13 +136,10 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
n_packets = 262145;
srslte::unique_byte_buffer_t pdu_exp_count262144_len18 = srslte::make_byte_buffer();
pdu_exp_count262144_len18->append_bytes(pdu1_count262144_snlen18, sizeof(pdu1_count262144_snlen18));
TESTASSERT(test_tx(n_packets,
normal_init_state,
srslte::PDCP_SN_LEN_18,
n_packets,
std::move(pdu_exp_count262144_len18),
pool,
log) == 0);
TESTASSERT(
test_tx(
n_packets, normal_init_state, srslte::PDCP_SN_LEN_18, n_packets, std::move(pdu_exp_count262144_len18), log) ==
0);
/*
* TX Test 7: PDCP Entity with SN LEN = 12
@ -175,7 +154,6 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
srslte::PDCP_SN_LEN_12,
1,
std::move(pdu_exp_count4294967295_len12),
pool,
log) == 0);
/*
@ -191,26 +169,25 @@ int test_tx_all(srslte::byte_buffer_pool* pool, srslte::log_ref log)
srslte::PDCP_SN_LEN_18,
1,
std::move(pdu_exp_count4294967295_len18),
pool,
log) == 0);
return 0;
}
// Setup all tests
int run_all_tests(srslte::byte_buffer_pool* pool)
int run_all_tests()
{
// Setup log
srslte::log_ref log("PDCP NR Test TX");
log->set_level(srslte::LOG_LEVEL_DEBUG);
log->set_hex_limit(128);
TESTASSERT(test_tx_all(pool, log) == 0);
TESTASSERT(test_tx_all(log) == 0);
return 0;
}
int main()
{
if (run_all_tests(srslte::byte_buffer_pool::get_instance()) != SRSLTE_SUCCESS) {
if (run_all_tests() != SRSLTE_SUCCESS) {
fprintf(stderr, "pdcp_nr_tests_tx() failed\n");
return SRSLTE_ERROR;
}

@ -139,8 +139,6 @@ private:
srslog::sink& log_sink;
srslog::basic_logger& enb_log;
srslte::byte_buffer_pool* pool = nullptr;
all_args_t args = {};
bool started = false;

@ -118,13 +118,13 @@ private:
stack_args_t args = {};
rrc_cfg_t rrc_cfg = {};
srslog::basic_logger &mac_logger;
srslog::basic_logger &rlc_logger;
srslog::basic_logger &pdcp_logger;
srslog::basic_logger &rrc_logger;
srslog::basic_logger &s1ap_logger;
srslog::basic_logger &gtpu_logger;
srslog::basic_logger &stack_logger;
srslog::basic_logger& mac_logger;
srslog::basic_logger& rlc_logger;
srslog::basic_logger& pdcp_logger;
srslog::basic_logger& rrc_logger;
srslog::basic_logger& s1ap_logger;
srslog::basic_logger& gtpu_logger;
srslog::basic_logger& stack_logger;
// task handling
srslte::task_scheduler task_sched;
@ -143,7 +143,6 @@ private:
srslte::s1ap_pcap s1ap_pcap;
srslte::logger* logger = nullptr;
srslte::byte_buffer_pool* pool = nullptr;
// Radio and PHY log are in enb.cc
srslte::log_ref mac_log{"MAC"};

@ -83,7 +83,6 @@ private:
std::unique_ptr<srslte::mac_pcap> pcap = nullptr;
srslte::log_ref log_h;
srslte::byte_buffer_pool* pool = nullptr;
mac_nr_args_t args = {};
bool started = false;

@ -140,7 +140,6 @@ private:
class ue;
// args
srslte::task_sched_handle task_sched;
srslte::byte_buffer_pool* pool = nullptr;
phy_interface_rrc_lte* phy = nullptr;
mac_interface_rrc* mac = nullptr;
rlc_interface_rrc* rlc = nullptr;

@ -68,7 +68,6 @@ private:
rrc::ue* rrc_ue = nullptr;
rrc* rrc_enb = nullptr;
srslte::byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
// vars

@ -106,7 +106,6 @@ public:
// setters
private:
srslte::byte_buffer_pool* pool = nullptr;
rrc_nr* parent;
uint16_t rnti;
@ -128,7 +127,6 @@ private:
ngap_interface_rrc_nr* ngap = nullptr;
// args
srslte::byte_buffer_pool* pool = nullptr;
srslte::log_ref m_log;
srslte::timer_handler* timers = nullptr;

@ -105,7 +105,6 @@ public:
private:
// args
srslte::byte_buffer_pool* pool = nullptr;
srslte::timer_handler::unique_timer activity_timer;
/// cached ASN1 fields for RRC config update checking, and ease of context transfer during HO

@ -63,7 +63,6 @@ private:
void rem_tunnel(uint32_t teidin);
srslte::byte_buffer_pool* pool = nullptr;
stack_interface_gtpu_lte* stack = nullptr;
bool enable_mbsfn = false;

@ -107,7 +107,6 @@ private:
gtpu_interface_pdcp* gtpu;
srslte::task_sched_handle task_sched;
srslog::basic_logger& logger;
srslte::byte_buffer_pool* pool;
};
} // namespace srsenb

@ -101,7 +101,6 @@ private:
// args
pdcp_nr_args_t m_args = {};
srslte::byte_buffer_pool* pool = nullptr;
srslte::log_ref m_log;
rlc_interface_pdcp_nr* m_rlc = nullptr;
rrc_interface_pdcp_nr* m_rrc = nullptr;

@ -93,7 +93,6 @@ private:
pdcp_interface_rlc* pdcp;
rrc_interface_rlc* rrc;
srslog::basic_logger& logger;
srslte::byte_buffer_pool* pool;
srslte::timer_handler* timers;
};

@ -79,7 +79,6 @@ private:
};
// args
srslte::byte_buffer_pool* pool = nullptr;
srslte::log_ref m_log;
srslte::timer_handler* timers = nullptr;
mac_interface_rlc_nr* m_mac = nullptr;

@ -102,7 +102,6 @@ private:
rrc_interface_s1ap* rrc = nullptr;
s1ap_args_t args;
srslog::basic_logger& logger;
srslte::byte_buffer_pool* pool = nullptr;
srsenb::stack_interface_s1ap_lte* stack = nullptr;
srslte::task_sched_handle task_sched;

@ -25,10 +25,7 @@
namespace srsenb {
enb::enb(srslog::sink& log_sink) :
started(false),
log_sink(log_sink),
enb_log(srslog::fetch_basic_logger("ENB", log_sink, false)),
pool(srslte::byte_buffer_pool::get_instance(ENB_POOL_SIZE))
started(false), log_sink(log_sink), enb_log(srslog::fetch_basic_logger("ENB", log_sink, false))
{
// print build info
std::cout << std::endl << get_build_string() << std::endl << std::endl;
@ -55,7 +52,7 @@ int enb::init(const all_args_t& args_, srslte::logger* logger_)
return SRSLTE_ERROR;
}
pool->enable_logger(true);
srslte::byte_buffer_pool::get_instance()->enable_logger(true);
// Create layers
if (args.stack.type == "lte") {

@ -43,8 +43,6 @@ enb_stack_lte::enb_stack_lte(srslte::logger* logger_, srslog::sink& log_sink) :
mme_task_queue = task_sched.make_task_queue();
gtpu_task_queue = task_sched.make_task_queue();
// sync_queue is added in init()
pool = byte_buffer_pool::get_instance();
}
enb_stack_lte::~enb_stack_lte()

@ -20,7 +20,7 @@
namespace srsenb {
mac_nr::mac_nr() : pool(srslte::byte_buffer_pool::get_instance()), log_h("MAC")
mac_nr::mac_nr() : log_h("MAC")
{
bcch_bch_payload = srslte::make_byte_buffer();

@ -49,7 +49,6 @@ ue::ue(uint16_t rnti_,
rx_used_buffers(nof_cells_),
ta_fsm(this)
{
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
tx_payload_buffer.resize(nof_cells_);
for (auto& carrier_buffers : tx_payload_buffer) {
for (auto& harq_buffers : carrier_buffers) {

@ -51,8 +51,6 @@ void rrc::init(const rrc_cfg_t& cfg_,
gtpu = gtpu_;
s1ap = s1ap_;
pool = srslte::byte_buffer_pool::get_instance();
cfg = cfg_;
if (cfg.sibs[12].type() == asn1::rrc::sys_info_r8_ies_s::sib_type_and_info_item_c_::types::sib13_v920 &&

@ -184,11 +184,7 @@ uint16_t rrc::start_ho_ue_resource_alloc(const asn1::s1ap::ho_request_s&
************************************************************************************************/
rrc::ue::rrc_mobility::rrc_mobility(rrc::ue* outer_ue) :
base_t(outer_ue->parent->logger),
rrc_ue(outer_ue),
rrc_enb(outer_ue->parent),
pool(outer_ue->pool),
logger(outer_ue->parent->logger)
base_t(outer_ue->parent->logger), rrc_ue(outer_ue), rrc_enb(outer_ue->parent), logger(outer_ue->parent->logger)
{}
//! Method to add Mobility Info to a RRC Connection Reconfiguration Message

@ -19,9 +19,7 @@ using namespace asn1::rrc_nr;
namespace srsenb {
rrc_nr::rrc_nr(srslte::timer_handler* timers_) :
m_log("RRC"), pool(srslte::byte_buffer_pool::get_instance()), timers(timers_)
{}
rrc_nr::rrc_nr(srslte::timer_handler* timers_) : m_log("RRC"), timers(timers_) {}
void rrc_nr::init(const rrc_nr_cfg_t& cfg_,
phy_interface_stack_nr* phy_,
@ -333,8 +331,6 @@ void rrc_nr::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_
*******************************************************************************/
rrc_nr::ue::ue(rrc_nr* parent_, uint16_t rnti_) : parent(parent_), rnti(rnti_)
{
pool = srslte::byte_buffer_pool::get_instance();
// setup periodic RRCSetup send
rrc_setup_periodic_timer = parent->timers->get_unique_timer();
rrc_setup_periodic_timer.set(5000, [this](uint32_t tid) {

@ -33,7 +33,6 @@ namespace srsenb {
rrc::ue::ue(rrc* outer_rrc, uint16_t rnti_, const sched_interface::ue_cfg_t& sched_ue_cfg) :
parent(outer_rrc),
rnti(rnti_),
pool(srslte::byte_buffer_pool::get_instance()),
phy_rrc_dedicated_list(sched_ue_cfg.supported_cc_list.size()),
ue_cell_list(parent->cfg, *outer_rrc->cell_res_list, *outer_rrc->cell_common_list),
bearer_list(rnti_, parent->cfg, outer_rrc->gtpu),

@ -34,7 +34,6 @@ int gtpu::init(std::string gtp_bind_addr_,
pdcp = pdcp_;
gtp_bind_addr = gtp_bind_addr_;
mme_addr = mme_addr_;
pool = byte_buffer_pool::get_instance();
stack = stack_;
char errbuf[128] = {};

@ -16,7 +16,7 @@
namespace srsenb {
pdcp::pdcp(srslte::task_sched_handle task_sched_, srslog::basic_logger& logger_) :
task_sched(task_sched_), logger(logger_), pool(srslte::byte_buffer_pool::get_instance())
task_sched(task_sched_), logger(logger_)
{}
void pdcp::init(rlc_interface_pdcp* rlc_, rrc_interface_pdcp* rrc_, gtpu_interface_pdcp* gtpu_)

@ -15,8 +15,7 @@
namespace srsenb {
pdcp_nr::pdcp_nr(srslte::task_sched_handle task_sched_, const char* logname) :
task_sched(task_sched_), m_log(logname), pool(srslte::byte_buffer_pool::get_instance())
pdcp_nr::pdcp_nr(srslte::task_sched_handle task_sched_, const char* logname) : task_sched(task_sched_), m_log(logname)
{}
void pdcp_nr::init(const pdcp_nr_args_t& args_,

@ -25,8 +25,6 @@ void rlc::init(pdcp_interface_rlc* pdcp_,
mac = mac_;
timers = timers_;
pool = srslte::byte_buffer_pool::get_instance();
pthread_rwlock_init(&rwlock, nullptr);
}

@ -15,7 +15,7 @@
namespace srsenb {
rlc_nr::rlc_nr(const char* logname) : m_log(logname), pool(srslte::byte_buffer_pool::get_instance()) {}
rlc_nr::rlc_nr(const char* logname) : m_log(logname) {}
void rlc_nr::init(pdcp_interface_rlc_nr* pdcp_,
rrc_interface_rlc_nr* rrc_,

@ -227,7 +227,6 @@ int s1ap::init(s1ap_args_t args_, rrc_interface_s1ap* rrc_, srsenb::stack_interf
rrc = rrc_;
args = args_;
stack = stack_;
pool = srslte::byte_buffer_pool::get_instance();
build_tai_cgi();

@ -224,7 +224,6 @@ bool unpack_asn1(ASN1Type& asn1obj, srslte::const_byte_span pdu)
inline void copy_msg_to_buffer(srslte::unique_byte_buffer_t& pdu, srslte::const_byte_span msg)
{
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
pdu = srslte::make_byte_buffer();
memcpy(pdu->msg, msg.data(), msg.size());
pdu->N_bytes = msg.size();

@ -64,7 +64,6 @@ private:
mme_gtpc* m_mme_gtpc;
bool m_running;
srslte::byte_buffer_pool* m_pool;
fd_set m_set;
// Timer map

@ -251,7 +251,6 @@ public:
sec_ctx_t m_sec_ctx = {};
private:
srslte::byte_buffer_pool* m_pool = nullptr;
srslog::basic_logger& m_logger = srslog::fetch_basic_logger("NAS");
gtpc_interface_nas* m_gtpc = nullptr;
s1ap_interface_nas* m_s1ap = nullptr;

@ -126,7 +126,6 @@ private:
static s1ap* m_instance;
uint32_t m_plmn;
srslte::byte_buffer_pool* m_pool;
hss_interface_nas* m_hss;
int m_s1mme;

@ -49,7 +49,6 @@ private:
s1ap_args_t m_s1ap_args;
mme_gtpc* m_mme_gtpc;
srslte::byte_buffer_pool* m_pool;
};
} // namespace srsepc

@ -54,7 +54,6 @@ private:
s1ap_args_t m_s1ap_args;
mme_gtpc* m_mme_gtpc = nullptr;
srslte::byte_buffer_pool* m_pool = nullptr;
};
} // namespace srsepc

@ -42,7 +42,6 @@ private:
srslog::basic_logger& m_logger = srslog::fetch_basic_logger("S1AP");
s1ap_args_t m_s1ap_args;
srslte::byte_buffer_pool* m_pool;
};
} // namespace srsepc

@ -83,7 +83,6 @@ public:
std::map<uint64_t, struct in_addr> m_imsi_to_ip;
srslog::basic_logger& m_logger = srslog::fetch_basic_logger("SPGW GTPC");
srslte::byte_buffer_pool* m_pool;
};
inline int spgw::gtpc::get_s11()

@ -24,7 +24,6 @@ pthread_mutex_t mme_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
mme::mme() : m_running(false), thread("MME")
{
m_pool = srslte::byte_buffer_pool::get_instance();
return;
}

@ -23,7 +23,6 @@
namespace srsepc {
nas::nas(const nas_init_t& args, const nas_if_t& itf) :
m_pool(srslte::byte_buffer_pool::get_instance()),
m_gtpc(itf.gtpc),
m_s1ap(itf.s1ap),
m_hss(itf.hss),
@ -329,7 +328,6 @@ bool nas::handle_guti_attach_request_unknown_ue(uint32_t
{
nas* nas_ctx;
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::byte_buffer_t* nas_tx;
// Interfaces
@ -566,7 +564,6 @@ bool nas::handle_service_request(uint32_t m_tmsi,
bool mac_valid = false;
LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT service_req;
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
// Interfaces
s1ap_interface_nas* s1ap = itf.s1ap;
@ -772,7 +769,6 @@ bool nas::handle_tracking_area_update_request(uint32_t m_tmsi,
const nas_if_t& itf)
{
auto& nas_logger = srslog::fetch_basic_logger("NAS");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
nas_logger.info("Tracking Area Update Request -- S-TMSI 0x%x", m_tmsi);
srslte::console("Tracking Area Update Request -- S-TMSI 0x%x\n", m_tmsi);
@ -1146,7 +1142,6 @@ bool nas::handle_tracking_area_update_request(srslte::byte_buffer_t* nas_rx)
srslte::console("Warning: Tracking Area Update Request messages not handled yet.\n");
m_logger.warning("Warning: Tracking Area Update Request messages not handled yet.");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::byte_buffer_t* nas_tx;
/* TAU handling unsupported, therefore send TAU reject with cause IMPLICITLY DETACHED.

@ -22,10 +22,7 @@ namespace srsepc {
s1ap* s1ap::m_instance = NULL;
pthread_mutex_t s1ap_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
s1ap::s1ap() : m_s1mme(-1), m_next_mme_ue_s1ap_id(1), m_mme_gtpc(NULL), m_pool(NULL)
{
return;
}
s1ap::s1ap() : m_s1mme(-1), m_next_mme_ue_s1ap_id(1), m_mme_gtpc(NULL) {}
s1ap::~s1ap()
{
@ -54,8 +51,6 @@ void s1ap::cleanup(void)
int s1ap::init(s1ap_args_t s1ap_args)
{
m_pool = srslte::byte_buffer_pool::get_instance();
m_s1ap_args = s1ap_args;
srslte::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn);
m_next_m_tmsi = rand();

@ -58,7 +58,6 @@ void s1ap_ctx_mngmt_proc::init()
m_s1ap = s1ap::get_instance();
m_mme_gtpc = mme_gtpc::get_instance();
m_s1ap_args = m_s1ap->m_s1ap_args;
m_pool = srslte::byte_buffer_pool::get_instance();
}
bool s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas* nas_ctx, uint16_t erab_to_setup)

@ -57,7 +57,6 @@ void s1ap_erab_mngmt_proc::init()
{
m_s1ap = s1ap::get_instance();
m_s1ap_args = m_s1ap->m_s1ap_args;
m_pool = srslte::byte_buffer_pool::get_instance();
}
bool s1ap_erab_mngmt_proc::send_erab_release_command(uint32_t enb_ue_s1ap_id,

@ -29,7 +29,6 @@ void s1ap_paging::init()
m_s1ap = s1ap::get_instance();
m_mme = mme::get_instance();
m_s1ap_args = m_s1ap->m_s1ap_args;
m_pool = srslte::byte_buffer_pool::get_instance();
}
bool s1ap_paging::send_paging(uint64_t imsi, uint16_t erab_to_setup)

@ -48,7 +48,6 @@ int spgw::gtpc::init(spgw_args_t* args,
const std::map<std::string, uint64_t>& ip_to_imsi)
{
int err;
m_pool = srslte::byte_buffer_pool::get_instance();
// Init interfaces
m_spgw = spgw;

@ -152,7 +152,6 @@ private:
/* Queue to dispatch stack tasks */
srslte::task_multiqueue::queue_handle stack_task_dispatch_queue;
srslte::byte_buffer_pool* pool = nullptr;
// pointer to MAC PCAP object
srslte::mac_pcap* pcap = nullptr;

@ -69,7 +69,6 @@ public:
void process_pdus();
private:
void handle_pdu(srslte::unique_byte_buffer_t pdu);
void get_ul_data(const mac_nr_grant_ul_t& grant, phy_interface_stack_nr::tx_request_t* tx_request);
@ -87,7 +86,6 @@ private:
std::unique_ptr<srslte::mac_pcap> pcap = nullptr;
srslog::basic_logger& logger;
srslte::byte_buffer_pool* pool = nullptr;
mac_nr_args_t args = {};
bool started = false;

@ -175,7 +175,6 @@ private:
stack_interface_rrc* stack = nullptr;
srslte::task_sched_handle task_sched;
srslte::byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
phy_interface_rrc_lte* phy = nullptr;
mac_interface_rrc* mac = nullptr;

@ -70,7 +70,6 @@ private:
static const int GW_THREAD_PRIO = -1;
stack_interface_gw* stack = nullptr;
srslte::byte_buffer_pool* pool = nullptr;
srslte::logger* old_logger = nullptr;
gw_args_t args = {};

@ -73,7 +73,6 @@ public:
void start_pcap(srslte::nas_pcap* pcap_) { pcap = pcap_; }
private:
srslte::byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
rrc_interface_nas* rrc = nullptr;
usim_interface_nas* usim = nullptr;

@ -111,7 +111,6 @@ private:
srslog::basic_logger& logger;
all_args_t args;
srslte::byte_buffer_pool* pool = nullptr;
// Helper functions
int parse_args(const all_args_t& args); // parse and validate arguments

@ -45,8 +45,6 @@ mac::mac(const char* logname, ext_task_sched_handle task_sched_) :
srslte_softbuffer_rx_init(&pch_softbuffer, 100);
srslte_softbuffer_rx_init(&mch_softbuffer, 100);
pool = srslte::byte_buffer_pool::get_instance();
// Keep initialising members
bzero(&metrics, sizeof(mac_metrics_t));
clear_rntis();

@ -15,7 +15,7 @@
namespace srsue {
mac_nr::mac_nr(srslte::ext_task_sched_handle task_sched_) :
pool(srslte::byte_buffer_pool::get_instance()), task_sched(task_sched_), logger(srslog::fetch_basic_logger("MAC"))
task_sched(task_sched_), logger(srslog::fetch_basic_logger("MAC"))
{
tx_buffer = srslte::make_byte_buffer();
rlc_buffer = srslte::make_byte_buffer();

@ -104,7 +104,6 @@ void rrc::init(phy_interface_rrc_lte* phy_,
#endif
const rrc_args_t& args_)
{
pool = byte_buffer_pool::get_instance();
phy = phy_;
mac = mac_;
rlc = rlc_;

@ -25,12 +25,7 @@
namespace srsue {
gw::gw() :
thread("GW"),
pool(srslte::byte_buffer_pool::get_instance()),
logger(srslog::fetch_basic_logger("GW", false)),
tft_matcher(logger)
{}
gw::gw() : thread("GW"), logger(srslog::fetch_basic_logger("GW", false)), tft_matcher(logger) {}
int gw::init(const gw_args_t& args_, srslte::logger* logger_, stack_interface_gw* stack_)
{

@ -36,7 +36,6 @@ namespace srsue {
********************************************************************/
nas::nas(srslte::task_sched_handle task_sched_) :
pool(byte_buffer_pool::get_instance()),
plmn_searcher(this),
task_sched(task_sched_),
t3402(task_sched_.get_unique_timer()),

@ -36,7 +36,6 @@ ue::ue(srslog::sink& log_sink) :
{
// print build info
std::cout << std::endl << get_build_string() << std::endl << std::endl;
pool = byte_buffer_pool::get_instance();
}
ue::~ue()

@ -27,9 +27,7 @@ using namespace srslte;
class ttcn3_drb_interface : public ttcn3_port_handler
{
public:
explicit ttcn3_drb_interface(srslog::basic_logger& logger) :
ttcn3_port_handler(logger), pool(byte_buffer_pool::get_instance())
{}
explicit ttcn3_drb_interface(srslog::basic_logger& logger) : ttcn3_port_handler(logger) {}
~ttcn3_drb_interface() = default;
int init(ss_srb_interface* syssim_, std::string net_ip_, uint32_t net_port_)
@ -133,7 +131,6 @@ private:
}
ss_srb_interface* syssim = nullptr;
byte_buffer_pool* pool = nullptr;
};
#endif // SRSUE_TTCN3_DRB_INTERFACE_H

@ -231,8 +231,6 @@ private:
all_args_t args = {};
srslte::byte_buffer_pool* pool = nullptr;
// Simulator vars
ttcn3_ue* ue = nullptr;
bool running = false;

@ -53,7 +53,6 @@ ttcn3_syssim::ttcn3_syssim(srslte::logger& logger_file_, srslte::logger& logger_
logger_stdout(logger_stdout_),
logger_file(logger_file_),
old_logger(&logger_file),
pool(byte_buffer_pool::get_instance()),
ue(ue_),
signal_handler(&running),
timer_handler(create_tti_timer(), [&](uint64_t res) { new_tti_indication(res); })

@ -361,9 +361,6 @@ int esm_info_request_test()
srsue::usim usim(srslog::fetch_basic_logger("USIM"));
usim.init(&args);
srslte::byte_buffer_pool* pool;
pool = byte_buffer_pool::get_instance();
{
srsue::nas nas(&stack.task_sched);
nas_args_t cfg;
@ -413,8 +410,6 @@ int dedicated_eps_bearer_test()
srsue::usim usim(srslog::fetch_basic_logger("USIM"));
usim.init(&args);
srslte::byte_buffer_pool* pool = byte_buffer_pool::get_instance();
srsue::nas nas(&stack.task_sched);
nas_args_t cfg = {};
cfg.force_imsi_attach = true; // make sure we get a fresh security context

@ -251,7 +251,6 @@ public:
rrc_test(srslte::log_ref log_, stack_test_dummy* stack_) :
rrc(stack_, &stack_->task_sched), stack(stack_), mactest(this, &stack_->task_sched)
{
pool = srslte::byte_buffer_pool::get_instance();
nastest = std::unique_ptr<nas_test>(new nas_test(&stack->task_sched));
pdcptest = std::unique_ptr<pdcp_test>(new pdcp_test(log_->get_service_name().c_str(), &stack->task_sched));
rrcnrtest = std::unique_ptr<rrc_nr_test>(new rrc_nr_test());
@ -375,7 +374,6 @@ private:
std::unique_ptr<nas_test> nastest;
std::unique_ptr<rrc_nr_test> rrcnrtest;
uint32_t tti = 0;
srslte::byte_buffer_pool* pool = nullptr;
};
// Test Cell select

@ -106,7 +106,6 @@ uint8_t ipv6_unmatched_packet_lport[] = {
int tft_filter_test_ipv6_combined()
{
srslog::basic_logger& logger = srslog::fetch_basic_logger("TFT");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::unique_byte_buffer_t ip_msg1, ip_msg2, ip_msg3, ip_msg4, ip_msg5;
ip_msg1 = make_byte_buffer();
ip_msg2 = make_byte_buffer();
@ -165,7 +164,6 @@ int tft_filter_test_single_local_port()
{
srslog::basic_logger& logger = srslog::fetch_basic_logger("TFT");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::unique_byte_buffer_t ip_msg1, ip_msg2;
ip_msg1 = make_byte_buffer();
ip_msg2 = make_byte_buffer();
@ -210,7 +208,6 @@ int tft_filter_test_single_remote_port()
{
srslog::basic_logger& logger = srslog::fetch_basic_logger("TFT");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::unique_byte_buffer_t ip_msg1, ip_msg2;
ip_msg1 = make_byte_buffer();
ip_msg2 = make_byte_buffer();
@ -255,7 +252,6 @@ int tft_filter_test_ipv4_local_addr()
{
srslog::basic_logger& logger = srslog::fetch_basic_logger("TFT");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::unique_byte_buffer_t ip_msg1, ip_msg2;
ip_msg1 = make_byte_buffer();
ip_msg2 = make_byte_buffer();
@ -303,7 +299,6 @@ int tft_filter_test_ipv4_remote_addr()
{
srslog::basic_logger& logger = srslog::fetch_basic_logger("TFT");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::unique_byte_buffer_t ip_msg1, ip_msg2;
ip_msg1 = make_byte_buffer();
ip_msg2 = make_byte_buffer();
@ -350,7 +345,6 @@ int tft_filter_test_ipv4_tos()
{
srslog::basic_logger& logger = srslog::fetch_basic_logger("TFT");
srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance();
srslte::unique_byte_buffer_t ip_msg1, ip_msg2;
ip_msg1 = make_byte_buffer();
ip_msg2 = make_byte_buffer();

Loading…
Cancel
Save