-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCP connection stalls #32270
Comments
Make sure we send any pending data when network interface comes up. Fixes zephyrproject-rtos#32270 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
@lund-prevas could you try #32290 if it works for you. One problem is that you have too few network buffers so it might be difficult so recover from this situation. |
I think I can explain what is going on. I think it should be considered if the tcp_layer could be changed to be able to handle this situation |
Yes, I think we could do something for this. I try to cook a patch for this. Thanks for the analysis! |
@lund-prevas I just sent PR that can prevent the memory exhaustion you saw #32423 |
Is it possible to limit the window size in Kconfig ? What if I have 32 KB of buffers and sends 32 KB data in one chunk, then all buffers will also be used. |
There is a config option for this |
My app is publishing MQTT messages on a TLS sockets using ethernet.
If I remove the ethernet cable a reinserts it the TCP connection stalls.
The log implies the TX buffer are all allocated and they are not sent or freed when ETH connection is reestablished
I have tried to increase the TX buffers, but it is not fixing the problem.
I can see this with CONFIG_NET_TCP1 & CONFIG_NET_TCP2 on both Zephyr 2.4.0 and 2.5.0-RC4
TCP1 seems to be able to handle it in some situations, but not all.
Getting a RST from the other end fixes it, but that is not a solution.
[00:00:19.002,000] eth_mcux: ETH_0 link down <--------- Remove ETH cable
[00:00:19.853,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:19.853,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:20.490,000] net_if: iface 0x200060a8 is down
[00:00:20.954,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:20.954,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:22.003,000] eth_mcux: ETH_0 enabled 100M full-duplex mode. <--------- Reinserted ETH cable
[00:00:22.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs low on buffers.
[00:00:22.054,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:22.054,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:23.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs blocked for 1 secs
[00:00:23.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs low on buffers.
[00:00:23.154,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:23.154,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:24.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs blocked for 2 secs
[00:00:24.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs low on buffers.
[00:00:24.254,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:24.254,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:25.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs blocked for 3 secs
[00:00:25.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs low on buffers.
[00:00:25.354,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:25.354,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:26.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs blocked for 4 secs
[00:00:26.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs low on buffers.
[00:00:26.455,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:26.455,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:27.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs blocked for 5 secs
[00:00:27.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs low on buffers.
[00:00:27.555,000] net_buf: pkt_alloc_buffer():867: Failed to get free buffer
[00:00:27.555,000] net_pkt: Data buffer (181) allocation failed (context_alloc_pkt:1321)
[00:00:28.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs blocked for 6 secs
[00:00:28.003,000] net_buf: pkt_alloc_buffer():867: Pool tx_bufs low on buffers.
.....
The text was updated successfully, but these errors were encountered: