[tcp] Allow out-of-order receive queue to be discarded

Allow packets in the receive queue to be discarded in order to free up
memory.  This avoids a potential deadlock condition in which the
missing packet can never be received because the receive queue is
occupying all of the memory available for further RX buffers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2010-07-21 12:01:50 +01:00
parent 9dc51afa2c
commit 1d3b6619e5
2 changed files with 50 additions and 3 deletions

View File

@@ -162,6 +162,18 @@ static inline int list_empty ( const struct list_head *head ) {
&pos->member != (head); \
pos = list_entry ( pos->member.next, typeof ( *pos ), member ) )
/**
* Iterate over entries in a list in reverse order
*
* @v pos The type * to use as a loop counter
* @v head The head for your list
* @v member The name of the list_struct within the struct
*/
#define list_for_each_entry_reverse( pos, head, member ) \
for ( pos = list_entry ( (head)->prev, typeof ( *pos ), member ); \
&pos->member != (head); \
pos = list_entry ( pos->member.prev, typeof ( *pos ), member ) )
/**
* Iterate over entries in a list, safe against deletion of entries
*