diff options
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/netdevice.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c index c6c377b52..90dab8fbe 100644 --- a/src/net/netdevice.c +++ b/src/net/netdevice.c @@ -669,14 +669,12 @@ int net_rx ( struct io_buffer *iobuf, struct net_device *netdev, } /** - * Single-step the network stack - * - * @v process Network stack process + * Poll the network stack * * This polls all interfaces for received packets, and processes * packets from the RX queue. */ -static void net_step ( struct process *process __unused ) { +void net_poll ( void ) { struct net_device *netdev; struct io_buffer *iobuf; struct ll_protocol *ll_protocol; @@ -691,6 +689,15 @@ static void net_step ( struct process *process __unused ) { /* Poll for new packets */ netdev_poll ( netdev ); + /* Leave received packets on the queue if receive + * queue processing is currently frozen. This will + * happen when the raw packets are to be manually + * dequeued using netdev_rx_dequeue(), rather than + * processed via the usual networking stack. + */ + if ( netdev_rx_frozen ( netdev ) ) + continue; + /* Process at most one received packet. Give priority * to getting packets out of the NIC over processing * the received packets, because we advertise a window @@ -723,6 +730,15 @@ static void net_step ( struct process *process __unused ) { } } +/** + * Single-step the network stack + * + * @v process Network stack process + */ +static void net_step ( struct process *process __unused ) { + net_poll(); +} + /** Networking stack process */ struct process net_process __permanent_process = { .list = LIST_HEAD_INIT ( net_process.list ), |
