mesh: Implement lower transport layer for segmentation and reassembly
PATCH v2 1/4 mesh: Implement lower transport layer for segmentation and reassembly
These is implementations of segmentation and reassembly, except for the friend feature for LPN nodes, implemented according to Mesh Protocol 1.1 section 3.5.3.
Sections 4.2.48 and 4.2.49 of Mesh Protocol 1.1 define the transmission interval, number of retransmissions, retransmission interval, ack transmission, number of ack retransmissions, ack retransmission interval, ack retransmission interval, and discard time for SAR, which is a mutable state, and required a SAR implementation that conforms to the specification. The existing segmentation and reassembly were implemented before the specification was officially released, so they were fixed.
- Changed the design of SAR retransmissions.
- Changed the design of SAR ack retransmissions.
- In the previous implementation, the segments of the SAR were sent to the network layer immediately for every segO. This has been changed so that they are sent one after the other when the timer expires for each segment interval state.
- In the previous implementation, the SAR retransmission feature for multicast sent all segments to the network layer a fixed four times. This has been changed to send as many SAR retransmissions for multicast as the number of states.
- In the original implementation, the SAR retransmission feaure for unicast was persistent as long as the receiver was receiving additional segments. This has been changed to send as many SAR retransmissions for unicast as the number of states.
- In the previous implementation, the SAR transfer feature for the same destination worked as a single thread, so if SAR transfers were duplicated, queuing was used to delay the transfer, but if the upper transport layer required successive SAR transfers, the queue would stack up infinitely. This was solved by discarding existing SAR transmissions when SAR transmissions for the same destination are required.
- In the previous implementation, an ack was sent each time a segment was received for a SAR that had already been successfully received. This has been changed to sending an ACK only once within a certain period.
--- mesh/mesh.c | 45 ++++ mesh/mesh.h | 2 + mesh/net.c | 672 +++++++++++++++++++++++++++++++++++----------------- 3 files changed, 498 insertions(+), 221 deletions(-)
mesh/mesh.c +45 -0
@@ -95,6 +95,41 @@ static struct l_queue *pending_queue;static const char *storage_dir; +struct mesh_sar_transmitter { +uint8_t seg_int_step; +uint8_t unicast_rtx_cnt; +uint8_t unicast_rtx_without_prog_cnt; +uint8_t unicast_rtx_int_step; +uint8_t unicast_rtx_int_inc; +uint8_t multicast_rtx_cnt; +uint8_t multicast_rtx_int_step; +}; + +struct mesh_sar_receiver { +uint8_t seg_threshold; +uint8_t ack_delay_inc; +uint8_t ack_rtx_cnt; +uint8_t discard_timeout; +uint8_t receiver_seg_int_step; +}; + +static struct mesh_sar_transmitter mesh_sar_txr = { + .seg_int_step =5 , + .unicast_rtx_cnt =2 , + .unicast_rtx_without_prog_cnt =2 , + .unicast_rtx_int_step =7 , + .unicast_rtx_int_inc =1 , + .multicast_rtx_cnt =2 , + .multicast_rtx_int_step =8 +}; +static struct mesh_sar_receiver mesh_sar_rxr = { + .seg_threshold =3 , + .ack_delay_inc =1 , + .ack_rtx_cnt =0 , + .discard_timeout =1 , + .receiver_seg_int_step =5 +}; +/* Forward static decalrations */ static void def_attach (struct l_timeout *timeout,void *user_data);static void def_leave (struct l_timeout *timeout,void *user_data);
@@ -203,6 +238,16 @@ uint8_t mesh_get_friend_queue_size(void)return mesh.friend_queue_sz; } +void mesh_get_sar_transmitter (void *sar_txr) +{ +memcpy (sar_txr, &mesh_sar_txr,sizeof (struct mesh_sar_transmitter )); +} + +void mesh_get_sar_receiver (void *sar_rxr) +{ +memcpy (sar_rxr, &mesh_sar_rxr,sizeof (struct mesh_sar_receiver )); +} +static void parse_settings (const char *mesh_conf_fname) {struct l_settings *settings;
mesh/mesh.h +2 -0
@@ -43,3 +43,5 @@ bool mesh_relay_supported(void);bool mesh_friendship_supported (void );uint16_t mesh_get_crpl (void );uint8_t mesh_get_friend_queue_size (void ); +void mesh_get_sar_transmitter (void *sar_txr); +void mesh_get_sar_receiver (void *sar_rxr);
mesh/net.c +451 -221
959 lines not on this page · raw message
Signature · 1 line
2.34.1
RE: mesh: Fix segmentation behavior of Lower transport layer
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=898694
---Test result---
Test Summary:
CheckPatch FAIL 2.54 seconds GitLint FAIL 1.68 seconds BuildEll PASS 24.59 seconds BluezMake PASS 1652.70 seconds MakeCheck PASS 12.95 seconds MakeDistcheck PASS 178.11 seconds CheckValgrind PASS 252.05 seconds CheckSmatch PASS 357.87 seconds bluezmakeextell PASS 120.03 seconds IncrementalBuild PASS 6218.53 seconds ScanBuild PASS 1016.20 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,v2,4/4] mesh: Add features of Segmented Control message WARNING:LONG_LINE: line length of 83 exceeds 80 columns #749: FILE: unit/test-mesh-crypto.c:1090:
+ seg_max = SEG_MAX(false, keys->segmented, app_msg_len + 8);
WARNING:LONG_LINE: line length of 83 exceeds 80 columns #758: FILE: unit/test-mesh-crypto.c:1100:
+ seg_max = SEG_MAX(false, keys->segmented, app_msg_len + 4);
/github/workspace/src/src/13834162.patch total: 0 errors, 2 warnings, 602 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13834162.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v2,1/4] mesh: Implement lower transport layer for segmentation and reassembly
WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
1: T1 Title exceeds max length (84>80): "[BlueZ,v2,1/4] mesh: Implement lower transport layer for segmentation and reassembly"
---
Regards,
Linux Bluetooth