summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2007-01-09 22:47:01 +0100
committerMichael Brown2007-01-09 22:47:01 +0100
commitc65fae2475ca652ef7948f286881b0c06bce861b (patch)
tree5588ec4b947ecc79201ee613d1cd0a0a7ca6d1d8 /src/include
parentAutopadding was sometimes overwriting the struct list_head at the end (diff)
downloadipxe-c65fae2475ca652ef7948f286881b0c06bce861b.tar.gz
ipxe-c65fae2475ca652ef7948f286881b0c06bce861b.tar.xz
ipxe-c65fae2475ca652ef7948f286881b0c06bce861b.zip
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/include')
-rw-r--r--src/include/gpxe/netdevice.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h
index ad1f90130..bc0827284 100644
--- a/src/include/gpxe/netdevice.h
+++ b/src/include/gpxe/netdevice.h
@@ -181,15 +181,16 @@ struct net_device {
/** Poll for received packet
*
* @v netdev Network device
+ * @v rx_quota Maximum number of packets to receive
*
* This method should cause the hardware to check for received
* packets. Any received packets should be delivered via
- * netdev_rx().
+ * netdev_rx(), up to a maximum of @c rx_quota packets.
*
* This method is guaranteed to be called only when the device
* is open.
*/
- void ( * poll ) ( struct net_device *netdev );
+ void ( * poll ) ( struct net_device *netdev, unsigned int rx_quota );
/** Link-layer protocol */
struct ll_protocol *ll_protocol;
@@ -238,7 +239,7 @@ extern int netdev_tx ( struct net_device *netdev, struct pk_buff *pkb );
void netdev_tx_complete ( struct net_device *netdev, struct pk_buff *pkb );
void netdev_tx_complete_next ( struct net_device *netdev );
extern void netdev_rx ( struct net_device *netdev, struct pk_buff *pkb );
-extern int netdev_poll ( struct net_device *netdev );
+extern int netdev_poll ( struct net_device *netdev, unsigned int rx_quota );
extern struct pk_buff * netdev_rx_dequeue ( struct net_device *netdev );
extern struct net_device * alloc_netdev ( size_t priv_size );
extern int register_netdev ( struct net_device *netdev );