From 81c1851bbdfe8df755d2c8dde1204f7b192eb1b8 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 19 May 2021 18:07:03 +0200 Subject: [PATCH] rlc_am_test: fix TSAN isses and removing info log when dropping PDU --- lib/test/upper/rlc_am_test.cc | 6 +++--- lib/test/upper/rlc_stress_test.cc | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/test/upper/rlc_am_test.cc b/lib/test/upper/rlc_am_test.cc index 98ba0e2d2..28a892905 100644 --- a/lib/test/upper/rlc_am_test.cc +++ b/lib/test/upper/rlc_am_test.cc @@ -83,7 +83,7 @@ public: class ul_writer : public thread { public: - ul_writer(rlc_am_lte* rlc_) : rlc(rlc_), running(false), thread("UL_WRITER") {} + ul_writer(rlc_am_lte* rlc_) : rlc(rlc_), thread("UL_WRITER") {} ~ul_writer() { stop(); } void stop() { @@ -119,8 +119,8 @@ private: running = false; } - rlc_am_lte* rlc; - bool running; + rlc_am_lte* rlc = nullptr; + std::atomic running = {false}; }; int basic_test_tx(rlc_am_lte* rlc, byte_buffer_t pdu_bufs[NBUFS]) diff --git a/lib/test/upper/rlc_stress_test.cc b/lib/test/upper/rlc_stress_test.cc index 050ae059e..54cd64eb1 100644 --- a/lib/test/upper/rlc_stress_test.cc +++ b/lib/test/upper/rlc_stress_test.cc @@ -245,7 +245,7 @@ private: pcap->write_ul_ccch(pdu->msg, pdu_len); } } else { - logger.warning(pdu->msg, pdu->N_bytes, "Dropping RLC PDU (%d B)", pdu->N_bytes); + logger.info(pdu->msg, pdu->N_bytes, "Dropping RLC PDU (%d B)", pdu->N_bytes); skip_action = true; // Avoid drop duplicating this PDU } @@ -254,7 +254,7 @@ private: it++; skip_action = false; // Allow action on the next PDU } else { - logger.warning(pdu->msg, pdu->N_bytes, "Duplicating RLC PDU (%d B)", pdu->N_bytes); + logger.info(pdu->msg, pdu->N_bytes, "Duplicating RLC PDU (%d B)", pdu->N_bytes); skip_action = true; // Avoid drop of this PDU } } @@ -299,7 +299,7 @@ private: rlc_interface_mac* rlc1 = nullptr; rlc_interface_mac* rlc2 = nullptr; - bool run_enable = false; + std::atomic run_enable = {false}; stress_test_args_t args = {}; rlc_pcap* pcap = nullptr; uint32_t lcid = 0; @@ -427,7 +427,8 @@ private: } } - bool run_enable = true; + std::atomic run_enable = {true}; + /// Tx uses thread-local PDCP SN to set SDU content, the Rx uses this variable to check received SDUs uint8_t next_expected_sdu = 0; uint64_t rx_pdus = 0;