feat(rtl8139): implement interrupt-driven packet processing#52
Merged
Conversation
This commit enables truly event-driven networking instead of CPU-intensive polling: RTL8139 Driver Changes (8139.c): - Added rtl8139_irq_driven flag to track interrupt mode status - Implemented rtl8139_process_packets() to process all available packets - Added rtl8139_interrupt_handler() called from ISR context - Packets processed immediately when hardware interrupt fires (ROK status) - Added rtl8139_irq_enable/disable() functions for mode control - Handles RX overflow, TX errors, and RX errors gracefully Network Core Changes (net_core.c): - netif_init() now enables interrupt-driven mode - netif_poll() remains as fallback/safety for missed packets - Maintains backward compatibility while using interrupts when available ISR Changes (isr.c): - rtl8139_handler() now calls rtl8139_interrupt_handler() for packet processing - Processes packets directly in interrupt context for minimum latency - Clears interrupt status bits immediately RTL8139 Header (rtl8139.h): - Added new function declarations for interrupt-driven mode - Documented the shift from polling to interrupt-driven approach Benefits: - Eliminates busy-waiting in the CPU-intensive netif_poll() loop - Packets processed with hardware interrupt latency (~microseconds) - CPU no longer wastes cycles polling when no packets available - Significant performance improvement for network-heavy workloads - Bottleneck now truly at network provider, not OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit enables truly event-driven networking instead of CPU-intensive polling:
RTL8139 Driver Changes (8139.c):
Network Core Changes (net_core.c):
ISR Changes (isr.c):
RTL8139 Header (rtl8139.h):
Benefits: