summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2014-05-14 14:50:30 +0200
committerMichael Brown2014-05-14 14:50:30 +0200
commitd31cf2de3072c270b0c8eaa5ad3f790e5377be86 (patch)
treeb20b0842b7163ba02385e87c67d197bd72fa2aab /src
parent[build] Avoid errors when build directory is mounted via NFS (diff)
downloadipxe-d31cf2de3072c270b0c8eaa5ad3f790e5377be86.tar.gz
ipxe-d31cf2de3072c270b0c8eaa5ad3f790e5377be86.tar.xz
ipxe-d31cf2de3072c270b0c8eaa5ad3f790e5377be86.zip
[undi] Apply quota only to number of complete received packets
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/drivers/net/undinet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/arch/i386/drivers/net/undinet.c b/src/arch/i386/drivers/net/undinet.c
index 82dd8d2f9..6450665ff 100644
--- a/src/arch/i386/drivers/net/undinet.c
+++ b/src/arch/i386/drivers/net/undinet.c
@@ -72,8 +72,8 @@ struct undi_nic {
/** Delay between retries of PXENV_UNDI_INITIALIZE */
#define UNDI_INITIALIZE_RETRY_DELAY_MS 200
-/** Maximum number of calls to PXENV_UNDI_ISR per poll */
-#define UNDI_POLL_QUOTA 4
+/** Maximum number of received packets per poll */
+#define UNDI_RX_QUOTA 4
/** Alignment of received frame payload */
#define UNDI_RX_ALIGN 16
@@ -331,7 +331,7 @@ static void undinet_poll ( struct net_device *netdev ) {
struct undi_nic *undinic = netdev->priv;
struct s_PXENV_UNDI_ISR undi_isr;
struct io_buffer *iobuf = NULL;
- unsigned int quota = UNDI_POLL_QUOTA;
+ unsigned int quota = UNDI_RX_QUOTA;
size_t len;
size_t reserve_len;
size_t frag_len;
@@ -370,7 +370,7 @@ static void undinet_poll ( struct net_device *netdev ) {
}
/* Run through the ISR loop */
- while ( quota-- ) {
+ while ( quota ) {
profile_start ( &undinet_isr_call_profiler );
if ( ( rc = pxeparent_call ( undinet_entry, PXENV_UNDI_ISR,
&undi_isr,
@@ -424,6 +424,7 @@ static void undinet_poll ( struct net_device *netdev ) {
if ( iob_len ( iobuf ) == len ) {
/* Whole packet received; deliver it */
netdev_rx ( netdev, iob_disown ( iobuf ) );
+ quota--;
/* Etherboot 5.4 fails to return all packets
* under mild load; pretend it retriggered.
*/