Commit graph

24,075 commits

Author SHA1 Message Date
Tomi Fontanilles
d38fb888a8 secure_storage: its: improve return codes
Instead of returning storage-related error codes, return ones which
make it clear that it's not about the storage itself.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Tomi Fontanilles
2cad6fab0b secure_storage: remove NULL pointer checks
It is the caller's responsibility to ensure pointers are valid.
Save on code size.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Iuliana Prodan
a795046143 ipc: move Open AMP from lib/ to subsys/ipc/
Moved the Open AMP code from lib/ to subsys/ipc/ to better
organize IPC-related components.

Updated build and config files to reflect the new location.

Adjusted path in MAINTAINERS.yml.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2025-09-26 13:22:55 +02:00
Heghedus Razvan
5430400579 shell: add option to toggle logs output
When logging through shell is enabled, it is inconvenient to use
the shell when there are logs coming in. Having a mechanism for
easy disabling/re-enabling the shell logs is a nice quality of life
feature.

To toggle the logs, `CTRL+T` combination can be used. This is
available only when meta key feature is enabled.

Signed-off-by: Heghedus Razvan <heghedus.razvan@protonmail.com>
2025-09-26 09:10:50 +02:00
Jukka Rissanen
c155dfa3a3 net: tcp: Print relative seq and ack numbers
It is easier to debug things when both the relative and absolute
TCP seq and ack numbers are printed in debug prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Jukka Rissanen
fe932ddbf0 net: context: Remember socket shutdown status
Use the socket eof flag to determine whether the receive
callback should be installed. If the receive cb is not installed,
then the socket cannot receive any data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Jukka Rissanen
a08d48ed19 logging: backend: net: Discard all received data from TCP or UDP socket
If there is received data in the TCP or UDP socket, discard it in order to
avoid leaking net_bufs because we are only sending data out and should
not receive anything.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Jukka Rissanen
f7c14319a3 logging: backend: net: Do not bind local socket
The logging net backend will send syslog messages to syslog server and
it is not meant to receive anything. If we bind to a local socket, it will
create UDP server socket that can receive data. Unfortunately there is no
one reading the data so we will eventually run out of memory in this case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Mark Wang
e82a9951e8 bluetooth: a2dp: fix spelling error of STEREO
change A2DP_SBC_CH_MODE_STREO as A2DP_SBC_CH_MODE_STEREO

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-09-26 06:40:29 +02:00
Cristian Bulacu
18f1abdc30 net: l2: openthread: Fix nat64 API compile warning
This PR includes OpenThread's NAT64 header file when
NAT64_TRANSLATOR is enabled. This is done to avoid compile
warnings when OT NAT64 API is used.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-09-25 14:18:45 -04:00
Declan Snyder
a4225b1ee8 pm: Add constraint lists and APIs
Some pieces of the system may have custom types of constraints that they
define based on different effects and reasons than just the standard
"zephyr,disabling-states". To avoid every single one of these component
reinventing the wheel, make some common APIs to handle these type of
custom constraint lists.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-25 14:18:05 -04:00
Declan Snyder
ae1f13149f pm: Extend pm notifier to be able to report substate
I am surprised this notifier didn't already report the substate id, it
seems important since different substate obviously are defined for a
reason, they can be having a different effect on the system.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-25 14:18:05 -04:00
Grzegorz Swiderski
620bf58a1e zms: Initial support for 64 bit IDs
Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t`
is added, so that the maximum ID width can be controlled using Kconfig.

The current ATE structure is already large enough that it is possible to
reserve 64 bits for IDs without increasing its total size (128 bits).
This makes the feature a natural, low footprint alternative to Settings,
for cases where the supported key namespace must be larger than 32 bit
but not arbitrarily large.

The ATE format does have to be altered to accommodate larger IDs, but
the default "32 bit" format is left as is. Now, the `struct zms_ate`
describes one of two supported formats, selected by an `#if` condition.
In the future, it may be possible to support multiple ATE formats at
runtime, in which case the structure can be turned into a union.

In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved
into a union, because they are found to be mutually exclusive. With the
old format, the same fields are in different locations, but one of them
always gets filled with a dummy value, depending on the given ATE type.
To cover both cases, a `memset` is used, which should be optimized away
by the compiler when appropriate.

