Commit Graph

1102 Commits

Author SHA1 Message Date
Srivats P
bd2a4715dc Fix windows build issues 2023-05-01 15:31:30 +05:30
Srivats P
4886739da6 Compile out timing debug prints
They can be compiled in if required
2023-04-30 11:50:54 +05:30
Srivats P
80a4578847 Fix latency timers not getting started/stopped
In a previous commit, we start/stop these timers based on number of
ports tracking stream stats triggered by RPCs. However, timers cannot
be triggered across threads (RPC thread and main thread in this case).

This fix uses a queued connection to post it to the other queue.
2023-04-30 10:40:49 +05:30
Srivats P
390ffae2b4 Fix tx ttag pcap filter capture filter syntax
The capture filter was not getting compiled earlier
2023-04-29 12:33:34 +05:30
Srivats P
d17ab7ab42 Use TtagTimeInterval to determine ttag markers
This is for interlaved mode; sequential mode was already using it
2023-04-29 12:08:26 +05:30
Srivats P
5abd6fb962 Don't use udiffTimeStamp() with struct timeval
It will fail to build for non-Linux platforms where TimeStamp is NOT timeval
2023-04-27 12:50:22 +05:30
Srivats P
3c0bc067fa Retain seq as param for sendQueueTransmit for now
If and when we remove PacketSequence::ttagL4ChecksumOffset we will take a call
if we should revert back to passing seq->sendQueue instead of seq at that time
2023-04-27 12:48:37 +05:30
Srivats P
223e44a6e3 Run stream latency timers only when required
Required => At least one port is tracking stream stats

Also changed some optimization FIXMEs as TODOs
2023-04-27 12:30:36 +05:30
Srivats P
6108de9b4f Remove comment about trying read-write lock
The stream timingHash is read by getStreamStats() while it is read/write
for processRecords(), the latter is a more frequent operation so there's
no real benefit of using a read-write lock instead of simple mutex.
2023-04-27 11:15:26 +05:30
Srivats P
e761bfa5c4 Make app QObject parent of StreamTiming singleton 2023-04-27 11:09:31 +05:30
Srivats P
b9345463c4 Add thread name for PcapRxStats
PcapTxTtagStats thread name has also been shortened since names beyond 16
chars are truncated.
2023-04-26 12:22:26 +05:30
Srivats P
dc6c4963a2 Change stream timing GC timer to CLOCK_REALTIME 2023-04-26 11:38:00 +05:30
Srivats P
cded62246e Don't fix incorrect checksum for Ttag packets
See comments in code
2023-04-26 10:01:24 +05:30
Srivats P
10befe0a66 Remove PcapTxTtagStats::handle_ member
PcaptxTtagStats inherits from PcapSession which already includes a protected
handle_ member.

This removal was likely left off when PcapTxTtagStats started inheriting from
PcapSession.
2023-04-24 17:26:50 +05:30
Srivats P
4394c7ffee Rework sequential mode build for new ttag algo
The previous commit changed the algo to determine which packets were Ttag'd,
but changes were done only for interleaved mode.

This commit adds the changes required for sequential mode.
2023-04-24 17:05:40 +05:30
Srivats P
ef1c166e7f 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-04-21 18:32:17 +05:30
Srivats P
d1d2a5c1b5 Fix infinite loop in building interleaved streams
Incorrect timestamp comparison was leading to infinite loop
2023-04-21 17:11:43 +05:30
Srivats P
f56ce2e2ec Add explicit packet set for interleaved streams
Interleaved mode used an implicitly added packet set in both base and Turbo
code. This has been chaned to use an explicit mode to keep things consistent.

