Transceiver52M: UHD: Exit on receive more than 100 timeout errors

Receiving timeout is not a fatal error and should be recoverable on network devices.
But for some reasons these errors are not always recoverable, in this case osmo-trx should be restarted.
This commit is contained in:
Ivan Kluchnikov 2014-06-30 20:36:51 +04:00
parent 187225cf33
commit 3605872e43
1 changed files with 6 additions and 0 deletions

View File

@ -823,6 +823,7 @@ void uhd_device::setPriority(float prio)
int uhd_device::check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls)
{
uhd::time_spec_t ts;
static int err_count = 0;
if (!num_smpls) {
LOG(ERR) << str_code(md);
@ -830,6 +831,11 @@ int uhd_device::check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls)
switch (md.error_code) {
case uhd::rx_metadata_t::ERROR_CODE_TIMEOUT:
LOG(ALERT) << "UHD: Receive timed out";
if (err_count > 100) {
err_count = 0;
return ERROR_UNRECOVERABLE;
}
err_count++;
case uhd::rx_metadata_t::ERROR_CODE_OVERFLOW:
case uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND:
case uhd::rx_metadata_t::ERROR_CODE_BROKEN_CHAIN: