rlc_am_test: fix TSAN isses and removing info log when dropping PDU

master
Andre Puschmann 4 years ago
parent f90f6f0c7e
commit 81c1851bbd

@ -83,7 +83,7 @@ public:
class ul_writer : public thread class ul_writer : public thread
{ {
public: 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(); } ~ul_writer() { stop(); }
void stop() void stop()
{ {
@ -119,8 +119,8 @@ private:
running = false; running = false;
} }
rlc_am_lte* rlc; rlc_am_lte* rlc = nullptr;
bool running; std::atomic<bool> running = {false};
}; };
int basic_test_tx(rlc_am_lte* rlc, byte_buffer_t pdu_bufs[NBUFS]) int basic_test_tx(rlc_am_lte* rlc, byte_buffer_t pdu_bufs[NBUFS])

@ -245,7 +245,7 @@ private:
pcap->write_ul_ccch(pdu->msg, pdu_len); pcap->write_ul_ccch(pdu->msg, pdu_len);
} }
} else { } 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 skip_action = true; // Avoid drop duplicating this PDU
} }
@ -254,7 +254,7 @@ private:
it++; it++;
skip_action = false; // Allow action on the next PDU skip_action = false; // Allow action on the next PDU
} else { } 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 skip_action = true; // Avoid drop of this PDU
} }
} }
@ -299,7 +299,7 @@ private:
rlc_interface_mac* rlc1 = nullptr; rlc_interface_mac* rlc1 = nullptr;
rlc_interface_mac* rlc2 = nullptr; rlc_interface_mac* rlc2 = nullptr;
bool run_enable = false; std::atomic<bool> run_enable = {false};
stress_test_args_t args = {}; stress_test_args_t args = {};
rlc_pcap* pcap = nullptr; rlc_pcap* pcap = nullptr;
uint32_t lcid = 0; uint32_t lcid = 0;
@ -427,7 +427,8 @@ private:
} }
} }
bool run_enable = true; std::atomic<bool> run_enable = {true};
/// Tx uses thread-local PDCP SN to set SDU content, the Rx uses this variable to check received SDUs /// 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; uint8_t next_expected_sdu = 0;
uint64_t rx_pdus = 0; uint64_t rx_pdus = 0;

Loading…
Cancel
Save