Browse Source

[realtek] Defer packets when no transmit descriptors are available

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
b4ec6a6a68
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/drivers/net/realtek.c

+ 3
- 3
src/drivers/net/realtek.c View File

@@ -724,8 +724,8 @@ static int realtek_transmit ( struct net_device *netdev,
724 724
 
725 725
 	/* Get next transmit descriptor */
726 726
 	if ( ( rtl->tx.prod - rtl->tx.cons ) >= RTL_NUM_TX_DESC ) {
727
-		DBGC ( rtl, "REALTEK %p out of transmit descriptors\n", rtl );
728
-		return -ENOBUFS;
727
+		netdev_tx_defer ( netdev, iobuf );
728
+		return 0;
729 729
 	}
730 730
 	tx_idx = ( rtl->tx.prod++ % RTL_NUM_TX_DESC );
731 731
 
@@ -809,8 +809,8 @@ static void realtek_poll_tx ( struct net_device *netdev ) {
809 809
 		DBGC2 ( rtl, "REALTEK %p TX %d complete\n", rtl, tx_idx );
810 810
 
811 811
 		/* Complete TX descriptor */
812
-		netdev_tx_complete_next ( netdev );
813 812
 		rtl->tx.cons++;
813
+		netdev_tx_complete_next ( netdev );
814 814
 	}
815 815
 }
816 816
 

Loading…
Cancel
Save