Browse Source

[undi] Apply quota only to number of complete received packets

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
d31cf2de30
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      src/arch/i386/drivers/net/undinet.c

+ 5
- 4
src/arch/i386/drivers/net/undinet.c View File

72
 /** Delay between retries of PXENV_UNDI_INITIALIZE */
72
 /** Delay between retries of PXENV_UNDI_INITIALIZE */
73
 #define UNDI_INITIALIZE_RETRY_DELAY_MS 200
73
 #define UNDI_INITIALIZE_RETRY_DELAY_MS 200
74
 
74
 
75
-/** Maximum number of calls to PXENV_UNDI_ISR per poll */
76
-#define UNDI_POLL_QUOTA 4
75
+/** Maximum number of received packets per poll */
76
+#define UNDI_RX_QUOTA 4
77
 
77
 
78
 /** Alignment of received frame payload */
78
 /** Alignment of received frame payload */
79
 #define UNDI_RX_ALIGN 16
79
 #define UNDI_RX_ALIGN 16
331
 	struct undi_nic *undinic = netdev->priv;
331
 	struct undi_nic *undinic = netdev->priv;
332
 	struct s_PXENV_UNDI_ISR undi_isr;
332
 	struct s_PXENV_UNDI_ISR undi_isr;
333
 	struct io_buffer *iobuf = NULL;
333
 	struct io_buffer *iobuf = NULL;
334
-	unsigned int quota = UNDI_POLL_QUOTA;
334
+	unsigned int quota = UNDI_RX_QUOTA;
335
 	size_t len;
335
 	size_t len;
336
 	size_t reserve_len;
336
 	size_t reserve_len;
337
 	size_t frag_len;
337
 	size_t frag_len;
370
 	}
370
 	}
371
 
371
 
372
 	/* Run through the ISR loop */
372
 	/* Run through the ISR loop */
373
-	while ( quota-- ) {
373
+	while ( quota ) {
374
 		profile_start ( &undinet_isr_call_profiler );
374
 		profile_start ( &undinet_isr_call_profiler );
375
 		if ( ( rc = pxeparent_call ( undinet_entry, PXENV_UNDI_ISR,
375
 		if ( ( rc = pxeparent_call ( undinet_entry, PXENV_UNDI_ISR,
376
 					     &undi_isr,
376
 					     &undi_isr,
424
 			if ( iob_len ( iobuf ) == len ) {
424
 			if ( iob_len ( iobuf ) == len ) {
425
 				/* Whole packet received; deliver it */
425
 				/* Whole packet received; deliver it */
426
 				netdev_rx ( netdev, iob_disown ( iobuf ) );
426
 				netdev_rx ( netdev, iob_disown ( iobuf ) );
427
+				quota--;
427
 				/* Etherboot 5.4 fails to return all packets
428
 				/* Etherboot 5.4 fails to return all packets
428
 				 * under mild load; pretend it retriggered.
429
 				 * under mild load; pretend it retriggered.
429
 				 */
430
 				 */

Loading…
Cancel
Save