fixed a few bugs with wholistic analysis

This commit is contained in:
2025-09-13 20:52:37 -04:00
parent 093a691113
commit 3872beaba3
4 changed files with 14 additions and 3 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
build/ build/
prompt.txt prompt.txt
docs/clang-doc/ docs/clang-doc/
**/tmp*
**/tmp/

View File

@@ -26,8 +26,7 @@ void Publisher::set_status(NodeStatus s, Time new_latency) noexcept {
// Forward to Node base if available (Host derives from Node). // Forward to Node base if available (Host derives from Node).
// If Node::set_status is public, this works; otherwise adjust when you expose it. // If Node::set_status is public, this works; otherwise adjust when you expose it.
// (We keep this call for correctness; remove if not yet available.) Node::set_status(s);
// Node::set_status(s);
if (s == NodeStatus::DOWN) { if (s == NodeStatus::DOWN) {
if (_staging_evt != NULL_EVENT) { if (_staging_evt != NULL_EVENT) {

View File

@@ -23,7 +23,8 @@ Subscriber::Subscriber(Simulator* sim,
} }
void Subscriber::set_status(NodeStatus s) noexcept { void Subscriber::set_status(NodeStatus s) noexcept {
// Node::set_status(s); Node::set_status(s);
if (s == NodeStatus::DOWN) { if (s == NodeStatus::DOWN) {
if (_hb_evt != NULL_EVENT) { if (_hb_evt != NULL_EVENT) {
_sim->cancel(_hb_evt); _sim->cancel(_hb_evt);

View File

@@ -179,6 +179,13 @@ void NetworkNic::recv_pkt(Packet &pkt_in, PortId ingress) {
Time rtt; Time rtt;
if (lookup_rtt_and_erase(pkt, now, rtt)) { if (lookup_rtt_and_erase(pkt, now, rtt)) {
auto &out = _tx_outstanding[pkt.flow_id()];
if (out >= DEFAULT_MSS_BYTES)
out -= DEFAULT_MSS_BYTES;
else
out = Bytes(0);
if (_cc) { if (_cc) {
_cc->update(pkt, rtt); _cc->update(pkt, rtt);
_telemetry.cc_updates++; _telemetry.cc_updates++;
@@ -388,6 +395,7 @@ void NetworkNic::schedule_ack(const Packet& rx_data, PortId ingress) noexcept {
[this, ack, egress]() mutable { [this, ack, egress]() mutable {
enqueue_packet(egress, QClass::CONTROL, ack); enqueue_packet(egress, QClass::CONTROL, ack);
}); });
_telemetry.tx_acks++; _telemetry.tx_acks++;
} }
@@ -602,6 +610,7 @@ bool NetworkNic::try_send_one(PortId port, QClass cls) noexcept {
if (pkt.protocol() == PacketProtocol::DATA) { if (pkt.protocol() == PacketProtocol::DATA) {
record_tx_timestamp(pkt); record_tx_timestamp(pkt);
} }
if (!_buf) return;
(void)_buf->enqueue_packet(pkt, port, pkt.priority()); (void)_buf->enqueue_packet(pkt, port, pkt.priority());
}); });
} }