Skip to content

Commit 71c7c6e

Browse files
Gather-send implementation Docs (#724)
* Refs #20352: Update ChainingTransport API Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20291: Use vector instead of list Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20291: Include new Allocation QoS Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20291: Mention payloads_to_send_ Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20291: Revision - Use RLContainerConfig Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20291: Improve format Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20291: Revision - docs Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent 6802780 commit 71c7c6e

6 files changed

Lines changed: 53 additions & 23 deletions

File tree

code/DDSCodeTester.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <fastdds/rtps/transport/TCPv6TransportDescriptor.h>
5050
#include <fastdds/rtps/transport/UDPv4TransportDescriptor.h>
5151
#include <fastdds/rtps/transport/UDPv6TransportDescriptor.h>
52+
#include <fastdds/rtps/transport/NetworkBuffer.hpp>
5253
#include <fastdds/statistics/dds/domain/DomainParticipant.hpp>
5354
#include <fastdds/statistics/dds/publisher/qos/DataWriterQos.hpp>
5455
#include <fastdds/statistics/topic_names.hpp>
@@ -105,8 +106,8 @@ class CustomChainingTransport : public eprosima::fastdds::rtps::ChainingTranspor
105106

106107
bool send(
107108
eprosima::fastrtps::rtps::SenderResource* low_sender_resource,
108-
const eprosima::fastrtps::rtps::octet* send_buffer,
109-
uint32_t send_buffer_size,
109+
const std::vector<eprosima::fastdds::rtps::NetworkBuffer>& buffers,
110+
uint32_t total_bytes,
110111
eprosima::fastrtps::rtps::LocatorsIterator* destination_locators_begin,
111112
eprosima::fastrtps::rtps::LocatorsIterator* destination_locators_end,
112113
const std::chrono::steady_clock::time_point& timeout) override
@@ -116,7 +117,7 @@ class CustomChainingTransport : public eprosima::fastdds::rtps::ChainingTranspor
116117
//
117118

118119
// Call low level transport
119-
return low_sender_resource->send(send_buffer, send_buffer_size, destination_locators_begin,
120+
return low_sender_resource->send(buffers, total_bytes, destination_locators_begin,
120121
destination_locators_end, timeout);
121122
}
122123

code/XMLTester.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,11 @@
15551555
<send_buffers>
15561556
<preallocated_number>127</preallocated_number>
15571557
<dynamic>true</dynamic>
1558+
<network_buffers_config>
1559+
<initial>16</initial>
1560+
<maximum>0</maximum>
1561+
<increment>16</increment>
1562+
</network_buffers_config>
15581563
</send_buffers>
15591564

15601565
<!-- content_filter cannot be configured using XML (yet) -->

code/XMLTesterExample.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,11 @@
449449
<send_buffers>
450450
<preallocated_number>127</preallocated_number>
451451
<dynamic>true</dynamic>
452+
<network_buffers_config>
453+
<initial>16</initial>
454+
<maximum>0</maximum>
455+
<increment>16</increment>
456+
</network_buffers_config>
452457
</send_buffers>
453458
</allocation>
454459

docs/03-exports/aliases-api.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@
527527
.. |SendBuffersAllocationAttributes-api| replace:: :cpp:struct:`SendBuffersAllocationAttributes<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes>`
528528
.. |SendBuffersAllocationAttributes::preallocated_number-api| replace:: :cpp:member:`preallocated_number<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::preallocated_number>`
529529
.. |SendBuffersAllocationAttributes::dynamic-api| replace:: :cpp:member:`dynamic<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::dynamic>`
530+
.. |SendBuffersAllocationAttributes::network_buffers_config-api| replace:: :cpp:member:`network_buffers_config<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::network_buffers_config>`
530531

531532
.. |ReaderTimes-api| replace:: :cpp:class:`ReaderTimes<eprosima::fastrtps::rtps::ReaderTimes>`
532533
.. |ReaderTimes::initial_acknack_delay-api| replace:: :cpp:member:`initial_acknack_delay<eprosima::fastrtps::rtps::ReaderTimes::initial_acknack_delay>`

docs/fastdds/dds_layer/core/policy/eprosimaExtensions.rst

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,22 @@ See |SendBuffersAllocationAttributes-api|.
384384

385385
List of structure members:
386386

387-
+------------------------------------------------------------------------+-------------------------+-------------------+
388-
| Member Name | Type | Default Value |
389-
+========================================================================+=========================+===================+
390-
| |SendBuffersAllocationAttributes::preallocated_number-api| | ``size_t`` | 0 |
391-
+------------------------------------------------------------------------+-------------------------+-------------------+
392-
| |SendBuffersAllocationAttributes::dynamic-api| | ``bool`` | ``false`` |
393-
+------------------------------------------------------------------------+-------------------------+-------------------+
387+
.. list-table::
388+
:header-rows: 1
389+
:align: left
390+
391+
* - Member Name
392+
- Type
393+
- Default Value
394+
* - |SendBuffersAllocationAttributes::preallocated_number-api|
395+
- ``size_t``
396+
- 0
397+
* - |SendBuffersAllocationAttributes::dynamic-api|
398+
- ``bool``
399+
- ``false``
400+
* - |SendBuffersAllocationAttributes::network_buffers_config-api|
401+
- :ref:`resourcelimitedcontainerconfig`
402+
- (16, inf, 16)
394403

395404
* |SendBuffersAllocationAttributes::preallocated_number-api|:
396405
This member controls the initial number of send buffers to be allocated.
@@ -399,6 +408,15 @@ List of structure members:
399408
* |SendBuffersAllocationAttributes::dynamic-api|:
400409
This member controls how the buffer manager behaves when a send buffer is not available.
401410
When true, a new buffer will be created. Otherwise, it will wait for a buffer to be returned.
411+
* |SendBuffersAllocationAttributes::network_buffers_config-api|:
412+
This attribute defines the allocation behavior and limits of the network buffers contained in each send buffer.
413+
The default value will preallocate 16 network buffers and dynamically allocate 16 network buffers every time
414+
that growing the vector is needed.
415+
416+
.. note::
417+
|SendBuffersAllocationAttributes::network_buffers_config-api| will also be used to instantiate a vector of
418+
|SerializedPayload_t-api| that contains the metadata necessary to avoid payload copies during the creation of the
419+
RTPS message.
402420

403421
.. _variablelengthdatalimits:
404422

docs/fastdds/xml_configuration/domainparticipant.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ These elements allow the user to define the DomainParticipant configuration.
172172
-
173173
* - ``<allocation>``
174174
- Configuration regarding allocation behavior. |br|
175-
It expects a |br|
176-
|PartAlloc|.
175+
It expects a |PartAlloc|.
177176
- |PartAlloc|
178177
-
179178
* - ``<userData>``
@@ -570,53 +569,44 @@ configuration.
570569
* - Name
571570
- Description
572571
- Values
573-
- Default
574572
* - ``<remote_locators>``
575573
- Defines the limits for the remote locators' collections. |br|
576574
See :ref:`remotelocatorsallocationattributes`.
577575
- :ref:`remote_locators_allocations`
578-
-
579576
* - ``<total_participants>``
580577
- DomainParticipant :ref:`CommonAlloc` to specify the |br|
581578
total number of DomainParticipants in the domain |br|
582579
(local and remote). See |br|
583580
:ref:`ResourceLimitedContainerConfig`.
584581
- :ref:`CommonAlloc`
585-
-
586582
* - ``<total_readers>``
587583
- DomainParticipant :ref:`CommonAlloc` to specify the |br|
588584
total number of DataReader on each DomainParticipant |br|
589585
(local and remote). See |br|
590586
:ref:`ResourceLimitedContainerConfig`.
591587
- :ref:`CommonAlloc`
592-
-
593588
* - ``<total_writers>``
594589
- DomainParticipant :ref:`CommonAlloc` related to the |br|
595590
total number of DataWriters on each DomainParticipant |br|
596591
(local and remote).
597592
See :ref:`resourcelimitedcontainerconfig`.
598593
- :ref:`CommonAlloc`
599-
-
600594
* - ``<max_partitions>``
601595
- Maximum size of the partitions submessage. |br|
602596
Set to zero for no limit.
603597
- ``uint32_t``
604-
-
605598
* - ``<max_user_data>``
606599
- Maximum size of the user data submessage. |br|
607600
Set to zero for no limit.
608601
- ``uint32_t``
609-
-
610602
* - ``<max_properties>``
611603
- Maximum size of the properties submessage. |br|
612604
Set to zero for no limit.
613605
- ``uint32_t``
614-
-
615606
* - ``<send_buffers>``
616607
- Allocation behaviour for the send buffer |br|
617608
manager.
618609
- :ref:`SendBuffers`
619-
-
620610

621611
**Example**
622612

@@ -672,12 +662,22 @@ Send buffers
672662
- ``uint32_t``
673663
- 0
674664
* - ``<dynamic>``
675-
- Whether the number of send buffers is allowed to grow. |br|
676-
See :ref:`sendbuffersallocationattributes`.
665+
- Whether the number of send buffers is allowed to |br|
666+
grow. See :ref:`sendbuffersallocationattributes`.
677667
- ``bool``
678668
- false
669+
* - ``<network_buffers_config>``
670+
- Network buffer :ref:`CommonAlloc` to specify the |br|
671+
number of network buffers to be allocated for each |br|
672+
send buffer. See :ref:`ResourceLimitedContainerConfig`.
673+
- :ref:`CommonAlloc`
674+
- (16, inf, 16)
679675

680676
.. note::
681677
The default value ``0`` of ``<preallocated_number>`` will perform an initial guess of the number of buffers
682678
required, based on the number of threads from which a send operation could be started.
683679
So it does not mean there are no buffers, instead it would use the maximum amount of buffers available.
680+
On the contrary, ``<network_buffers_config>`` will default to an initial number of 16 buffers, with an infinite
681+
maximum and an increment of 16 buffers per send buffer.
682+
An initial value of ``0`` will imply more dynamic allocations, especially at the beginning of the execution.
683+
In case of doubt, it should be left to the default values.

0 commit comments

Comments
 (0)