Commit Graph

1109 Commits

Author SHA1 Message Date
Srivats P
f27003b8f5 Use base class link state in case of Win intf stats
After this change adapter_ and linkStateOid_ members are no longer
required in case of Windows Interface stats, so don't initialize them.

Also remove all references to them in ifstats mode - the change in
has/setExclusiveControl also fixes the non-working bindconfig - the
problem was the portname being derived in those functions was not
correct causing bindconfig to fail - bindconfig itself probably never
had a problem.
2023-09-28 15:49:32 +05:30
Srivats P
e5375247a9 Implement set/clear promisc for Windows ports
With windows if stats, we need to put the ports explicitly in promisc
mode; with internal-stats this happens implicitly when we create
monitorRx/Tx
2023-09-28 12:39:04 +05:30
Srivats P
6d312764e8 Use interface stats as port stats on Windows
Initial working changes. More changes in subsequent commits
2023-09-26 15:06:06 +05:30
Srivats P
ca956c3c18 Fix extra whitespace in latency feature added code 2023-05-26 11:07:27 +05:30
Srivats P
f98c8af594 Comment out L4Cksum code from pcap tx thread
We are not rewriting L4Cksum for ttag packets at the moment. See
comment in packetsequence.h

Commenting out this code doesn't seem to observably improve tx
performance though.

The latency code seems to reduce stream stats max tx performance
by around 3 to 5%. Recovering this may be done separately as part
of overall performance optimzation of Tx code.
2023-05-08 15:31:20 +05:30
Srivats P
accc47fa34 Don't use avgDelay in interleaved mode
The interleaved mode's single packet set MUST always have 0 delay
for accurate rate.

Before latency code, the interleaved packet set was added implicitly
and had 0 delay. Latency code added explicit packet set and used
avgDelay for the set. The avgDelay was needed for the original algo
used to determine when to send ttag packets. That algo is no longer
used (ttag markers are now explicitly configured by AbstractPort).

Turbo still needs avgDelay for other use, but changes will be made in
Turbo code for that.
2023-05-08 12:01:56 +05:30
Srivats P
6f71844f7c Make win32 specific changes for per-stream latency
There are 2 changes -
1. Encode txPort in ttag packets and use it at TxTtagStats and
RxPcapStats to identify Tx and Rx packets respectively
2. Don't use pcap_sendqueue_transmit() if stream timing is in use -
since we can't modify TTAG packets inside that API
2023-05-06 13:15:37 +05:30
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