Skip to content

Commit

Permalink
SHM transport is enabled by default [9814] (#205)
Browse files Browse the repository at this point in the history
* SHM transport is enabled by default

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* More updates regarding default SHM transport

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* SHM transport descriptor default values

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>

* make text fit in table width

Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
  • Loading branch information
IkerLuengo authored and MiguelCompany committed Nov 11, 2020
1 parent 94dedc1 commit 633100f
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 29 deletions.
2 changes: 1 addition & 1 deletion docs/fastdds/library_overview/includes/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ Transport layer

*Fast DDS* supports the implementation of applications over various transport protocols.
Those are UDPv4, UDPv6, TCPv4, TCPv6 and Shared Memory Transport (SHM).
By default, a DomainParticipant implements a UDPv4 transport protocol.
By default, a DomainParticipant implements a UDPv4 and a SHM transport protocol.
The configuration of all supported transport protocols is detailed in the :ref:`comm-transports-configuration` section.

5 changes: 5 additions & 0 deletions docs/fastdds/transport/includes/aliases.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. |Log::Kind::Info| replace:: :cpp:enumerator:`Log::Kind::Info <eprosima::fastdds::dds::Log::Kind::Info>`

.. |br| raw:: html

<br/>
59 changes: 40 additions & 19 deletions docs/fastdds/transport/shared_memory/shared_memory.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. include:: ../includes/aliases.rst

.. _transport_sharedMemory_sharedMemory:

Shared Memory Transport
Expand Down Expand Up @@ -121,21 +123,38 @@ SharedMemTransportDescriptor
In addition to the data members defined in the :ref:`transport_transportApi_transportDescriptor`,
the TransportDescriptor for Shared Memory defines the following ones:

+------------------------------+----------------+----------------------------------+------------------------------+
| Member | Data type | Accessor / Mutator | Description |
+==============================+================+==================================+==============================+
| ``segment_size_`` | ``uint32_t`` | :func:`segment_size` | The size of the shared |
| | | | memory segment (in octets). |
+------------------------------+----------------+----------------------------------+------------------------------+
| ``port_queue_capacity_`` | ``uint32_t`` | :func:`port_queue_capacity` | The size of the listening |
| | | | port (in messages). |
+------------------------------+----------------+----------------------------------+------------------------------+
| ``healthy_check_timeout_ms_``| ``uint32_t`` | :func:`healthy_check_timeout_ms` | Timeout for the health check |
| | | | of ports (in milliseconds). |
+------------------------------+----------------+----------------------------------+------------------------------+
| ``rtps_dump_file_`` | ``string`` | :func:`rtps_dump_file` | Full path of the protocol |
| | | | dump_file. |
+------------------------------+----------------+----------------------------------+------------------------------+

.. list-table::
:header-rows: 1

* - Member
- Data type
- Default
- Accessor / Mutator
- Description
* - ``segment_size_``
- ``uint32_t``
- ``512*1024``
- :func:`segment_size`
- Size of the shared memory segment |br|
(in octets).
* - ``port_queue_capacity_``
- ``uint32_t``
- ``512``
- :func:`port_queue_capacity`
- The size of the listening port |br|
(in messages).
* - ``healthy_check_timeout_ms_``
- ``uint32_t``
- ``1000``
- :func:`healthy_check_timeout_ms`
- Timeout for the health check of ports |br|
(in milliseconds).
* - ``rtps_dump_file_``
- ``string``
- Empty
- :func:`rtps_dump_file`
- Full path of the protocol dump file.

If ``rtps_dump_file_`` is not empty, all the shared memory traffic on the DomainParticipant
(sent and received) is traced to a file.
Expand All @@ -153,10 +172,12 @@ such as Wireshark.
Enabling Shared Memory Transport
--------------------------------

SHM transport is not enabled by default.
To enable SHM transport in a DomainParticipant, you need to
create an instance of SharedMemTransportDescriptor and add it to the user transport list of the
DomainParticipant.
*Fast DDS* enables a SHM transport by default.
Nevertheless, the application can enable other SHM transports if needed.
To enable a new SHM transport in a :ref:`dds_layer_domainParticipant`, first
create an instance of :ref:`transport_sharedMemory_transportDescriptor`,
and add it to the user transport list of the :ref:`dds_layer_domainParticipant`.

The examples below show this procedure in both C++ code and XML file.

+--------------------------------------------------+
Expand Down
9 changes: 6 additions & 3 deletions docs/fastdds/transport/transport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ can choose the one that best suits their requirements, or create their own.

*eProsima Fast DDS* comes with five transports already implemented:

- **UDPv4**: UDP Datagram communication over IPv4. This is the default transport created on a new
:ref:`dds_layer_domainParticipant` if no specific transport configuration is given
- **UDPv4**: UDP Datagram communication over IPv4.
This transport is created by default on a new :ref:`dds_layer_domainParticipant`
if no specific transport configuration is given
(see :ref:`transport_udp_udp`).

- **UDPv6**: UDP Datagram communication over IPv6
Expand All @@ -30,7 +31,9 @@ can choose the one that best suits their requirements, or create their own.
- **TCPv6**: TCP communication over IPv6
(see :ref:`transport_tcp_tcp`).

- **SHM**: Shared memory communication among entities running on the same host
- **SHM**: Shared memory communication among entities running on the same host.
This transport is created by default on a new :ref:`dds_layer_domainParticipant`
if no specific transport configuration is given
(see :ref:`transport_sharedMemory_sharedMemory`).

Although it is not part of the transport module, :ref:`intraprocess data delivery<intraprocess-delivery>`
Expand Down
10 changes: 4 additions & 6 deletions docs/installation/configuration/cmake_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ dependency on other options.
Setting :class:`EPROSIMA_BUILD` to ``ON`` has the following effects on other options:

- :class:`INTERNAL_DEBUG` is set to ``ON``.
- :class:`SHM_TRANSPORT_DEFAULT` is set to ``ON`` and :class:`EPROSIMA_INSTALLER` is set to ``OFF``.
- :class:`COMPILE_EXAMPLES` is set to ``ON`` if :class:`EPROSIMA_INSTALLER` is ``OFF``.
- :class:`THIRDPARTY` is set to ``ON``.
- :class:`EPROSIMA_GTEST` is set to ``ON`` if GoogleTest (GTest) library was found.
Expand All @@ -68,11 +67,10 @@ dependency on other options.
more information on *Fast DDS* TLS configuration.
- ``OFF``
* - :class:`SHM_TRANSPORT_DEFAULT`
- Adds Shared Memory transport (SHM) to the default transports. It is set to ``ON`` if |br|
:class:`EPROSIMA_BUILD` is ``ON``. Please refer to :ref:`SHM <transport_sharedMemory_sharedMemory>` section
for more information |br|
on *Fast DDS* SHM transport.
- ``OFF``
- Adds Shared Memory transport (SHM) to the default transports.
Please refer to :ref:`SHM <transport_sharedMemory_sharedMemory>` section |br|
for more information on *Fast DDS* SHM transport.
- ``ON``
* - :class:`COMPILE_EXAMPLES`
- Builds the *Fast DDS* examples. It is set to ``ON`` if :class:`EPROSIMA_BUILD` is ``ON`` and |br|
:class:`EPROSIMA_INSTALLER` is ``OFF``. These examples can be found in the
Expand Down

0 comments on commit 633100f

Please sign in to comment.