[netdevice] Add netdev_tx_defer() to allow drivers to defer transmissions

Devices with small transmit descriptor rings may temporarily run out
of space.  Provide netdev_tx_defer() to allow drivers to defer packets
for retransmission as soon as a descriptor becomes available.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-05-01 14:05:42 +01:00
parent ab1e3ce0d7
commit 2095ed413e
2 changed files with 91 additions and 3 deletions

View File

@@ -346,6 +346,8 @@ struct net_device {
size_t max_pkt_len;
/** TX packet queue */
struct list_head tx_queue;
/** Deferred TX packet queue */
struct list_head tx_deferred;
/** RX packet queue */
struct list_head rx_queue;
/** TX statistics */
@@ -605,6 +607,8 @@ netdev_rx_frozen ( struct net_device *netdev ) {
extern void netdev_link_err ( struct net_device *netdev, int rc );
extern void netdev_link_down ( struct net_device *netdev );
extern int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf );
extern void netdev_tx_defer ( struct net_device *netdev,
struct io_buffer *iobuf );
extern void netdev_tx_err ( struct net_device *netdev,
struct io_buffer *iobuf, int rc );
extern void netdev_tx_complete_err ( struct net_device *netdev,