diff --git a/.gitignore b/.gitignore index a30adb7..ded733d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build/ prompt.txt docs/clang-doc/ +**/tmp* +**/tmp/ diff --git a/src/hosts/publisher.cc b/src/hosts/publisher.cc index 7b862fa..b9e78e1 100644 --- a/src/hosts/publisher.cc +++ b/src/hosts/publisher.cc @@ -26,8 +26,7 @@ void Publisher::set_status(NodeStatus s, Time new_latency) noexcept { // Forward to Node base if available (Host derives from Node). // 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 (_staging_evt != NULL_EVENT) { diff --git a/src/hosts/subscriber.cc b/src/hosts/subscriber.cc index 92e2d86..594f96e 100644 --- a/src/hosts/subscriber.cc +++ b/src/hosts/subscriber.cc @@ -23,7 +23,8 @@ Subscriber::Subscriber(Simulator* sim, } void Subscriber::set_status(NodeStatus s) noexcept { - // Node::set_status(s); + Node::set_status(s); + if (s == NodeStatus::DOWN) { if (_hb_evt != NULL_EVENT) { _sim->cancel(_hb_evt); diff --git a/src/network/network_nic.cc b/src/network/network_nic.cc index 6910b56..14013e2 100644 --- a/src/network/network_nic.cc +++ b/src/network/network_nic.cc @@ -179,6 +179,13 @@ void NetworkNic::recv_pkt(Packet &pkt_in, PortId ingress) { Time 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) { _cc->update(pkt, rtt); _telemetry.cc_updates++; @@ -388,6 +395,7 @@ void NetworkNic::schedule_ack(const Packet& rx_data, PortId ingress) noexcept { [this, ack, egress]() mutable { enqueue_packet(egress, QClass::CONTROL, ack); }); + _telemetry.tx_acks++; } @@ -602,6 +610,7 @@ bool NetworkNic::try_send_one(PortId port, QClass cls) noexcept { if (pkt.protocol() == PacketProtocol::DATA) { record_tx_timestamp(pkt); } + if (!_buf) return; (void)_buf->enqueue_packet(pkt, port, pkt.priority()); }); }