qcacmn: Compute client inactive time from last one second tx/rx activity
If client is having non-zero tx/rx packets in last one second, reset inactive time to zero, else increment inactive time. Change-Id: Ie25fb43adec252e93ebc1bb1a7aa0fa207e7af1e
Este cometimento está contido em:

cometido por
nshrivas

ascendente
9a1368c4ca
cometimento
f0fa2f5beb
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -147,6 +147,14 @@ void dp_cal_client_update_peer_stats(struct cdp_peer_stats *peer_stats)
|
||||
peer_stats->tx.tx_data_ucast_rate = temp_tx_ucast_pkts -
|
||||
peer_stats->tx.tx_data_ucast_last;
|
||||
|
||||
/* Check tx and rx packets in last one second, and increment
|
||||
* inactive time for peer
|
||||
*/
|
||||
if (peer_stats->tx.tx_data_rate || peer_stats->rx.rx_data_rate)
|
||||
peer_stats->tx.inactive_time = 0;
|
||||
else
|
||||
peer_stats->tx.inactive_time++;
|
||||
|
||||
peer_stats->rx.rx_bytes_success_last = temp_rx_bytes;
|
||||
peer_stats->rx.rx_data_success_last = temp_rx_data;
|
||||
peer_stats->tx.tx_bytes_success_last = temp_tx_bytes;
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador