From 84b5427864ca550bfc39b52f65a64d530fd7ce0b Mon Sep 17 00:00:00 2001 From: Mario-DL Date: Fri, 25 Oct 2024 09:16:02 +0200 Subject: [PATCH 1/3] Refs #21959: Check for SHM_DISABLE in large_data setup modes Signed-off-by: Mario-DL --- src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp index d60e1281b87..ec84b51fcf7 100644 --- a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp +++ b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp @@ -224,8 +224,7 @@ static void setup_transports_large_data( { if (!intraprocess_only) { - auto shm_transport = create_shm_transport(att, options); - att.userTransports.push_back(shm_transport); + setup_transports_shm(att, options); auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST); att.defaultUnicastLocatorList.push_back(shm_loc); @@ -261,8 +260,7 @@ static void setup_transports_large_datav6( { if (!intraprocess_only) { - auto shm_transport = create_shm_transport(att, options); - att.userTransports.push_back(shm_transport); + setup_transports_shm(att, options); auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST); att.defaultUnicastLocatorList.push_back(shm_loc); From f56e3788830e7d3f3176e899a645d1bff646df9f Mon Sep 17 00:00:00 2001 From: Mario Dominguez Date: Thu, 31 Oct 2024 07:51:26 +0100 Subject: [PATCH 2/3] Refs #21959: Apply Miguels rev Signed-off-by: Mario Dominguez --- .../attributes/RTPSParticipantAttributes.cpp | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp index ec84b51fcf7..cd0dac2de59 100644 --- a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp +++ b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp @@ -217,6 +217,23 @@ static void setup_transports_udpv6( att.userTransports.push_back(descriptor); } +static void setup_large_data_shm_transport( + RTPSParticipantAttributes& att, + const fastdds::rtps::BuiltinTransportsOptions& options) +{ +#ifdef FASTDDS_SHM_TRANSPORT_DISABLED + static_cast(att); + EPROSIMA_LOG_ERROR(RTPS_PARTICIPANT, "Trying to configure Large Data transport, " << + "but Fast DDS was built without SHM transport support."); +#else + auto descriptor = create_shm_transport(att, options); + att.userTransports.push_back(descriptor); + + auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST); + att.defaultUnicastLocatorList.push_back(shm_loc); +#endif // FASTDDS_SHM_TRANSPORT_DISABLED +} + static void setup_transports_large_data( RTPSParticipantAttributes& att, bool intraprocess_only, @@ -224,10 +241,7 @@ static void setup_transports_large_data( { if (!intraprocess_only) { - setup_transports_shm(att, options); - - auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST); - att.defaultUnicastLocatorList.push_back(shm_loc); + setup_large_data_shm_transport(att, options); auto tcp_transport = create_tcpv4_transport(att, options); att.userTransports.push_back(tcp_transport); @@ -260,10 +274,7 @@ static void setup_transports_large_datav6( { if (!intraprocess_only) { - setup_transports_shm(att, options); - - auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST); - att.defaultUnicastLocatorList.push_back(shm_loc); + setup_large_data_shm_transport(att, options); auto tcp_transport = create_tcpv6_transport(att, options); att.userTransports.push_back(tcp_transport); From e45ed59477c9ebbd370fa10ca074b9bc1883f9f1 Mon Sep 17 00:00:00 2001 From: Mario Dominguez Date: Thu, 31 Oct 2024 14:49:37 +0100 Subject: [PATCH 3/3] Refs #21959: Apply suggestion Signed-off-by: Mario Dominguez --- src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp index cd0dac2de59..74140cf2896 100644 --- a/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp +++ b/src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp @@ -224,7 +224,8 @@ static void setup_large_data_shm_transport( #ifdef FASTDDS_SHM_TRANSPORT_DISABLED static_cast(att); EPROSIMA_LOG_ERROR(RTPS_PARTICIPANT, "Trying to configure Large Data transport, " << - "but Fast DDS was built without SHM transport support."); + "but Fast DDS was built without SHM transport support. Will use " << + "TCP for communications on the same host."); #else auto descriptor = create_shm_transport(att, options); att.userTransports.push_back(descriptor);