Skip to content

Commit

Permalink
Refs #20291: Revision - Use RLContainerConfig
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
  • Loading branch information
cferreiragonz committed Jun 12, 2024
1 parent de09101 commit 40ef047
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 42 deletions.
7 changes: 5 additions & 2 deletions code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1555,8 +1555,11 @@
<send_buffers>
<preallocated_number>127</preallocated_number>
<dynamic>true</dynamic>
<preallocated_network_buffers>16</preallocated_network_buffers>
<allocation_inc_network_buffers>16</allocation_inc_network_buffers>
<network_buffers_config>
<initial>16</initial>
<maximum>0</maximum>
<increment>16</increment>
</network_buffers_config>
</send_buffers>

<!-- content_filter cannot be configured using XML (yet) -->
Expand Down
7 changes: 5 additions & 2 deletions code/XMLTesterExample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,11 @@
<send_buffers>
<preallocated_number>127</preallocated_number>
<dynamic>true</dynamic>
<preallocated_network_buffers>16</preallocated_network_buffers>
<allocation_inc_network_buffers>16</allocation_inc_network_buffers>
<network_buffers_config>
<initial>16</initial>
<maximum>0</maximum>
<increment>16</increment>
</network_buffers_config>
</send_buffers>
</allocation>

Expand Down
3 changes: 1 addition & 2 deletions docs/03-exports/aliases-api.include
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,7 @@
.. |SendBuffersAllocationAttributes-api| replace:: :cpp:struct:`SendBuffersAllocationAttributes<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes>`
.. |SendBuffersAllocationAttributes::preallocated_number-api| replace:: :cpp:member:`preallocated_number<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::preallocated_number>`
.. |SendBuffersAllocationAttributes::dynamic-api| replace:: :cpp:member:`dynamic<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::dynamic>`
.. |SendBuffersAllocationAttributes::preallocated_network_buffers-api| replace:: :cpp:member:`preallocated_network_buffers<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::preallocated_network_buffers>`
.. |SendBuffersAllocationAttributes::allocation_inc_network_buffers-api| replace:: :cpp:member:`allocation_inc_network_buffers<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::allocation_inc_network_buffers>`
.. |SendBuffersAllocationAttributes::network_buffers_config-api| replace:: :cpp:member:`network_buffers_config<eprosima::fastrtps::rtps::SendBuffersAllocationAttributes::network_buffers_config>`

.. |ReaderTimes-api| replace:: :cpp:class:`ReaderTimes<eprosima::fastrtps::rtps::ReaderTimes>`
.. |ReaderTimes::initial_acknack_delay-api| replace:: :cpp:member:`initial_acknack_delay<eprosima::fastrtps::rtps::ReaderTimes::initial_acknack_delay>`
Expand Down
34 changes: 14 additions & 20 deletions docs/fastdds/dds_layer/core/policy/eprosimaExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,15 @@ See |SendBuffersAllocationAttributes-api|.

List of structure members:

+------------------------------------------------------------------------+-------------------------+-------------------+
| Member Name | Type | Default Value |
+========================================================================+=========================+===================+
| |SendBuffersAllocationAttributes::preallocated_number-api| | ``size_t`` | 0 |
+------------------------------------------------------------------------+-------------------------+-------------------+
| |SendBuffersAllocationAttributes::dynamic-api| | ``bool`` | ``false`` |
+------------------------------------------------------------------------+-------------------------+-------------------+
| |SendBuffersAllocationAttributes::preallocated_network_buffers-api| | ``size_t`` | ``0`` |
+------------------------------------------------------------------------+-------------------------+-------------------+
| |SendBuffersAllocationAttributes::allocation_inc_network_buffers-api| | ``size_t`` | ``0`` |
+------------------------------------------------------------------------+-------------------------+-------------------+
+----------------------------------------------------------------+---------------------------------------+----------------+
| Member Name | Type | Default Value |
+================================================================+=======================================+================+
| |SendBuffersAllocationAttributes::preallocated_number-api| | ``size_t`` | 0 |
+----------------------------------------------------------------+---------------------------------------+----------------+
| |SendBuffersAllocationAttributes::dynamic-api| | ``bool`` | ``false`` |
+----------------------------------------------------------------+---------------------------------------+----------------+
| |SendBuffersAllocationAttributes::network_buffers_config-api| | :ref:`resourcelimitedcontainerconfig` | (16, inf, 16) |
+------------------------------------------------------------------------+-------------------------------+----------------+