Turbo code still has the implicit packet set related code - that needs to be
removed, once the explicit packet set code is validated and tested.
2023-04-17 11:59:00 +05:30
Srivats P
c91475d416 Use qFrom/ToBigEndian instead of ntohs/htons
For consistency with rest of the code
2023-04-13 18:10:43 +05:30
Srivats P
b2ad3c5d08 Recompute L4 checksum on-the-fly for TTag packets 2023-04-12 15:47:55 +05:30
Srivats P
896371b987 Calculate L4 checksum offset for TTag packets 2023-04-11 18:09:14 +05:30
Srivats P
f5bb2e5d80 Rename delay as latency in Protobuf/RPC
The GUI uses the term 'latency', so it's better if the API alsos use the same
term instead of 'delay'
2023-04-04 18:34:20 +05:30
Srivats P
7cfccd686e Fix StreamTiming TxRxKey
makeKey was incorrect by mistake
2023-04-04 13:22:18 +05:30
Srivats P
2e502434db GUI changes to display avg latency
At this time we only show per-guid latency aggregated across all ports
2023-04-04 13:19:53 +05:30
Srivats P
aa140cd32a Process pending before fetching streamTiming delay 2023-04-03 12:58:58 +05:30
Srivats P
3b499263ec Fix MacOS build break by removing unused member
PcapTxTtagStats::lastPcapStats_ was unused because debugStats() was moved to
PcapSession, but removing this member var was left out
2023-04-03 12:54:13 +05:30
Srivats P
c378600baf Fix streamTiming garbage collection infinite loop 2023-04-03 12:47:30 +05:30
Srivats P
68734c44ca Delete PcapTxTtagSession::debugStats
debugStats() was moved to base class PcapSession earlier, but removing it
from here was missed out
2023-03-31 18:21:36 +05:30
Srivats P
05a9dd5743 Rename PcapRxStats::id_ as PcapRxStats::portId_
Better code clarity
2023-03-31 16:58:52 +05:30
Srivats P
05335b31d5 Integrate StreamTiming with the code
Bugs found during integration were fixed and minor code improvements were made
such as using consts, const params, renaming members etc.
2023-03-31 16:55:03 +05:30
Srivats P
f4c21e1ae4 Change StreamTiming::timing_ from QList to QHash
Using QList meant we need to know the port count in the constructor - which is
difficult to know because StreamTiming is designed as a singleton
2023-03-29 17:13:12 +05:30
Srivats P
757d3f1b24 Add initial cut of StreamTiming class
This singleton class will keep track of Ttag timing across all ports and GUIDs.

A bunch of FIXMEs/TODOs are pending for this class implementation; also this
class has not been hooked up to the rest of the code yet.
2023-03-28 16:06:28 +05:30
Srivats P
7e30ef5541 Fix another MacOS build break
Break was due to following warnings (being promoted to errors) -
 * id_ private member was unused
 * tv_usec is int on MacOS (but long on Linux)
2023-03-23 15:55:35 +05:30
Srivats P
f7b6b46a5d Move debugStats() from PcapRx to base PcapSession
With this change, other classes that use PcapSession as base can also
use debugStats(), if required
2023-03-23 15:42:41 +05:30
Srivats P
823f01557b Ignore failures when stopping stream stats tracking
Stop everything irrespective of any failures
2023-03-22 16:42:54 +05:30
Srivats P
682d0cc5c9 Create a Tx Ttag tracker thread
For now we are just debug printing timestamp with T-TagId and GUID. We
need to store this tuple and compare when we Rx the same - this will be
in a upcoming commit.
2023-03-22 16:32:41 +05:30
Srivats P
f1cfaa6e89 Fix MacOS build break
For some reason udiffTimeStamp is not defined for MacOS. To be investigated
later.
2023-03-22 16:29:51 +05:30
Srivats P
072dfcdc3b Add an incrementing tag id to T-Tag packets 2023-03-18 16:34:47 +05:30
Srivats P
90a3731a90 Add infra to update L4 checksum for T-Tag packets
Pending
 * Calculate L4 checksum offset instead of hardcoded value
 * Recalculate packet L4 checksum instead of using 0 value
2023-03-18 15:01:11 +05:30
Srivats P
5d4a19174e Change T-Tag on the fly 2023-03-17 12:45:59 +05:30
Srivats P
2104936b69 Don't create implicit packet sets for Tx
As part of Turbo changes, we made changes to create explicit packet
sets, but for the base code we continued creating implicit packet
sets for some cases. With this change we don't create any implicit
packet set.

This change needs to be tested thoroughly for multiple cases.
2023-03-17 12:36:29 +05:30
Srivats P
5dc1b851cc Reduce vertical whitespace in sendQueueTransmit() 2023-03-16 12:10:42 +05:30
Srivats P
8e25669a0e Add T-Tag placeholder in sign protocol 2023-03-16 11:30:02 +05:30
Srivats P
ebccc44cdf Reformat TxThread/run {} to use less vertical space 2023-03-08 18:14:45 +05:30
Srivats P
f3a9b507b0 Update comments about implict packetset 2023-03-08 18:10:09 +05:30
Srivats P
620004d46b Fix werror warning about 0 being signed by default 2023-03-08 18:09:34 +05:30
Srivats P
425e4ef261 Rename port stats names to begin with send/receive
This will hopefully make it quicker and easier for the user to find
the stats item of interest.
2023-03-04 15:31:24 +05:30
Srivats P
d950432bc9 Move port stats hidden rows to the end
This avoids having to recalculate row indices
2023-03-04 10:49:35 +05:30
Srivats P
9849973562 Visually group related port stats
A horizontal line is drawn between groups
2023-03-04 09:57:56 +05:30
Srivats P
4f6749f16d Set alternate colors for port stats row headers
All 'sent' rows including the row header have the alt color, and
the 'recv' rows including the row header has the base color. This
change should make it easier to quickly distinguish sent/recv rows
2023-03-03 17:37:43 +05:30