zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
11.01k stars 6.7k forks source link

civetweb issues #27020

Closed xhpohanka closed 4 years ago

xhpohanka commented 4 years ago

I'm playing with civetweb webserver module on latest zephyr tree and I see some issues here

stack size

When I try to serve a bit bigger pages that are in provided in samples I got stack overflow errors. Looking into code this does not lookg good to me

#if defined(USE_STACK_SIZE) && (USE_STACK_SIZE > 1)
#define ZEPHYR_STACK_SIZE USE_STACK_SIZE
#else
#define ZEPHYR_STACK_SIZE 8096
#endif
...
/* General purpose buffer size. */
#if !defined(MG_BUF_LEN) /* in bytes */
#define MG_BUF_LEN (1024 * 8)
#endif
...
static void
discard_unread_request_data(struct mg_connection *conn)
{
    char buf[MG_BUF_LEN];

MG_BUF_LEN sized arrays are allocated on stack on several places and this size is even bigger than default stack size used in zephyr sample.

very slow upload

I have tested upload using form (FileUploadForm handler) in modules/lib/civetweb/examples/embedded_c/embedded_c.c. It is unacceptably slow on my embedded platform (stm32f429) and also very slow using qemu_x86, so I think it is not platform related.

Civetweb threads are made by pthread api with default priority equal to 0 which corresponds to lowest preempt priority of 15. I was able to speed up the upload only by changing the priority to highest one (-15). The same priority is used in zephyr/samples/net/sockets/dumb_http_server_mt. However with such setup my pages stop to work entirely with errors like <err> net_pkt: Data buffer (28) allocation failed (arp_prepare_reply:495). I was not able to found the connection between packet allocations and civetweb priority yet. It seems wierd to me, this failed allocations start to appear even when the priority is inreased only by a small number, not neccessarily to -15.

Do anyone use civetweb on zephyr for some real project?

my config

``` # # Modules # # # Optional modules. Make sure they're installed, via the project manifest. # # CONFIG_CANOPENNODE is not set CONFIG_CIVETWEB=y # CONFIG_LIBMETAL is not set # CONFIG_HAS_SEMTECH_LORAMAC is not set # CONFIG_HAS_SEMTECH_RADIO_DRIVERS is not set CONFIG_MBEDTLS=y CONFIG_MBEDTLS_BUILTIN=y # CONFIG_MBEDTLS_LIBRARY is not set CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h" # # TLS configuration # # # Supported TLS version # # CONFIG_MBEDTLS_TLS_VERSION_1_0 is not set # CONFIG_MBEDTLS_TLS_VERSION_1_1 is not set CONFIG_MBEDTLS_TLS_VERSION_1_2=y CONFIG_MBEDTLS_DTLS=y # CONFIG_MBEDTLS_SSL_EXPORT_KEYS is not set # end of Supported TLS version # # Ciphersuite configuration # # # Supported key exchange modes # # CONFIG_MBEDTLS_KEY_EXCHANGE_ALL_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED is not set CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED=y # CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED is not set # CONFIG_MBEDTLS_ECDSA_DETERMINISTIC is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED is not set # CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED is not set # # Supported cipher modes # # CONFIG_MBEDTLS_CIPHER_ALL_ENABLED is not set CONFIG_MBEDTLS_CIPHER_AES_ENABLED=y CONFIG_MBEDTLS_AES_ROM_TABLES=y # CONFIG_MBEDTLS_CIPHER_CAMELLIA_ENABLED is not set CONFIG_MBEDTLS_CIPHER_DES_ENABLED=y # CONFIG_MBEDTLS_CIPHER_ARC4_ENABLED is not set # CONFIG_MBEDTLS_CIPHER_CHACHA20_ENABLED is not set # CONFIG_MBEDTLS_CIPHER_BLOWFISH_ENABLED is not set # CONFIG_MBEDTLS_CIPHER_CCM_ENABLED is not set # CONFIG_MBEDTLS_CIPHER_GCM_ENABLED is not set # CONFIG_MBEDTLS_CIPHER_MODE_XTS_ENABLED is not set CONFIG_MBEDTLS_CIPHER_MODE_CBC_ENABLED=y # CONFIG_MBEDTLS_CIPHER_MODE_CTR_ENABLED is not set # # Supported message authentication methods # # CONFIG_MBEDTLS_MAC_ALL_ENABLED is not set # CONFIG_MBEDTLS_MAC_MD4_ENABLED is not set CONFIG_MBEDTLS_MAC_MD5_ENABLED=y CONFIG_MBEDTLS_MAC_SHA1_ENABLED=y CONFIG_MBEDTLS_MAC_SHA256_ENABLED=y CONFIG_MBEDTLS_SHA256_SMALLER=y # CONFIG_MBEDTLS_MAC_SHA512_ENABLED is not set # CONFIG_MBEDTLS_MAC_POLY1305_ENABLED is not set # CONFIG_MBEDTLS_MAC_CMAC_ENABLED is not set # end of Ciphersuite configuration # # Random number generators # CONFIG_MBEDTLS_CTR_DRBG_ENABLED=y # CONFIG_MBEDTLS_HMAC_DRBG_ENABLED is not set # # Other configurations # CONFIG_MBEDTLS_CIPHER=y CONFIG_MBEDTLS_MD=y # CONFIG_MBEDTLS_GENPRIME_ENABLED is not set # CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT is not set CONFIG_MBEDTLS_HAVE_ASM=y CONFIG_MBEDTLS_ENTROPY_ENABLED=y # CONFIG_MBEDTLS_USER_CONFIG_ENABLE is not set # end of TLS configuration CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=1500 CONFIG_MBEDTLS_DEBUG=y CONFIG_MBEDTLS_DEBUG_LEVEL=0 # CONFIG_MBEDTLS_TEST is not set CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=64000 CONFIG_APP_LINK_WITH_MBEDTLS=y # CONFIG_HAS_MEC_HAL is not set # CONFIG_OPENAMP is not set # CONFIG_MIPI_SYST_LIB is not set # CONFIG_TINYCBOR is not set # CONFIG_TINYCRYPT is not set # end of Modules # CONFIG_SPI is not set CONFIG_NET_L2_ETHERNET=y CONFIG_TEST_RANDOM_GENERATOR=y # CONFIG_I2C is not set # CONFIG_MODEM is not set CONFIG_UART_INTERRUPT_DRIVEN=y # CONFIG_NET_IPV6 is not set # CONFIG_NET_CONFIG_NEED_IPV6 is not set # CONFIG_BUILD_OUTPUT_BIN is not set CONFIG_BOARD="qemu_x86" CONFIG_SOC="ia32" CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=25000000 CONFIG_HPET_TIMER=y # CONFIG_APIC_TIMER is not set # CONFIG_PCIE_MMIO_CFG is not set CONFIG_UART_PIPE_ON_DEV_NAME="UART_1" CONFIG_QEMU_TARGET=y CONFIG_BOARD_QEMU_X86=y # CONFIG_BOARD_QEMU_X86_64 is not set # # Board Options # # CONFIG_QEMU_ICOUNT is not set # end of Board Options # CONFIG_SOC_APOLLO_LAKE is not set # CONFIG_SOC_ATOM is not set CONFIG_SOC_IA32=y # # Hardware Configuration # # CONFIG_SOC_LOG_LEVEL_OFF is not set # CONFIG_SOC_LOG_LEVEL_ERR is not set # CONFIG_SOC_LOG_LEVEL_WRN is not set CONFIG_SOC_LOG_LEVEL_INF=y # CONFIG_SOC_LOG_LEVEL_DBG is not set CONFIG_SOC_LOG_LEVEL=3 # end of Hardware Configuration # # X86 Architecture Options # CONFIG_ARCH="x86" CONFIG_CPU_MINUTEIA=y # CONFIG_X86_64 is not set CONFIG_X86_KERNEL_OFFSET=1048576 CONFIG_MAX_IRQ_LINES=128 # CONFIG_XIP is not set CONFIG_PIC_DISABLE=y # CONFIG_ACPI is not set CONFIG_X86_MEMMAP_ENTRIES=1 CONFIG_MULTIBOOT=y # CONFIG_MULTIBOOT_INFO is not set # CONFIG_MULTIBOOT_MEMMAP is not set # CONFIG_MULTIBOOT_FRAMEBUF is not set CONFIG_EXCEPTION_DEBUG=y CONFIG_X86_VERY_EARLY_CONSOLE=y CONFIG_X86_MMU=y CONFIG_X86_MMU_PAGE_POOL_PAGES=15 CONFIG_NESTED_INTERRUPTS=y # # Memory Layout Options # CONFIG_IDT_NUM_VECTORS=256 CONFIG_SET_GDT=y # CONFIG_GDT_DYNAMIC is not set # end of Memory Layout Options # # Processor Capabilities # # # Architecture Floating Point Options # # CONFIG_SSE is not set CONFIG_LAZY_FPU_SHARING=y # end of Architecture Floating Point Options CONFIG_CACHE_LINE_SIZE_DETECT=y CONFIG_CACHE_LINE_SIZE=0 # CONFIG_CACHE_FLUSHING is not set # end of Processor Capabilities CONFIG_X86_EXCEPTION_STACK_TRACE=y CONFIG_MAIN_STACK_SIZE=8192 CONFIG_IDLE_STACK_SIZE=2048 CONFIG_ISR_STACK_SIZE=8192 CONFIG_TEST_EXTRA_STACKSIZE=0 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1024 # end of X86 Architecture Options CONFIG_X86=y CONFIG_ARCH_IS_SET=y # # General Architecture Options # # CONFIG_ARCH_LOG_LEVEL_OFF is not set # CONFIG_ARCH_LOG_LEVEL_ERR is not set # CONFIG_ARCH_LOG_LEVEL_WRN is not set CONFIG_ARCH_LOG_LEVEL_INF=y # CONFIG_ARCH_LOG_LEVEL_DBG is not set CONFIG_ARCH_LOG_LEVEL=3 # CONFIG_MPU_LOG_LEVEL_OFF is not set # CONFIG_MPU_LOG_LEVEL_ERR is not set # CONFIG_MPU_LOG_LEVEL_WRN is not set CONFIG_MPU_LOG_LEVEL_INF=y # CONFIG_MPU_LOG_LEVEL_DBG is not set CONFIG_MPU_LOG_LEVEL=3 CONFIG_SRAM_SIZE=4096 CONFIG_SRAM_BASE_ADDRESS=0x0 CONFIG_FLASH_SIZE=4096 CONFIG_FLASH_BASE_ADDRESS=0x500000 # CONFIG_HW_STACK_PROTECTION is not set # CONFIG_USERSPACE is not set CONFIG_PRIVILEGED_STACK_SIZE=1024 CONFIG_KOBJECT_TEXT_AREA=256 # CONFIG_STACK_GROWS_UP is not set # # Interrupt Configuration # # CONFIG_DYNAMIC_INTERRUPTS is not set # CONFIG_GEN_ISR_TABLES is not set # end of Interrupt Configuration # end of General Architecture Options CONFIG_ARCH_HAS_STACK_PROTECTION=y CONFIG_ARCH_HAS_USERSPACE=y CONFIG_CPU_HAS_FPU=y CONFIG_MEMORY_PROTECTION=y # # Floating Point Options # CONFIG_FPU=y CONFIG_FPU_SHARING=y # end of Floating Point Options # # General Kernel Options # # CONFIG_KERNEL_LOG_LEVEL_OFF is not set # CONFIG_KERNEL_LOG_LEVEL_ERR is not set # CONFIG_KERNEL_LOG_LEVEL_WRN is not set CONFIG_KERNEL_LOG_LEVEL_INF=y # CONFIG_KERNEL_LOG_LEVEL_DBG is not set CONFIG_KERNEL_LOG_LEVEL=3 CONFIG_MULTITHREADING=y CONFIG_NUM_COOP_PRIORITIES=16 CONFIG_NUM_PREEMPT_PRIORITIES=15 CONFIG_MAIN_THREAD_PRIORITY=0 CONFIG_COOP_ENABLED=y CONFIG_PREEMPT_ENABLED=y CONFIG_PRIORITY_CEILING=0 CONFIG_NUM_METAIRQ_PRIORITIES=0 # CONFIG_SCHED_DEADLINE is not set CONFIG_THREAD_STACK_INFO=y # CONFIG_THREAD_CUSTOM_DATA is not set CONFIG_ERRNO=y # CONFIG_SCHED_DUMB is not set CONFIG_SCHED_SCALABLE=y # CONFIG_SCHED_MULTIQ is not set CONFIG_WAITQ_SCALABLE=y # CONFIG_WAITQ_DUMB is not set # # Kernel Debugging and Metrics # # CONFIG_INIT_STACKS is not set CONFIG_BOOT_BANNER=y CONFIG_BOOT_DELAY=0 # CONFIG_EXECUTION_BENCHMARKING is not set # CONFIG_THREAD_MONITOR is not set # CONFIG_THREAD_NAME is not set # end of Kernel Debugging and Metrics # # Work Queue Options # CONFIG_SYSTEM_WORKQUEUE_PRIORITY=-1 # end of Work Queue Options # # Atomic Operations # CONFIG_ATOMIC_OPERATIONS_BUILTIN=y # end of Atomic Operations # # Timer API Options # CONFIG_TIMESLICING=y CONFIG_TIMESLICE_SIZE=0 CONFIG_TIMESLICE_PRIORITY=0 CONFIG_POLL=y # end of Timer API Options # # Other Kernel Object Options # CONFIG_NUM_MBOX_ASYNC_MSGS=10 CONFIG_NUM_PIPE_ASYNC_MSGS=10 CONFIG_MEM_POOL_HEAP_BACKEND=y CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_HEAP_MEM_POOL_MIN_SIZE=64 # end of Other Kernel Object Options CONFIG_ARCH_HAS_CUSTOM_SWAP_TO_MAIN=y CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 CONFIG_SYS_CLOCK_EXISTS=y # CONFIG_LEGACY_TIMEOUT_API is not set CONFIG_TIMEOUT_64BIT=y # # Initialization Priorities # CONFIG_KERNEL_INIT_PRIORITY_OBJECTS=30 CONFIG_KERNEL_INIT_PRIORITY_DEFAULT=40 CONFIG_KERNEL_INIT_PRIORITY_DEVICE=50 CONFIG_APPLICATION_INIT_PRIORITY=90 # end of Initialization Priorities # # Security Options # # CONFIG_STACK_CANARIES is not set CONFIG_STACK_POINTER_RANDOM=0 # end of Security Options # # SMP Options # CONFIG_MP_NUM_CPUS=1 # end of SMP Options CONFIG_TICKLESS_IDLE=y CONFIG_TICKLESS_IDLE_THRESH=3 CONFIG_TICKLESS_KERNEL=y # CONFIG_SYS_POWER_MANAGEMENT is not set # CONFIG_DEVICE_POWER_MANAGEMENT is not set # end of General Kernel Options CONFIG_HAS_DTS=y # # Device Drivers # # CONFIG_IEEE802154 is not set # CONFIG_LORA is not set CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_0" CONFIG_CONSOLE=y CONFIG_CONSOLE_INPUT_MAX_LINE_LEN=128 CONFIG_CONSOLE_HAS_DRIVER=y # CONFIG_CONSOLE_HANDLER is not set CONFIG_UART_CONSOLE=y CONFIG_UART_CONSOLE_INIT_PRIORITY=60 # CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS is not set # CONFIG_UART_CONSOLE_MCUMGR is not set # CONFIG_USB_UART_CONSOLE is not set # CONFIG_RAM_CONSOLE is not set # CONFIG_IPM_CONSOLE_SENDER is not set # CONFIG_IPM_CONSOLE_RECEIVER is not set CONFIG_UART_PIPE=y # CONFIG_UART_MCUMGR is not set # CONFIG_UART_CONSOLE_LOG_LEVEL_OFF is not set # CONFIG_UART_CONSOLE_LOG_LEVEL_ERR is not set # CONFIG_UART_CONSOLE_LOG_LEVEL_WRN is not set CONFIG_UART_CONSOLE_LOG_LEVEL_INF=y # CONFIG_UART_CONSOLE_LOG_LEVEL_DBG is not set CONFIG_UART_CONSOLE_LOG_LEVEL=3 # CONFIG_GSM_MUX is not set CONFIG_UART_MUX_RX_STACK_SIZE=512 CONFIG_UART_MUX_RX_PRIORITY=7 # CONFIG_UART_MUX_LOG_LEVEL_OFF is not set # CONFIG_UART_MUX_LOG_LEVEL_ERR is not set # CONFIG_UART_MUX_LOG_LEVEL_WRN is not set CONFIG_UART_MUX_LOG_LEVEL_INF=y # CONFIG_UART_MUX_LOG_LEVEL_DBG is not set CONFIG_UART_MUX_LOG_LEVEL=3 # # Ethernet Drivers # # CONFIG_ETHERNET_LOG_LEVEL_OFF is not set # CONFIG_ETHERNET_LOG_LEVEL_ERR is not set # CONFIG_ETHERNET_LOG_LEVEL_WRN is not set # CONFIG_ETHERNET_LOG_LEVEL_INF is not set # CONFIG_ETHERNET_LOG_LEVEL_DBG is not set CONFIG_ETHERNET_LOG_LEVEL_DEFAULT=y CONFIG_ETHERNET_LOG_LEVEL=3 CONFIG_ETH_INIT_PRIORITY=80 # CONFIG_ETH_E1000_VERBOSE_DEBUG is not set # CONFIG_ETH_STM32_HAL is not set # CONFIG_ETH_SMSC911X is not set # CONFIG_ETH_STELLARIS is not set # CONFIG_ETH_LITEETH is not set # CONFIG_ETH_GECKO is not set # end of Ethernet Drivers CONFIG_SLIP=y CONFIG_SLIP_DRV_NAME="slip" # CONFIG_SLIP_LOG_LEVEL_OFF is not set # CONFIG_SLIP_LOG_LEVEL_ERR is not set # CONFIG_SLIP_LOG_LEVEL_WRN is not set # CONFIG_SLIP_LOG_LEVEL_INF is not set # CONFIG_SLIP_LOG_LEVEL_DBG is not set CONFIG_SLIP_LOG_LEVEL_DEFAULT=y CONFIG_SLIP_LOG_LEVEL=3 # CONFIG_SLIP_STATISTICS is not set CONFIG_SLIP_TAP=y CONFIG_SLIP_MAC_ADDR="" # CONFIG_NET_LOOPBACK is not set CONFIG_SERIAL=y # # Capabilities # CONFIG_SERIAL_HAS_DRIVER=y CONFIG_SERIAL_SUPPORT_INTERRUPT=y # CONFIG_UART_LINE_CTRL is not set # CONFIG_UART_DRV_CMD is not set # # Serial Drivers # CONFIG_UART_NS16550=y # CONFIG_UART_NS16750 is not set # CONFIG_UART_NS16550_ACCESS_WORD_ONLY is not set # CONFIG_UART_NSIM is not set # CONFIG_UART_ALTERA_JTAG is not set # CONFIG_UART_PL011 is not set # # Interrupt Controllers # # CONFIG_SWERV_PIC is not set CONFIG_LOAPIC=y CONFIG_LOAPIC_BASE_ADDRESS=0xFEE00000 # CONFIG_X2APIC is not set # CONFIG_LOAPIC_SPURIOUS_VECTOR is not set CONFIG_IOAPIC=y CONFIG_IOAPIC_NUM_RTES=24 CONFIG_IOAPIC_MASK_RTE=y # end of Interrupt Controllers # # Timer Drivers # # CONFIG_LOAPIC_TIMER is not set # CONFIG_SYSTEM_CLOCK_DISABLE is not set CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y # CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE is not set CONFIG_SYSTEM_CLOCK_INIT_PRIORITY=0 CONFIG_TICKLESS_CAPABLE=y # end of Timer Drivers CONFIG_ENTROPY_GENERATOR=y # CONFIG_PCIE is not set # CONFIG_GPIO is not set # CONFIG_SHARED_IRQ is not set # CONFIG_I2S is not set # CONFIG_PWM is not set # CONFIG_PINMUX is not set # CONFIG_ADC is not set # CONFIG_DAC is not set # CONFIG_WATCHDOG is not set # CONFIG_CLOCK_CONTROL is not set # CONFIG_PTP_CLOCK is not set # CONFIG_IPM is not set # CONFIG_FLASH is not set # CONFIG_SENSOR is not set # CONFIG_COUNTER is not set # CONFIG_DMA is not set # CONFIG_USB is not set # CONFIG_CRYPTO is not set # CONFIG_DISPLAY is not set # CONFIG_LED_STRIP is not set # CONFIG_WIFI is not set # CONFIG_LED is not set # CONFIG_CAN is not set # CONFIG_AUDIO is not set # CONFIG_NEURAL_NET_ACCEL is not set # CONFIG_HWINFO is not set # CONFIG_ESPI is not set # CONFIG_PS2 is not set # CONFIG_KSCAN is not set # CONFIG_VIDEO is not set # CONFIG_EEPROM is not set # CONFIG_PECI is not set # CONFIG_PECI_INTERRUPT_DRIVEN is not set # end of Device Drivers # # C Library # CONFIG_MINIMAL_LIBC=y # CONFIG_NEWLIB_LIBC is not set # CONFIG_EXTERNAL_LIBC is not set CONFIG_MINIMAL_LIBC_MALLOC=y CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=65536 CONFIG_MINIMAL_LIBC_CALLOC=y CONFIG_MINIMAL_LIBC_REALLOCARRAY=y # CONFIG_MINIMAL_LIBC_LL_PRINTF is not set CONFIG_STDOUT_CONSOLE=y # end of C Library # # Additional libraries # # CONFIG_FNMATCH is not set # CONFIG_LVGL is not set # # OS Support Library # CONFIG_JSON_LIBRARY=y # CONFIG_RING_BUFFER is not set # CONFIG_BASE64 is not set # CONFIG_SYS_HEAP_VALIDATE is not set CONFIG_SYS_HEAP_ALLOC_LOOPS=3 # CONFIG_SYS_HEAP_ALIGNED_ALLOC is not set CONFIG_PRINTK64=y # CONFIG_PRINTK_SYNC is not set # end of OS Support Library CONFIG_POSIX_MAX_FDS=16 CONFIG_POSIX_API=y CONFIG_PTHREAD_IPC=y CONFIG_MAX_PTHREAD_COUNT=5 CONFIG_SEM_VALUE_MAX=32767 CONFIG_POSIX_CLOCK=y CONFIG_MAX_TIMER_COUNT=5 CONFIG_POSIX_MQUEUE=y CONFIG_MSG_COUNT_MAX=16 CONFIG_MSG_SIZE_MAX=16 CONFIG_MQUEUE_NAMELEN_MAX=16 CONFIG_APP_LINK_WITH_POSIX_SUBSYS=y # CONFIG_EVENTFD is not set # CONFIG_UPDATEHUB is not set # CONFIG_UPDATEHUB_LOG_LEVEL_OFF is not set # CONFIG_UPDATEHUB_LOG_LEVEL_ERR is not set # CONFIG_UPDATEHUB_LOG_LEVEL_WRN is not set CONFIG_UPDATEHUB_LOG_LEVEL_INF=y # CONFIG_UPDATEHUB_LOG_LEVEL_DBG is not set CONFIG_UPDATEHUB_LOG_LEVEL=3 # CONFIG_OPENAMP_RSC_TABLE is not set # end of Additional libraries # CONFIG_BT is not set # CONFIG_CONSOLE_SUBSYS is not set # CONFIG_CPLUSPLUS is not set # # System Monitoring Options # # CONFIG_BOOT_TIME_MEASUREMENT is not set # CONFIG_STATS is not set # end of System Monitoring Options # # Debugging Options # CONFIG_DEBUG=y CONFIG_STACK_USAGE=y CONFIG_STACK_SENTINEL=y CONFIG_PRINTK=y CONFIG_EARLY_CONSOLE=y CONFIG_ASSERT=y CONFIG_ASSERT_LEVEL=2 CONFIG_SPIN_VALIDATE=y # CONFIG_FORCE_NO_ASSERT is not set CONFIG_ASSERT_VERBOSE=y # CONFIG_ASSERT_NO_FILE_INFO is not set # CONFIG_ASSERT_NO_COND_INFO is not set # CONFIG_ASSERT_NO_MSG_INFO is not set # CONFIG_OBJECT_TRACING is not set # CONFIG_OVERRIDE_FRAME_POINTER_DEFAULT is not set CONFIG_DEBUG_INFO=y CONFIG_EXCEPTION_STACK_TRACE=y # CONFIG_OPENOCD_SUPPORT is not set # end of Debugging Options # CONFIG_THREAD_ANALYZER is not set # CONFIG_DISK_ACCESS is not set # # File Systems # # CONFIG_FILE_SYSTEM is not set # CONFIG_NVS is not set # end of File Systems CONFIG_LOG=y # CONFIG_LOG_MINIMAL is not set # CONFIG_LOG_RUNTIME_FILTERING is not set CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_LOG_OVERRIDE_LEVEL=0 CONFIG_LOG_MAX_LEVEL=4 # CONFIG_LOG_MIPI_SYST_ENABLE is not set # # Prepend non-hexdump log message with function name # # CONFIG_LOG_FUNC_NAME_PREFIX_ERR is not set # CONFIG_LOG_FUNC_NAME_PREFIX_WRN is not set # CONFIG_LOG_FUNC_NAME_PREFIX_INF is not set CONFIG_LOG_FUNC_NAME_PREFIX_DBG=y # end of Prepend non-hexdump log message with function name # CONFIG_LOG_PRINTK is not set # CONFIG_LOG_IMMEDIATE is not set # CONFIG_LOG_ENABLE_FANCY_OUTPUT_FORMATTING is not set CONFIG_LOG_MODE_OVERFLOW=y # CONFIG_LOG_MODE_NO_OVERFLOW is not set # CONFIG_LOG_BLOCK_IN_THREAD is not set CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=10 CONFIG_LOG_PROCESS_THREAD=y CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=1000 CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=768 CONFIG_LOG_BUFFER_SIZE=1024 CONFIG_LOG_DETECT_MISSED_STRDUP=y CONFIG_LOG_STRDUP_MAX_STRING=46 CONFIG_LOG_STRDUP_BUF_COUNT=4 # CONFIG_LOG_STRDUP_POOL_PROFILING is not set CONFIG_LOG_DOMAIN_ID=0 # CONFIG_LOG_FRONTEND is not set CONFIG_LOG_BACKEND_UART=y # CONFIG_LOG_BACKEND_NET is not set # CONFIG_LOG_BACKEND_RB is not set CONFIG_LOG_BACKEND_SHOW_COLOR=y CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=y # # Management # # CONFIG_MCUMGR_SMP_BT is not set # CONFIG_MCUMGR_SMP_SHELL is not set # CONFIG_MCUMGR_SMP_UART is not set # CONFIG_MCUMGR is not set # CONFIG_MCUMGR_SMP_UDP is not set # end of Management # # Networking # CONFIG_NET_BUF=y CONFIG_NET_BUF_USER_DATA_SIZE=4 # CONFIG_NET_BUF_LOG is not set # CONFIG_NET_BUF_LOG_LEVEL_OFF is not set # CONFIG_NET_BUF_LOG_LEVEL_ERR is not set # CONFIG_NET_BUF_LOG_LEVEL_WRN is not set CONFIG_NET_BUF_LOG_LEVEL_INF=y # CONFIG_NET_BUF_LOG_LEVEL_DBG is not set CONFIG_NET_BUF_LOG_LEVEL=3 # CONFIG_NET_BUF_POOL_USAGE is not set CONFIG_NETWORKING=y CONFIG_NET_HOSTNAME_ENABLE=y CONFIG_NET_HOSTNAME="poe" # CONFIG_NET_HOSTNAME_UNIQUE is not set # CONFIG_NET_HOSTNAME_LOG_LEVEL_OFF is not set # CONFIG_NET_HOSTNAME_LOG_LEVEL_ERR is not set # CONFIG_NET_HOSTNAME_LOG_LEVEL_WRN is not set # CONFIG_NET_HOSTNAME_LOG_LEVEL_INF is not set # CONFIG_NET_HOSTNAME_LOG_LEVEL_DBG is not set CONFIG_NET_HOSTNAME_LOG_LEVEL_DEFAULT=y CONFIG_NET_HOSTNAME_LOG_LEVEL=3 # # Link layer options # # CONFIG_NET_L2_DUMMY is not set # CONFIG_NET_L2_BT_SHELL is not set # CONFIG_NET_L2_ETHERNET_LOG_LEVEL_OFF is not set # CONFIG_NET_L2_ETHERNET_LOG_LEVEL_ERR is not set # CONFIG_NET_L2_ETHERNET_LOG_LEVEL_WRN is not set # CONFIG_NET_L2_ETHERNET_LOG_LEVEL_INF is not set # CONFIG_NET_L2_ETHERNET_LOG_LEVEL_DBG is not set CONFIG_NET_L2_ETHERNET_LOG_LEVEL_DEFAULT=y CONFIG_NET_L2_ETHERNET_LOG_LEVEL=3 # CONFIG_NET_L2_ETHERNET_MGMT is not set # CONFIG_NET_VLAN is not set CONFIG_NET_ARP=y CONFIG_NET_ARP_TABLE_SIZE=2 CONFIG_NET_ARP_GRATUITOUS=y # CONFIG_NET_ARP_LOG_LEVEL_OFF is not set # CONFIG_NET_ARP_LOG_LEVEL_ERR is not set # CONFIG_NET_ARP_LOG_LEVEL_WRN is not set # CONFIG_NET_ARP_LOG_LEVEL_INF is not set # CONFIG_NET_ARP_LOG_LEVEL_DBG is not set CONFIG_NET_ARP_LOG_LEVEL_DEFAULT=y CONFIG_NET_ARP_LOG_LEVEL=3 # CONFIG_NET_GPTP is not set # CONFIG_NET_LLDP is not set # CONFIG_NET_L2_PPP is not set # CONFIG_NET_L2_IEEE802154 is not set # CONFIG_NET_L2_CANBUS_RAW is not set # CONFIG_NET_L2_WIFI_MGMT is not set # CONFIG_NET_L2_WIFI_SHELL is not set # end of Link layer options # # IP stack # CONFIG_NET_NATIVE=y CONFIG_NET_NATIVE_IPV4=y CONFIG_NET_NATIVE_TCP=y CONFIG_NET_NATIVE_UDP=y # CONFIG_NET_OFFLOAD is not set CONFIG_NET_QEMU_SLIP=y # CONFIG_NET_QEMU_PPP is not set # CONFIG_NET_QEMU_ETHERNET is not set # CONFIG_NET_QEMU_USER is not set CONFIG_NET_INIT_PRIO=90 CONFIG_NET_IPV4=y CONFIG_NET_INITIAL_TTL=64 CONFIG_NET_IF_MAX_IPV4_COUNT=1 CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1 CONFIG_NET_IF_MCAST_IPV4_ADDR_COUNT=1 # CONFIG_NET_ICMPV4_ACCEPT_BROADCAST is not set # CONFIG_NET_IPV4_ACCEPT_ZERO_BROADCAST is not set # CONFIG_NET_DHCPV4 is not set # CONFIG_NET_IPV4_AUTO is not set # CONFIG_NET_IPV4_HDR_OPTIONS is not set # CONFIG_NET_IPV4_LOG_LEVEL_OFF is not set # CONFIG_NET_IPV4_LOG_LEVEL_ERR is not set # CONFIG_NET_IPV4_LOG_LEVEL_WRN is not set # CONFIG_NET_IPV4_LOG_LEVEL_INF is not set # CONFIG_NET_IPV4_LOG_LEVEL_DBG is not set CONFIG_NET_IPV4_LOG_LEVEL_DEFAULT=y CONFIG_NET_IPV4_LOG_LEVEL=3 # CONFIG_NET_ICMPV4_LOG_LEVEL_OFF is not set # CONFIG_NET_ICMPV4_LOG_LEVEL_ERR is not set # CONFIG_NET_ICMPV4_LOG_LEVEL_WRN is not set # CONFIG_NET_ICMPV4_LOG_LEVEL_INF is not set # CONFIG_NET_ICMPV4_LOG_LEVEL_DBG is not set CONFIG_NET_ICMPV4_LOG_LEVEL_DEFAULT=y CONFIG_NET_ICMPV4_LOG_LEVEL=3 # CONFIG_NET_SHELL is not set CONFIG_NET_TC_TX_COUNT=1 CONFIG_NET_TC_RX_COUNT=1 CONFIG_NET_TC_MAPPING_STRICT=y CONFIG_NET_TX_DEFAULT_PRIORITY=1 CONFIG_NET_RX_DEFAULT_PRIORITY=0 CONFIG_NET_IP_ADDR_CHECK=y CONFIG_NET_MAX_ROUTERS=1 CONFIG_NET_TCP=y CONFIG_NET_TCP_CHECKSUM=y # CONFIG_NET_TCP_LOG_LEVEL_OFF is not set # CONFIG_NET_TCP_LOG_LEVEL_ERR is not set # CONFIG_NET_TCP_LOG_LEVEL_WRN is not set # CONFIG_NET_TCP_LOG_LEVEL_INF is not set # CONFIG_NET_TCP_LOG_LEVEL_DBG is not set CONFIG_NET_TCP_LOG_LEVEL_DEFAULT=y CONFIG_NET_TCP_LOG_LEVEL=3 CONFIG_NET_TCP_BACKLOG_SIZE=1 # CONFIG_NET_TCP_AUTO_ACCEPT is not set CONFIG_NET_TCP_TIME_WAIT_DELAY=250 CONFIG_NET_TCP_ACK_TIMEOUT=1000 CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT=200 CONFIG_NET_TCP_RETRY_COUNT=9 CONFIG_NET_TCP1=y # CONFIG_NET_TCP2 is not set # CONFIG_NET_TEST_PROTOCOL is not set CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUM=y # CONFIG_NET_UDP_MISSING_CHECKSUM is not set # CONFIG_NET_UDP_LOG_LEVEL_OFF is not set # CONFIG_NET_UDP_LOG_LEVEL_ERR is not set # CONFIG_NET_UDP_LOG_LEVEL_WRN is not set # CONFIG_NET_UDP_LOG_LEVEL_INF is not set # CONFIG_NET_UDP_LOG_LEVEL_DBG is not set CONFIG_NET_UDP_LOG_LEVEL_DEFAULT=y CONFIG_NET_UDP_LOG_LEVEL=3 CONFIG_NET_MAX_CONN=16 CONFIG_NET_MAX_CONTEXTS=16 # CONFIG_NET_CONTEXT_NET_PKT_POOL is not set CONFIG_NET_CONTEXT_SYNC_RECV=y CONFIG_NET_CONTEXT_CHECK=y # CONFIG_NET_CONTEXT_PRIORITY is not set # CONFIG_NET_CONTEXT_TIMESTAMP is not set # CONFIG_NET_CONTEXT_TXTIME is not set # CONFIG_NET_TEST is not set CONFIG_NET_SLIP_TAP=y # CONFIG_NET_TRICKLE is not set CONFIG_NET_PKT_RX_COUNT=64 CONFIG_NET_PKT_TX_COUNT=64 CONFIG_NET_BUF_RX_COUNT=64 CONFIG_NET_BUF_TX_COUNT=256 CONFIG_NET_BUF_FIXED_DATA_SIZE=y # CONFIG_NET_BUF_VARIABLE_DATA_SIZE is not set CONFIG_NET_BUF_DATA_SIZE=1024 CONFIG_NET_DEFAULT_IF_FIRST=y # CONFIG_NET_DEFAULT_IF_ETHERNET is not set # CONFIG_NET_PKT_TIMESTAMP is not set # CONFIG_NET_PKT_TXTIME is not set # CONFIG_NET_PKT_RXTIME_STATS is not set # CONFIG_NET_PKT_TXTIME_STATS is not set # CONFIG_NET_PROMISCUOUS_MODE is not set # # Stack usage # CONFIG_NET_TX_STACK_SIZE=8192 CONFIG_NET_RX_STACK_SIZE=8192 # end of Stack usage CONFIG_NET_MGMT=y CONFIG_NET_MGMT_EVENT=y CONFIG_NET_MGMT_EVENT_STACK_SIZE=768 CONFIG_NET_MGMT_EVENT_THREAD_PRIO=7 CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=2 # CONFIG_NET_MGMT_EVENT_INFO is not set # CONFIG_NET_MGMT_EVENT_LOG_LEVEL_OFF is not set # CONFIG_NET_MGMT_EVENT_LOG_LEVEL_ERR is not set # CONFIG_NET_MGMT_EVENT_LOG_LEVEL_WRN is not set # CONFIG_NET_MGMT_EVENT_LOG_LEVEL_INF is not set # CONFIG_NET_MGMT_EVENT_LOG_LEVEL_DBG is not set CONFIG_NET_MGMT_EVENT_LOG_LEVEL_DEFAULT=y CONFIG_NET_MGMT_EVENT_LOG_LEVEL=3 # CONFIG_NET_DEBUG_MGMT_EVENT_STACK is not set # CONFIG_NET_STATISTICS is not set CONFIG_NET_LOG=y # CONFIG_NET_PKT_LOG_LEVEL_OFF is not set # CONFIG_NET_PKT_LOG_LEVEL_ERR is not set # CONFIG_NET_PKT_LOG_LEVEL_WRN is not set # CONFIG_NET_PKT_LOG_LEVEL_INF is not set # CONFIG_NET_PKT_LOG_LEVEL_DBG is not set CONFIG_NET_PKT_LOG_LEVEL_DEFAULT=y CONFIG_NET_PKT_LOG_LEVEL=3 # CONFIG_NET_DEBUG_NET_PKT_ALLOC is not set CONFIG_NET_DEBUG_NET_PKT_EXTERNALS=0 # CONFIG_NET_DEBUG_NET_PKT_NON_FRAGILE_ACCESS is not set # CONFIG_NET_CORE_LOG_LEVEL_OFF is not set # CONFIG_NET_CORE_LOG_LEVEL_ERR is not set # CONFIG_NET_CORE_LOG_LEVEL_WRN is not set # CONFIG_NET_CORE_LOG_LEVEL_INF is not set # CONFIG_NET_CORE_LOG_LEVEL_DBG is not set CONFIG_NET_CORE_LOG_LEVEL_DEFAULT=y CONFIG_NET_CORE_LOG_LEVEL=3 # CONFIG_NET_IF_LOG_LEVEL_OFF is not set # CONFIG_NET_IF_LOG_LEVEL_ERR is not set # CONFIG_NET_IF_LOG_LEVEL_WRN is not set # CONFIG_NET_IF_LOG_LEVEL_INF is not set # CONFIG_NET_IF_LOG_LEVEL_DBG is not set CONFIG_NET_IF_LOG_LEVEL_DEFAULT=y CONFIG_NET_IF_LOG_LEVEL=3 # CONFIG_NET_TC_LOG_LEVEL_OFF is not set # CONFIG_NET_TC_LOG_LEVEL_ERR is not set # CONFIG_NET_TC_LOG_LEVEL_WRN is not set # CONFIG_NET_TC_LOG_LEVEL_INF is not set # CONFIG_NET_TC_LOG_LEVEL_DBG is not set CONFIG_NET_TC_LOG_LEVEL_DEFAULT=y CONFIG_NET_TC_LOG_LEVEL=3 # CONFIG_NET_UTILS_LOG_LEVEL_OFF is not set # CONFIG_NET_UTILS_LOG_LEVEL_ERR is not set # CONFIG_NET_UTILS_LOG_LEVEL_WRN is not set # CONFIG_NET_UTILS_LOG_LEVEL_INF is not set # CONFIG_NET_UTILS_LOG_LEVEL_DBG is not set CONFIG_NET_UTILS_LOG_LEVEL_DEFAULT=y CONFIG_NET_UTILS_LOG_LEVEL=3 # CONFIG_NET_CONTEXT_LOG_LEVEL_OFF is not set # CONFIG_NET_CONTEXT_LOG_LEVEL_ERR is not set # CONFIG_NET_CONTEXT_LOG_LEVEL_WRN is not set # CONFIG_NET_CONTEXT_LOG_LEVEL_INF is not set # CONFIG_NET_CONTEXT_LOG_LEVEL_DBG is not set CONFIG_NET_CONTEXT_LOG_LEVEL_DEFAULT=y CONFIG_NET_CONTEXT_LOG_LEVEL=3 # CONFIG_NET_CONN_LOG_LEVEL_OFF is not set # CONFIG_NET_CONN_LOG_LEVEL_ERR is not set # CONFIG_NET_CONN_LOG_LEVEL_WRN is not set # CONFIG_NET_CONN_LOG_LEVEL_INF is not set # CONFIG_NET_CONN_LOG_LEVEL_DBG is not set CONFIG_NET_CONN_LOG_LEVEL_DEFAULT=y CONFIG_NET_CONN_LOG_LEVEL=3 # CONFIG_NET_ROUTE_LOG_LEVEL_OFF is not set # CONFIG_NET_ROUTE_LOG_LEVEL_ERR is not set # CONFIG_NET_ROUTE_LOG_LEVEL_WRN is not set # CONFIG_NET_ROUTE_LOG_LEVEL_INF is not set # CONFIG_NET_ROUTE_LOG_LEVEL_DBG is not set CONFIG_NET_ROUTE_LOG_LEVEL_DEFAULT=y CONFIG_NET_ROUTE_LOG_LEVEL=3 # end of IP stack # # Network Protocols # # CONFIG_COAP is not set CONFIG_DNS_RESOLVER=y # CONFIG_MDNS_RESOLVER is not set # CONFIG_LLMNR_RESOLVER is not set CONFIG_DNS_RESOLVER_ADDITIONAL_BUF_CTR=0 CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES=1 CONFIG_DNS_RESOLVER_MAX_SERVERS=1 # CONFIG_DNS_SERVER_IP_ADDRESSES is not set CONFIG_DNS_NUM_CONCUR_QUERIES=1 # CONFIG_DNS_RESOLVER_LOG_LEVEL_OFF is not set # CONFIG_DNS_RESOLVER_LOG_LEVEL_ERR is not set # CONFIG_DNS_RESOLVER_LOG_LEVEL_WRN is not set # CONFIG_DNS_RESOLVER_LOG_LEVEL_INF is not set # CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG is not set CONFIG_DNS_RESOLVER_LOG_LEVEL_DEFAULT=y CONFIG_DNS_RESOLVER_LOG_LEVEL=3 CONFIG_MDNS_RESPONDER=y CONFIG_MDNS_RESPONDER_TTL=600 CONFIG_MDNS_RESPONDER_INIT_PRIO=96 # CONFIG_MDNS_RESPONDER_LOG_LEVEL_OFF is not set # CONFIG_MDNS_RESPONDER_LOG_LEVEL_ERR is not set # CONFIG_MDNS_RESPONDER_LOG_LEVEL_WRN is not set # CONFIG_MDNS_RESPONDER_LOG_LEVEL_INF is not set # CONFIG_MDNS_RESPONDER_LOG_LEVEL_DBG is not set CONFIG_MDNS_RESPONDER_LOG_LEVEL_DEFAULT=y CONFIG_MDNS_RESPONDER_LOG_LEVEL=3 CONFIG_MDNS_RESOLVER_ADDITIONAL_BUF_CTR=0 # CONFIG_LLMNR_RESPONDER is not set # CONFIG_MQTT_LIB is not set # CONFIG_TFTP_LIB is not set # CONFIG_HTTP_PARSER is not set # CONFIG_HTTP_PARSER_URL is not set # CONFIG_HTTP_CLIENT is not set # CONFIG_NET_HTTP_LOG_LEVEL_OFF is not set # CONFIG_NET_HTTP_LOG_LEVEL_ERR is not set # CONFIG_NET_HTTP_LOG_LEVEL_WRN is not set # CONFIG_NET_HTTP_LOG_LEVEL_INF is not set # CONFIG_NET_HTTP_LOG_LEVEL_DBG is not set CONFIG_NET_HTTP_LOG_LEVEL_DEFAULT=y CONFIG_NET_HTTP_LOG_LEVEL=3 # CONFIG_WEBSOCKET_CLIENT is not set # CONFIG_LWM2M is not set # CONFIG_SOCKS is not set # CONFIG_SNTP is not set # end of Network Protocols # # Network Libraries # CONFIG_NET_CONFIG_AUTO_INIT=y CONFIG_NET_CONFIG_INIT_PRIO=95 CONFIG_NET_CONFIG_INIT_TIMEOUT=30 # CONFIG_NET_CONFIG_NEED_IPV4 is not set # CONFIG_NET_CONFIG_LOG_LEVEL_OFF is not set # CONFIG_NET_CONFIG_LOG_LEVEL_ERR is not set # CONFIG_NET_CONFIG_LOG_LEVEL_WRN is not set # CONFIG_NET_CONFIG_LOG_LEVEL_INF is not set # CONFIG_NET_CONFIG_LOG_LEVEL_DBG is not set CONFIG_NET_CONFIG_LOG_LEVEL_DEFAULT=y CONFIG_NET_CONFIG_LOG_LEVEL=3 CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0" CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2" CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_POLL_MAX=3 CONFIG_NET_SOCKETS_CONNECT_TIMEOUT=3000 CONFIG_NET_SOCKETS_DNS_TIMEOUT=2000 CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_NET_SOCKETS_ENABLE_DTLS=y CONFIG_NET_SOCKETS_DTLS_TIMEOUT=30000 CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=6 CONFIG_NET_SOCKETS_TLS_MAX_CREDENTIALS=4 CONFIG_NET_SOCKETS_TLS_MAX_CIPHERSUITES=4 # CONFIG_NET_SOCKETS_OFFLOAD is not set # CONFIG_NET_SOCKETS_PACKET is not set # CONFIG_NET_SOCKETS_CAN is not set # CONFIG_NET_SOCKETPAIR is not set # CONFIG_NET_SOCKETS_NET_MGMT is not set # CONFIG_NET_SOCKETS_LOG_LEVEL_OFF is not set # CONFIG_NET_SOCKETS_LOG_LEVEL_ERR is not set # CONFIG_NET_SOCKETS_LOG_LEVEL_WRN is not set # CONFIG_NET_SOCKETS_LOG_LEVEL_INF is not set # CONFIG_NET_SOCKETS_LOG_LEVEL_DBG is not set CONFIG_NET_SOCKETS_LOG_LEVEL_DEFAULT=y CONFIG_NET_SOCKETS_LOG_LEVEL=3 CONFIG_TLS_CREDENTIALS=y CONFIG_TLS_MAX_CREDENTIALS_NUMBER=4 # end of Network Libraries # # Network additional services # # CONFIG_NET_CONNECTION_MANAGER is not set # end of Network additional services # end of Networking # CONFIG_SHELL is not set # CONFIG_IMG_MANAGER is not set # # Random subsystem # CONFIG_TIMER_RANDOM_GENERATOR=y # end of Random subsystem # # Storage # # CONFIG_STREAM_FLASH is not set # end of Storage # CONFIG_SETTINGS is not set # # Testing # # CONFIG_ZTEST is not set # CONFIG_ZTEST_MOCKING is not set # CONFIG_TEST is not set CONFIG_HAS_COVERAGE_SUPPORT=y # CONFIG_COVERAGE is not set # CONFIG_TEST_USERSPACE is not set # CONFIG_TEST_FLASH_DRIVERS is not set # end of Testing # CONFIG_TRACING is not set # CONFIG_CHARACTER_FRAMEBUFFER is not set # CONFIG_JWT is not set # # Controller Area Network (CAN) bus subsystem # # CONFIG_ISOTP is not set # end of Controller Area Network (CAN) bus subsystem CONFIG_TOOLCHAIN_ZEPHYR_0_11=y # # Build and Link Features # # # Linker Options # # CONFIG_LINKER_ORPHAN_SECTION_PLACE is not set CONFIG_LINKER_ORPHAN_SECTION_WARN=y # CONFIG_LINKER_ORPHAN_SECTION_ERROR is not set CONFIG_TEXT_SECTION_OFFSET=0 # CONFIG_HAVE_CUSTOM_LINKER_SCRIPT is not set CONFIG_KERNEL_ENTRY="__start" CONFIG_LINKER_SORT_BY_ALIGNMENT=y # end of Linker Options # # Compiler Options # # CONFIG_NATIVE_APPLICATION is not set CONFIG_SIZE_OPTIMIZATIONS=y # CONFIG_SPEED_OPTIMIZATIONS is not set # CONFIG_DEBUG_OPTIMIZATIONS is not set # CONFIG_NO_OPTIMIZATIONS is not set CONFIG_COMPILER_OPT="" # end of Compiler Options # CONFIG_ASSERT_ON_ERRORS is not set # CONFIG_NO_RUNTIME_CHECKS is not set CONFIG_RUNTIME_ERROR_CHECKS=y # # Build Options # CONFIG_KERNEL_BIN_NAME="zephyr" CONFIG_OUTPUT_STAT=y CONFIG_OUTPUT_DISASSEMBLY=y # CONFIG_OUTPUT_DISASSEMBLE_ALL is not set CONFIG_OUTPUT_PRINT_MEMORY_USAGE=y # CONFIG_BUILD_OUTPUT_HEX is not set # CONFIG_BUILD_OUTPUT_EXE is not set # CONFIG_BUILD_OUTPUT_S19 is not set # CONFIG_BUILD_NO_GAP_FILL is not set # CONFIG_BUILD_OUTPUT_STRIPPED is not set # CONFIG_APPLICATION_DEFINED_SYSCALL is not set # CONFIG_MAKEFILE_EXPORTS is not set # CONFIG_LEGACY_DEVICETREE_MACROS is not set CONFIG_DEPRECATED_ZEPHYR_INT_TYPES=y # end of Build Options # end of Build and Link Features # # Boot Options # # CONFIG_BOOTLOADER_MCUBOOT is not set # CONFIG_BOOTLOADER_KEXEC is not set # CONFIG_REBOOT is not set # CONFIG_MISRA_SANE is not set # end of Boot Options # # Compatibility # CONFIG_COMPAT_INCLUDES=y # end of Compatibility ```

bel2125 commented 4 years ago

I do not know Zephyr (although I know some other embedded operating systems), but I might be able to provide some details on civetweb (I came here from https://github.com/civetweb/civetweb/issues/895).

Regarding stack size:

Indeed civetweb assumes the stack size to be some pages larger than the MG_BUF_LEN size. A buffer needs to contain at least the entire HTTP/1.x header. This is

GET /some/path/to/some/file.name?query=string&max=contain&multiple=parameters HTTP/1.1
Host: www.example.com
User-Agent: Some-name-and-version-of-your-browser
Cookie: yet=another; list=of; key=value; pairs=with; unknown=length

Once the header is longer than MG_BUF_LEN, the request cannot be processed anymore - the current definition #define MG_BUF_LEN (1024 * 8) is plenty. Half of this might be sufficient. The URL+query string (/path/to...parameters) are not limited in any standard, but typical recommendations are 2,048 bytes. Microsoft Internet Explorer (if you want to call this a browser) has a limit of 2,083 bytes, Chrome of 2 MB or 32kB (depending on the platform). Cookies seem to have a limit around 4096 bytes for each cookie (test it yourself: http://browsercookielimits.squawky.net/), but you may have several of them. If you know your URLs and query strings you plan to support on your server, and if you know the maximum cookie length, you may go lower in this limit, but keep some space for unexpected additional header fields sent by certain browsers. Or increase the stack size - in particular if you plan to use Lua pages.

Regarding priority:

I cannot recommend any details, since I do not know the priority levels of Zephyr. From the CivetWeb point of view, there is one priority define USE_MASTER_THREAD_PRIORITY that could be used to move the master thread (the one accepting all incomming connections) to some SCHED_RR priority. If it is not set (default), CivetWeb will in itself not set any thread priorities. CivetWeb offers a callback "init_thread" that is called from every thread after creation. You can use this to set the priority of the calling thread to something suitable for you. CivetWeb will not modify the priorities afterwards.

Not knowing Zephyr, I cannot directly tell you where the performance bottleneck might be. From another real time operating system, I know it was important to get the priorities right, together with the priorities of the network interface card interrupt and the priorities of the thread responsible for the TCP/IP stack. It was required to keep these thread priorities one level higher than the civetweb master thread. The worker threads could be the same as the master thread or one level lower. I do not know if this experience allows any conclusion for Zephyr, or if it will be helpful in your case.

I hope this explanation "from the CivetWeb side" is of any use - probably if you add proper know how from the Zephyr side, it might help you solve this issue.

xhpohanka commented 4 years ago

Thank you @bel2125 for sharing useful info about CivetWeb. I'm still sniffing around, trying to set correct prioirities etc. Unfortunatelly I'm struggling with errors like net_pkt: Data buffer (48) allocation failed (prepare_segment:444) or os: Linear address not present in page tables which appears on embedded platform as well as on qemu_x86 simulation. This will probably need someone who is more familiar with Zephyr internals than me.

xhpohanka commented 4 years ago

Ok. At least I have found the reason for failed allocations of packets or buffers. When I set civetweb priority close to TCP/IP stack it means that we are in cooperative range (zephyr priority < 0). In such case when civetweb is serving a bigger page (multiple mg_write()s in a loop) there is no chance for other thread (even with higher priority - like TCP/IP stack) to run without explicit k_yield() or sleep.

My upload is still quite slow, though.

AntoineZen commented 4 years ago

For the slow upload, you might be impacted by #26330. Have a look at the TCP window using Wireshark.

We have been hit by this when implemented also an HTTP upload with civetweb. It seems that this comes from Zephyr's TCP module and not civetweb. @armandciejak in #26330 is my co-worker.

armandciejak commented 4 years ago

@xhpohanka I noticed the same issues as you. For the allocation problem I increased the value for CONFIG_NET_BUF_TX_COUNT, but that's a workaround which doesn't scale.

I do not fully understand the relation between allocation failing and thread priorities. Shouldn't mg_write block when there are no more buffers available until some data has been transferred on the network?

bel2125 commented 4 years ago

Shouldn't mg_write block when there are no more buffers available until some data has been transferred on the network?

From the pure civetweb point of view (no Zephyr specifics): Civetweb uses non-blocking sockets when calling "send". If "send" returns EWOULDBLOCK, it calls "poll" to wait for a fixed time or until the socket is ready to send (if there is no "poll" it will use "select"). Anyway, if send/poll do not return success after some time (configured, default 30 seconds), mg_write will return an error. Ín short: it blocks for a limited time (30 s) and then returns an error.

CivetWeb does not care (cannot know) why "send" is not ready ... peer not responding, no memory in TCP/IP stack, ... but will work as long as it returns "EWOULDBLOCK" (or OK). Any other return value will be treated as error, and the mg_write function returns immediately with an error.

I just found in the CivetWeb source: in most places it checks for "EWOULDBLOCK" and "EAGAIN", in some places only for "EWOULDBLOCK". In all gnuC libraries, they have the same value. According to google, there are some old (historic?) UNIX variants where they had different values. I hope this is not the case for Zephyr, since it might cause some issues.

armandciejak commented 4 years ago

EWOULDBLOCK is the same as EAGAIN in Zephyr.

zephyr/lib/libc/minimal/include/errno.h:110:#define EWOULDBLOCK EAGAIN /* Operation would block */
xhpohanka commented 4 years ago

I do not fully understand the relation between allocation failing and thread priorities. Shouldn't mg_write block when there are no more buffers available until some data has been transferred on the network?

I also am not sure how poll works in zephyr. But in my case when I was runnig out of memory it could be solved by adding k_yield or k_sleep between successive mg_write calls.

carlescufi commented 4 years ago

@PiotrZierhoffer could you please take a look since you are the maintainer of the civetweb module?

xhpohanka commented 4 years ago

same new notes from my side:

KozhinovAlexander commented 4 years ago

@xhpohanka Try to gzip your files served from your civetweb http server and use mg_send_chunk() for bigger files. Still, there may be issues. Let me know, if mg_send_chunk() improves your performance. If you need more information how to use it, see my PR #28323.

P.S.: How much Bytes, KiB or MiB needed your biggest file be on your civetweb http server?

xhpohanka commented 4 years ago

@Nukersson Thanks for suggestion of mg_send_chunk() I will try it. If I understand correctly it could also simplify serving of dynamic pages as you do not need to know Content-Length before the whole page.

Currently I have quite stable implementation of web server on my platform. Only time-to-time one of the pages is not transfered and need to be refreshed. I have merged mbedtls support for civetweb (originaly by qinch) and it also works with exception of loading files (firmware update). I also tried to alter civetweb source to use zephyr's internal tls_socket implementation and it works (no big testing though) the same (normal pages ok, upload fails).

The biggest web page is jquery. So around 85kB/

KozhinovAlexander commented 4 years ago

@xhpohanka Thank you for sharing of your experience here.

Only time-to-time one of the pages is not transfered and need to be refreshed.

Believe me, I've seen same production code with well tested network staks and web/http servers. They do same files dropping and whole page reloading from time to time. I think, we need dig deeper here 😄

The biggest web page is jquery. So around 85kB/

Take a look at #28323 PR and search for gzip in main CMakeLists.txt. You will se, how typical *.js files may be gzipped. You can also gzip small and compressed version jquery-3.5.1.slim.min.js. I did it once and it worked fine for me.

KozhinovAlexander commented 4 years ago

@xhpohanka By the way: does this conversation solves your civetweb problems mentioned here? Can then we close this issue? Otherways, if you have more questions I can try to answer - you're welcome!

KozhinovAlexander commented 4 years ago

@xhpohanka Do you have any new insights?

xhpohanka commented 4 years ago

Hello, I think that we can close this issue. The original problems was solved with TCP2 introduction and now I have just an occassional instabilities that are probably caused by tcp stack in connection with STM32H7 driver. I understand your suggestions with compressing the pages but I think that this should not be neccessary. We had a similar web on the same architecture and freertos and it works without any issues. I will try to check file upload using TLS with civetweb author and eventually open a new issue here. Thanks for support.