lwIP - A Lightweight TCP/IP stack - Bugs: bug #46289, tcp_write fails with ERR_MEM if...
You are not allowed to post comments on this tracker with your current authentication level.
bug #46289: tcp_write fails with ERR_MEM if TCP_SND_QUEUELEN is reached
Submitter: | Ambroz Bizjak <abizjak> | ||
Submitted: | Sun 25 Oct 2015 08:23:14 AM UTC | ||
Category: | TCP | Severity: | 1 - Wish |
Item Group: | Feature Request | Status: | Invalid |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | git head |
Jump to the original submission
Sun 06 Mar 2016 11:46:55 PM UTC, comment #13: |
Sylvain Rochet <gradator> |
Sat 05 Mar 2016 01:59:14 PM UTC, comment #12:
|
Ambroz Bizjak <abizjak> |
Sat 05 Mar 2016 01:56:17 PM UTC, comment #11: Hey,
|
Ambroz Bizjak <abizjak> |
Sat 05 Mar 2016 01:12:18 PM UTC, comment #10: He is merging changes from the lwIP master branch, by breaking all commit authorship so it isn't very clear at first sight. The question is, how long someone could keep up doing that given the high commit rate on lwIP. I even have trouble myself following everything that's happening. |
Sylvain Rochet <gradator> |
Sat 05 Mar 2016 01:02:43 PM UTC, comment #9: Forking lwIP is not a good idea in the first place, as you risk getting new bugs/not fixing old bugs that get fixed in our sources, but I can't keep you from doing so and won't try :-) |
Simon Goldschmidt <goldsimon> |
Sat 05 Mar 2016 12:46:22 PM UTC, comment #8: That's not a very good idea, PBUF_POOL is meant to be used for TX packets only.
|
Sylvain Rochet <gradator> |
Sat 05 Mar 2016 12:31:41 PM UTC, comment #7: @Simon, what I mean is that I've removed all uses (relevant to me) of mem_malloc, especially pbuf_alloc(PBUF_RAM). The PBUF_RAM type is gone and all uses were changed to pbuf_alloc(PBUF_POOL). |
Ambroz Bizjak <abizjak> |
Sat 05 Mar 2016 12:22:45 PM UTC, comment #6: Great! Actually you can use lwIP without a heap allocator, too. Although I don't think it matters for you... ;-) |
Simon Goldschmidt <goldsimon> |
Fri 04 Mar 2016 09:54:21 PM UTC, comment #5: That would be https://github.com/ambrop72/aprinter/tree/web-interface/lwip actually (wrong branch), just in case anyone is interested. One significant change is that the heap allocator is gone. |
Ambroz Bizjak <abizjak> |
Fri 04 Mar 2016 09:52:49 PM UTC, comment #4: Hey,
|
Ambroz Bizjak <abizjak> |
Fri 04 Mar 2016 08:49:47 PM UTC, comment #3: Updating category/item group/severity: this is not faulty behaviour, it is intended behaviour for *lw*IP. |
Simon Goldschmidt <goldsimon> |
Mon 02 Nov 2015 10:15:45 PM UTC, comment #2: Hey,
|
Ambroz Bizjak <abizjak> |
Thu 29 Oct 2015 09:26:16 PM UTC, comment #1: The idea is good, but the implementation could be improved. I'd prefer havin an additional "tcp_write_partly()" that checks before calling "tcp_write()" so that the majority of users not using this new code don't get increased code size. |
Simon Goldschmidt <goldsimon> |
Sun 25 Oct 2015 08:23:14 AM UTC, original submission:
If tcp_write() is called many times with small chunks of data and tcp_output() calls in between, the maximum allowed number of queued pbufs (TCP_SND_QUEUELEN) will be reached and tcp_write() calls will start failing with ERR_MEM.
|
Ambroz Bizjak <abizjak> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2016-03-05 | goldsimon | Status | None | Invalid | |
Open/Closed | Open | Closed | |||
2016-03-04 | goldsimon | Category | IPv4 | TCP | |
Severity | 3 - Normal | 1 - Wish | |||
Item Group | Faulty Behaviour | Feature Request | |||
2015-10-25 | abizjak | Attached File | - | Added lwip-partial-write.patch, #35283 |
Powered by Savane 3.13-758e.
Corresponding source code
Yes, sorry, PBUF_POOL is meant to be used for RX packets :-)
From what I can tell, you are doing things well. I am not sure the PBUF_POOL problem when used with both TX and RX paths is documented somewhere, especially for our users without heap (i.e. without PBUF_RAM). What is really missing in lwIP is a PBUF_POOL_RX and a PBUF_POOL_TX to prevent this condition to happen.