The only limitation is that the new ATE format has no room for data CRC,
but an alternative integrity check can be implemented by the caller.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-09-25 14:17:24 -04:00
Yangbo Lu
dddb4a5a9d net: ethernet: drop duplicated bridge forwarding in TX
Ethernet TX should not handle bridge forwarding. The bridge layer
had already handled forwarding.

Current code is causing duplicated TX if sending is via bridge
interface, or causing needless TX on other bridge ports if sending
is via one bridge port.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-25 12:01:31 +01:00
Yangbo Lu
401cbbb6c5 net: bridge: fix pkt management during forwarding
There were several problems of pkt management during forwarding.

1. No need to do net_pkt_ref/net_pkt_unref around net_if_queue_tx.
2. Finally when completed forwarding, there was a net_pkt_unref for
   pkt using cloning. However it also applied to pkt not using
   cloning. This was causing pkt was released before sending.
3. Whether pkt cloning used or not, should not be decided by bridge
   interfaces count. It's should be decided by interface count to
   forward.
   An example was sending pkt via bridge interface. If there were
   two interfaces attached to bridge, cloning was needed but current
   code won't.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-25 12:01:31 +01:00
Emil Gydesen
a738b2641e Bluetooth: BAP: Add NULL check in bt_bap_stream_detach
If stream->ep is NULL, which is really shouldn't be,
then we should not attempt to dereference it.
Add simple NULL check to ensure behavior, and make
Sonarcloud happy.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-25 11:01:10 +02:00
Mike J. Chen
c6206c220d bluetooth: BAP: fix select bug
Change 4c86a5cc8d moved a select
from Kconfig.asc to Kconfig.bap (amongst some other changes
from select to depends), but inverted the PAC_{SRC,SNK} from
ASCS_ASE_{SRC,SNK} condition.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-09-25 09:21:42 +02:00
Vinayak Kariappa Chettimada
15d3b57e90 Bluetooth: Controller: Fix inter-operability when BT_PHY_UPDATE=n
Fix inter-operability, when BT_PHY_UPDATE=n the feature bits
contained 2M and Coded PHY when Advertising Extensions where
enabled, and Central devices did not progress with any data
packet transfers when PHY_REQ was rejected as unknown PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-09-24 15:51:13 +01:00
Cristian Bulacu
4cec954e2b net: l2: openthread: Add DHCP6_PD, DNS upstream resolver and SRP server
- Initialize platform requirements and start OpenThread DHCP6_PD
  feature.
- Added initialization logic for DNS upstream resolver.
	OTBR message data structure has been updated to store a user data
	structure, if needed.
- Added SRP server initialization call.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-09-24 15:50:18 +01:00
James Roy
889a713ca2 subsystem: fs: Use better wrapper macros
Replace `DT_INST_PROP(inst, mount_point)` with
`FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst)`.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-09-24 15:49:36 +01:00
Michael Zimmermann
7f55e702eb net: mqtt_sn: udp: fix joining v6 multicast group
GCC gave the following warning:

