Mercurial > ecos
changeset 2233:42c9e3ed9654
* cdl/freebsd_net.cdl, src/ecos/support.c, src/ecos/support.c:
Changes to make stack sizes CDL configurable.
| author | asl |
|---|---|
| date | Sat, 17 Jun 2006 18:05:20 +0000 |
| parents | 8e3602f394e2 |
| children | 3a4028c88f35 |
| files | packages/net/bsd_tcpip/current/ChangeLog packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl packages/net/bsd_tcpip/current/src/ecos/support.c packages/net/bsd_tcpip/current/src/ecos/timeout.c |
| diffstat | 4 files changed, 65 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/net/bsd_tcpip/current/ChangeLog +++ b/packages/net/bsd_tcpip/current/ChangeLog @@ -1,3 +1,8 @@ +2006-06-14 Andy Jackson <andy@xylanta.com> + + * cdl/freebsd_net.cdl, src/ecos/support.c, src/ecos/support.c: + Changes to make stack sizes CDL configurable. + 2006-05-19 Andrew Lunn <andrew.lunn@ascom.ch> * tests/sysctl1.c: Use CYG_NELEM from infra.
--- a/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl +++ b/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl @@ -320,7 +320,7 @@ cdl_package CYGPKG_NET_FREEBSD_STACK { } cdl_option CYGPKG_NET_MAXSOCKETS { - display "Max number of open sockets." + display "Max number of open sockets" flavor data default_value CYGNUM_FILEIO_NFILE description " @@ -337,31 +337,63 @@ cdl_package CYGPKG_NET_FREEBSD_STACK { used by the networking code." } - cdl_option CYGPKG_NET_THREAD_PRIORITY { - display "Priority level for backgound network processing." - flavor data - default_value 7 - description " - This option allows the thread priority level used by the - networking stack to be adjusted by the user. It should be set - high enough that sufficient CPU resources are available to - process network data, but may be adjusted so that application - threads can have precedence over network processing." + cdl_component CYGPKG_NET_THREAD { + display "Background network processing thread options" + flavor none + no_define + + cdl_option CYGPKG_NET_THREAD_PRIORITY { + display "Priority level for background network processing" + flavor data + default_value 7 + description " + This option allows the thread priority level used by the + networking stack to be adjusted by the user. It should be set + high enough that sufficient CPU resources are available to + process network data, but may be adjusted so that application + threads can have precedence over network processing." + } + + cdl_option CYGNUM_NET_THREAD_STACKSIZE { + display "Stack size for backgound network processing" + flavor data + default_value { (CYGPKG_NET_INET6 ? + "CYGNUM_HAL_STACK_SIZE_TYPICAL+2048" : + "CYGNUM_HAL_STACK_SIZE_TYPICAL") } + description " + This option allows the thread stack allocated for the + networking stack to be adjusted by the user. " + } } - cdl_option CYGPKG_NET_FAST_THREAD_PRIORITY { - display "Priority level for fast network processing." - flavor data - default_value CYGPKG_NET_THREAD_PRIORITY - 1 - description " - This option sets the thread priority level used by the fast - network thread. The fast network thread runs often but briefly, to - service network device interrupts and network timeout events. This - thread should have higher priority than the background network - thread. It is reasonable to set this thread's priority higher than - application threads for best network throughput, or to set it lower - than application threads for best latency for those application - threads themselves, potentially at a cost to network throughput." + cdl_component CYGPKG_NET_FAST_THREAD { + display "Fast network processing thread options" + flavor none + no_define + + cdl_option CYGPKG_NET_FAST_THREAD_PRIORITY { + display "Priority level for fast network processing" + flavor data + default_value CYGPKG_NET_THREAD_PRIORITY - 1 + description " + This option sets the thread priority level used by the fast + network thread. The fast network thread runs often but briefly, to + service network device interrupts and network timeout events. This + thread should have higher priority than the background network + thread. It is reasonable to set this thread's priority higher than + application threads for best network throughput, or to set it lower + than application threads for best latency for those application + threads themselves, potentially at a cost to network throughput." + } + + cdl_option CYGNUM_NET_FAST_THREAD_STACKSIZE { + display "Stack size for fast network processing" + flavor data + default_value { "CYGNUM_HAL_STACK_SIZE_TYPICAL" } + description " + This option allows the thread stack allocated for the + fast networking stack to be adjusted by the user. " + } } cdl_component CYGPKG_NET_FAST_THREAD_TICKLE_DEVS {
--- a/packages/net/bsd_tcpip/current/src/ecos/support.c +++ b/packages/net/bsd_tcpip/current/src/ecos/support.c @@ -104,11 +104,8 @@ volatile struct timeval mono_time; int cyg_net_log_mask = CYGPKG_NET_FREEBSD_LOGGING; #endif -#ifdef CYGPKG_NET_INET6 -#define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL+2048) -#else -#define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL -#endif +#define STACK_SIZE CYGNUM_NET_THREAD_STACKSIZE + static char netint_stack[STACK_SIZE]; static cyg_thread netint_thread_data; static cyg_handle_t netint_thread_handle;
--- a/packages/net/bsd_tcpip/current/src/ecos/timeout.c +++ b/packages/net/bsd_tcpip/current/src/ecos/timeout.c @@ -64,7 +64,8 @@ static cyg_alarm timeout_alarm; static cyg_int32 last_delta; static cyg_tick_count_t last_set_time; -#define STACK_SIZE CYGNUM_HAL_STACK_SIZE_TYPICAL +#define STACK_SIZE CYGNUM_NET_FAST_THREAD_STACKSIZE + static char alarm_stack[STACK_SIZE]; static cyg_thread alarm_thread_data; static cyg_handle_t alarm_thread_handle;
