mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
Kernel: Coalesce TCP ACKs
Previously we'd send a TCP ACK for each TCP packet we received. This changes NetworkTask so that we send fewer TCP ACKs.
This commit is contained in:
parent
ffc6b714b0
commit
af59f64bc0
3 changed files with 81 additions and 8 deletions
|
@ -133,10 +133,13 @@ public:
|
|||
void set_duplicate_acks(u32 acks) { m_duplicate_acks = acks; }
|
||||
u32 duplicate_acks() const { return m_duplicate_acks; }
|
||||
|
||||
KResult send_ack(bool allow_duplicate = false);
|
||||
KResult send_tcp_packet(u16 flags, const UserOrKernelBuffer* = nullptr, size_t = 0);
|
||||
void send_outgoing_packets(RoutingDecision&);
|
||||
void receive_tcp_packet(const TCPPacket&, u16 size);
|
||||
|
||||
bool should_delay_next_ack() const;
|
||||
|
||||
static Lockable<HashMap<IPv4SocketTuple, TCPSocket*>>& sockets_by_tuple();
|
||||
static RefPtr<TCPSocket> from_tuple(const IPv4SocketTuple& tuple);
|
||||
static RefPtr<TCPSocket> from_endpoints(const IPv4Address& local_address, u16 local_port, const IPv4Address& peer_address, u16 peer_port);
|
||||
|
@ -194,6 +197,9 @@ private:
|
|||
SinglyLinkedList<OutgoingPacket> m_not_acked;
|
||||
|
||||
u32 m_duplicate_acks { 0 };
|
||||
|
||||
u32 m_last_ack_number_sent { 0 };
|
||||
Time m_last_ack_sent_time;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue