From ebef8a4cc46f6867c6ec5bac6d6d6f6a7a5d5c8c Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 1 Sep 2021 14:13:18 +0200 Subject: [PATCH] enb_stack_lte: implement the PDCP interface for GTPU on the stack this prepares for a change in which GTPU no longer writes into PDCP directly but instead uses the stack as a wrapper. For this the interface will be changed to use the EPS bearer ID instead of the LCID The stack will know which PDCP entity (EUTRA or NR) is currently associated with the EPS bearer ID and will forward the PDU accordingly. --- srsenb/hdr/stack/enb_stack_lte.h | 5 +++++ srsenb/src/stack/enb_stack_lte.cc | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/srsenb/hdr/stack/enb_stack_lte.h b/srsenb/hdr/stack/enb_stack_lte.h index 925c64f5e..94d970b63 100644 --- a/srsenb/hdr/stack/enb_stack_lte.h +++ b/srsenb/hdr/stack/enb_stack_lte.h @@ -38,6 +38,7 @@ namespace srsenb { class enb_stack_lte final : public enb_stack_base, public stack_interface_phy_lte, public stack_interface_phy_nr, + public pdcp_interface_gtpu, public srsran::thread { public: @@ -132,6 +133,10 @@ public: } void rach_detected(const rach_info_t& rach_info) override { mac_nr.rach_detected(rach_info); } + // pdcp_interface_gtpu + void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu, int pdcp_sn = -1) override; + std::map get_buffered_pdus(uint16_t rnti, uint32_t lcid) override; + private: static const int STACK_MAIN_THREAD_PRIO = 4; // thread loop diff --git a/srsenb/src/stack/enb_stack_lte.cc b/srsenb/src/stack/enb_stack_lte.cc index e936d3a79..14e231dcb 100644 --- a/srsenb/src/stack/enb_stack_lte.cc +++ b/srsenb/src/stack/enb_stack_lte.cc @@ -187,7 +187,7 @@ int enb_stack_lte::init(const stack_args_t& args_, const rrc_cfg_t& rrc_cfg_) gtpu_args.mme_addr = args.s1ap.mme_addr; gtpu_args.gtp_bind_addr = args.s1ap.gtp_bind_addr; gtpu_args.indirect_tunnel_timeout_msec = args.gtpu_indirect_tunnel_timeout_msec; - if (gtpu.init(gtpu_args, &pdcp) != SRSRAN_SUCCESS) { + if (gtpu.init(gtpu_args, this) != SRSRAN_SUCCESS) { stack_logger.error("Couldn't initialize GTPU"); return SRSRAN_ERROR; } @@ -278,4 +278,17 @@ void enb_stack_lte::run_thread() } } +void enb_stack_lte::write_sdu(uint16_t rnti, + uint32_t lcid /* to be replaced with eps_bearer_id */, + srsran::unique_byte_buffer_t sdu, + int pdcp_sn) +{ + pdcp.write_sdu(rnti, lcid, std::move(sdu), pdcp_sn); +} + +std::map enb_stack_lte::get_buffered_pdus(uint16_t rnti, uint32_t lcid) +{ + return pdcp.get_buffered_pdus(rnti, lcid); +} + } // namespace srsenb