From f3dedc6824c81f3b0eee8b618d02d5bcaebf8aa1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 24 Jun 2014 11:53:19 -0600 Subject: Add throttle support to the I/O buffer logic --- nuttx/include/nuttx/net/iob.h | 42 ++++++++++++++++++++-- nuttx/include/nuttx/net/tcp.h | 2 +- nuttx/net/iob/Kconfig | 22 ++++++++++-- nuttx/net/iob/iob.h | 11 ++++-- nuttx/net/iob/iob_add_queue.c | 2 +- nuttx/net/iob/iob_alloc.c | 78 ++++++++++++++++++++++++++++------------ nuttx/net/iob/iob_alloc_qentry.c | 2 +- nuttx/net/iob/iob_clone.c | 6 ++-- nuttx/net/iob/iob_concat.c | 2 +- nuttx/net/iob/iob_contig.c | 2 +- nuttx/net/iob/iob_copyin.c | 6 ++-- nuttx/net/iob/iob_copyout.c | 2 +- nuttx/net/iob/iob_free.c | 2 +- nuttx/net/iob/iob_free_chain.c | 2 +- nuttx/net/iob/iob_free_qentry.c | 2 +- nuttx/net/iob/iob_free_queue.c | 2 +- nuttx/net/iob/iob_initialize.c | 9 +++-- nuttx/net/iob/iob_pack.c | 2 +- nuttx/net/iob/iob_remove_queue.c | 2 +- nuttx/net/iob/iob_test.c | 6 ++-- nuttx/net/iob/iob_trimhead.c | 2 +- nuttx/net/iob/iob_trimtail.c | 2 +- nuttx/net/tcp/Kconfig | 4 +-- nuttx/net/tcp/tcp.h | 3 ++ nuttx/net/tcp/tcp_wrbuffer.c | 5 ++- 25 files changed, 161 insertions(+), 59 deletions(-) diff --git a/nuttx/include/nuttx/net/iob.h b/nuttx/include/nuttx/net/iob.h index 36d1e306d..d3eebe8d5 100644 --- a/nuttx/include/nuttx/net/iob.h +++ b/nuttx/include/nuttx/net/iob.h @@ -43,6 +43,7 @@ #include #include +#include #include @@ -51,6 +52,41 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Configuration ************************************************************/ + +/* I/O buffer allocation logic supports a throttle value for the TCP + * read-ahead buffering to prevent the read-ahead from consuming all + * available I/O buffers. This throttle only applies if both TCP write + * buffering and TCP read-ahead buffering are enabled. + */ + +#if !defined(CONFIG_NET_TCP_WRITE_BUFFERS) || !defined(CONFIG_NET_TCP_READAHEAD) +# undef CONFIG_IOB_THROTTLE +# define CONFIG_IOB_THROTTLE 0 +#endif + +/* The correct way to disable throttling is to the the throttle value to + * zero. + */ + +#if !defined(CONFIG_IOB_THROTTLE) +# define CONFIG_IOB_THROTTLE 0 +#endif + +/* Some I/O buffers should be allocated */ + +#if !defined(CONFIG_IOB_NBUFFERS) +# warning CONFIG_IOB_NBUFFERS not defined +# define CONFIG_IOB_NBUFFERS 0 +#endif + +#if CONFIG_IOB_NBUFFERS < 1 +# error CONFIG_IOB_NBUFFERS is zero +#endif + +#if CONFIG_IOB_NBUFFERS <= CONFIG_IOB_THROTTLE +# error CONFIG_IOB_NBUFFERS <= CONFIG_IOB_THROTTLE +#endif /* IOB helpers */ @@ -146,7 +182,7 @@ void iob_initialize(void); * ****************************************************************************/ -FAR struct iob_s *iob_alloc(void); +FAR struct iob_s *iob_alloc(bool throttled); /**************************************************************************** * Name: iob_free @@ -217,7 +253,7 @@ void iob_free_queue(FAR struct iob_queue_s *qhead); ****************************************************************************/ int iob_copyin(FAR struct iob_s *iob, FAR const uint8_t *src, - unsigned int len, unsigned int offset); + unsigned int len, unsigned int offset, bool throttled); /**************************************************************************** * Name: iob_copyout @@ -239,7 +275,7 @@ int iob_copyout(FAR uint8_t *dest, FAR const struct iob_s *iob, * ****************************************************************************/ -int iob_clone(FAR struct iob_s *iob1, FAR struct iob_s *iob2); +int iob_clone(FAR struct iob_s *iob1, FAR struct iob_s *iob2, bool throttled); /**************************************************************************** * Name: iob_concat diff --git a/nuttx/include/nuttx/net/tcp.h b/nuttx/include/nuttx/net/tcp.h index 05ccf4c4a..6cba92934 100644 --- a/nuttx/include/nuttx/net/tcp.h +++ b/nuttx/include/nuttx/net/tcp.h @@ -133,7 +133,7 @@ # define WRB_NRTX(wrb) ((wrb)->wb_nrtx) # define WRB_IOB(wrb) ((wrb)->wb_iob) # define WRB_COPYOUT(wrb,dest,n) (iob_copyout(dest,(wrb)->wb_iob,(n),0)) -# define WRB_COPYIN(wrb,src,n) (iob_copyin((wrb)->wb_iob,src,(n),0)) +# define WRB_COPYIN(wrb,src,n) (iob_copyin((wrb)->wb_iob,src,(n),0,false)) # define WRB_TRIM(wrb,n) \ do { (wrb)->wb_iob = iob_trimhead((wrb)->wb_iob,(n)); } while (0) diff --git a/nuttx/net/iob/Kconfig b/nuttx/net/iob/Kconfig index ea6a851cd..b8481ab9e 100644 --- a/nuttx/net/iob/Kconfig +++ b/nuttx/net/iob/Kconfig @@ -14,7 +14,9 @@ if NET_IOB config IOB_NBUFFERS int "Number of pre-allocated network I/O buffers" - default 24 + default 24 if (NET_TCP_WRITE_BUFFERS && !NET_TCP_READAHEAD) || (!NET_TCP_WRITE_BUFFERS && NET_TCP_READAHEAD) + default 36 if NET_TCP_WRITE_BUFFERS && NET_TCP_READAHEAD + default 8 if !NET_TCP_WRITE_BUFFERS && !NET_TCP_READAHEAD ---help--- Each packet is represented by a series of small I/O buffers in a chain. This setting determines the number of preallocated I/O @@ -30,7 +32,8 @@ config IOB_BUFSIZE config IOB_NCHAINS int "Number of pre-allocated I/O buffer chain heads" - default 0 + default 0 if !NET_TCP_READAHEAD + default 8 if NET_TCP_READAHEAD ---help--- These tiny nodes are used as "containers" to support queueing of I/O buffer chains. This will limit the number of I/O transactions @@ -42,7 +45,20 @@ config IOB_NCHAINS I/O buffer chain containers that also carry a payload of usage specific information. -config NET_IOB_DEBUG +config IOB_THROTTLE + int "I/O buffer throttle value" + default 0 if !NET_TCP_WRITE_BUFFERS || !NET_TCP_READAHEAD + default 8 if NET_TCP_WRITE_BUFFERS && !NET_TCP_READAHEAD + depends on NET_TCP_WRITE_BUFFERS && !NET_TCP_READAHEAD + ---help--- + TCP write buffering and read-ahead buffer use the same pool of free + I/O buffers. In order to prevent uncontrolled incoming TCP packets + from hogging all of the available, pre-allocated I/O buffers, a + throttling value is required. This throttle value assures that + I/O buffers will be denied to the read-ahead logic before TCP writes + are halted. + +config IOB_DEBUG bool "Force I/O buffer debug" default n depends on DEBUG diff --git a/nuttx/net/iob/iob.h b/nuttx/net/iob/iob.h index 03ea6d14d..3b5eaf9e4 100644 --- a/nuttx/net/iob/iob.h +++ b/nuttx/net/iob/iob.h @@ -64,12 +64,19 @@ extern FAR struct iob_s *g_iob_freelist; /* A list of all free, unallocated I/O buffer queue containers */ +#if CONFIG_IOB_NCHAINS > 0 extern FAR struct iob_qentry_s *g_iob_freeqlist; +#endif /* Counting semaphores that tracks the number of free IOBs/qentries */ -extern sem_t g_iob_sem; -extern sem_t g_qentry_sem; +extern sem_t g_iob_sem; /* Counts free I/O buffers */ +#if CONFIG_IOB_THROTTLE > 0 +extern sem_t g_throttle_sem; /* Counts available I/O buffers when throttled */ +#endif +#if CONFIG_IOB_NCHAINS > 0 +extern sem_t g_qentry_sem; /* Counts free I/O buffer queue containers */ +#endif /**************************************************************************** * Public Data diff --git a/nuttx/net/iob/iob_add_queue.c b/nuttx/net/iob/iob_add_queue.c index f915b49a0..99e0f6ff4 100644 --- a/nuttx/net/iob/iob_add_queue.c +++ b/nuttx/net/iob/iob_add_queue.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_alloc.c b/nuttx/net/iob/iob_alloc.c index be6491dbb..672d1e2e7 100644 --- a/nuttx/net/iob/iob_alloc.c +++ b/nuttx/net/iob/iob_alloc.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET @@ -83,34 +83,59 @@ * ****************************************************************************/ -static FAR struct iob_s *iob_tryalloc(void) +static FAR struct iob_s *iob_tryalloc(bool throttled) { FAR struct iob_s *iob; irqstate_t flags; +#if CONFIG_IOB_THROTTLE > 0 + FAR sem_t *sem; + int semcount; +#endif + +#if CONFIG_IOB_THROTTLE > 0 + /* Select the semaphore count to check. */ + + sem = (throttled ? : &g_throttled_sem, &g_iob_sem); +#endif /* We don't know what context we are called from so we use extreme measures * to protect the free list: We disable interrupts very briefly. */ flags = irqsave(); - iob = g_iob_freelist; - if (iob) + +#if CONFIG_IOB_THROTTLE > 0 + /* If there are free I/O buffers for this allocation */ + + DEBUGVERIFY(sem_getvalue(sem, semcount)); + if (semcount > 0) +#endif { - /* Remove the I/O buffer from the free list and decrement the counting - * semaphore that tracks the number of free IOBs. - */ + /* Take the I/O buffer from the head of the free list */ - g_iob_freelist = iob->io_flink; - DEBUGVERIFY(sem_trywait(&g_iob_sem)); - irqrestore(flags); + iob = g_iob_freelist; + if (iob) + { + /* Remove the I/O buffer from the free list and decrement the + * counting semaphore(s) that tracks the number of available + * IOBs. + */ + + g_iob_freelist = iob->io_flink; + DEBUGVERIFY(sem_trywait(&g_iob_sem)); +#if CONFIG_IOB_THROTTLE > 0 + DEBUGVERIFY(sem_trywait(&g_throttle_sem)); +#endif + irqrestore(flags); - /* Put the I/O buffer in a known state */ + /* Put the I/O buffer in a known state */ - iob->io_flink = NULL; /* Not in a chain */ - iob->io_len = 0; /* Length of the data in the entry */ - iob->io_offset = 0; /* Offset to the beginning of data */ - iob->io_pktlen = 0; /* Total length of the packet */ - return iob; + iob->io_flink = NULL; /* Not in a chain */ + iob->io_len = 0; /* Length of the data in the entry */ + iob->io_offset = 0; /* Offset to the beginning of data */ + iob->io_pktlen = 0; /* Total length of the packet */ + return iob; + } } irqrestore(flags); @@ -126,12 +151,21 @@ static FAR struct iob_s *iob_tryalloc(void) * ****************************************************************************/ -static FAR struct iob_s *iob_allocwait(void) +static FAR struct iob_s *iob_allocwait(bool throttled) { FAR struct iob_s *iob; irqstate_t flags; + FAR sem_t *sem; int ret; +#if CONFIG_IOB_THROTTLE > 0 + /* Select the semaphore count to check. */ + + sem = (throttled ? : &g_throttled_sem, &g_iob_sem); +#else + sem = &g_iob_sem; +#endif + /* The following must be atomic; interrupt must be disabled so that there * is no conflict with interrupt level I/O buffer allocations. This is * not as bad as it sounds because interrupts will be re-enabled while @@ -145,7 +179,7 @@ static FAR struct iob_s *iob_allocwait(void) * will be decremented atomically. */ - iob = iob_tryalloc(); + iob = iob_tryalloc(throttled); if (!iob) { /* If not successful, then the semaphore count was less than or @@ -154,7 +188,7 @@ static FAR struct iob_s *iob_allocwait(void) * count will be incremented. */ - ret = sem_wait(&g_iob_sem); + ret = sem_wait(sem); /* When we wake up from wait, an I/O buffer was returned to * the free list. However, if there are concurrent allocations @@ -182,7 +216,7 @@ static FAR struct iob_s *iob_allocwait(void) * ****************************************************************************/ -FAR struct iob_s *iob_alloc(void) +FAR struct iob_s *iob_alloc(bool throttled) { /* Were we called from the interrupt level? */ @@ -190,12 +224,12 @@ FAR struct iob_s *iob_alloc(void) { /* Yes, then try to allocate an I/O buffer without waiting */ - return iob_tryalloc(); + return iob_tryalloc(throttled); } else { /* Then allocate an I/O buffer, waiting as necessary */ - return iob_allocwait(); + return iob_allocwait(throttled); } } diff --git a/nuttx/net/iob/iob_alloc_qentry.c b/nuttx/net/iob/iob_alloc_qentry.c index 43813a269..f75d21009 100644 --- a/nuttx/net/iob/iob_alloc_qentry.c +++ b/nuttx/net/iob/iob_alloc_qentry.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_clone.c b/nuttx/net/iob/iob_clone.c index ce83400d4..1162b87dd 100644 --- a/nuttx/net/iob/iob_clone.c +++ b/nuttx/net/iob/iob_clone.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET @@ -87,7 +87,7 @@ * ****************************************************************************/ -int iob_clone(FAR struct iob_s *iob1, FAR struct iob_s *iob2) +int iob_clone(FAR struct iob_s *iob1, FAR struct iob_s *iob2, bool throttled) { FAR uint8_t *src; FAR uint8_t *dest; @@ -177,7 +177,7 @@ int iob_clone(FAR struct iob_s *iob1, FAR struct iob_s *iob2) * destination I/O buffer chain. */ - next = iob_alloc(); + next = iob_alloc(throttled); if (!next) { ndbg("Failed to allocate an I/O buffer/n"); diff --git a/nuttx/net/iob/iob_concat.c b/nuttx/net/iob/iob_concat.c index 68d35c480..ecaa33b87 100644 --- a/nuttx/net/iob/iob_concat.c +++ b/nuttx/net/iob/iob_concat.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_contig.c b/nuttx/net/iob/iob_contig.c index 6af1b9c99..9c3a6306b 100755 --- a/nuttx/net/iob/iob_contig.c +++ b/nuttx/net/iob/iob_contig.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_copyin.c b/nuttx/net/iob/iob_copyin.c index c7e4d39f7..1cfd1f697 100644 --- a/nuttx/net/iob/iob_copyin.c +++ b/nuttx/net/iob/iob_copyin.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET @@ -90,7 +90,7 @@ ****************************************************************************/ int iob_copyin(FAR struct iob_s *iob, FAR const uint8_t *src, - unsigned int len, unsigned int offset) + unsigned int len, unsigned int offset, bool throttled) { FAR struct iob_s *head = iob; FAR struct iob_s *next; @@ -206,7 +206,7 @@ int iob_copyin(FAR struct iob_s *iob, FAR const uint8_t *src, { /* Yes.. allocate a new buffer */ - next = iob_alloc(); + next = iob_alloc(throttled); if (next == NULL) { ndbg("ERROR: Failed to allocate I/O buffer\n"); diff --git a/nuttx/net/iob/iob_copyout.c b/nuttx/net/iob/iob_copyout.c index 2db050d31..300b63df8 100644 --- a/nuttx/net/iob/iob_copyout.c +++ b/nuttx/net/iob/iob_copyout.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_free.c b/nuttx/net/iob/iob_free.c index 68c7fb264..ada8a7fe6 100644 --- a/nuttx/net/iob/iob_free.c +++ b/nuttx/net/iob/iob_free.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_free_chain.c b/nuttx/net/iob/iob_free_chain.c index d09a0ca97..2534bde10 100644 --- a/nuttx/net/iob/iob_free_chain.c +++ b/nuttx/net/iob/iob_free_chain.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_free_qentry.c b/nuttx/net/iob/iob_free_qentry.c index 3f5a517b9..f93f16f8f 100644 --- a/nuttx/net/iob/iob_free_qentry.c +++ b/nuttx/net/iob/iob_free_qentry.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_free_queue.c b/nuttx/net/iob/iob_free_queue.c index f23394d45..cf7ffff0c 100644 --- a/nuttx/net/iob/iob_free_queue.c +++ b/nuttx/net/iob/iob_free_queue.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_initialize.c b/nuttx/net/iob/iob_initialize.c index 319e75b8a..8971f8d63 100644 --- a/nuttx/net/iob/iob_initialize.c +++ b/nuttx/net/iob/iob_initialize.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET @@ -88,9 +88,12 @@ FAR struct iob_qentry_s *g_iob_freeqlist; /* Counting semaphores that tracks the number of free IOBs/qentries */ -sem_t g_iob_sem; +sem_t g_iob_sem; /* Counts free I/O buffers */ +#if CONFIG_IOB_THROTTLE > 0 +sem_t g_throttle_sem; /* Counts available I/O buffers when throttled */ +#endif #if CONFIG_IOB_NCHAINS > 0 -sem_t g_qentry_sem; +sem_t g_qentry_sem; /* Counts free I/O buffer queue containers */ #endif /**************************************************************************** diff --git a/nuttx/net/iob/iob_pack.c b/nuttx/net/iob/iob_pack.c index f129e7357..4765e8e59 100644 --- a/nuttx/net/iob/iob_pack.c +++ b/nuttx/net/iob/iob_pack.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_remove_queue.c b/nuttx/net/iob/iob_remove_queue.c index e8ee794e3..f516ad047 100644 --- a/nuttx/net/iob/iob_remove_queue.c +++ b/nuttx/net/iob/iob_remove_queue.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_test.c b/nuttx/net/iob/iob_test.c index 7171db3cd..5c58852cf 100644 --- a/nuttx/net/iob/iob_test.c +++ b/nuttx/net/iob/iob_test.c @@ -121,7 +121,7 @@ int main(int argc, char **argv) int i; iob_initialize(); - iob = iob_alloc(); + iob = iob_alloc(false); for (i = 0; i < 4096; i++) { @@ -129,11 +129,11 @@ int main(int argc, char **argv) } memset(buffer2, 0xff, 4096); - iob_copyin(iob, buffer2, 47, 0); + iob_copyin(iob, buffer2, 47, 0, false); printf("Copy IN: 47, offset 0\n"); dump_chain(iob); - iob_copyin(iob, buffer1, 4096, 47); + iob_copyin(iob, buffer1, 4096, 47, false); printf("Copy IN: 4096, offset 47\n"); dump_chain(iob); diff --git a/nuttx/net/iob/iob_trimhead.c b/nuttx/net/iob/iob_trimhead.c index 6ea684b9a..bb3997c69 100644 --- a/nuttx/net/iob/iob_trimhead.c +++ b/nuttx/net/iob/iob_trimhead.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/iob/iob_trimtail.c b/nuttx/net/iob/iob_trimtail.c index c87de712f..c436550a8 100644 --- a/nuttx/net/iob/iob_trimtail.c +++ b/nuttx/net/iob/iob_trimtail.c @@ -39,7 +39,7 @@ #include -#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +#if defined(CONFIG_DEBUG) && defined(CONFIG_IOB_DEBUG) /* Force debug output (from this file only) */ # undef CONFIG_DEBUG_NET diff --git a/nuttx/net/tcp/Kconfig b/nuttx/net/tcp/Kconfig index d6237c35f..dacb96395 100644 --- a/nuttx/net/tcp/Kconfig +++ b/nuttx/net/tcp/Kconfig @@ -107,7 +107,7 @@ config NET_TCP_WRBUFFER_DEBUG bool "Force write buffer debug" default n depends on DEBUG - select NET_IOB_DEBUG + select IOB_DEBUG ---help--- This option will force debug output from TCP write buffer logic, even without network debug output. This is not normally something @@ -119,7 +119,7 @@ config NET_TCP_WRBUFFER_DUMP bool "Force write buffer dump" default n depends on DEBUG_NET || NET_TCP_WRBUFFER_DEBUG - select NET_IOB_DEBUG + select IOB_DEBUG ---help--- Dump the contents of the write buffers. You do not want to do this unless you really want to analyze the write buffer transfers in diff --git a/nuttx/net/tcp/tcp.h b/nuttx/net/tcp/tcp.h index 73fcdd9f8..b63725ac0 100644 --- a/nuttx/net/tcp/tcp.h +++ b/nuttx/net/tcp/tcp.h @@ -153,6 +153,9 @@ void tcp_wrbuffer_initialize(void); * the free list. This function is called from TCP logic when a buffer * of TCP data is about to sent * + * Input parameters: + * None + * * Assumptions: * Called from user logic with interrupts enabled. * diff --git a/nuttx/net/tcp/tcp_wrbuffer.c b/nuttx/net/tcp/tcp_wrbuffer.c index 21da66cb0..df73fb049 100644 --- a/nuttx/net/tcp/tcp_wrbuffer.c +++ b/nuttx/net/tcp/tcp_wrbuffer.c @@ -128,6 +128,9 @@ void tcp_wrbuffer_initialize(void) * the free list. This function is called from TCP logic when a buffer * of TCP data is about to sent * + * Input parameters: + * None + * * Assumptions: * Called from user logic with interrupts enabled. * @@ -157,7 +160,7 @@ FAR struct tcp_wrbuffer_s *tcp_wrbuffer_alloc(void) /* Now get the first I/O buffer for the write buffer structure */ - wrb->wb_iob = iob_alloc(); + wrb->wb_iob = iob_alloc(false); if (!wrb->wb_iob) { ndbg("ERROR: Failed to allocate I/O buffer\n"); -- cgit v1.2.3