* |SendBuffersAllocationAttributes::preallocated_number-api|:
This member controls the initial number of send buffers to be allocated.
Expand All @@ -403,17 +401,13 @@ List of structure members:
* |SendBuffersAllocationAttributes::dynamic-api|:
This member controls how the buffer manager behaves when a send buffer is not available.
When true, a new buffer will be created. Otherwise, it will wait for a buffer to be returned.
* |SendBuffersAllocationAttributes::preallocated_network_buffers-api|:
This attribute controls the initial number of network buffers to be allocated for each send buffer.
The default value will preallocate 16 network buffers.
* |SendBuffersAllocationAttributes::allocation_inc_network_buffers-api|:
This attribute controls the initial number of network buffers to be allocated when growing the vector of the send
buffer if it runs out of capacity.
The default value will dynamically allocate 16 network buffers every time is needed.
* |SendBuffersAllocationAttributes::network_buffers_config-api|:
This attribute defines the allocation behavior and limits of the network buffers contained in each send buffer.
The default value will preallocate 16 network buffers and dynamically allocate 16 network buffers every time
that growing the vector is needed.

.. note::
|SendBuffersAllocationAttributes::preallocated_network_buffers-api| and
|SendBuffersAllocationAttributes::allocation_inc_network_buffers-api| will also be used to instantiate a vector of
|SendBuffersAllocationAttributes::network_buffers_config-api| will also be used to instantiate a vector of
|SerializedPayload_t-api| that contains the metadata necessary to avoid payload copies during the creation of the
RTPS message.

Expand Down
25 changes: 9 additions & 16 deletions docs/fastdds/xml_configuration/domainparticipant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -676,24 +676,17 @@ Send buffers
See :ref:`sendbuffersallocationattributes`.
- ``bool``
- false
* - ``<preallocated_network_buffers>``
- Initial number initial number of network buffers |br|
to be allocated for each send buffer. See |br|
:ref:`sendbuffersallocationattributes`.
- ``uint32_t``
- 0
* - ``<allocation_inc_network_buffers>``
- Number of network buffers to be dynamically |br|
allocated when growing the vector of the send buffer |br|
if it runs out of capacity. See |br|
:ref:`sendbuffersallocationattributes`.
- ``uint32_t``
- 0
* - ``<network_buffers_config>``
- Network buffer :ref:`CommonAlloc` to specify the |br|
number of network buffers to be allocated for each |br|
send buffer. See :ref:`ResourceLimitedContainerConfig`.
- :ref:`CommonAlloc`
- (16, inf, 16)

.. note::
The default value ``0`` of ``<preallocated_number>`` will perform an initial guess of the number of buffers
required, based on the number of threads from which a send operation could be started.
So it does not mean there are no buffers, instead it would use the maximum amount of buffers available.
Similarly, the default value ``0`` of ``<preallocated_network_buffers>`` and ``<allocation_inc_network_buffers>``
will use a fixed amount of 16 network buffers per send buffer as the preallocated and the increment number,
respectively.
On the contrary, ``<network_buffers_config>`` will default to an initial number of 16 buffers, with an infinite
maximum and an increment of 16 buffers per send buffer. Setting a value of ``0`` will prevent the creation of
network buffers. In case of doubt, leave it unset.

0 comments on commit 40ef047

Please sign in to comment.