diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-01-09 21:47:01 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-01-09 21:47:01 +0000 |
commit | c65fae2475ca652ef7948f286881b0c06bce861b (patch) | |
tree | 5588ec4b947ecc79201ee613d1cd0a0a7ca6d1d8 /src/drivers/net/pnic.c | |
parent | e822bc2a90016f206b051cce1287a655e66b6b9b (diff) | |
download | ipxe-c65fae2475ca652ef7948f286881b0c06bce861b.tar.gz |
Add RX quotas to the net device poll() method. This avoids the problem
of alloc_pkb() exhaustion when e.g. an iSCSI-booted DOS session is left
idle for a long time at the C:\ prompt and builds up a huge packet
backlog.
Diffstat (limited to 'src/drivers/net/pnic.c')
-rw-r--r-- | src/drivers/net/pnic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/drivers/net/pnic.c b/src/drivers/net/pnic.c index 09ac92a4..c74e7b50 100644 --- a/src/drivers/net/pnic.c +++ b/src/drivers/net/pnic.c @@ -112,14 +112,14 @@ static int pnic_api_check ( uint16_t api_version ) { /************************************************************************** POLL - Wait for a frame ***************************************************************************/ -static void pnic_poll ( struct net_device *netdev ) { +static void pnic_poll ( struct net_device *netdev, unsigned int rx_quota ) { struct pnic *pnic = netdev->priv; struct pk_buff *pkb; uint16_t length; uint16_t qlen; /* Fetch all available packets */ - while ( 1 ) { + while ( rx_quota ) { if ( pnic_command ( pnic, PNIC_CMD_RECV_QLEN, NULL, 0, &qlen, sizeof ( qlen ), NULL ) != PNIC_STATUS_OK ) @@ -139,6 +139,7 @@ static void pnic_poll ( struct net_device *netdev ) { } pkb_put ( pkb, length ); netdev_rx ( netdev, pkb ); + --rx_quota; } } |