Add identifier builders and route the ZTEST_BENCHMARK*() macros through
them. Suite, benchmark and wrapper-function symbols are now prefixed and
qualified by suite name, preventing collisions between identically-named
benchmarks in different suites and keeping user identifiers out of the
global symbol space.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
before perf use timer to call sample in one core.
and donot support smp.
after ipi support new feature k_ipi_work.so we
can use timer to send ipicalls to other cpus,then
active sample in other cores.
Signed-off-by: Liu Qian <liuqian.andy@picoheart.com>
Since the Broadcast Assistant implementation may have a
pending request _per_ instance, each instance needs its own
buffer to accomodate that, otherwise we may risk overwriting
data between instances. This follows the design used in the
BAP Unicast Client
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
`subsys/net/l2/ppp/misc.c` uses NET_DBG() inside
`validate_phase_transition()`, which is compiled only when
CONFIG_NET_L2_PPP_LOG_LEVEL is at LOG_LEVEL_DBG. The macro is
declared in <zephyr/net/net_log.h>, which the file does not include.
At log level INF (default) the function body is a no-op stub
(ARG_UNUSED), so the missing macro goes unnoticed. At log level DBG
the file fails to build:
misc.c: implicit declaration of function 'NET_DBG'
[-Wimplicit-function-declaration]
Other files in the same directory (e.g. `link.c`) include
<zephyr/net/net_log.h> correctly; only `misc.c` is missing it.
Signed-off-by: Petr Hlineny <development@hlineny.cz>
Rename the PTP UDP IPv4/IPv6 protocol Kconfig symbols to use
consistent all-uppercase IP version naming.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
Replace the broken `_kernel.cpus[cpu].current` reference (which used
an undefined `cpu` variable) and the open-coded `arch_curr_cpu()->id`
pattern with the standard `CPU_ID` macro from `<zephyr/kernel_structs.h>`.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
When no runnable threads contribute to the pressure accumulator,
max_pressure stays at zero and the subsequent division would trigger
undefined behavior. Return a normalized pressure of 0 in that case.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
As the aliases support will increase stack usage, turn the
feature off by default in order to avoid surprises with
tests and samples.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
the name inside of struct net_if_config, that is
part of struct net_if does not need to be zeroed,
as that is already the initial value.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Allow user to specify a file containing command name aliases.
The format of the file is:
# This is an example aliases file. The file can have
# comments on it.
stacks="kernel thread stacks"
foo=bar
There is "aliases" shell command that can show the current
list of aliases specified in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
CONFIG_NET_SOCKETS_POLL_MAX was deprecated in v4.0 and removed in
v4.5 in favour of CONFIG_ZVFS_POLL_MAX. Update the SSH server
BUILD_ASSERT and the sample/test prj.conf files accordingly so the
symbol resolves and the assertion remains effective.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When the client connection to external peer is terminated,
close the client automatically so that user does not need
to do it manually by "net ssh stop"
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow user to kill an active ssh connection. This is useful as
otherwise it is impossible to stop incoming connection without
affecting other incoming connections. It is always possible to
stop the ssh server but then that kills all incoming client
connections and that might not be desired.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add a list command that can show information about active
client and server ssh connections.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If both CONFIG_NET_IPV6 and CONFIG_NET_IPV4 are disabled, then
the addr_len in resolve.c dns_resolve_init_locked() will be
unused which will cause a warning.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow multiple incoming SSH connections if we are the server.
This is controlled by CONFIG_SSH_SERVER_SHELL_COUNT option, the
default value is 1 so only one simultaneous ssh connections by
default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The local channel ID was immediately memset to zero after being set.
This caused issues when allocating multiple channels
Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
If user application calls the new API, then SSH server is
automatically started when the device boots.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for SSH client and server connections.
Original code is from https://github.com/grantramsay/zephyr-ssh
Following modifications are done by this commit compared to original
one:
- Coding style issues, like converting // comments to /* */ ones
- Converting to use PSA APIs
- Add IPv6 support
Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The wr_chunk function had a fast path for devices without explicit erase
(e.g. nRF54L RRAM) that wrote chunk data directly without aligning the
offset or size to the flash write block size. On RRAM with
write-block-size=16, this caused -EINVAL from the flash driver for every
chunk write since chunk_size (161) and most chunk offsets are not
16-byte aligned.
The failed writes caused the BLOB server to never mark chunks as
received, resulting in block_status_rsp always reporting all chunks
missing. This led to infinite retransmission of block 0 and eventual
DFU timeout.
Fix by using a read-modify-write approach for non-erase devices:
read existing data at the aligned boundaries, overlay the chunk data,
and write back the full aligned buffer. This satisfies the driver's
alignment requirements while preserving neighboring bytes.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Once `rx_full` has been set, the modem is instructed to no longer send
data on that DLCI channel until we notify the modem that the channel is
able to receive more data. This happens in the RX callback which drains
the pipe.
Currently the amount of free space required in the ring buffer to
release the flow control condition is hardcoded to
`CONFIG_MODEM_CMUX_MTU`. While this value is fine for the DLCI1 and
DLCI2 channels (which have buffers created as
`CONFIG_MODEM_CMUX_MTU + N` bytes large), the user pipes with size
`MODEM_CELLULAR_USER_PIPE_BUFFER_SIZES` are typically much smaller. This
lead to the flow control condition never being released on the user
pipe DLCI channels once it was set.
Fix the issue by limiting the threshold to the capacity of the ring
buffer, so that if the buffer is completely empty we will always release
the flow control condition.
Signed-off-by: Jordan Yates <jordan@embeint.com>
When calling other functions, pass "struct net_sockaddr" instead of
"struct net_sockaddr_storage" as the former is usually passed around
between functions. This is a style issue and there is no functionality
changes by this commit.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Some of the statistical collector functions were checking null
pointers without a reason. The pointers cannot be null at this point
and the callers already have those checked.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
mq_unlink() was setting errno to EBADF when the named message queue
did not exist. POSIX IEEE 1003.1-2017 specifies ENOENT for this case,
as EBADF is reserved for invalid file descriptors.
Fixes#106002
Signed-off-by: Jose Sanchez <jsanchezrs828@gmail.com>
When function prefix is used then formatting is expected to be
<source_name>.<func_name> but it was as if function prefix was
not used <source_name>: <func_name>.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
bt_iso_recv pulls the SDU header (with or without) timestamp,
but did not check the length of `buf` before doing so.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Only same-CPU recursive logging should bypass the clean-output
process lock. The previous owner-tracking logic also skipped the
lock when another CPU already owned clean-output processing,
allowing concurrent backend processing on SMP.
Fix that by requiring the process lock whenever the owner differs
from the current CPU, by assigning the owner only after the
spinlock is acquired, and by keeping the lock-decision helper
local to log_core.c.
Tested with:
- west build -b native_sim/native/64 tests/subsys/logging/log_immediate \
-d build-log-immediate-green --pristine -- \
-DCONFIG_LOG_IMMEDIATE_CLEAN_OUTPUT=y \
-DZEPHYR_TOOLCHAIN_VARIANT=host
- ./build-log-immediate-green/zephyr/zephyr.exe
- west build -b native_sim/native/64 tests/subsys/logging/log_immediate \
-d build-log-immediate-default --pristine -- \
-DZEPHYR_TOOLCHAIN_VARIANT=host
- ./build-log-immediate-default/zephyr/zephyr.exe
Signed-off-by: Luming Ou <olm_cse@hust.edu.cn>
The CONFIG_NET_SOCKETS_POLL_MAX Kconfig option was deprecated in
Zephyr 4.0.0, remove it and any leftover in-tree option use.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO Kconfig option was deprecated in
Zephyr 4.1.0, remove it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fix number of writes to trigger a GC for native_sim/native/64 board
as it has a different sector size.
Fix the returned value for zms_free_space when ate_wra < data_wra.
Skip test_zms_gc_3sectors for targets that have a sector size different
than 1KB.
Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no>
Downlink MAC commands are not parsed yet.
Reject frames that carry FOpts before advancing FCntDown so the stack
does not silently consume network commands it cannot handle.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
LoRaWAN NbTrans is encoded in the 1..15 range.
Reject zero and out-of-range values so confirmed sends cannot block for
an unexpectedly large number of attempts.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Several public APIs update or consume shared MAC state while the engine
thread is processing join and send requests.
Use a single API mutex for join, send, and mutable setters so only one
public operation can touch the native LoRaWAN state at a time. Also
reject region changes after the stack has started.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Do not trust FCtrl.FOptsLen until it has been checked against the actual
frame length.
Reject frames whose FOpts area would overlap the MIC or extend past the
received buffer before verifying the MIC or updating FCntDown.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Confirmed uplink retries must retransmit the same LoRaWAN frame.
Rebuilding each attempt advanced FCntUp and changed the MIC, allowing a
missed ACK to turn a retry into a second application uplink.
Build the frame once, reuse it for confirmed retry attempts, and consume
FCntUp once after transmission.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Channel masks apply to the region channel plan initialized by
lorawan_start(). Accepting a mask before start leaves the backend without
a concrete channel table to update.
Document the ordering requirement in the public API and have the native
backend return -EPERM until the stack has been started.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Swap condition order in two for-loops in llext_experimental.c so the
bounds check (j < ARRAY_SIZE) is evaluated before the array access.
The previous order caused an off-by-one OOB read when all 8 dependency
slots were populated.
Aligns with the correct pattern already used in llext_link.c.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>