Commit Graph

16 Commits

Author SHA1 Message Date
Srivats P
f185ceb206 Stop thread if still running in destructor
Threads addressed in this commit:
 - Transmitter (txThread, txStats)
 - Capturer
 - EmulXcvr
2023-11-24 13:12:35 +05:30
Srivats P
cf84060277 Start/stop the txStats thread along with txThread
This will avoid having an always running thread unnecessarily
2023-11-23 17:02:58 +05:30
Srivats P
5ec7010c51 Fix contention for port streamStats across threads
Tx/Rx stream stats related threads no longer have a direct reference to the
port's stream stats - instead they have their own copy that they keep and
return (in a reset-on-read fashion) when asked for. Each copy also has it's
own lock to prevent contention for read/update/clear.

PcapPort now fetches Tx(Transmitter) and Rx(Poller) stats on demand and
updates the port's stream stats - under protection of a lock.
2023-06-17 11:31:48 +05:30
Srivats P
598e6bf243 Merge changes made in base code for turbo/latency 2023-06-15 12:32:20 +05:30
Srivats P
aebb609e37 Change algo to infer next Ttag pkt (interleaved mode)
The algo works for the following cases of interleaved streams -
 * pktListDuration < ttagTimeInterval
 * pktListDuration > ttagTimeInterval
 * some streams have Ttag, some don't
    - first stream has Ttag
    - first stream does NOT have Ttag
 * no streams have Ttag

Changes for sequential mode are pending
2023-05-26 11:31:52 +05:30
Srivats P
c70811eaa4 Fix spurious stream stats drops
The problem happens for bidirectional flows. The sequence of events is
as follows when you start Tx on Ports p1, p2 with the current code -

1. Clear stream stats on p1
2. Start tx on p1
3. Clear stream stats on p2
4. Start tx on p2

By the time #3 is executed, it may have already rx packets from p1 which
are being incorrectly cleared, this will cause these number of packets
to show up as dropped instead - incorrectly.

The fix is to change the order like this -

1. Clear stream stats on p1
2. Clear stream stats on p2
3. Start tx on p1
4. Start tx on p2

Unidirectional flows will not see this problem - as long as startTx is
done only on the Tx port and not the Rx port.

This bug is a regression caused due to the code changes introduced for the
stream stats rates feature implemented in 1.2.0
2023-02-08 16:34:03 +05:30
Srivats P
329469dd6e Calculate port tx duration and send to controller
This commit only includes server side changes plus the .proto changes.

Client side UI changes are still pending.
2022-02-21 22:20:59 +05:30
Srivats P
f7ace4c5c2 Name threads for easier debugging 2020-05-15 18:55:03 +05:30
Srivats P
13e28cff68 sign: Fix Tx stream stats counted as Rx on some platforms
On platforms that don't support filtering IN/OUT using
pcap_setdirection() - e.g. Windows, adjust Rx stats appropriately
2017-01-09 18:57:38 +05:30
Srivats P
35c56b9181 sign: Calculate stream stats only if configured
Stream Stats Rx and Tx both are calculated only if 'Track Stream Stats'
is configured on the port
2016-12-06 21:41:47 +05:30
Srivats P
afcb4126b5 sign: port stream tx stats are updated when TxThread finishes; actual Tx stream stats collection by TxThread is still pending 2016-11-11 21:22:07 +05:30
Srivats P
e0bf173b39 sign: remove sign stats and remnants of signed streams 2016-11-05 19:53:01 +05:30
Srivats P
a79bbb1fcd sign: signed tx stats infra; actual tx signing pending 2016-10-23 17:24:23 +05:30
Srivats P
31c2cd2dcb sign: refactored tx stats into a new PcapTxStats class 2016-10-19 18:52:35 +05:30
Srivats P
12351d6304 sign: Refactored PortTransmitter into PcapTransmitter and PcapTxThread classes. Also broke out PacketSequence and Timestamp stuff into their own files. No change in functionality. 2016-09-13 19:05:24 +05:30
Srivats P
20fa1dcb69 sign: refactor (Pcap)PortTransmitter into a separate file 2016-09-06 18:50:08 +05:30