diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index a8c0662ac6..ad51e3aeb0 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -147,6 +147,7 @@ - Add //:iceoryx Bazel alias [#2368](https://github.com/eclipse-iceoryx/iceoryx/issues/2368) - Depend on @ncurses when building with Bazel [#2372](https://github.com/eclipse-iceoryx/iceoryx/issues/2372) - Fix windows performance issue [#2377](https://github.com/eclipse-iceoryx/iceoryx/issues/2377) +- Max Client and Server cannot be configured independently of Max Publisher and Subscriber [#2394](https://github.com/eclipse-iceoryx/iceoryx/issues/2394) **Refactoring:** diff --git a/iceoryx_examples/small_memory/options.cmake b/iceoryx_examples/small_memory/options.cmake index ce98c9e17c..b167ec2f73 100644 --- a/iceoryx_examples/small_memory/options.cmake +++ b/iceoryx_examples/small_memory/options.cmake @@ -30,6 +30,8 @@ set(IOX_MAX_NUMBER_OF_CONDITION_VARIABLES 8 CACHE STRING "") set(IOX_MAX_NODE_NAME_LENGTH 30 CACHE STRING "") set(IOX_MAX_ID_STRING_LENGTH 30 CACHE STRING "") set(IOX_MAX_RUNTIME_NAME_LENGTH 30 CACHE STRING "") +set(IOX_MAX_CLIENTS 4 CACHE STRING "") +set(IOX_MAX_SERVERS 2 CACHE STRING "") set(IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY 2 CACHE STRING "") set(IOX_MAX_RESPONSE_QUEUE_CAPACITY 2 CACHE STRING "") set(IOX_MAX_REQUEST_QUEUE_CAPACITY 2 CACHE STRING "") diff --git a/iceoryx_posh/BUILD.bazel b/iceoryx_posh/BUILD.bazel index ec1e742431..93e144d8c6 100644 --- a/iceoryx_posh/BUILD.bazel +++ b/iceoryx_posh/BUILD.bazel @@ -35,6 +35,7 @@ configure_file( "IOX_INTERPROCESS_SEMAPHORE": "UnnamedSemaphore", "IOX_MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY": "8", "IOX_MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY": "256", + "IOX_MAX_CLIENTS": "512", "IOX_MAX_CLIENTS_PER_SERVER": "256", "IOX_MAX_ID_STRING_LENGTH": "100", "IOX_MAX_INTERFACE_NUMBER": "4", @@ -52,6 +53,7 @@ configure_file( "IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY": "16", "IOX_MAX_RESPONSE_QUEUE_CAPACITY": "16", "IOX_MAX_RUNTIME_NAME_LENGTH": "85", + "IOX_MAX_SERVERS": "128", "IOX_MAX_SHM_SEGMENTS": "100", "IOX_MAX_SUBSCRIBERS": "1024", "IOX_MAX_SUBSCRIBERS_PER_PUBLISHER": "256", @@ -64,6 +66,7 @@ configure_file( "IOX_INTERPROCESS_SEMAPHORE": "UnnamedSemaphore", "IOX_MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY": "8", "IOX_MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY": "256", + "IOX_MAX_CLIENTS": "512", "IOX_MAX_CLIENTS_PER_SERVER": "256", "IOX_MAX_ID_STRING_LENGTH": "100", "IOX_MAX_INTERFACE_NUMBER": "4", @@ -81,6 +84,7 @@ configure_file( "IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY": "16", "IOX_MAX_RESPONSE_QUEUE_CAPACITY": "16", "IOX_MAX_RUNTIME_NAME_LENGTH": "87", + "IOX_MAX_SERVERS": "128", "IOX_MAX_SHM_SEGMENTS": "100", "IOX_MAX_SUBSCRIBERS": "1024", "IOX_MAX_SUBSCRIBERS_PER_PUBLISHER": "256", diff --git a/iceoryx_posh/cmake/IceoryxPoshDeployment.cmake b/iceoryx_posh/cmake/IceoryxPoshDeployment.cmake index f7dffc9e62..e77dbe3007 100644 --- a/iceoryx_posh/cmake/IceoryxPoshDeployment.cmake +++ b/iceoryx_posh/cmake/IceoryxPoshDeployment.cmake @@ -107,6 +107,14 @@ configure_option( NAME IOX_MAX_RUNTIME_NAME_LENGTH DEFAULT_VALUE ${IOX_MAX_RUNTIME_NAME_LENGTH_DEFAULT} ) +configure_option( + NAME IOX_MAX_SERVERS + DEFAULT_VALUE 128 +) +configure_option( + NAME IOX_MAX_CLIENTS + DEFAULT_VALUE 512 +) configure_option( NAME IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY DEFAULT_VALUE 16 diff --git a/iceoryx_posh/cmake/iceoryx_posh_deployment.hpp.in b/iceoryx_posh/cmake/iceoryx_posh_deployment.hpp.in index ee0bd31e2d..96b75e4dd9 100644 --- a/iceoryx_posh/cmake/iceoryx_posh_deployment.hpp.in +++ b/iceoryx_posh/cmake/iceoryx_posh_deployment.hpp.in @@ -73,6 +73,8 @@ constexpr uint32_t IOX_MAX_NUMBER_OF_CONDITION_VARIABLES = constexpr uint32_t IOX_MAX_NODE_NAME_LENGTH = static_cast(@IOX_MAX_NODE_NAME_LENGTH@); constexpr uint32_t IOX_MAX_ID_STRING_LENGTH = static_cast(@IOX_MAX_ID_STRING_LENGTH@); constexpr uint32_t IOX_MAX_RUNTIME_NAME_LENGTH = static_cast(@IOX_MAX_RUNTIME_NAME_LENGTH@); +constexpr uint32_t IOX_MAX_CLIENTS = static_cast(@IOX_MAX_CLIENTS@); +constexpr uint32_t IOX_MAX_SERVERS = static_cast(@IOX_MAX_SERVERS@); constexpr uint32_t IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY = static_cast(@IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY@); constexpr uint32_t IOX_MAX_RESPONSE_QUEUE_CAPACITY = static_cast(@IOX_MAX_RESPONSE_QUEUE_CAPACITY@); diff --git a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp index 0960c72619..6c42bedf09 100644 --- a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp +++ b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp @@ -89,12 +89,12 @@ constexpr uint32_t MAX_INTERFACE_CAPRO_FIFO_SIZE = MAX_PUBLISHERS; constexpr uint32_t MAX_CHANNEL_NUMBER = MAX_PUBLISHERS + MAX_SUBSCRIBERS; constexpr uint32_t MAX_GATEWAY_SERVICES = 2 * MAX_CHANNEL_NUMBER; // Client -constexpr uint32_t MAX_CLIENTS = build::IOX_MAX_SUBSCRIBERS; +constexpr uint32_t MAX_CLIENTS = build::IOX_MAX_CLIENTS; constexpr uint32_t MAX_REQUESTS_ALLOCATED_SIMULTANEOUSLY = 4U; constexpr uint32_t MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY = build::IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY; constexpr uint32_t MAX_RESPONSE_QUEUE_CAPACITY = build::IOX_MAX_RESPONSE_QUEUE_CAPACITY; // Server -constexpr uint32_t MAX_SERVERS = build::IOX_MAX_PUBLISHERS; +constexpr uint32_t MAX_SERVERS = build::IOX_MAX_SERVERS; constexpr uint32_t MAX_CLIENTS_PER_SERVER = build::IOX_MAX_CLIENTS_PER_SERVER; constexpr uint32_t MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY = build::IOX_MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY; constexpr uint32_t MAX_RESPONSES_ALLOCATED_SIMULTANEOUSLY = MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY; diff --git a/iceoryx_posh/test/integrationtests/test_service_discovery.cpp b/iceoryx_posh/test/integrationtests/test_service_discovery.cpp index f8d052506f..04f6e69834 100644 --- a/iceoryx_posh/test/integrationtests/test_service_discovery.cpp +++ b/iceoryx_posh/test/integrationtests/test_service_discovery.cpp @@ -1002,11 +1002,11 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices) { ::testing::Test::RecordProperty("TEST_ID", "e0b292c2-49ce-47b4-b38e-456732240c41"); // maximum number of producers to generate - auto constexpr MAX = TestFixture::maxProducers(TestFixture::Variation::PATTERN); + auto constexpr SUT_MAX = TestFixture::maxProducers(TestFixture::Variation::PATTERN); // first threshold to change generation strategy at (about 1/3 of max) - auto constexpr N1 = MAX / 3; + auto constexpr SUT_N1 = SUT_MAX / 3; // second threshold to change generation strategy at (about 2/3 of max) - auto constexpr N2 = 2 * N1; + auto constexpr SUT_N2 = 2 * SUT_N1; // phase 1 : generate random services (no Umlaut) auto s1 = randomService(); @@ -1014,7 +1014,7 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices) uint32_t created = 1; - for (; created < N1; ++created) + for (; created < SUT_N1; ++created) { this->add(randomService()); } @@ -1025,13 +1025,13 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices) ++created; // phase 2 : fix service, generate random instances (no Umlaut) - for (; created < N2; ++created) + for (; created < SUT_N2; ++created) { this->add(randomService("Ferdinand")); } // phase 3 : fix service and instance, generate random events (no Umlaut) - for (; created < MAX - 1; ++created) + for (; created < SUT_MAX - 1; ++created) { this->add(randomService("Ferdinand", "Spitz")); } @@ -1040,21 +1040,23 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices) this->add(s3); ++created; - EXPECT_EQ(created, MAX); + EXPECT_EQ(created, SUT_MAX); // create some services of the other kind created = 0; auto constexpr OTHER_MAX = TestFixture::maxProducers(TestFixture::otherPattern()); + auto constexpr OTHER_N1 = OTHER_MAX / 3; + auto constexpr OTHER_N2 = 2 * OTHER_N1; // same phases, but now for the other service type // note that thresholds N1, N2 are chosen in a way that we can reuse them - for (; created < N1; ++created) + for (; created < OTHER_N1; ++created) { this->addOther(randomService()); } - for (; created < N2; ++created) + for (; created < OTHER_N2; ++created) { this->addOther(randomService("Spitz")); }