net/tcp: Fix a deadlock condition that can occur when (1) all network logic runs on a single work queue, (1) TCP write buffering is enabled, and (2) we run out of IOBs. In this case, the TCP write buffering logic was blocking on iob_alloc() with the network locked. Since the network was locked, the device driver polls that would provide take the write buffer data and release the IOBs could not execute. This fixes the problem by unlocking the network lock while waiting for the IOBs.

This commit is contained in:
Gregory Nutt
2018-07-06 19:49:05 -06:00
parent 23a8af2069
commit 75cc19ebb4
3 changed files with 107 additions and 5 deletions
+21
View File
@@ -86,6 +86,27 @@ struct timeval; /* Forward reference */
void net_lockinitialize(void);
/****************************************************************************
* Name: net_breaklock
*
* Description:
* Break the lock, return information needed to restore re-entrant lock
* state.
*
****************************************************************************/
int net_breaklock(FAR unsigned int *count);
/****************************************************************************
* Name: net_breaklock
*
* Description:
* Restore the locked state
*
****************************************************************************/
void net_restorelock(unsigned int count);
/****************************************************************************
* Name: net_dsec2timeval
*