diff --git a/lib/include/srslte/common/basic_pnf.h b/lib/include/srslte/common/basic_pnf.h index 717faf494..91321a37d 100644 --- a/lib/include/srslte/common/basic_pnf.h +++ b/lib/include/srslte/common/basic_pnf.h @@ -510,7 +510,6 @@ private: std::unique_ptr 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; diff --git a/lib/include/srslte/common/basic_vnf.h b/lib/include/srslte/common/basic_vnf.h index fcd8f48fb..2c98cf15d 100644 --- a/lib/include/srslte/common/basic_vnf.h +++ b/lib/include/srslte/common/basic_vnf.h @@ -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 m_tx_req_msg; diff --git a/lib/include/srslte/common/mac_pcap.h b/lib/include/srslte/common/mac_pcap.h index cacc96ec7..83ff7dc3c 100644 --- a/lib/include/srslte/common/mac_pcap.h +++ b/lib/include/srslte/common/mac_pcap.h @@ -61,30 +61,29 @@ 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; - uint32_t dlt = 0; // The DLT used for the PCAP file - std::string filename; - FILE* pcap_file = nullptr; - uint32_t ue_id = 0; - void pack_and_queue(uint8_t* payload, - uint32_t payload_len, - uint32_t reTX, - bool crc_ok, - uint8_t cc_idx, - uint32_t tti, - uint16_t crnti_, - uint8_t direction, - uint8_t rnti_type); - void pack_and_queue_nr(uint8_t* payload, - uint32_t payload_len, - uint32_t tti, - uint16_t crnti, - uint8_t harqid, - uint8_t direction, - uint8_t rnti_type); + srslog::basic_logger& logger; + bool running = false; + srslte_rat_t rat = srslte_rat_t::nulltype; + uint32_t dlt = 0; // The DLT used for the PCAP file + std::string filename; + FILE* pcap_file = nullptr; + uint32_t ue_id = 0; + void pack_and_queue(uint8_t* payload, + uint32_t payload_len, + uint32_t reTX, + bool crc_ok, + uint8_t cc_idx, + uint32_t tti, + uint16_t crnti_, + uint8_t direction, + uint8_t rnti_type); + void pack_and_queue_nr(uint8_t* payload, + uint32_t payload_len, + uint32_t tti, + uint16_t crnti, + uint8_t harqid, + uint8_t direction, + uint8_t rnti_type); typedef struct { // Different PCAP context for both RATs diff --git a/lib/include/srslte/common/network_utils.h b/lib/include/srslte/common/network_utils.h index 454cd0e56..332938726 100644 --- a/lib/include/srslte/common/network_utils.h +++ b/lib/include/srslte/common/network_utils.h @@ -150,9 +150,8 @@ private: bool remove_socket_unprotected(int fd, fd_set* total_fd_set, int* max_fd); // args - std::string name; - srslog::basic_logger& logger; - srslte::byte_buffer_pool* pool = nullptr; + std::string name; + srslog::basic_logger& logger; // state std::mutex socket_mutex; diff --git a/lib/src/common/basic_vnf.cc b/lib/src/common/basic_vnf.cc index 500967533..de5793f92 100644 --- a/lib/src/common/basic_vnf.cc +++ b/lib/src/common/basic_vnf.cc @@ -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); diff --git a/lib/src/common/mac_pcap.cc b/lib/src/common/mac_pcap.cc index ea87403b5..a0b86c3c8 100644 --- a/lib/src/common/mac_pcap.cc +++ b/lib/src/common/mac_pcap.cc @@ -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() diff --git a/lib/src/common/network_utils.cc b/lib/src/common/network_utils.cc index 35a4f43dd..4b795cf9b 100644 --- a/lib/src/common/network_utils.cc +++ b/lib/src/common/network_utils.cc @@ -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,9 +479,8 @@ public: } private: - srslte::byte_buffer_pool* pool = nullptr; - srslog::basic_logger& logger; - callback_t func; + 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)); } diff --git a/lib/test/asn1/srslte_asn1_nas_test.cc b/lib/test/asn1/srslte_asn1_nas_test.cc index bc9a60f04..c8369412b 100644 --- a/lib/test/asn1/srslte_asn1_nas_test.cc +++ b/lib/test/asn1/srslte_asn1_nas_test.cc @@ -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(); diff --git a/lib/test/upper/pdcp_lte_test.h b/lib/test/upper/pdcp_lte_test.h index 2db79c18a..5311f6a1a 100644 --- a/lib/test/upper/pdcp_lte_test.h +++ b/lib/test/upper/pdcp_lte_test.h @@ -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 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 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)); } diff --git a/lib/test/upper/pdcp_lte_test_rx.cc b/lib/test/upper/pdcp_lte_test_rx.cc index 0931a480e..25145bc01 100644 --- a/lib/test/upper/pdcp_lte_test_rx.cc +++ b/lib/test/upper/pdcp_lte_test_rx.cc @@ -21,7 +21,6 @@ int test_rx(std::vector 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 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 test1_counts(2); // Test two packets std::iota(test1_counts.begin(), test1_counts.end(), 31); // Starting at COUNT 31 - std::vector 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 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 test_counts(2); // Test two packets std::iota(test_counts.begin(), test_counts.end(), 4095); // Starting at COUNT 4095 - std::vector 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 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 test_counts(2); // Test two packets std::iota(test_counts.begin(), test_counts.end(), 31); // Starting at COUNT 31 - std::vector 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 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; } diff --git a/lib/test/upper/pdcp_nr_test.h b/lib/test/upper/pdcp_nr_test.h index f7704b2fa..e2bce5bfa 100644 --- a/lib/test/upper/pdcp_nr_test.h +++ b/lib/test/upper/pdcp_nr_test.h @@ -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 gen_expected_pdus_vector(const srslte::unique_byt const std::vector& 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 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)); } diff --git a/lib/test/upper/pdcp_nr_test_discard_sdu.cc b/lib/test/upper/pdcp_nr_test_discard_sdu.cc index d4faae619..1fb59cb32 100644 --- a/lib/test/upper/pdcp_nr_test_discard_sdu.cc +++ b/lib/test/upper/pdcp_nr_test_discard_sdu.cc @@ -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; } diff --git a/lib/test/upper/pdcp_nr_test_rx.cc b/lib/test/upper/pdcp_nr_test_rx.cc index 6592ac99b..864e25535 100644 --- a/lib/test/upper/pdcp_nr_test_rx.cc +++ b/lib/test/upper/pdcp_nr_test_rx.cc @@ -20,7 +20,6 @@ int test_rx(std::vector 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 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 test1_counts(2); // Test two packets std::iota(test1_counts.begin(), test1_counts.end(), 4095); // Starting at COUNT 4095 std::vector 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 test2_counts(2); // Test two packets std::iota(test2_counts.begin(), test2_counts.end(), 4294967295); // Starting at COUNT 4294967295 std::vector 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 test3_counts(2); // Test two packets std::iota(test3_counts.begin(), test3_counts.end(), 262144); // Starting at COUNT 262144 std::vector 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 test4_counts(2); // Test two packets std::iota(test4_counts.begin(), test4_counts.end(), 4294967295); // Starting at COUNT 4294967295 std::vector 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; } diff --git a/lib/test/upper/pdcp_nr_test_tx.cc b/lib/test/upper/pdcp_nr_test_tx.cc index 119556121..0a4e67495 100644 --- a/lib/test/upper/pdcp_nr_test_tx.cc +++ b/lib/test/upper/pdcp_nr_test_tx.cc @@ -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; } diff --git a/srsenb/hdr/enb.h b/srsenb/hdr/enb.h index 292af36d2..aa97675bd 100644 --- a/srsenb/hdr/enb.h +++ b/srsenb/hdr/enb.h @@ -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; diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index fd79ccfaa..c603d0634 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -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 >pu_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; @@ -142,8 +142,7 @@ private: srsenb::s1ap s1ap; srslte::s1ap_pcap s1ap_pcap; - srslte::logger* logger = nullptr; - srslte::byte_buffer_pool* pool = nullptr; + srslte::logger* logger = nullptr; // Radio and PHY log are in enb.cc srslte::log_ref mac_log{"MAC"}; diff --git a/srsenb/hdr/stack/mac/mac_nr.h b/srsenb/hdr/stack/mac/mac_nr.h index ca14f921f..437f1168c 100644 --- a/srsenb/hdr/stack/mac/mac_nr.h +++ b/srsenb/hdr/stack/mac/mac_nr.h @@ -81,10 +81,9 @@ private: rlc_interface_mac_nr* rlc_h = nullptr; rrc_interface_mac_nr* rrc_h = nullptr; - std::unique_ptr pcap = nullptr; - srslte::log_ref log_h; - srslte::byte_buffer_pool* pool = nullptr; - mac_nr_args_t args = {}; + std::unique_ptr pcap = nullptr; + srslte::log_ref log_h; + mac_nr_args_t args = {}; bool started = false; diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index c8aa4102d..b45d96f74 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -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; diff --git a/srsenb/hdr/stack/rrc/rrc_mobility.h b/srsenb/hdr/stack/rrc/rrc_mobility.h index 6534c66c8..c4a75dcce 100644 --- a/srsenb/hdr/stack/rrc/rrc_mobility.h +++ b/srsenb/hdr/stack/rrc/rrc_mobility.h @@ -66,10 +66,9 @@ private: uint32_t src_pci); bool apply_ho_prep_cfg(const asn1::rrc::ho_prep_info_r8_ies_s& ho_prep, const asn1::s1ap::ho_request_s& ho_req_msg); - rrc::ue* rrc_ue = nullptr; - rrc* rrc_enb = nullptr; - srslte::byte_buffer_pool* pool = nullptr; - srslog::basic_logger& logger; + rrc::ue* rrc_ue = nullptr; + rrc* rrc_enb = nullptr; + srslog::basic_logger& logger; // vars asn1::rrc::meas_cfg_s current_meas_cfg; diff --git a/srsenb/hdr/stack/rrc/rrc_nr.h b/srsenb/hdr/stack/rrc/rrc_nr.h index 243a0834e..683d33acd 100644 --- a/srsenb/hdr/stack/rrc/rrc_nr.h +++ b/srsenb/hdr/stack/rrc/rrc_nr.h @@ -106,9 +106,8 @@ public: // setters private: - srslte::byte_buffer_pool* pool = nullptr; - rrc_nr* parent; - uint16_t rnti; + rrc_nr* parent; + uint16_t rnti; // state rrc_nr_state_t state = rrc_nr_state_t::RRC_IDLE; @@ -128,9 +127,8 @@ private: ngap_interface_rrc_nr* ngap = nullptr; // args - srslte::byte_buffer_pool* pool = nullptr; - srslte::log_ref m_log; - srslte::timer_handler* timers = nullptr; + srslte::log_ref m_log; + srslte::timer_handler* timers = nullptr; // derived uint32_t slot_dur_ms = 0; diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index 72230b256..98f88da70 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -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 diff --git a/srsenb/hdr/stack/upper/gtpu.h b/srsenb/hdr/stack/upper/gtpu.h index 73318a873..13336e254 100644 --- a/srsenb/hdr/stack/upper/gtpu.h +++ b/srsenb/hdr/stack/upper/gtpu.h @@ -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; diff --git a/srsenb/hdr/stack/upper/pdcp.h b/srsenb/hdr/stack/upper/pdcp.h index 92c7e8b56..b3d409286 100644 --- a/srsenb/hdr/stack/upper/pdcp.h +++ b/srsenb/hdr/stack/upper/pdcp.h @@ -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 diff --git a/srsenb/hdr/stack/upper/pdcp_nr.h b/srsenb/hdr/stack/upper/pdcp_nr.h index 6a25d00fe..06c42dc0a 100644 --- a/srsenb/hdr/stack/upper/pdcp_nr.h +++ b/srsenb/hdr/stack/upper/pdcp_nr.h @@ -100,12 +100,11 @@ 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; - sdap_interface_pdcp_nr* m_sdap = nullptr; + pdcp_nr_args_t m_args = {}; + srslte::log_ref m_log; + rlc_interface_pdcp_nr* m_rlc = nullptr; + rrc_interface_pdcp_nr* m_rrc = nullptr; + sdap_interface_pdcp_nr* m_sdap = nullptr; std::map users; diff --git a/srsenb/hdr/stack/upper/rlc.h b/srsenb/hdr/stack/upper/rlc.h index 79fe1337c..0dd19d1f3 100644 --- a/srsenb/hdr/stack/upper/rlc.h +++ b/srsenb/hdr/stack/upper/rlc.h @@ -89,12 +89,11 @@ private: std::map users; std::vector mch_services; - mac_interface_rlc* mac; - pdcp_interface_rlc* pdcp; - rrc_interface_rlc* rrc; - srslog::basic_logger& logger; - srslte::byte_buffer_pool* pool; - srslte::timer_handler* timers; + mac_interface_rlc* mac; + pdcp_interface_rlc* pdcp; + rrc_interface_rlc* rrc; + srslog::basic_logger& logger; + srslte::timer_handler* timers; }; } // namespace srsenb diff --git a/srsenb/hdr/stack/upper/rlc_nr.h b/srsenb/hdr/stack/upper/rlc_nr.h index 8089f0b4e..d36ffbc98 100644 --- a/srsenb/hdr/stack/upper/rlc_nr.h +++ b/srsenb/hdr/stack/upper/rlc_nr.h @@ -79,12 +79,11 @@ 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; - pdcp_interface_rlc_nr* m_pdcp = nullptr; - rrc_interface_rlc_nr* m_rrc = nullptr; + srslte::log_ref m_log; + srslte::timer_handler* timers = nullptr; + mac_interface_rlc_nr* m_mac = nullptr; + pdcp_interface_rlc_nr* m_pdcp = nullptr; + rrc_interface_rlc_nr* m_rrc = nullptr; // state std::map users; diff --git a/srsenb/hdr/stack/upper/s1ap.h b/srsenb/hdr/stack/upper/s1ap.h index 014afc8b9..28f0a75a9 100644 --- a/srsenb/hdr/stack/upper/s1ap.h +++ b/srsenb/hdr/stack/upper/s1ap.h @@ -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; diff --git a/srsenb/src/enb.cc b/srsenb/src/enb.cc index c8450957d..b93970eec 100644 --- a/srsenb/src/enb.cc +++ b/srsenb/src/enb.cc @@ -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") { diff --git a/srsenb/src/stack/enb_stack_lte.cc b/srsenb/src/stack/enb_stack_lte.cc index ecd3f684f..b3bd8ccab 100644 --- a/srsenb/src/stack/enb_stack_lte.cc +++ b/srsenb/src/stack/enb_stack_lte.cc @@ -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() diff --git a/srsenb/src/stack/mac/mac_nr.cc b/srsenb/src/stack/mac/mac_nr.cc index e7629d904..d431f6ed2 100644 --- a/srsenb/src/stack/mac/mac_nr.cc +++ b/srsenb/src/stack/mac/mac_nr.cc @@ -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(); diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 6b8f30ec0..2559c5f87 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -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) { diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index da1a3cc86..ea5e2accd 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -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 && diff --git a/srsenb/src/stack/rrc/rrc_mobility.cc b/srsenb/src/stack/rrc/rrc_mobility.cc index ad3d0723e..90d3711ef 100644 --- a/srsenb/src/stack/rrc/rrc_mobility.cc +++ b/srsenb/src/stack/rrc/rrc_mobility.cc @@ -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 diff --git a/srsenb/src/stack/rrc/rrc_nr.cc b/srsenb/src/stack/rrc/rrc_nr.cc index 0259011cb..6cacda4d3 100644 --- a/srsenb/src/stack/rrc/rrc_nr.cc +++ b/srsenb/src/stack/rrc/rrc_nr.cc @@ -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) { diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index e0a5da8be..590dbe1c0 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -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), diff --git a/srsenb/src/stack/upper/gtpu.cc b/srsenb/src/stack/upper/gtpu.cc index ef1373e7f..3a46c526a 100644 --- a/srsenb/src/stack/upper/gtpu.cc +++ b/srsenb/src/stack/upper/gtpu.cc @@ -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] = {}; diff --git a/srsenb/src/stack/upper/pdcp.cc b/srsenb/src/stack/upper/pdcp.cc index 3c06acf73..a0132390d 100644 --- a/srsenb/src/stack/upper/pdcp.cc +++ b/srsenb/src/stack/upper/pdcp.cc @@ -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_) diff --git a/srsenb/src/stack/upper/pdcp_nr.cc b/srsenb/src/stack/upper/pdcp_nr.cc index 4244a2207..8fb870811 100644 --- a/srsenb/src/stack/upper/pdcp_nr.cc +++ b/srsenb/src/stack/upper/pdcp_nr.cc @@ -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_, diff --git a/srsenb/src/stack/upper/rlc.cc b/srsenb/src/stack/upper/rlc.cc index d2c762f27..b4d246fce 100644 --- a/srsenb/src/stack/upper/rlc.cc +++ b/srsenb/src/stack/upper/rlc.cc @@ -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); } diff --git a/srsenb/src/stack/upper/rlc_nr.cc b/srsenb/src/stack/upper/rlc_nr.cc index 7a6beb6aa..02bd7454a 100644 --- a/srsenb/src/stack/upper/rlc_nr.cc +++ b/srsenb/src/stack/upper/rlc_nr.cc @@ -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_, diff --git a/srsenb/src/stack/upper/s1ap.cc b/srsenb/src/stack/upper/s1ap.cc index be42caacd..c782a2756 100644 --- a/srsenb/src/stack/upper/s1ap.cc +++ b/srsenb/src/stack/upper/s1ap.cc @@ -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(); diff --git a/srsenb/test/upper/test_helpers.h b/srsenb/test/upper/test_helpers.h index 38a03bcf0..ed31fd1a0 100644 --- a/srsenb/test/upper/test_helpers.h +++ b/srsenb/test/upper/test_helpers.h @@ -224,8 +224,7 @@ 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(); + pdu = srslte::make_byte_buffer(); memcpy(pdu->msg, msg.data(), msg.size()); pdu->N_bytes = msg.size(); } diff --git a/srsepc/hdr/mme/mme.h b/srsepc/hdr/mme/mme.h index 8bace603c..3f33d9ce3 100644 --- a/srsepc/hdr/mme/mme.h +++ b/srsepc/hdr/mme/mme.h @@ -63,9 +63,8 @@ private: s1ap* m_s1ap; mme_gtpc* m_mme_gtpc; - bool m_running; - srslte::byte_buffer_pool* m_pool; - fd_set m_set; + bool m_running; + fd_set m_set; // Timer map std::vector timers; diff --git a/srsepc/hdr/mme/nas.h b/srsepc/hdr/mme/nas.h index b91679874..7f11b462a 100644 --- a/srsepc/hdr/mme/nas.h +++ b/srsepc/hdr/mme/nas.h @@ -251,12 +251,11 @@ 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; - hss_interface_nas* m_hss = nullptr; - mme_interface_nas* m_mme = nullptr; + srslog::basic_logger& m_logger = srslog::fetch_basic_logger("NAS"); + gtpc_interface_nas* m_gtpc = nullptr; + s1ap_interface_nas* m_s1ap = nullptr; + hss_interface_nas* m_hss = nullptr; + mme_interface_nas* m_mme = nullptr; uint16_t m_mcc = 0; uint16_t m_mnc = 0; diff --git a/srsepc/hdr/mme/s1ap.h b/srsepc/hdr/mme/s1ap.h index 54a207818..5e849d44b 100644 --- a/srsepc/hdr/mme/s1ap.h +++ b/srsepc/hdr/mme/s1ap.h @@ -125,8 +125,7 @@ private: static s1ap* m_instance; - uint32_t m_plmn; - srslte::byte_buffer_pool* m_pool; + uint32_t m_plmn; hss_interface_nas* m_hss; int m_s1mme; diff --git a/srsepc/hdr/mme/s1ap_ctx_mngmt_proc.h b/srsepc/hdr/mme/s1ap_ctx_mngmt_proc.h index 6774644f8..e4b2f8d50 100644 --- a/srsepc/hdr/mme/s1ap_ctx_mngmt_proc.h +++ b/srsepc/hdr/mme/s1ap_ctx_mngmt_proc.h @@ -48,8 +48,7 @@ private: s1ap_args_t m_s1ap_args; - mme_gtpc* m_mme_gtpc; - srslte::byte_buffer_pool* m_pool; + mme_gtpc* m_mme_gtpc; }; } // namespace srsepc diff --git a/srsepc/hdr/mme/s1ap_erab_mngmt_proc.h b/srsepc/hdr/mme/s1ap_erab_mngmt_proc.h index 11612098a..7b3549c39 100644 --- a/srsepc/hdr/mme/s1ap_erab_mngmt_proc.h +++ b/srsepc/hdr/mme/s1ap_erab_mngmt_proc.h @@ -53,8 +53,7 @@ private: s1ap_args_t m_s1ap_args; - mme_gtpc* m_mme_gtpc = nullptr; - srslte::byte_buffer_pool* m_pool = nullptr; + mme_gtpc* m_mme_gtpc = nullptr; }; } // namespace srsepc diff --git a/srsepc/hdr/mme/s1ap_paging.h b/srsepc/hdr/mme/s1ap_paging.h index ca0deb67b..1af3560f3 100644 --- a/srsepc/hdr/mme/s1ap_paging.h +++ b/srsepc/hdr/mme/s1ap_paging.h @@ -41,8 +41,7 @@ private: s1ap* m_s1ap; srslog::basic_logger& m_logger = srslog::fetch_basic_logger("S1AP"); - s1ap_args_t m_s1ap_args; - srslte::byte_buffer_pool* m_pool; + s1ap_args_t m_s1ap_args; }; } // namespace srsepc diff --git a/srsepc/hdr/spgw/gtpc.h b/srsepc/hdr/spgw/gtpc.h index c7a9d8025..05f2e81cc 100644 --- a/srsepc/hdr/spgw/gtpc.h +++ b/srsepc/hdr/spgw/gtpc.h @@ -82,8 +82,7 @@ public: std::set m_ue_ip_addr_pool; std::map m_imsi_to_ip; - srslog::basic_logger& m_logger = srslog::fetch_basic_logger("SPGW GTPC"); - srslte::byte_buffer_pool* m_pool; + srslog::basic_logger& m_logger = srslog::fetch_basic_logger("SPGW GTPC"); }; inline int spgw::gtpc::get_s11() diff --git a/srsepc/src/mme/mme.cc b/srsepc/src/mme/mme.cc index f6a784933..119dd5147 100644 --- a/srsepc/src/mme/mme.cc +++ b/srsepc/src/mme/mme.cc @@ -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; } diff --git a/srsepc/src/mme/nas.cc b/srsepc/src/mme/nas.cc index 3c2c3fd75..b083439d0 100644 --- a/srsepc/src/mme/nas.cc +++ b/srsepc/src/mme/nas.cc @@ -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), @@ -328,9 +327,8 @@ bool nas::handle_guti_attach_request_unknown_ue(uint32_t const nas_if_t& itf) { - nas* nas_ctx; - srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance(); - srslte::byte_buffer_t* nas_tx; + nas* nas_ctx; + srslte::byte_buffer_t* nas_tx; // Interfaces s1ap_interface_nas* s1ap = itf.s1ap; @@ -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; @@ -771,8 +768,7 @@ bool nas::handle_tracking_area_update_request(uint32_t m_tmsi, const nas_init_t& args, const nas_if_t& itf) { - auto& nas_logger = srslog::fetch_basic_logger("NAS"); - srslte::byte_buffer_pool* pool = srslte::byte_buffer_pool::get_instance(); + auto& nas_logger = srslog::fetch_basic_logger("NAS"); 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,8 +1142,7 @@ 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; + srslte::byte_buffer_t* nas_tx; /* TAU handling unsupported, therefore send TAU reject with cause IMPLICITLY DETACHED. * this will trigger full re-attach by the UE, instead of going to a TAU request loop */ diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 0e7bd91ea..9b05d6015 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -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(); diff --git a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc index bd2c91688..73a2beebc 100644 --- a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc @@ -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) diff --git a/srsepc/src/mme/s1ap_erab_mngmt_proc.cc b/srsepc/src/mme/s1ap_erab_mngmt_proc.cc index d8db1c1eb..723962558 100644 --- a/srsepc/src/mme/s1ap_erab_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_erab_mngmt_proc.cc @@ -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, diff --git a/srsepc/src/mme/s1ap_paging.cc b/srsepc/src/mme/s1ap_paging.cc index c4b17b1dc..e7a29b8b2 100644 --- a/srsepc/src/mme/s1ap_paging.cc +++ b/srsepc/src/mme/s1ap_paging.cc @@ -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) diff --git a/srsepc/src/spgw/gtpc.cc b/srsepc/src/spgw/gtpc.cc index 545482cc5..9e051f213 100644 --- a/srsepc/src/spgw/gtpc.cc +++ b/srsepc/src/spgw/gtpc.cc @@ -48,7 +48,6 @@ int spgw::gtpc::init(spgw_args_t* args, const std::map& ip_to_imsi) { int err; - m_pool = srslte::byte_buffer_pool::get_instance(); // Init interfaces m_spgw = spgw; diff --git a/srsue/hdr/stack/mac/mac.h b/srsue/hdr/stack/mac/mac.h index 389bc1a50..975b59255 100644 --- a/srsue/hdr/stack/mac/mac.h +++ b/srsue/hdr/stack/mac/mac.h @@ -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; diff --git a/srsue/hdr/stack/mac_nr/mac_nr.h b/srsue/hdr/stack/mac_nr/mac_nr.h index 9520afd36..aa3c6e581 100644 --- a/srsue/hdr/stack/mac_nr/mac_nr.h +++ b/srsue/hdr/stack/mac_nr/mac_nr.h @@ -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); @@ -85,10 +84,9 @@ private: rlc_interface_mac* rlc = nullptr; srslte::ext_task_sched_handle task_sched; - std::unique_ptr pcap = nullptr; - srslog::basic_logger& logger; - srslte::byte_buffer_pool* pool = nullptr; - mac_nr_args_t args = {}; + std::unique_ptr pcap = nullptr; + srslog::basic_logger& logger; + mac_nr_args_t args = {}; bool started = false; diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 93cafacf5..f64585b9a 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -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; diff --git a/srsue/hdr/stack/upper/gw.h b/srsue/hdr/stack/upper/gw.h index 4cbfc2542..00da23f97 100644 --- a/srsue/hdr/stack/upper/gw.h +++ b/srsue/hdr/stack/upper/gw.h @@ -69,9 +69,8 @@ public: private: static const int GW_THREAD_PRIO = -1; - stack_interface_gw* stack = nullptr; - srslte::byte_buffer_pool* pool = nullptr; - srslte::logger* old_logger = nullptr; + stack_interface_gw* stack = nullptr; + srslte::logger* old_logger = nullptr; gw_args_t args = {}; @@ -85,7 +84,7 @@ private: uint32_t default_lcid = 0; srslog::basic_logger& logger; - + std::map eps_lcid; // Mapping between eps bearer ID and LCID uint32_t current_ip_addr = 0; diff --git a/srsue/hdr/stack/upper/nas.h b/srsue/hdr/stack/upper/nas.h index 8aaeca086..dae5ec7a4 100644 --- a/srsue/hdr/stack/upper/nas.h +++ b/srsue/hdr/stack/upper/nas.h @@ -73,11 +73,10 @@ 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; - gw_interface_nas* gw = nullptr; + srslog::basic_logger& logger; + rrc_interface_nas* rrc = nullptr; + usim_interface_nas* usim = nullptr; + gw_interface_nas* gw = nullptr; bool running = false; diff --git a/srsue/hdr/ue.h b/srsue/hdr/ue.h index 5a0ebc1d2..3dbdebdf9 100644 --- a/srsue/hdr/ue.h +++ b/srsue/hdr/ue.h @@ -110,8 +110,7 @@ private: srslog::sink& log_sink; srslog::basic_logger& logger; - all_args_t args; - srslte::byte_buffer_pool* pool = nullptr; + all_args_t args; // Helper functions int parse_args(const all_args_t& args); // parse and validate arguments diff --git a/srsue/src/stack/mac/mac.cc b/srsue/src/stack/mac/mac.cc index 6d5e38698..48e653b79 100644 --- a/srsue/src/stack/mac/mac.cc +++ b/srsue/src/stack/mac/mac.cc @@ -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(); diff --git a/srsue/src/stack/mac_nr/mac_nr.cc b/srsue/src/stack/mac_nr/mac_nr.cc index 3c17a2cfb..24bb8d240 100644 --- a/srsue/src/stack/mac_nr/mac_nr.cc +++ b/srsue/src/stack/mac_nr/mac_nr.cc @@ -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(); diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 5af8dbde9..450dbb965 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -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_; diff --git a/srsue/src/stack/upper/gw.cc b/srsue/src/stack/upper/gw.cc index 86626c746..80e647140 100644 --- a/srsue/src/stack/upper/gw.cc +++ b/srsue/src/stack/upper/gw.cc @@ -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_) { diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index 097e861fd..2e2786d34 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -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()), diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index f8f231810..c4469c3d8 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -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() diff --git a/srsue/test/ttcn3/hdr/ttcn3_drb_interface.h b/srsue/test/ttcn3/hdr/ttcn3_drb_interface.h index 248ca37ea..be73a14d3 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_drb_interface.h +++ b/srsue/test/ttcn3/hdr/ttcn3_drb_interface.h @@ -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 diff --git a/srsue/test/ttcn3/hdr/ttcn3_syssim.h b/srsue/test/ttcn3/hdr/ttcn3_syssim.h index fa40aa3a6..92f450136 100644 --- a/srsue/test/ttcn3/hdr/ttcn3_syssim.h +++ b/srsue/test/ttcn3/hdr/ttcn3_syssim.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; diff --git a/srsue/test/ttcn3/src/ttcn3_syssim.cc b/srsue/test/ttcn3/src/ttcn3_syssim.cc index db68cf4ad..dc10f3487 100644 --- a/srsue/test/ttcn3/src/ttcn3_syssim.cc +++ b/srsue/test/ttcn3/src/ttcn3_syssim.cc @@ -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); }) diff --git a/srsue/test/upper/nas_test.cc b/srsue/test/upper/nas_test.cc index 58214cfa0..4e2283d0c 100644 --- a/srsue/test/upper/nas_test.cc +++ b/srsue/test/upper/nas_test.cc @@ -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 diff --git a/srsue/test/upper/rrc_meas_test.cc b/srsue/test/upper/rrc_meas_test.cc index 0fa9988d9..912492e4a 100644 --- a/srsue/test/upper/rrc_meas_test.cc +++ b/srsue/test/upper/rrc_meas_test.cc @@ -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(new nas_test(&stack->task_sched)); pdcptest = std::unique_ptr(new pdcp_test(log_->get_service_name().c_str(), &stack->task_sched)); rrcnrtest = std::unique_ptr(new rrc_nr_test()); @@ -374,8 +373,7 @@ private: std::unique_ptr pdcptest; std::unique_ptr nastest; std::unique_ptr rrcnrtest; - uint32_t tti = 0; - srslte::byte_buffer_pool* pool = nullptr; + uint32_t tti = 0; }; // Test Cell select diff --git a/srsue/test/upper/tft_test.cc b/srsue/test/upper/tft_test.cc index 33e3d388b..fdf8ed41e 100644 --- a/srsue/test/upper/tft_test.cc +++ b/srsue/test/upper/tft_test.cc @@ -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();