Skip to content

Commit 611bf17

Browse files
sdap,gtpu: forward QoS flow identifier in UL direction
1 parent fdd3be5 commit 611bf17

File tree

8 files changed

+20
-17
lines changed

8 files changed

+20
-17
lines changed

include/srsran/gtpu/gtpu_tunnel_tx.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#pragma once
1212

1313
#include "srsran/adt/byte_buffer.h"
14+
#include "srsran/ran/cu_types.h"
1415
#include <sys/socket.h>
1516

1617
/*
@@ -49,7 +50,8 @@ class gtpu_tunnel_tx_lower_layer_interface
4950

5051
/// \brief Interface for the lower layers to pass SDUs into the GTP-U
5152
/// \param sdu SDU to be handled
52-
virtual void handle_sdu(byte_buffer sdu) = 0;
53+
/// \param qfi QoS flow associated with the SDU
54+
virtual void handle_sdu(byte_buffer sdu, qos_flow_id_t qfi) = 0;
5355
};
5456

5557
/// This interface represents the data exit point of the transmitting side of a GTP-U entity.

include/srsran/sdap/sdap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class sdap_rx_sdu_notifier
4040
virtual ~sdap_rx_sdu_notifier() = default;
4141

4242
/// This callback is invoked on each generated SDU.
43-
virtual void on_new_sdu(byte_buffer sdu) = 0;
43+
virtual void on_new_sdu(byte_buffer sdu, qos_flow_id_t qfi) = 0;
4444
};
4545

4646
/// This interface notifies to lower layers the generation of new PDUs in the transmitting side of a SDAP entity.

lib/cu_up/adapters/sdap_adapters.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class sdap_gtpu_adapter : public sdap_rx_sdu_notifier
2626

2727
void connect_gtpu(gtpu_tunnel_tx_lower_layer_interface& gtpu_handler_) { gtpu_handler = &gtpu_handler_; }
2828

29-
void on_new_sdu(byte_buffer sdu) override
29+
void on_new_sdu(byte_buffer sdu, qos_flow_id_t qfi) override
3030
{
3131
srsran_assert(gtpu_handler != nullptr, "GTPU handler must not be nullptr");
32-
gtpu_handler->handle_sdu(std::move(sdu));
32+
gtpu_handler->handle_sdu(std::move(sdu), qfi);
3333
}
3434

3535
private:

lib/gtpu/gtpu_tunnel_base_tx.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class gtpu_tunnel_tx : public gtpu_tunnel_tx_lower_layer_interface
4444
/*
4545
* SDU/PDU handlers
4646
*/
47-
void handle_sdu(byte_buffer buf) final
47+
48+
void handle_sdu(byte_buffer buf, qos_flow_id_t qfi) final
4849
{
4950
gtpu_header hdr = {};
5051
hdr.flags.version = GTPU_FLAGS_VERSION_V1;

lib/sdap/sdap_entity_rx_impl.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ namespace srs_cu_up {
2121
class sdap_entity_rx_impl : public sdap_rx_pdu_handler
2222
{
2323
public:
24-
sdap_entity_rx_impl(uint32_t ue_index,
25-
pdu_session_id_t psi,
26-
optional<qos_flow_id_t> qfi_,
27-
drb_id_t drb_id_,
28-
unique_timer& ue_inactivity_timer_,
29-
sdap_rx_sdu_notifier& sdu_notifier_) :
24+
sdap_entity_rx_impl(uint32_t ue_index,
25+
pdu_session_id_t psi,
26+
qos_flow_id_t qfi_,
27+
drb_id_t drb_id_,
28+
unique_timer& ue_inactivity_timer_,
29+
sdap_rx_sdu_notifier& sdu_notifier_) :
3030
logger("SDAP", {ue_index, psi, qfi_, drb_id_, "UL"}),
3131
qfi(qfi_),
3232
drb_id(drb_id_),
@@ -37,17 +37,17 @@ class sdap_entity_rx_impl : public sdap_rx_pdu_handler
3737

3838
void handle_pdu(byte_buffer pdu) final
3939
{
40-
// pass through
40+
// pass through with qfi
4141
logger.log_debug("RX SDU. {} sdu_len={}", qfi, pdu.length());
42-
sdu_notifier.on_new_sdu(std::move(pdu));
42+
sdu_notifier.on_new_sdu(std::move(pdu), qfi);
4343
ue_inactivity_timer.run();
4444
}
4545

4646
drb_id_t get_drb_id() const { return drb_id; }
4747

4848
private:
4949
sdap_session_trx_logger logger;
50-
optional<qos_flow_id_t> qfi;
50+
qos_flow_id_t qfi;
5151
drb_id_t drb_id;
5252
unique_timer& ue_inactivity_timer;
5353
sdap_rx_sdu_notifier& sdu_notifier;

tests/unittests/gtpu/gtpu_tunnel_ngu_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ TEST_F(gtpu_tunnel_ngu_test, tx_pdu)
147147
byte_buffer sdu = gtpu_extract_t_pdu(std::move(dissected_pdu));
148148

149149
gtpu_tunnel_tx_lower_layer_interface* tx = gtpu->get_tx_lower_layer_interface();
150-
tx->handle_sdu(std::move(sdu));
150+
tx->handle_sdu(std::move(sdu), qos_flow_id_t{});
151151
ASSERT_EQ(orig_vec, gtpu_tx.last_tx);
152152
};
153153

tests/unittests/sdap/sdap_rx_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class sdap_rx_test_frame : public sdap_rx_sdu_notifier
2424
std::queue<byte_buffer> sdu_queue;
2525

2626
// sdap_rx_sdu_notifier interface
27-
void on_new_sdu(byte_buffer pdu) override { sdu_queue.push(std::move(pdu)); };
27+
void on_new_sdu(byte_buffer pdu, qos_flow_id_t qfi) override { sdu_queue.push(std::move(pdu)); };
2828
};
2929

3030
/// Fixture class for SDAP RX tests

tests/unittests/sdap/sdap_test.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class sdap_upper_dummy : public sdap_rx_sdu_notifier
2727
std::queue<byte_buffer> sdu_queue;
2828

2929
// sdap_rx_sdu_notifier interface
30-
void on_new_sdu(byte_buffer pdu) override { sdu_queue.push(std::move(pdu)); };
30+
void on_new_sdu(byte_buffer pdu, qos_flow_id_t qfi) override { sdu_queue.push(std::move(pdu)); };
3131
};
3232

3333
/// Mocking class of the lower layers invoked by the SDAP entity.

0 commit comments

Comments
 (0)