From 3484b2d468eff654db42d6fb07fbb0e05e8d01ab Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Wed, 2 Aug 2023 13:13:50 +0200 Subject: [PATCH] User configuration for SHM metatraffic (#535) * Refs #19263. Add documentation for shm.enforce_metatraffic Signed-off-by: Miguel Company * Refs #19263. Add examples. Signed-off-by: Miguel Company * Refs #19263. Fixed line length. Signed-off-by: Miguel Company * Refs #19263. Apply suggestion. Signed-off-by: Miguel Company * Refs #19263. Adding 'SHM' to word list. Signed-off-by: Miguel Company * Refs #19263. Apply suggestion 2. Signed-off-by: Miguel Company --------- Signed-off-by: Miguel Company --- code/DDSCodeTester.cpp | 11 ++++ code/XMLTester.xml | 15 ++++++ .../non_consolidated_qos.rst | 54 +++++++++++++++++++ docs/spelling_wordlist.txt | 1 + 4 files changed, 81 insertions(+) diff --git a/code/DDSCodeTester.cpp b/code/DDSCodeTester.cpp index 3f2c472bd..4f35be116 100644 --- a/code/DDSCodeTester.cpp +++ b/code/DDSCodeTester.cpp @@ -787,6 +787,17 @@ void dds_domain_examples() "true"); //!-- } + + { + //DDS-SHM-ENFORCE-META-TRAFFIC + DomainParticipantQos participant_qos; + + // SHM transport will listen for unicast meta-traffic + participant_qos.properties().properties().emplace_back( + "fastdds.shm.enforce_metatraffic", + "unicast"); + //!-- + } } //DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS diff --git a/code/XMLTester.xml b/code/XMLTester.xml index b5d48d21f..1a92710fc 100644 --- a/code/XMLTester.xml +++ b/code/XMLTester.xml @@ -3282,6 +3282,21 @@ <--> +XML-SHM-ENFORCE-META-TRAFFIC<--> + + + + + + fastdds.shm.enforce_metatraffic + unicast + + + + + +<--> + XML_TYPELOOKUP_SERVICE_ENABLING<--> diff --git a/docs/fastdds/property_policies/non_consolidated_qos.rst b/docs/fastdds/property_policies/non_consolidated_qos.rst index 88dbf3662..7b0e14656 100644 --- a/docs/fastdds/property_policies/non_consolidated_qos.rst +++ b/docs/fastdds/property_policies/non_consolidated_qos.rst @@ -297,3 +297,57 @@ Currently there are two different exchange formats which can be selected using t :language: xml :start-after: XML-STATIC-DISCOVERY-FORMAT :end-before: <--> + +.. _property_policies_shm_enforce_metatraffic: + +SHM transport meta-traffic enforcement +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A DomainParticipant will by default configure both a :ref:`transport_udp_udp` and a +:ref:`transport_sharedMemory_sharedMemory`. +When a participant on another process in the same host is discovered, the endpoint discovery +might be done using either transport. + +Avoiding Shared Memory communication for discovery traffic can save valuable resources. +The behavior regarding this can be configured using the property ``fastdds.shm.enforce_metatraffic``. + +.. list-table:: + :header-rows: 1 + :align: left + + * - PropertyPolicyQos value + - Description + - Default + * - ``"none"`` + - Use other transports for meta-traffic. + - ✅ + * - ``"unicast"`` + - Enable SHM transport unicast communications. + - + * - ``"all"`` + - Enable SHM transport unicast and multicast communications. |br| + This will enable discovery between SHM only participants |br| + and participants having several transports. + - + +.. note:: + + When SHM is the only transport configured for a participant, the setting of this property is ignored, + and considered to be ``"all"``. + +.. tabs:: + + .. tab:: C++ + + .. literalinclude:: /../code/DDSCodeTester.cpp + :language: c++ + :start-after: //DDS-SHM-ENFORCE-META-TRAFFIC + :end-before: //!-- + :dedent: 8 + + .. tab:: XML + + .. literalinclude:: /../code/XMLTester.xml + :language: xml + :start-after: XML-SHM-ENFORCE-META-TRAFFIC + :end-before: <--> diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 6b5cffa25..5917f9749 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -211,6 +211,7 @@ seqNum SequenceNumber sequencenumbers shm +SHM simpleEDP sqlite statechart