A hard fault occurs when the `sample_echo_packet` function attempts
to print the average time per successful echo and no packets have
been sent, resulting in a division by zero error. This fix adds a check
to ensure that `packets_sent` is greater than 0 before performing
the division. This prevents the system from halting due to a usage fault.
Signed-off-by: Natalia Pluta <pluta.natalia.m@gmail.com>
As found in PR #75525, we should not modify the polled fd array
in multiple places. Because of this fix, the async version of
the socket service could start to trigger while it is being handled
by the async handler. This basically means that the async version
cannot work as intended so remove its support.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Increase the number of network packets and buffers for better TCP
performance in the sample out-of-the-box.
Decrease the network buffer data size for better buffer management in
the sample (less buffer space wasted for L2 header). The only drawback
of this is reduced TCP TX performance, but less than 2 Mbps in my case.
Finally, enable speed optimizations for another small performance boost.
As the RAM requirements of the sample now increase considerably in the
default configuration, add a note in the readme file about it, and how
to make it fit into smaller boards.
Tested on nucleo_h723zg:
Before (current defaults):
UDP TX RX
76.47 Mbps 93.48 Mbps
TCP TX RX
76.18 Mbps 67.75 Mbps
After (new defaults):
UDP TX RX
76.08 Mbps 93.62 Mbps
TCP TX RX
74.19 Mbps 85.51 Mbps
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
EVENTFD is not anymore compatible with these targets so let's
disable them with this sample to avoid a failure in twister
otherwise.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The DHCP server can distribute DNS addresses, hence enable DNS resolver
in the sample to show this functionality.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Currently used DHCP server in the sample, dhcpd, is no longer maintained
and reached EOL. Therefore, update the sample's readme file with a
sample configuration for its successor, kea.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The txtime can be run manually with qemu_x86 but it is enough
to have native_sim compiled with twister.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When setting boolean options using setsockopt(), the option
type should be int as the size of the option type is checked
and only int is accepted.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Sockets service thread need to be cooperative for best performance.
Enable CACHE_MANAGEMENT as some boards don't do it by default, it has
devastating impact on the performance as well.
Finally, increase FDS count, so that uploads still work when both TCP
and UDP receiver are enabled.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
`checkpatch.pl` requires that dts sources are indented with tabs,
fix all the spaces that slipped in while checkpatch wasn't watching.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Recent POSIX changes caused that 3 file descriptors are now preallocated
for stdin/out/err. This caused file descriptor shortage in all-in TLS
configuration of the sample, hence increase the maximum FD count.
In the server sample this manifested itself as an accept() error. This
triggered a busy loop though in the sample, as in case of accept()
errors it'd just try again w/o any delay. This made this issue hard to
investigate, so to avoid such cases in the future, make the accept()
failure fatal in the echo_server sample.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Echo samples exchange data fragments longer than the default DTLS max
fragment length introduced in commit
f033cd5601. Hence, need to increase this
config value for the sample.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Commit 3046e95d85 introduced eventfd use
in the sample, increasing the pollfd array size, however the config
indicating maximum number of monitored events remained intact, so the
sample didn't really work.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The NRF91_SLM has no additional AT channel for the AT shell to
use. This commit disables the AT shell for boards which use
the NRF91_SLM.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
net_mgmt sockets do not implement internal queue but use
net_mgmt_event_wait() internally to receive events. As a consequence,
in case of events burst, some events may be lost if the receiving
thread has lower priority than the net_mgmt thread.
This was visible in the sample, where only DAD event was reported
properly, as IPv6 Add/Remove events were triggered in pair with
corresponding multicast events (from solicited-node multicast
address).
We can mitigate this by increasing main thread priority to be at the
same priority as net_mgmt thread, so that the receiving thread (main)
has a chance to run in between event reports.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
After enabled POSIX_API in the sample, not all headers were included in
the build due to #ifdefs around header inclusions. This commit fixes
this.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The multicast IPv6 address count was too low to create all
solicited-node multicast address, resulting in an error being
printed on boot:
Cannot join solicit node address ff02::1:ff00:1 for 1 (-12)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fix two issues with the current configuration:
* The log buffer was too small for the sample, causing part of the stats
printout to be dropped
* The sample set CONFIG_NET_CONFIG_NEED_IPV4 but did not actually set
any IPv4 address, nor enable DHCP, causing the NET_CONFIG
initialization failure.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The multicast IPv6 address count was too low to create all
solicited-node multicast address, resulting in an error being
printed on boot:
Cannot join solicit node address ff02::1:ff00:1 for 1 (-12)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Current NET_SOCKETS_POLL_MAX and ZVFS_OPEN_MAX values were too low for
the sample after the DNS refactoring, making the sample unusable in
current state.
Bump those values accordingly to make the sample functional again.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Achieve proper syntax highlighting using "console"
language when command snippets start with a prompt.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
config file snippets should use "cfg" pygment to get proper highlighting
This commit updates all occurences where "kconfig" or other languages
were used.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Include new AT shell alongside the PM device shell to allow
for powering back up the modem after the sample has completed
to test out the at shell.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The sample won't build with PSA crypto enabled on non-secure platform,
causing disturbances in the CI.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A few samples were not limiting the CI execution scope in any reasonable
way, they should at least limit the execution to platforms that support
netif capability.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Align the name of the ETH PTP Config Status values
depending on the stm32HAL serie
to be the HAL_ETH_PTP_NOT_CONFIGURATED/HAL_ETH_PTP_CONFIGURATED
or HAL_ETH_PTP_NOT_CONFIGURED/HAL_ETH_PTP_CONFIGURED
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Support NXP ENET_1G on mimxrt1170_evk/mimxrt1176/cm7 platform.
Added test configuration sample.net.zperf.nxp_enet1g and
documented the usage of the ethernet driver with ENET_1G
peripheral.
Fixes: #66348
Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
The POSIX_MAX_FDS option does not correspond to any standard
POSIX option. It was used to define the size of the file
descriptor table, which is by no means exclusively used by
POSIX (also net, fs, ...).
POSIX_MAX_FDS is being deprecated in order to ensure that
Zephyr's POSIX Kconfig variables correspond to those defined in
the specification, as of IEEE 1003.1-2017. Namely,
POSIX_OPEN_MAX. CONFIG_POSIX_MAX_OPEN_FILES is being deprecated
for the same reason.
To mitigate any possible layering violations, that option is
not user selectable. It tracks the newly added
CONFIG_ZVFS_OPEN_MAX option, which is native to Zephyr.
With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":
* CONFIG_POSIX_DEVICE_IO
Similarly, with this deprecation, we introduce the following
Kconfig options that map directly to standard POSIX Options by
simply removing "CONFIG":
* CONFIG_POSIX_OPEN_MAX
In order to maintain parity with the current feature set, we
introduce the following Kconfig options.
* CONFIG_POSIX_DEVICE_IO_ALIAS_CLOSE
* CONFIG_POSIX_DEVICE_IO_ALIAS_OPEN
* CONFIG_POSIX_DEVICE_IO_ALIAS_READ
* CONFIG_POSIX_DEVICE_IO_ALIAS_WRITE
Gate open(), close(), read(), and write() via the
CONFIG_POSIX_DEVICE_IO Kconfig option and move
implementations into device_io.c, to be conformant with the
spec.
Lastly, stage function names for upcoming ZVFS work, to be
completed as part of the LTSv3 Roadmap (e.g. zvfs_open(), ..).
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The POSIX_CLOCK option does not correspond to any standard
option. It was used to active features of several distinct
POSIX Options and Option Groups, which complicated API and
application configuration as a result.
POSIX_CLOCK is being deprecated in order to ensure that Zephyr's
POSIX Kconfig variables correspond to those defined in the
specification, as of IEEE 1003.1-2017.
Additionally, CONFIG_TIMER is being deprecated because it does
not match the corresponding POSIX Option (_POSIX_TIMERS).
With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":
* CONFIG_POSIX_TIMERS
Similarly, we introduce the following Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":
* CONFIG_POSIX_CLOCK_SELECTION
* CONFIG_POSIX_CPUTIME
* CONFIG_POSIX_DELAYTIMER_MAX
* CONFIG_POSIX_MONOTONIC_CLOCK
* CONFIG_POSIX_TIMEOUTS
* CONFIG_POSIX_TIMER_MAX
In order to maintain parity with the current feature set, we
introduce the following Kconfig options that map directly to
standard POSIX Option Groups by simply removing "CONFIG_":
* CONFIG_POSIX_MULTI_PROCESS - sleep()
Similarly, in order to maintain parity with the current feature
set, we introduce the following additional Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":
* CONFIG_XSI_SINGLE_PROCESS - gettimeofday()
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Due to the recent changes in mbed TLS area, and due to adding new
certificates to the sample, the mbed TLS configuration has to be update
to be able to support them all.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Baltimore certificate expires in 2025 and Azure is in the transition
period for the time being to the new certificates. Add support for all
certificates needed in the sample.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The number of suitable network IPv6/4 configurations in interfaces
affect the number of pollable sockets. So need to increase the value
from the default value of 3.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
according to the latest build log, we need increase the MAX_THREEED
/usr/bin/python3 scripts/build/gen_kobject_list.py \
--kernel twister-out/frdm_k64f/samples/net/mqtt_publisher/\
sample.net.mqtt_publisher.userspace/zephyr/zephyr_pre0.elf \
--gperf-output kobject_prebuilt_hash.gperf --include-subsystem-list \
twister-out/frdm_k64f/samples/net/mqtt_publisher/\
sample.net.mqtt_publisher.userspace/zephyr/misc/generated/struct_tags.json
Too many thread objects (17)
Increase CONFIG_MAX_THREAD_BYTES to 3
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
In an effort to shave off code size, remove out-of-the-box
enabling of crypto features (except SHA-256).
Configurations are adjusted to enable what they need.
Bonuses:
- When enabled, AES now defaults to using a smaller version
(`CONFIG_MBEDTLS_AES_ROM_TABLES` isn't default enabled anymore,
and if enabled, `CONFIG_MBEDTLS_AES_FEWER_TABLES` defaults to y).
- Conditions around Mbed TLS Kconfig options have been improved
to reflect the reality of the dependencies.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The gsm modem driver is deprecated and will be removed. Remove
the build overlay and dependency on the gsm modem from the
tagoio sample.
The new cellular modem driver and subsystem use the native
networking stack and the pm subsystem, so just like ethernet,
enabling the cellular modem is up to the board configuration.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The gsm_modem driver is deprecated, and will be removed. Remove
the gsm modem sample which depends on the deprecated driver.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
In order to be compatible with Linux AF_PACKET socket calls, the
protocol field needs to be in network byte order.
So for example, if user wants to receive all packets, then the
protocol field needs to be set as "htons(ETH_P_ALL)".
See Linux manual page at
https://www.man7.org/linux/man-pages/man7/packet.7.html
for details.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Socket service library uses eventfd, which does not work with
native_posix platform, hence need to exclude it from samples that now
rely on socket services.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
CONFIG_POSIX_API depends on !CONFIG_NATIVE_APPLICATION, which is
incompatible with the native_posix platforms.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>