Skip to content

Commit 504aa3d

Browse files
alvasMancodebot
authored andcommitted
pdcp: add warn_on_drop option
1 parent ac3eed8 commit 504aa3d

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

apps/gnb/gnb_appconfig_translators.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ std::map<five_qi_t, srs_cu_up::cu_up_qos_config> srsran::generate_cu_up_qos_conf
993993
{
994994
std::map<five_qi_t, srs_cu_up::cu_up_qos_config> out_cfg = {};
995995
if (config.qos_cfg.empty()) {
996-
out_cfg = config_helpers::make_default_cu_up_qos_config_list();
996+
out_cfg = config_helpers::make_default_cu_up_qos_config_list(config.cu_up_cfg.warn_on_drop);
997997
return out_cfg;
998998
}
999999

@@ -1009,6 +1009,7 @@ std::map<five_qi_t, srs_cu_up::cu_up_qos_config> srsran::generate_cu_up_qos_conf
10091009
}
10101010
// Convert PDCP custom config
10111011
pdcp_custom_config& out_pdcp_custom = out_cfg[qos.five_qi].pdcp_custom;
1012+
out_pdcp_custom.tx.warn_on_drop = config.cu_up_cfg.warn_on_drop;
10121013

10131014
// Obtain RLC config parameters from the respective RLC mode
10141015
const auto& du_five_qi = du_qos[qos.five_qi];

include/srsran/cu_up/cu_up_configuration_helpers.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,22 @@ namespace srsran {
1818
namespace config_helpers {
1919

2020
/// Generates default QoS configuration used by gNB CU-UP.
21-
inline std::map<five_qi_t, srs_cu_up::cu_up_qos_config> make_default_cu_up_qos_config_list()
21+
inline std::map<five_qi_t, srs_cu_up::cu_up_qos_config> make_default_cu_up_qos_config_list(bool warn_on_drop)
2222
{
2323
std::map<five_qi_t, srs_cu_up::cu_up_qos_config> qos_list = {};
2424
{
2525
// 5QI=7
2626
srs_cu_up::cu_up_qos_config cfg{};
2727
cfg.pdcp_custom = pdcp_custom_config{}; // defaults are configured as member-initialization within the struct
28+
cfg.pdcp_custom.tx.warn_on_drop = warn_on_drop;
2829

2930
qos_list[uint_to_five_qi(7)] = cfg;
3031
}
3132
{
3233
// 5QI=9
3334
srs_cu_up::cu_up_qos_config cfg{};
3435
cfg.pdcp_custom = pdcp_custom_config{}; // defaults are configured as member-initialization within the struct
36+
cfg.pdcp_custom.tx.warn_on_drop = warn_on_drop;
3537

3638
qos_list[uint_to_five_qi(9)] = cfg;
3739
}

include/srsran/pdcp/pdcp_config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ struct pdcp_custom_config_base {
142142

143143
struct pdcp_custom_config_tx : public pdcp_custom_config_base {
144144
uint16_t rlc_sdu_queue = 4096;
145+
bool warn_on_drop = false;
145146
};
146147

147148
struct pdcp_custom_config_rx : public pdcp_custom_config_base {
@@ -376,10 +377,11 @@ struct formatter<srsran::pdcp_custom_config_tx> {
376377
auto format(srsran::pdcp_custom_config_tx cfg, FormatContext& ctx) -> decltype(std::declval<FormatContext>().out())
377378
{
378379
return format_to(ctx.out(),
379-
"count_notify={} count_max={} rlc_sdu_queue={}",
380+
"count_notify={} count_max={} rlc_sdu_queue={} warn_on_drop={}",
380381
cfg.max_count.notify,
381382
cfg.max_count.hard,
382-
cfg.rlc_sdu_queue);
383+
cfg.rlc_sdu_queue,
384+
cfg.warn_on_drop);
383385
}
384386
};
385387

lib/pdcp/pdcp_entity_tx.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ void pdcp_entity_tx::handle_sdu(byte_buffer buf)
3333
return;
3434
}
3535
if ((st.tx_next - st.tx_trans) >= cfg.custom.rlc_sdu_queue) {
36-
logger.log_info("Dropping SDU to avoid overloading RLC queue. rlc_sdu_queue={} {}", cfg.custom.rlc_sdu_queue, st);
36+
if (not cfg.custom.warn_on_drop) {
37+
logger.log_info("Dropping SDU to avoid overloading RLC queue. rlc_sdu_queue={} {}", cfg.custom.rlc_sdu_queue, st);
38+
} else {
39+
logger.log_warning(
40+
"Dropping SDU to avoid overloading RLC queue. rlc_sdu_queue={} {}", cfg.custom.rlc_sdu_queue, st);
41+
}
3742
return;
3843
}
3944
if ((st.tx_next - st.tx_trans) >= (window_size - 1)) {

tests/unittests/cu_up/cu_up_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class cu_up_test : public ::testing::Test
117117
cfg.gtpu_pcap = &dummy_pcap;
118118
cfg.net_cfg.n3_bind_port = 0; // Random free port selected by the OS.
119119
cfg.n3_cfg.gtpu_reordering_timer = std::chrono::milliseconds(0);
120+
cfg.n3_cfg.warn_on_drop = false;
120121
cfg.statistics_report_period = std::chrono::seconds(1);
121122

122123
return cfg;

0 commit comments

Comments
 (0)