mqtt_sn_transport_udp.c: In function ‘tp_udp_init’:
mqtt_sn_transport_udp.c:117:9: warning: ‘memcpy’ forming offset [12, 105]
is out of the bounds [0, 12] of object ‘mreqn’ with type ‘struct ip_mreqn’
[-Warray-bounds=]
  117 |         memcpy(&mreqn.imr_multiaddr, &udp->bcaddr.data[2], si...
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mqtt_sn_transport_udp.c:48:25: note: ‘mreqn’ declared here
   48 |         struct ip_mreqn mreqn;
      |                         ^~~~~

And it turns out that it's right. The original code looks like it tries to
copy the IP address to imr_multiaddr in a way that works for both v4 and
v6. It ignores, that bcaddr.data may be way larger than even a v6 addr,
because it's a buffer that's big enough to hold many other structs as well.

Not only that, IP_ADD_MEMBERSHIP is for IPv4 only and imr_multiaddr can
only hold an IPv4 address anyway.

This modifies the code to have separate code paths for v4 and v6 and call
the correct APIs. This also gets rid of the memcpy, since it can be a
simple struct assignment now.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-23 17:49:56 -04:00
Michael Zimmermann
557d2aa0e0 net: mqtt_sn: allow using all of CONFIG_MQTT_SN_LIB_MAX_ADDR_SIZE
The check didn't allow the address to be exactly this size.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-23 17:49:56 -04:00
Michael Zimmermann
8ae28567d3 net: mqtt_sn: udp: fix warning: ‘port’ may be used uninitialized
This can't happen, but GCC doesn't see the relation between out and port.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-23 17:49:56 -04:00
Michael Zimmermann
38b890e5e4 net: mqtt_sn: udp: fix typo in log message
It's called Broadcast, not Brodcast.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-23 17:49:56 -04:00
Aksel Skauge Mellbye
cfa2992a64 pm: Mark pm_device_driver_init as boot function
Mark pm_device_driver_init() as a boot function to support using it
for early init on devices with demand paging.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-09-23 17:49:38 -04:00
Bjarki Arge Andreasen
1767f131aa pm: refactor PM_S2RAM_CUSTOM_MARKING option to be promptless
The config PM_S2RAM_CUSTOM_MARKING is not an optional config for a
user to select, it is required by some soc implementations of S2RAM,
in which case it must be selected by the soc.

Refactor the configuration to be HAS_PM_S2RAM_CUSTOM_MARKING, and
make the currently only soc which needs it select it. Then update
samples which previously had to select this option for this soc.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-09-23 12:07:59 -04:00
Bjarki Arge Andreasen
4626f6b776 pm: bind the PM_S2RAM kconfig option to devicetree
Currently it is possible to have an enabled (status="okay")
"suspend-to-ram" "zephyr,power-state" in the devicetree,
CONFIG_PM=y, but CONFIG_PM_S2RAM=n

This means the presence and state of the "suspend-to-ram" power
state in the devicetree does not match the PM_S2RAM option,
despite PM_S2RAM being dependent on the devicetree state.

This commit makes the devicetree the "source of truth" for
whether one or more s2ram power states shall be included and
supported, by enabling PM_S2RAM if any s2ram power state with
status "okay" is present in the devicetree. To disable the
s2ram power state, like with any other state, disable it by
setting its state to "disabled".

The help of the now promptless PM_S2RAM config has been
updated to reflect the new meaning. It previously held
cortex-m specific implementation details, these have been
removed as these details are already present in the file
pointed to as well (arch/arm/core/cortex_m/pm_s2ram.c
line 22)

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-09-23 12:07:59 -04:00
Jiawei Yang
d5969f952d Bluetooth: HFP: Fix +BSIR=0 not being recognized issue
In HFP PTS, cases run fail with the log 'unsupported unsolicited
format: +BSIR=0' and 'FAIL: Expected to receive +BSIR: 0'.

Fixed issue by changing +BSIR=0 to +BSIR: 0.

Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
2025-09-23 09:38:37 +01:00
Robert Lubos
fda82471db net: llmnr_responder: Align with dns_unpack_query() change
dns_unpack_query() no longer prepends the unpacked query with extra dot,
therefore LLMNR responder needs to be aligned with this change when
parsing result and preparing response.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-09-22 17:51:55 -04:00
Robert Lubos
9e5922952a net: mdns_responder: Align with dns_unpack_query() change
dns_unpack_query() no longer prepends the unpacked query with extra dot,
therefore mDNS responder needs to be aligned with this change when
parsing result and preparing response.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-09-22 17:51:55 -04:00
Cla Mattia Galliard
1e4bc2855e net: connection: Unconditionally forward into packet sockets
When handling packets for inputing into packet-sockets, unconditionally
forward them, so that they may be handled by the rest of the network
stack after.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
2025-09-22 17:49:19 -04:00
Alberto Escolar Piedras
b86e52bd6f subsys/fs/fuse: Support using libfuse3
Support using FUSE v3, instead of FUSE v2.

FUSE v3 has been out for a couple of years now, so most distributions
have it.
But note the FUSE library (and its v3 branch) is currently unmaintained,
and older distributions do not ship it.

Some Linux distros have transitioned their packages away from fuse2.
Which results in less atention in these distros to fuse2, and therefore
a higher likelyhood that there would be distribution issues with the
corresponding packages.
There is also some likelihood the fuse2 packages may be eventually
droped by some of these.

So let's support either version, with a kconfig adapting to either API
and their quirks.

Note that both the fuse2 and fuse3 library code have quite a few
sideeffects on the process that uses it.

By now we continue defaulting to fuse2 as it is the most common.
But users can select to use the v3 if they have an issue w v2 or want
to start trying out using v3.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-09-22 13:30:46 -04:00
Alberto Escolar Piedras
24252e2ac4 subsys/fs/fuse: Avoid possible race
Avoid a possible race between the FUSE thread and the Zephyr threads
during init.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-09-22 13:30:46 -04:00
Alberto Escolar Piedras
129e50cd34 subsys/fs/fuse: Misc build fixes
FUSE_INCLUDE_DIRS should be passed to the native_simulator build.
If there is several fuse libraries installed, we need to ensure the
bottom side of the driver is built with the correct include paths.
(These includes are irrelevant for the Zephyr side build)

Support having a list of include paths instead of single one.

Support having a list of libraries to link to instead of a single one.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-09-22 13:30:46 -04:00
Jordan Yates
aa9123606c fs: zms: fix delete non-existent with cache
Fix deleting a key that doesn't exist from writing a new entry to the
filesystem when `CONFIG_ZMS_NO_DOUBLE_WRITE` and
`CONFIG_ZMS_LOOKUP_CACHE` are enabled.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-22 13:28:28 -04:00
Jordan Yates
ff020ec8a0 fs: zms: fix no-cache + no-double-write
Fix a compiler error when `CONFIG_ZMS_NO_DOUBLE_WRITE=y` and
`CONFIG_ZMS_LOOKUP_CACHE=n`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-22 13:28:28 -04:00
Jordan Yates
c3221f0420 bluetooth: host: conn: handle bt_le_create_conn_cancel error
Handle the `bt_le_create_conn_cancel` call in the deferred worker
failing due to insufficient command buffers.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-22 13:28:00 -04:00
Tomasz Chyrowicz
c1baf2f763 mgmt: Allow to block confirming non-acive slots
In Direct XIP with revert, it should be possible to block confirmation
of the non-active slot, so only a bootable binaries are marked as valid.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-09-22 13:27:27 -04:00
Christophe Dufaza
69cab3f6a8 Bluetooth: Host: Fix some MISRA c:M23_112 warnings
Fix some "All if ... else if constructs shall be terminated
with an else clause" (c:M23_112) issues reported by SonarQube.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-09-22 13:25:11 -04:00
Christophe Dufaza
c3f175825e Bluetooth: Host: Fix possible inconsistent access to connection state
An assertion in bt_conn_unref() accesses the connection's state
after decrementing its reference count.
This is not consistent since, if we removed the last reference,
the Bluetooth Host stack may reuse the connection object
before the assertion is checked.
Instead, retrieve the connection property tested by the assertion
before decrementing the counter, as we do for other properties.

Simplify the code path by returning early when we did not remove
the last reference.

Remind that automatic advertiser resumption is deprecated.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-09-22 13:25:11 -04:00
Christophe Dufaza
51f57da387 Bluetooth: Host: Fix use of local variable as atomic target
In bt_conn_unref(), a local variable is used as atomic target:

    atomic_val_t old = atomic_dec(&conn->ref);
    /* Prevent from accessing connection object */
    bool deallocated = (atomic_get(&old) == 1);

Using atomic_get() to access a non-shared local variable
cannot prevent any data race on that variable,
and only causes confusion.

Moreover, this call to atomic_get() is incorrect: the API expects
an atomic_t* argument (target), not an atomic_val_t* (value).
This compiles and /works/ only because Zephyr defines both to be
the same integer type, and thus: atomic_get(&old) == old.
The equivalent C11 code, where _Atomic(T) and T are different types,
wouldn't compile.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-09-22 13:25:11 -04:00
Szymon Janc
9354e06422 Bluetooth: SMP: Print extra state information on timeout
This gives some extra information on what could be a reason
for SMP timeout.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-09-22 11:17:59 +02:00
Ludvig Jordet
8720ab7390 Bluetooth: Mesh: Deprecate blob_io_flash erase cap options
The only reason to keep these would be to enable conditional compilation
of some parts of the code. However, we can't see enough benefit in doing
this, particularly since the flash driver itself will conditionally
handle certain paths depending on erase caps, so the options are
deprecated to reduce complexity.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-09-22 11:17:25 +02:00
Ludvig Jordet
db207b04a8 Bluetooth: Mesh: decouple blob_io_flash from internal flash
This fully decouples blob_io_flash from specific flash device details,
by not reading the write block size from a hard-coded device tree node,
instead pulling this from the actual flash device used.

The block write routine has been updated to be more generic and fix a
few bugs:

  * The write buffer is now sized based on a KConfig option instead of
    basing it off the device tree - this makes the module usable with
    any flash device, not just the internal memory. The configured value
    is checked during initialization, to ensure that the configured size
    will fit the write block size required by the device passed to the
    init function.
  * The erase value used to fill the buffer when using a device with
    explicit erase is now pulled from the flash parameters instead of
    being hard-coded to `0xff`.
  * An additional write block sized piece of buffer is allocated - the
    previous buffer sizing with rounding up only worked if
    `BLOB_RX_CHUNK_SIZE % WRITE_BLOCK_SIZE` was 0 or 1 (which
    coincidentally worked in all testing because the chunk size defaults
    to 161, and for internal flash w/write block size of 4,
    `161 % 4 == 1`).
  * The choice of whether to just write the chunk as-is or to
    write-block align it is now based on the erase cap pulled from the
    flash parameters, instead of checking the type of memory in the SOC.
    This means the module dos _not_ currently support the case where
    memory has to be written write-block aligned, but the memory does
    _not_ use explicit erase. It uses a trick of filling the write
    buffer with the erase value to avoid overwriting existing chunks,
    which will not work in this case. This trick is required to support
    random ordered chunks while still writing write-block aligned.
  * The code has been cleaned up a bit in general.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-09-22 11:17:25 +02:00
Ludvig Jordet
99190cb08f Bluetooth: Mesh: make blob_io_flash support smaller blocks
Only erase a page when starting the first block on that page.
This fixes a bug where, if the block size is smaller than the page size,
the entire page would be erased upon start of each block when writing,
meaning only the final block on each page would be retained. This works
because blocks are always received in order.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-09-22 11:17:25 +02:00
Ludvig Jordet
294a2cd9db Bluetooth: Mesh: Decouple blob_io_flash erase from flash config
This adds a Kconfig dependency on FLASH_PAGE_LAYOUT when using flash
with explicit erase, removing all code dependencies on flash
configuration from the erasure logic. This module already requires
FLASH_PAGE_LAYOUT to be set when using it with flash with explicit
erase, as a silent requirement. The current code does not work without
this option enabled except for the case where a BLOB has a size which is
a multiple of the page size (since, without it, trying to erase flash
space for the final block, which is of variable size, will fail). Also
cleans up the code a bit.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-09-22 11:17:25 +02:00
Robert Lubos
178150590c net: tcp: Fix ACK processing when FIN packet is received
In case FIN packed also acknowledged most recently sent data, not all
ack-related TCP context variables were updated, resulting in invalid SEQ
number values sent in consecutive packets.

Fix this by refactoring the FIN handling in TCP_ESTABLISHED state.
Instead of having a separate block strictly for FIN packet processing,
let the packet be processed by common code responsible for regular
data/ack processing. This should be less error-prone for any future
modifications or not-yet-discovered issues. Only after the common
processing of data/ack is done, we check whether FIN flag was present in
the packet, and mark the connection for closing.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-09-22 09:52:13 +02:00
Robert Lubos
eda76ad21b net: tcp: Preallocate TX packet for TCP context
TCP context cannot operate w/o a TX packet for buffering transmitted
data. So far this net_pkt was allocated at runtime from the common
packet pool, but this created some not-obvious memory requirement on TCP
and could lead to TX packet starvation in case many TCP connections are
open in parallel. Therefore, allocate this packet structure statically,
as a part of the TCP context instead.

This increases the memory requirement of the TCP context by ~64 bytes,
however if that's a concern for the application, the maximum number of
TX packets can be lowered instead. In return, we get a clear separation
between the number of TCP connections opened, and the amount of packets
that can be transmitted.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-09-22 09:51:10 +02:00
Robert Lubos
b8c7984099 net: pkt: Add helper function to initialize TX packet
Add helper function to initialize externally allocated TX packet. It's
especially important to configure net_buf slab for the packet so that
net buffers are allocated from a correct pool for the packet.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-09-22 09:51:10 +02:00
Robert Lubos
aca511c91f net: tcp: Use net_buf pointer directly for out-of-order recv queue
Using net_pkt for TCP out-of-order recv queue was an overshot, as the
mechanism mostly used net_buf operations directly anyway. It can be
easily replaced with a direct net_buf pointer, so that it's not longer
needed to hog one net_pkt per TCP context anymore.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-09-22 09:51:10 +02:00