diff --git a/lib/include/srslte/adt/bounded_vector.h b/lib/include/srslte/adt/bounded_vector.h index c1cf124b9..9f4a08733 100644 --- a/lib/include/srslte/adt/bounded_vector.h +++ b/lib/include/srslte/adt/bounded_vector.h @@ -127,6 +127,7 @@ public: bool empty() const { return size_ == 0; } std::size_t size() const { return size_; } std::size_t capacity() const { return MAX_N; } + bool full() const { return size_ == MAX_N; } // modifiers void clear() diff --git a/lib/include/srslte/interfaces/enb_pdcp_interfaces.h b/lib/include/srslte/interfaces/enb_pdcp_interfaces.h index ba5ee32f3..719c46e4f 100644 --- a/lib/include/srslte/interfaces/enb_pdcp_interfaces.h +++ b/lib/include/srslte/interfaces/enb_pdcp_interfaces.h @@ -53,8 +53,8 @@ class pdcp_interface_rlc public: /* RLC calls PDCP to push a PDCP PDU. */ virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0; - virtual void notify_delivery(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sns) = 0; - virtual void notify_failure(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sns) = 0; + virtual void notify_delivery(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) = 0; + virtual void notify_failure(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) = 0; }; } // namespace srsenb diff --git a/lib/include/srslte/interfaces/gnb_interfaces.h b/lib/include/srslte/interfaces/gnb_interfaces.h index dcfd6be86..dc0a36374 100644 --- a/lib/include/srslte/interfaces/gnb_interfaces.h +++ b/lib/include/srslte/interfaces/gnb_interfaces.h @@ -83,8 +83,8 @@ class pdcp_interface_rlc_nr public: /* RLC calls PDCP to push a PDCP PDU. */ virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0; - virtual void notify_delivery(uint16_t rnti, uint32_t lcid, const std::vector& tx_count) = 0; - virtual void notify_failure(uint16_t rnti, uint32_t lcid, const std::vector& tx_count) = 0; + virtual void notify_delivery(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) = 0; + virtual void notify_failure(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) = 0; }; class pdcp_interface_rrc_nr diff --git a/lib/include/srslte/interfaces/pdcp_interface_types.h b/lib/include/srslte/interfaces/pdcp_interface_types.h index e4f21a656..5db48df2e 100644 --- a/lib/include/srslte/interfaces/pdcp_interface_types.h +++ b/lib/include/srslte/interfaces/pdcp_interface_types.h @@ -18,6 +18,7 @@ #ifndef SRSLTE_PDCP_INTERFACE_TYPES_H #define SRSLTE_PDCP_INTERFACE_TYPES_H +#include "srslte/adt/bounded_vector.h" #include "srslte/common/security.h" #include #include @@ -168,6 +169,11 @@ struct pdcp_lte_state_t { uint32_t reordering_pdcp_rx_count; }; +// Custom type for interface between PDCP and RLC to convey SDU delivery status +#define MAX_SDUS_PER_RLC_PDU (256) // default to RLC SDU queue length +#define MAX_SDUS_TO_NOTIFY (MAX_SDUS_PER_RLC_PDU) // Arbitrarily chosen limit +typedef srslte::bounded_vector pdcp_sn_vector_t; + } // namespace srslte #endif // SRSLTE_PDCP_INTERFACE_TYPES_H diff --git a/lib/include/srslte/interfaces/ue_pdcp_interfaces.h b/lib/include/srslte/interfaces/ue_pdcp_interfaces.h index 681902b54..0a66dcf88 100644 --- a/lib/include/srslte/interfaces/ue_pdcp_interfaces.h +++ b/lib/include/srslte/interfaces/ue_pdcp_interfaces.h @@ -44,8 +44,8 @@ public: virtual void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t sdu) = 0; virtual void write_pdu_pcch(srslte::unique_byte_buffer_t sdu) = 0; virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0; - virtual void notify_delivery(uint32_t lcid, const std::vector& pdcp_sn) = 0; - virtual void notify_failure(uint32_t lcid, const std::vector& pdcp_sn) = 0; + virtual void notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn) = 0; + virtual void notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn) = 0; }; class pdcp_interface_gw diff --git a/lib/include/srslte/upper/pdcp.h b/lib/include/srslte/upper/pdcp.h index 12366719b..36401bfc1 100644 --- a/lib/include/srslte/upper/pdcp.h +++ b/lib/include/srslte/upper/pdcp.h @@ -59,8 +59,8 @@ public: void write_pdu_bcch_bch(unique_byte_buffer_t sdu) override; void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) override; void write_pdu_pcch(unique_byte_buffer_t sdu) override; - void notify_delivery(uint32_t lcid, const std::vector& pdcp_sn) override; - void notify_failure(uint32_t lcid, const std::vector& pdcp_sn) override; + void notify_delivery(uint32_t lcid, const pdcp_sn_vector_t& pdcp_sns) override; + void notify_failure(uint32_t lcid, const pdcp_sn_vector_t& pdcp_sns) override; // eNB-only methods std::map get_buffered_pdus(uint32_t lcid); diff --git a/lib/include/srslte/upper/pdcp_entity_base.h b/lib/include/srslte/upper/pdcp_entity_base.h index 213738dae..1d30146fb 100644 --- a/lib/include/srslte/upper/pdcp_entity_base.h +++ b/lib/include/srslte/upper/pdcp_entity_base.h @@ -113,8 +113,8 @@ public: // RLC interface virtual void write_pdu(unique_byte_buffer_t pdu) = 0; - virtual void notify_delivery(const std::vector& pdcp_sns) = 0; - virtual void notify_failure(const std::vector& pdcp_sns) = 0; + virtual void notify_delivery(const pdcp_sn_vector_t& pdcp_sns) = 0; + virtual void notify_failure(const pdcp_sn_vector_t& pdcp_sns) = 0; virtual void get_bearer_state(pdcp_lte_state_t* state) = 0; virtual void set_bearer_state(const pdcp_lte_state_t& state) = 0; diff --git a/lib/include/srslte/upper/pdcp_entity_lte.h b/lib/include/srslte/upper/pdcp_entity_lte.h index 13a017430..259c903b9 100644 --- a/lib/include/srslte/upper/pdcp_entity_lte.h +++ b/lib/include/srslte/upper/pdcp_entity_lte.h @@ -120,8 +120,8 @@ public: // RLC interface void write_pdu(unique_byte_buffer_t pdu) override; - void notify_failure(const std::vector& pdcp_sns) override; - void notify_delivery(const std::vector& pdcp_sns) override; + void notify_failure(const pdcp_sn_vector_t& pdcp_sns) override; + void notify_delivery(const pdcp_sn_vector_t& pdcp_sns) override; // Config helpers bool check_valid_config(); diff --git a/lib/include/srslte/upper/pdcp_entity_nr.h b/lib/include/srslte/upper/pdcp_entity_nr.h index 12baf2903..02d31ea69 100644 --- a/lib/include/srslte/upper/pdcp_entity_nr.h +++ b/lib/include/srslte/upper/pdcp_entity_nr.h @@ -51,8 +51,8 @@ public: // RLC interface void write_pdu(unique_byte_buffer_t pdu) final; - void notify_delivery(const std::vector& tx_count) final; - void notify_failure(const std::vector& tx_count) final; + void notify_delivery(const pdcp_sn_vector_t& pdcp_sns) final; + void notify_failure(const pdcp_sn_vector_t& pdcp_sns) final; // State variable setters (should be used only for testing) void set_tx_next(uint32_t tx_next_) { tx_next = tx_next_; } diff --git a/lib/include/srslte/upper/rlc_am_lte.h b/lib/include/srslte/upper/rlc_am_lte.h index 8e7dbef0e..b66b83c9b 100644 --- a/lib/include/srslte/upper/rlc_am_lte.h +++ b/lib/include/srslte/upper/rlc_am_lte.h @@ -20,6 +20,7 @@ #include "srslte/common/log.h" #include "srslte/common/task_scheduler.h" #include "srslte/common/timeout.h" +#include "srslte/interfaces/pdcp_interface_types.h" #include "srslte/upper/byte_buffer_queue.h" #include "srslte/upper/rlc_am_base.h" #include "srslte/upper/rlc_common.h" @@ -42,12 +43,12 @@ struct rlc_amd_rx_pdu_segments_t { }; struct rlc_amd_tx_pdu_t { - rlc_amd_pdu_header_t header; - unique_byte_buffer_t buf; - std::vector pdcp_sns; - uint32_t retx_count; - uint32_t rlc_sn; - bool is_acked; + rlc_amd_pdu_header_t header; + unique_byte_buffer_t buf; + pdcp_sn_vector_t pdcp_sns; + uint32_t retx_count; + uint32_t rlc_sn; + bool is_acked; }; struct rlc_amd_retx_t { @@ -346,7 +347,7 @@ private: // Tx windows rlc_ringbuffer_t tx_window; pdu_retx_queue retx_queue; - std::vector notify_info_vec; + pdcp_sn_vector_t notify_info_vec; // Mutexes pthread_mutex_t mutex; diff --git a/lib/include/srslte/upper/rlc_common.h b/lib/include/srslte/upper/rlc_common.h index ab32faa53..4c8e72836 100644 --- a/lib/include/srslte/upper/rlc_common.h +++ b/lib/include/srslte/upper/rlc_common.h @@ -28,6 +28,7 @@ namespace srslte { #define RLC_AM_WINDOW_SIZE 512 #define RLC_MAX_SDU_SIZE ((1 << 11) - 1) // Length of LI field is 11bits +#define RLC_AM_MIN_DATA_PDU_SIZE (3) // AMD PDU with 10 bit SN (length of LI field is 11 bits) (No LI) typedef enum { RLC_FI_FIELD_START_AND_END_ALIGNED = 0, diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 7d6ca647a..17f3371dc 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -285,7 +285,7 @@ void pdcp::write_pdu_mch(uint32_t lcid, unique_byte_buffer_t sdu) } } -void pdcp::notify_delivery(uint32_t lcid, const std::vector& pdcp_sns) +void pdcp::notify_delivery(uint32_t lcid, const pdcp_sn_vector_t& pdcp_sns) { if (valid_lcid(lcid)) { pdcp_array.at(lcid)->notify_delivery(pdcp_sns); @@ -294,7 +294,7 @@ void pdcp::notify_delivery(uint32_t lcid, const std::vector& pdcp_sns) } } -void pdcp::notify_failure(uint32_t lcid, const std::vector& pdcp_sns) +void pdcp::notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { if (valid_lcid(lcid)) { pdcp_array.at(lcid)->notify_failure(pdcp_sns); diff --git a/lib/src/upper/pdcp_entity_lte.cc b/lib/src/upper/pdcp_entity_lte.cc index c42740e2e..ef68ccbfa 100644 --- a/lib/src/upper/pdcp_entity_lte.cc +++ b/lib/src/upper/pdcp_entity_lte.cc @@ -652,7 +652,7 @@ void pdcp_entity_lte::discard_callback::operator()(uint32_t timer_id) /**************************************************************************** * Handle delivery/failure notifications from RLC ***************************************************************************/ -void pdcp_entity_lte::notify_delivery(const std::vector& pdcp_sns) +void pdcp_entity_lte::notify_delivery(const pdcp_sn_vector_t& pdcp_sns) { if (not is_drb()) { return; @@ -682,7 +682,7 @@ void pdcp_entity_lte::notify_delivery(const std::vector& pdcp_sns) } } -void pdcp_entity_lte::notify_failure(const std::vector& pdcp_sns) +void pdcp_entity_lte::notify_failure(const pdcp_sn_vector_t& pdcp_sns) { if (not is_drb()) { return; diff --git a/lib/src/upper/pdcp_entity_nr.cc b/lib/src/upper/pdcp_entity_nr.cc index 863270e84..7cd034d84 100644 --- a/lib/src/upper/pdcp_entity_nr.cc +++ b/lib/src/upper/pdcp_entity_nr.cc @@ -203,12 +203,12 @@ void pdcp_entity_nr::write_pdu(unique_byte_buffer_t pdu) } // Notification of delivery/failure -void pdcp_entity_nr::notify_delivery(const std::vector& pdcp_sns) +void pdcp_entity_nr::notify_delivery(const pdcp_sn_vector_t& pdcp_sns) { logger.debug("Received delivery notification from RLC. Nof SNs=%ld", pdcp_sns.size()); } -void pdcp_entity_nr::notify_failure(const std::vector& pdcp_sns) +void pdcp_entity_nr::notify_failure(const pdcp_sn_vector_t& pdcp_sns) { logger.debug("Received failure notification from RLC. Nof SNs=%ld", pdcp_sns.size()); } diff --git a/lib/src/upper/rlc_am_lte.cc b/lib/src/upper/rlc_am_lte.cc index 5e73b420c..c207a3186 100644 --- a/lib/src/upper/rlc_am_lte.cc +++ b/lib/src/upper/rlc_am_lte.cc @@ -211,7 +211,6 @@ rlc_am_lte::rlc_am_lte_tx::rlc_am_lte_tx(rlc_am_lte* parent_) : status_prohibit_timer(parent_->timers->get_unique_timer()) { pthread_mutex_init(&mutex, NULL); - notify_info_vec.reserve(RLC_AM_WINDOW_SIZE); } rlc_am_lte::rlc_am_lte_tx::~rlc_am_lte_tx() @@ -226,7 +225,14 @@ void rlc_am_lte::rlc_am_lte_tx::set_bsr_callback(bsr_callback_t callback) bool rlc_am_lte::rlc_am_lte_tx::configure(const rlc_config_t& cfg_) { - // TODO: add config checks + if (cfg_.tx_queue_length > MAX_SDUS_PER_RLC_PDU) { + logger.error("Configuring Tx queue length of %d PDUs too big. Maximum value is %d.", + cfg_.tx_queue_length, + MAX_SDUS_PER_RLC_PDU); + return false; + } + + // TODO: add more config checks cfg = cfg_.am; // check timers @@ -890,6 +896,14 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt return 0; } + if (nof_bytes < RLC_AM_MIN_DATA_PDU_SIZE) { + logger.info("%s Cannot build data PDU - %d bytes available but at least %d bytes are required ", + RB_NAME, + nof_bytes, + RLC_AM_MIN_DATA_PDU_SIZE); + return 0; + } + unique_byte_buffer_t pdu = srslte::make_byte_buffer(); if (pdu == NULL) { #ifdef RLC_AM_BUFFER_DEBUG @@ -912,22 +926,20 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt header.fi = RLC_FI_FIELD_START_AND_END_ALIGNED; header.sn = vt_s; + // insert newly assigned SN into window and use reference for in-place operations + // NOTE: from now on, we can't return from this function anymore before increasing vt_s + rlc_amd_tx_pdu_t& tx_pdu = tx_window.add_pdu(header.sn); + tx_pdu.pdcp_sns.clear(); + uint32_t head_len = rlc_am_packed_length(&header); uint32_t to_move = 0; uint32_t last_li = 0; uint32_t pdu_space = SRSLTE_MIN(nof_bytes, pdu->get_tailroom()); uint8_t* pdu_ptr = pdu->msg; - if (pdu_space <= head_len) { - logger.info( - "%s Cannot build a PDU - %d bytes available, %d bytes required for header", RB_NAME, nof_bytes, head_len); - return 0; - } - logger.debug("%s Building PDU - pdu_space: %d, head_len: %d ", RB_NAME, pdu_space, head_len); // Check for SDU segment - std::vector pdcp_sns; if (tx_sdu != nullptr) { to_move = ((pdu_space - head_len) >= tx_sdu->N_bytes) ? tx_sdu->N_bytes : pdu_space - head_len; memcpy(pdu_ptr, tx_sdu->msg, to_move); @@ -939,7 +951,11 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt if (undelivered_sdu_info_queue.has_pdcp_sn(tx_sdu->md.pdcp_sn)) { pdcp_sdu_info_t& pdcp_sdu = undelivered_sdu_info_queue[tx_sdu->md.pdcp_sn]; pdcp_sdu.rlc_sn_info_list.push_back({header.sn, false}); - pdcp_sns.push_back(tx_sdu->md.pdcp_sn); + if (not tx_pdu.pdcp_sns.full()) { + tx_pdu.pdcp_sns.push_back(tx_sdu->md.pdcp_sn); + } else { + logger.warning("Cant't store PDCP_SN=%d for delivery notification.", tx_sdu->md.pdcp_sn); + } if (tx_sdu->N_bytes == 0) { pdcp_sdu.fully_txed = true; } @@ -992,7 +1008,11 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt if (undelivered_sdu_info_queue.has_pdcp_sn(tx_sdu->md.pdcp_sn)) { pdcp_sdu_info_t& pdcp_sdu = undelivered_sdu_info_queue[tx_sdu->md.pdcp_sn]; pdcp_sdu.rlc_sn_info_list.push_back({header.sn, false}); - pdcp_sns.push_back(tx_sdu->md.pdcp_sn); + if (not tx_pdu.pdcp_sns.full()) { + tx_pdu.pdcp_sns.push_back(tx_sdu->md.pdcp_sn); + } else { + logger.warning("Cant't store PDCP_SN=%d for delivery notification.", tx_sdu->md.pdcp_sn); + } if (tx_sdu->N_bytes == 0) { pdcp_sdu.fully_txed = true; } @@ -1021,7 +1041,6 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt // Make sure, at least one SDU (segment) has been added until this point if (pdu->N_bytes == 0) { logger.error("Generated empty RLC PDU."); - return 0; } if (tx_sdu != NULL) { @@ -1044,19 +1063,16 @@ int rlc_am_lte::rlc_am_lte_tx::build_data_pdu(uint8_t* payload, uint32_t nof_byt } } - // Set SN - header.sn = vt_s; + // Update Tx window vt_s = (vt_s + 1) % MOD; - // Place PDU in tx_window, write header and TX - tx_window.add_pdu(header.sn); - tx_window[header.sn].buf = std::move(pdu); - tx_window[header.sn].header = header; - tx_window[header.sn].is_acked = false; - tx_window[header.sn].retx_count = 0; - tx_window[header.sn].rlc_sn = header.sn; - tx_window[header.sn].pdcp_sns = std::move(pdcp_sns); - const byte_buffer_t* buffer_ptr = tx_window[header.sn].buf.get(); + // Write final header and TX + tx_pdu.buf = std::move(pdu); + tx_pdu.header = header; + tx_pdu.is_acked = false; + tx_pdu.retx_count = 0; + tx_pdu.rlc_sn = header.sn; + const byte_buffer_t* buffer_ptr = tx_pdu.buf.get(); uint8_t* ptr = payload; rlc_am_write_data_pdu_header(&header, &ptr); @@ -1204,7 +1220,7 @@ void rlc_am_lte::rlc_am_lte_tx::update_notification_ack_info(const rlc_amd_tx_pd if (not tx_window.has_sn(tx_pdu.header.sn)) { return; } - std::vector& pdcp_sns = tx_window[tx_pdu.header.sn].pdcp_sns; + pdcp_sn_vector_t& pdcp_sns = tx_window[tx_pdu.header.sn].pdcp_sns; for (uint32_t pdcp_sn : pdcp_sns) { // Iterate over all SNs that were TX'ed auto& info = undelivered_sdu_info_queue[pdcp_sn]; @@ -1221,7 +1237,11 @@ void rlc_am_lte::rlc_am_lte_tx::update_notification_ack_info(const rlc_amd_tx_pd info.rlc_sn_info_list.end(), [](rlc_sn_info_t rlc_sn_info) { return rlc_sn_info.is_acked; }); if (info.fully_acked) { - notify_info_vec.push_back(pdcp_sn); + if (not notify_info_vec.full()) { + notify_info_vec.push_back(pdcp_sn); + } else { + logger.warning("Can't notify delivery of PDCP_SN=%d.", pdcp_sn); + } } } } diff --git a/lib/test/upper/pdcp_lte_test_discard_sdu.cc b/lib/test/upper/pdcp_lte_test_discard_sdu.cc index d5582e307..5b700e39c 100644 --- a/lib/test/upper/pdcp_lte_test_discard_sdu.cc +++ b/lib/test/upper/pdcp_lte_test_discard_sdu.cc @@ -45,7 +45,8 @@ int test_tx_sdu_notify(const srslte::pdcp_lte_state_t& init_state, TESTASSERT(out_pdu->N_bytes == 4); TESTASSERT(pdcp->nof_discard_timers() == 1); // One timer should be running - std::vector sns_notified = {0}; + srslte::pdcp_sn_vector_t sns_notified; + sns_notified.push_back(0); pdcp->notify_delivery(sns_notified); TESTASSERT(pdcp->nof_discard_timers() == 0); // Timer should have been difused after @@ -103,7 +104,8 @@ int test_tx_sdu_discard(const srslte::pdcp_lte_state_t& init_state, TESTASSERT(pdcp->nof_discard_timers() == 0); // Timer should have been difused after expiry TESTASSERT(rlc->discard_count == 1); // RLC should be notified of discard - std::vector sns_notified = {0}; + srslte::pdcp_sn_vector_t sns_notified; + sns_notified.push_back(0); pdcp->notify_delivery(sns_notified); // PDCP should not find PDU to notify. return 0; } diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/upper/rlc_am_test.cc index 2c3d20a55..fafc7cea4 100644 --- a/lib/test/upper/rlc_am_test.cc +++ b/lib/test/upper/rlc_am_test.cc @@ -52,7 +52,7 @@ public: void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {} void write_pdu_pcch(unique_byte_buffer_t sdu) {} void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {} - void notify_delivery(uint32_t lcid, const std::vector& pdcp_sn_vec) + void notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn_vec) { assert(lcid == 1); for (uint32_t pdcp_sn : pdcp_sn_vec) { @@ -62,7 +62,7 @@ public: notified_counts[pdcp_sn] += 1; } } - void notify_failure(uint32_t lcid, const std::vector& pdcp_sn_vec) + void notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn_vec) { assert(lcid == 1); // TODO diff --git a/lib/test/upper/rlc_common_test.cc b/lib/test/upper/rlc_common_test.cc index 79d223dc6..2fae1781e 100644 --- a/lib/test/upper/rlc_common_test.cc +++ b/lib/test/upper/rlc_common_test.cc @@ -46,8 +46,8 @@ public: } sdus[n_sdus++] = std::move(sdu); } - void notify_delivery(uint32_t lcid, const std::vector& pdcp_sn) {} - void notify_failure(uint32_t lcid, const std::vector& pdcp_sn) {} + void notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn) {} + void notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn) {} void write_pdu_bcch_bch(unique_byte_buffer_t sdu) {} void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {} void write_pdu_pcch(unique_byte_buffer_t sdu) {} diff --git a/lib/test/upper/rlc_stress_test.cc b/lib/test/upper/rlc_stress_test.cc index 4313f327e..b1225f76d 100644 --- a/lib/test/upper/rlc_stress_test.cc +++ b/lib/test/upper/rlc_stress_test.cc @@ -368,8 +368,8 @@ public: void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {} void write_pdu_pcch(unique_byte_buffer_t sdu) {} void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {} - void notify_delivery(uint32_t lcid, const std::vector& pdcp_sns) {} - void notify_failure(uint32_t lcid, const std::vector& pdcp_sns) {} + void notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) {} + void notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) {} // RRC interface void max_retx_attempted() diff --git a/lib/test/upper/rlc_test_common.h b/lib/test/upper/rlc_test_common.h index c97cf9a21..6bf75d5a3 100644 --- a/lib/test/upper/rlc_test_common.h +++ b/lib/test/upper/rlc_test_common.h @@ -51,8 +51,8 @@ public: void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {} void write_pdu_pcch(unique_byte_buffer_t sdu) {} void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) { sdus.push_back(std::move(sdu)); } - void notify_delivery(uint32_t lcid, const std::vector& pdcp_sns) {} - void notify_failure(uint32_t lcid, const std::vector& pdcp_sns) {} + void notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) {} + void notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) {} // RRC interface void max_retx_attempted() {} diff --git a/srsenb/hdr/stack/upper/pdcp.h b/srsenb/hdr/stack/upper/pdcp.h index 14d9469e5..2f9d4dfe7 100644 --- a/srsenb/hdr/stack/upper/pdcp.h +++ b/srsenb/hdr/stack/upper/pdcp.h @@ -38,8 +38,8 @@ public: // pdcp_interface_rlc void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) override; - void notify_delivery(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sn) override; - void notify_failure(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sn) override; + void notify_delivery(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn) override; + void notify_failure(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn) override; void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {} // pdcp_interface_rrc diff --git a/srsenb/hdr/stack/upper/pdcp_nr.h b/srsenb/hdr/stack/upper/pdcp_nr.h index de50f797e..dd380711c 100644 --- a/srsenb/hdr/stack/upper/pdcp_nr.h +++ b/srsenb/hdr/stack/upper/pdcp_nr.h @@ -42,8 +42,8 @@ public: // pdcp_interface_rlc_nr void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu); - void notify_delivery(uint16_t rnti, uint32_t lcid, const std::vector& tx_count); - void notify_failure(uint16_t rnti, uint32_t lcid, const std::vector& tx_count); + void notify_delivery(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn); + void notify_failure(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn); void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {} // pdcp_interface_rrc_nr diff --git a/srsenb/hdr/stack/upper/rlc.h b/srsenb/hdr/stack/upper/rlc.h index 0089ca3d3..a555b7763 100644 --- a/srsenb/hdr/stack/upper/rlc.h +++ b/srsenb/hdr/stack/upper/rlc.h @@ -71,8 +71,8 @@ private: { public: void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu); - void notify_delivery(uint32_t lcid, const std::vector& tx_count); - void notify_failure(uint32_t lcid, const std::vector& tx_count); + void notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn); + void notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sn); void write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu); void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t sdu); void write_pdu_pcch(srslte::unique_byte_buffer_t sdu); diff --git a/srsenb/hdr/stack/upper/rlc_nr.h b/srsenb/hdr/stack/upper/rlc_nr.h index a0fc7e912..e337a1cd1 100644 --- a/srsenb/hdr/stack/upper/rlc_nr.h +++ b/srsenb/hdr/stack/upper/rlc_nr.h @@ -63,8 +63,8 @@ private: { public: void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu); - void notify_delivery(uint32_t lcid, const std::vector& pdcp_sns); - void notify_failure(uint32_t lcid, const std::vector& pdcp_sns); + void notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns); + void notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns); void write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu); void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t sdu); void write_pdu_pcch(srslte::unique_byte_buffer_t sdu); diff --git a/srsenb/src/stack/upper/pdcp.cc b/srsenb/src/stack/upper/pdcp.cc index 4ca8c86ed..d323ed42e 100644 --- a/srsenb/src/stack/upper/pdcp.cc +++ b/srsenb/src/stack/upper/pdcp.cc @@ -143,14 +143,14 @@ void pdcp::send_status_report(uint16_t rnti) users[rnti].pdcp->send_status_report(); } -void pdcp::notify_delivery(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sns) +void pdcp::notify_delivery(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { if (users.count(rnti)) { users[rnti].pdcp->notify_delivery(lcid, pdcp_sns); } } -void pdcp::notify_failure(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sns) +void pdcp::notify_failure(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { if (users.count(rnti)) { users[rnti].pdcp->notify_failure(lcid, pdcp_sns); diff --git a/srsenb/src/stack/upper/pdcp_nr.cc b/srsenb/src/stack/upper/pdcp_nr.cc index 853112186..67ec04284 100644 --- a/srsenb/src/stack/upper/pdcp_nr.cc +++ b/srsenb/src/stack/upper/pdcp_nr.cc @@ -99,7 +99,7 @@ void pdcp_nr::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer } } -void pdcp_nr::notify_delivery(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sns) +void pdcp_nr::notify_delivery(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { if (users.count(rnti)) { users[rnti].pdcp->notify_delivery(lcid, pdcp_sns); @@ -108,7 +108,7 @@ void pdcp_nr::notify_delivery(uint16_t rnti, uint32_t lcid, const std::vector& pdcp_sns) +void pdcp_nr::notify_failure(uint16_t rnti, uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { if (users.count(rnti)) { users[rnti].pdcp->notify_failure(lcid, pdcp_sns); diff --git a/srsenb/src/stack/upper/rlc.cc b/srsenb/src/stack/upper/rlc.cc index b819a5866..f439d83c2 100644 --- a/srsenb/src/stack/upper/rlc.cc +++ b/srsenb/src/stack/upper/rlc.cc @@ -269,12 +269,12 @@ void rlc::user_interface::write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t } } -void rlc::user_interface::notify_delivery(uint32_t lcid, const std::vector& pdcp_sns) +void rlc::user_interface::notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { pdcp->notify_delivery(rnti, lcid, pdcp_sns); } -void rlc::user_interface::notify_failure(uint32_t lcid, const std::vector& pdcp_sns) +void rlc::user_interface::notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { pdcp->notify_failure(rnti, lcid, pdcp_sns); } diff --git a/srsenb/src/stack/upper/rlc_nr.cc b/srsenb/src/stack/upper/rlc_nr.cc index 1de1ded4d..f0bfeb170 100644 --- a/srsenb/src/stack/upper/rlc_nr.cc +++ b/srsenb/src/stack/upper/rlc_nr.cc @@ -207,12 +207,12 @@ std::string rlc_nr::user_interface::get_rb_name(uint32_t lcid) return srslte::to_string(static_cast(lcid)); } -void rlc_nr::user_interface::notify_delivery(uint32_t lcid, const std::vector& pdcp_sns) +void rlc_nr::user_interface::notify_delivery(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { m_pdcp->notify_delivery(rnti, lcid, pdcp_sns); } -void rlc_nr::user_interface::notify_failure(uint32_t lcid, const std::vector& pdcp_sns) +void rlc_nr::user_interface::notify_failure(uint32_t lcid, const srslte::pdcp_sn_vector_t& pdcp_sns) { m_pdcp->notify_failure(rnti, lcid, pdcp_sns); }