mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
net: limit TCP and UDP send/recv buffer usage with throttled IOB
The main content of this submission is to limit both the TX/RX buffers of TCP/UDP to throttled IOBs, avoiding impacts on the sending and receiving of control-type messages. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -94,7 +94,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_alloc(void)
|
||||
|
||||
/* Now get the first I/O buffer for the write buffer structure */
|
||||
|
||||
wrb->wb_iob = net_ioballoc(false);
|
||||
wrb->wb_iob = net_ioballoc(true);
|
||||
if (!wrb->wb_iob)
|
||||
{
|
||||
nerr("ERROR: Failed to allocate I/O buffer\n");
|
||||
@@ -205,7 +205,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_tryalloc(void)
|
||||
#ifdef CONFIG_NET_JUMBO_FRAME
|
||||
iob_alloc_dynamic(len);
|
||||
#else
|
||||
iob_tryalloc(false);
|
||||
iob_tryalloc(true);
|
||||
#endif
|
||||
if (!wrb->wb_iob)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user