From 633100f71f410b621a88bec017c0a0735f592d0a Mon Sep 17 00:00:00 2001 From: IkerLuengo <57146230+IkerLuengo@users.noreply.github.com> Date: Thu, 5 Nov 2020 15:10:11 +0100 Subject: [PATCH] SHM transport is enabled by default [9814] (#205) * SHM transport is enabled by default Signed-off-by: Iker Luengo * More updates regarding default SHM transport Signed-off-by: Iker Luengo * SHM transport descriptor default values Signed-off-by: Iker Luengo * make text fit in table width Signed-off-by: Iker Luengo --- .../includes/architecture.rst | 2 +- docs/fastdds/transport/includes/aliases.rst | 5 ++ .../transport/shared_memory/shared_memory.rst | 59 +++++++++++++------ docs/fastdds/transport/transport.rst | 9 ++- .../configuration/cmake_options.rst | 10 ++-- 5 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 docs/fastdds/transport/includes/aliases.rst diff --git a/docs/fastdds/library_overview/includes/architecture.rst b/docs/fastdds/library_overview/includes/architecture.rst index 095b6307a..9aaf386c1 100644 --- a/docs/fastdds/library_overview/includes/architecture.rst +++ b/docs/fastdds/library_overview/includes/architecture.rst @@ -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. diff --git a/docs/fastdds/transport/includes/aliases.rst b/docs/fastdds/transport/includes/aliases.rst new file mode 100644 index 000000000..80a3cb06b --- /dev/null +++ b/docs/fastdds/transport/includes/aliases.rst @@ -0,0 +1,5 @@ +.. |Log::Kind::Info| replace:: :cpp:enumerator:`Log::Kind::Info ` + +.. |br| raw:: html + +
diff --git a/docs/fastdds/transport/shared_memory/shared_memory.rst b/docs/fastdds/transport/shared_memory/shared_memory.rst index 26674e190..a1f5e91a2 100644 --- a/docs/fastdds/transport/shared_memory/shared_memory.rst +++ b/docs/fastdds/transport/shared_memory/shared_memory.rst @@ -1,3 +1,5 @@ +.. include:: ../includes/aliases.rst + .. _transport_sharedMemory_sharedMemory: Shared Memory Transport @@ -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. @@ -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. +--------------------------------------------------+ diff --git a/docs/fastdds/transport/transport.rst b/docs/fastdds/transport/transport.rst index 44d70321d..c11313480 100644 --- a/docs/fastdds/transport/transport.rst +++ b/docs/fastdds/transport/transport.rst @@ -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 @@ -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` diff --git a/docs/installation/configuration/cmake_options.rst b/docs/installation/configuration/cmake_options.rst index 3c3c3452a..28c260936 100644 --- a/docs/installation/configuration/cmake_options.rst +++ b/docs/installation/configuration/cmake_options.rst @@ -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. @@ -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 ` 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 ` 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