Skip to content

Commit

Permalink
User configuration for SHM metatraffic (#535)
Browse files Browse the repository at this point in the history
* Refs #19263. Add documentation for shm.enforce_metatraffic

Signed-off-by: Miguel Company <[email protected]>

* Refs #19263. Add examples.

Signed-off-by: Miguel Company <[email protected]>

* Refs #19263. Fixed line length.

Signed-off-by: Miguel Company <[email protected]>

* Refs #19263. Apply suggestion.

Signed-off-by: Miguel Company <[email protected]>

* Refs #19263. Adding 'SHM' to word list.

Signed-off-by: Miguel Company <[email protected]>

* Refs #19263. Apply suggestion 2.

Signed-off-by: Miguel Company <[email protected]>

---------

Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany authored Aug 2, 2023
1 parent e52264a commit 3484b2d
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3282,6 +3282,21 @@
</participant>
<!--><-->

<!-->XML-SHM-ENFORCE-META-TRAFFIC<-->
<participant profile_name="participant_xml_conf_shm_enforce_metatraffic_profile">
<rtps>
<propertiesPolicy>
<properties>
<property>
<name>fastdds.shm.enforce_metatraffic</name>
<value>unicast</value>
</property>
</properties>
</propertiesPolicy>
</rtps>
</participant>
<!--><-->

<!-->XML_TYPELOOKUP_SERVICE_ENABLING<-->
<participant profile_name="participant_typelookup_service_enabled">
<rtps>
Expand Down
54 changes: 54 additions & 0 deletions docs/fastdds/property_policies/non_consolidated_qos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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: <!--><-->
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ seqNum
SequenceNumber
sequencenumbers
shm
SHM
simpleEDP
sqlite
statechart
Expand Down

0 comments on commit 3484b2d

Please sign in to comment.