Skip to content
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

Add fragmentation feature token #326

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

jean-roland
Copy link
Contributor

@jean-roland jean-roland commented Jan 24, 2024

Related to #261, this PR adds a config token to toggle the message fragmentation feature.

  • Adds also an error log if transport buffers / defragmentation buffer allocation fails.

(_z_zbuf_capacity(&zt->_transport._unicast._zbuf) != zbuf_size)) {
ret = _Z_ERR_SYSTEM_OUT_OF_MEMORY;

#if Z_FEATURE_MULTI_THREAD == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -284,8 +301,10 @@
// Clean up the buffers
_z_wbuf_clear(&ztu->_wbuf);
_z_zbuf_clear(&ztu->_zbuf);
#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
_z_zbuf_clear(&zt->_transport._unicast._zbuf);
}

#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -123,6 +123,7 @@
ztu->_transmitted = true; // Mark the session that we have transmitted data
}
} else {
#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -278,6 +278,7 @@
// Mark the session that we have transmitted data
ztm->_transmitted = true;
} else { // The message does not fit in the current batch, let's fragment it
#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -108,15 +108,19 @@
if (_z_sn_precedes(ztu->_sn_res, ztu->_sn_rx_reliable, t_msg->_body._frame._sn) == true) {
ztu->_sn_rx_reliable = t_msg->_body._frame._sn;
} else {
#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -267,12 +275,14 @@
_z_conduit_sn_list_copy(&entry->_sn_rx_sns, &t_msg->_body._join._next_sn);
_z_conduit_sn_list_decrement(entry->_sn_res, &entry->_sn_rx_sns);

#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -146,7 +146,9 @@
true) {
entry->_sn_rx_sns._val._plain._reliable = t_msg->_body._frame._sn;
} else {
#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -175,6 +179,7 @@

case _Z_MID_T_FRAGMENT: {
_Z_INFO("Received Z_FRAGMENT message");
#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@@ -155,7 +157,9 @@
t_msg->_body._frame._sn) == true) {
entry->_sn_rx_sns._val._plain._best_effort = t_msg->_body._frame._sn;
} else {
#if Z_FEATURE_FRAGMENTATION == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
ret = _Z_ERR_SYSTEM_OUT_OF_MEMORY;
_Z_ERROR("Not enough memory to allocate transport tx rx buffers!");

#if Z_FEATURE_MULTI_THREAD == 1

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 2009 with no text in the supplied rule-texts-file Warning

misra violation 2009 with no text in the supplied rule-texts-file
@Mallets Mallets merged commit 702dfeb into eclipse-zenoh:main Jan 25, 2024
48 checks passed
@Mallets Mallets added the enhancement Things could work better label Jan 25, 2024
@jean-roland jean-roland deleted the ft_fragmentation branch February 16, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Things could work better
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants