-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Zenoh Pico multicast receive fragments memory #171
Comments
In a first glance, the proposed solution would break the current abstraction for platforms and links. Also, we shall also consider that there are other type of addresses coming from non-IP transports that are currently supported in some platforms, thus cannot make it work just for IPv4 and IPv6. Still, you point to an enhancement that can be made, where we alloc once and reuse after. We just need to make sure that the allocated |
@p-avital was this tackled with the lastest protocol refactor? I believe you had to touch this part of the code in the process. |
Hi there, At a glance, there are a few things that could be done:
union {
_z_bytes_t bytes;
struct {
char buf[127];
char len; \*negative len = zbytes variant active*\
} inline;
} Either way, we currently have higher priority tasks on our stack, so we can't commit to any timeline for implementing either of these ideas. Feel free to make a PR with solution 2 if it sounds useful to you, as it has the advantage of not adding any safety invariants that might be hard to review. |
Describe the bug
The way how Zenoh pico multicast now is implemented it allocates and frees the address + port causing to memory to fragment a lot.
zenoh-pico/src/transport/multicast/link/task/read.c
Line 51 in 5b47341
Since the (address + port) is relatively small I would propose to allocate the address on multicast read task stack.
However this a bit more complex since addr can be either IPv4 or IPv6 thus the size might differ.
A proposal from would be to introduce a new Zenoh datatype i.e.
_z_addr_t
That includes both ip address (IPv4 & IPv6) and the port.
Any suggestions or am I missing something here?
To reproduce
Start a multicast UDP Rx session
System info
NuttX
The text was updated successfully, but these errors were encountered: