mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
Kernel: Update E1000 link state using interrupt
Calls to link_up() in the E1000 driver would read the link state directly from the hardware on every call. This had negative performance impact in high throughput situations since link_up() is called every time an IP packet's route is resolved. This patch takes inspiration from the RTL8139 network adapter where the link state is stored in a bool and only updated when the hardware generates an interrupt related to link state change. After this change I measured a ~9% increase in TCP Tx throughput using: cat /dev/zero | nc <host_IP> <host_port> from the Serenity VM to my host machine
This commit is contained in:
parent
d7f6635d55
commit
b6ba0f9fad
2 changed files with 7 additions and 6 deletions
|
@ -27,7 +27,7 @@ public:
|
|||
virtual ~E1000NetworkAdapter() override;
|
||||
|
||||
virtual void send_raw(ReadonlyBytes) override;
|
||||
virtual bool link_up() override;
|
||||
virtual bool link_up() override { return m_link_up; };
|
||||
virtual i32 link_speed() override;
|
||||
virtual bool link_full_duplex() override;
|
||||
|
||||
|
@ -93,6 +93,7 @@ protected:
|
|||
OwnPtr<Memory::Region> m_mmio_region;
|
||||
bool m_has_eeprom { false };
|
||||
bool m_use_mmio { false };
|
||||
bool m_link_up { false };
|
||||
EntropySource m_entropy_source;
|
||||
|
||||
WaitQueue m_wait_queue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue