net: tcp: Do not capture tx_sem during retransmission
As the stack can safely keep allocating data during retransmission mode there is no need to take the tx_sem during retransmission any more. Data stored in the send_data buffer will be transmitted upon the ack of the data for which an ack is pending. This the application being fully stalled when the TCP connection enters retransmission mode. Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
This commit is contained in:
parent
17f94d3f96
commit
4243e8e99c
1 changed files with 0 additions and 6 deletions
|
@ -1201,8 +1201,6 @@ static void tcp_resend_data(struct k_work *work)
|
||||||
conn->data_mode = TCP_DATA_MODE_RESEND;
|
conn->data_mode = TCP_DATA_MODE_RESEND;
|
||||||
conn->unacked_len = 0;
|
conn->unacked_len = 0;
|
||||||
|
|
||||||
(void)k_sem_take(&conn->tx_sem, K_NO_WAIT);
|
|
||||||
|
|
||||||
ret = tcp_send_data(conn);
|
ret = tcp_send_data(conn);
|
||||||
conn->send_data_retries++;
|
conn->send_data_retries++;
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
@ -1227,10 +1225,6 @@ static void tcp_resend_data(struct k_work *work)
|
||||||
} else if (ret == -ENODATA) {
|
} else if (ret == -ENODATA) {
|
||||||
conn->data_mode = TCP_DATA_MODE_SEND;
|
conn->data_mode = TCP_DATA_MODE_SEND;
|
||||||
|
|
||||||
if (!tcp_window_full(conn)) {
|
|
||||||
k_sem_give(&conn->tx_sem);
|
|
||||||
}
|
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
} else if (ret == -ENOBUFS) {
|
} else if (ret == -ENOBUFS) {
|
||||||
NET_ERR("TCP failed to allocate buffer in retransmission");
|
NET_ERR("TCP failed to allocate buffer in retransmission");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue