浏览代码

[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 年前
父节点
当前提交
d31cf2de30
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5
    4
      src/arch/i386/drivers/net/undinet.c

+ 5
- 4
src/arch/i386/drivers/net/undinet.c 查看文件

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

正在加载...
取消
保存