Skip to content

Commit e088257

Browse files
authored
Merge pull request #2395 from elBoberido/iox-2394-make-max-client-and-server-independently-configurable
iox-#2394 Make max number of Client and Server configurable
2 parents f7f07b2 + 0dcaa10 commit e088257

File tree

7 files changed

+30
-11
lines changed

7 files changed

+30
-11
lines changed

doc/website/release-notes/iceoryx-unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
- Add //:iceoryx Bazel alias [#2368](https://github.com/eclipse-iceoryx/iceoryx/issues/2368)
148148
- Depend on @ncurses when building with Bazel [#2372](https://github.com/eclipse-iceoryx/iceoryx/issues/2372)
149149
- Fix windows performance issue [#2377](https://github.com/eclipse-iceoryx/iceoryx/issues/2377)
150+
- Max Client and Server cannot be configured independently of Max Publisher and Subscriber [#2394](https://github.com/eclipse-iceoryx/iceoryx/issues/2394)
150151

151152
**Refactoring:**
152153

iceoryx_examples/small_memory/options.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ set(IOX_MAX_NUMBER_OF_CONDITION_VARIABLES 8 CACHE STRING "")
3030
set(IOX_MAX_NODE_NAME_LENGTH 30 CACHE STRING "")
3131
set(IOX_MAX_ID_STRING_LENGTH 30 CACHE STRING "")
3232
set(IOX_MAX_RUNTIME_NAME_LENGTH 30 CACHE STRING "")
33+
set(IOX_MAX_CLIENTS 4 CACHE STRING "")
34+
set(IOX_MAX_SERVERS 2 CACHE STRING "")
3335
set(IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY 2 CACHE STRING "")
3436
set(IOX_MAX_RESPONSE_QUEUE_CAPACITY 2 CACHE STRING "")
3537
set(IOX_MAX_REQUEST_QUEUE_CAPACITY 2 CACHE STRING "")

iceoryx_posh/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ configure_file(
3535
"IOX_INTERPROCESS_SEMAPHORE": "UnnamedSemaphore",
3636
"IOX_MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY": "8",
3737
"IOX_MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY": "256",
38+
"IOX_MAX_CLIENTS": "512",
3839
"IOX_MAX_CLIENTS_PER_SERVER": "256",
3940
"IOX_MAX_ID_STRING_LENGTH": "100",
4041
"IOX_MAX_INTERFACE_NUMBER": "4",
@@ -52,6 +53,7 @@ configure_file(
5253
"IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY": "16",
5354
"IOX_MAX_RESPONSE_QUEUE_CAPACITY": "16",
5455
"IOX_MAX_RUNTIME_NAME_LENGTH": "85",
56+
"IOX_MAX_SERVERS": "128",
5557
"IOX_MAX_SHM_SEGMENTS": "100",
5658
"IOX_MAX_SUBSCRIBERS": "1024",
5759
"IOX_MAX_SUBSCRIBERS_PER_PUBLISHER": "256",
@@ -64,6 +66,7 @@ configure_file(
6466
"IOX_INTERPROCESS_SEMAPHORE": "UnnamedSemaphore",
6567
"IOX_MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY": "8",
6668
"IOX_MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY": "256",
69+
"IOX_MAX_CLIENTS": "512",
6770
"IOX_MAX_CLIENTS_PER_SERVER": "256",
6871
"IOX_MAX_ID_STRING_LENGTH": "100",
6972
"IOX_MAX_INTERFACE_NUMBER": "4",
@@ -81,6 +84,7 @@ configure_file(
8184
"IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY": "16",
8285
"IOX_MAX_RESPONSE_QUEUE_CAPACITY": "16",
8386
"IOX_MAX_RUNTIME_NAME_LENGTH": "87",
87+
"IOX_MAX_SERVERS": "128",
8488
"IOX_MAX_SHM_SEGMENTS": "100",
8589
"IOX_MAX_SUBSCRIBERS": "1024",
8690
"IOX_MAX_SUBSCRIBERS_PER_PUBLISHER": "256",

iceoryx_posh/cmake/IceoryxPoshDeployment.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ configure_option(
107107
NAME IOX_MAX_RUNTIME_NAME_LENGTH
108108
DEFAULT_VALUE ${IOX_MAX_RUNTIME_NAME_LENGTH_DEFAULT}
109109
)
110+
configure_option(
111+
NAME IOX_MAX_SERVERS
112+
DEFAULT_VALUE 128
113+
)
114+
configure_option(
115+
NAME IOX_MAX_CLIENTS
116+
DEFAULT_VALUE 512
117+
)
110118
configure_option(
111119
NAME IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY
112120
DEFAULT_VALUE 16

iceoryx_posh/cmake/iceoryx_posh_deployment.hpp.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ constexpr uint32_t IOX_MAX_NUMBER_OF_CONDITION_VARIABLES =
7373
constexpr uint32_t IOX_MAX_NODE_NAME_LENGTH = static_cast<uint32_t>(@IOX_MAX_NODE_NAME_LENGTH@);
7474
constexpr uint32_t IOX_MAX_ID_STRING_LENGTH = static_cast<uint32_t>(@IOX_MAX_ID_STRING_LENGTH@);
7575
constexpr uint32_t IOX_MAX_RUNTIME_NAME_LENGTH = static_cast<uint32_t>(@IOX_MAX_RUNTIME_NAME_LENGTH@);
76+
constexpr uint32_t IOX_MAX_CLIENTS = static_cast<uint32_t>(@IOX_MAX_CLIENTS@);
77+
constexpr uint32_t IOX_MAX_SERVERS = static_cast<uint32_t>(@IOX_MAX_SERVERS@);
7678
constexpr uint32_t IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY =
7779
static_cast<uint32_t>(@IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY@);
7880
constexpr uint32_t IOX_MAX_RESPONSE_QUEUE_CAPACITY = static_cast<uint32_t>(@IOX_MAX_RESPONSE_QUEUE_CAPACITY@);

iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ constexpr uint32_t MAX_INTERFACE_CAPRO_FIFO_SIZE = MAX_PUBLISHERS;
8989
constexpr uint32_t MAX_CHANNEL_NUMBER = MAX_PUBLISHERS + MAX_SUBSCRIBERS;
9090
constexpr uint32_t MAX_GATEWAY_SERVICES = 2 * MAX_CHANNEL_NUMBER;
9191
// Client
92-
constexpr uint32_t MAX_CLIENTS = build::IOX_MAX_SUBSCRIBERS;
92+
constexpr uint32_t MAX_CLIENTS = build::IOX_MAX_CLIENTS;
9393
constexpr uint32_t MAX_REQUESTS_ALLOCATED_SIMULTANEOUSLY = 4U;
9494
constexpr uint32_t MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY = build::IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY;
9595
constexpr uint32_t MAX_RESPONSE_QUEUE_CAPACITY = build::IOX_MAX_RESPONSE_QUEUE_CAPACITY;
9696
// Server
97-
constexpr uint32_t MAX_SERVERS = build::IOX_MAX_PUBLISHERS;
97+
constexpr uint32_t MAX_SERVERS = build::IOX_MAX_SERVERS;
9898
constexpr uint32_t MAX_CLIENTS_PER_SERVER = build::IOX_MAX_CLIENTS_PER_SERVER;
9999
constexpr uint32_t MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY = build::IOX_MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY;
100100
constexpr uint32_t MAX_RESPONSES_ALLOCATED_SIMULTANEOUSLY = MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY;

iceoryx_posh/test/integrationtests/test_service_discovery.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,19 +1002,19 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices)
10021002
{
10031003
::testing::Test::RecordProperty("TEST_ID", "e0b292c2-49ce-47b4-b38e-456732240c41");
10041004
// maximum number of producers to generate
1005-
auto constexpr MAX = TestFixture::maxProducers(TestFixture::Variation::PATTERN);
1005+
auto constexpr SUT_MAX = TestFixture::maxProducers(TestFixture::Variation::PATTERN);
10061006
// first threshold to change generation strategy at (about 1/3 of max)
1007-
auto constexpr N1 = MAX / 3;
1007+
auto constexpr SUT_N1 = SUT_MAX / 3;
10081008
// second threshold to change generation strategy at (about 2/3 of max)
1009-
auto constexpr N2 = 2 * N1;
1009+
auto constexpr SUT_N2 = 2 * SUT_N1;
10101010

10111011
// phase 1 : generate random services (no Umlaut)
10121012
auto s1 = randomService();
10131013
this->add(s1);
10141014

10151015
uint32_t created = 1;
10161016

1017-
for (; created < N1; ++created)
1017+
for (; created < SUT_N1; ++created)
10181018
{
10191019
this->add(randomService());
10201020
}
@@ -1025,13 +1025,13 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices)
10251025
++created;
10261026

10271027
// phase 2 : fix service, generate random instances (no Umlaut)
1028-
for (; created < N2; ++created)
1028+
for (; created < SUT_N2; ++created)
10291029
{
10301030
this->add(randomService("Ferdinand"));
10311031
}
10321032

10331033
// phase 3 : fix service and instance, generate random events (no Umlaut)
1034-
for (; created < MAX - 1; ++created)
1034+
for (; created < SUT_MAX - 1; ++created)
10351035
{
10361036
this->add(randomService("Ferdinand", "Spitz"));
10371037
}
@@ -1040,21 +1040,23 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices)
10401040
this->add(s3);
10411041
++created;
10421042

1043-
EXPECT_EQ(created, MAX);
1043+
EXPECT_EQ(created, SUT_MAX);
10441044

10451045
// create some services of the other kind
10461046
created = 0;
10471047

10481048
auto constexpr OTHER_MAX = TestFixture::maxProducers(TestFixture::otherPattern());
1049+
auto constexpr OTHER_N1 = OTHER_MAX / 3;
1050+
auto constexpr OTHER_N2 = 2 * OTHER_N1;
10491051

10501052
// same phases, but now for the other service type
10511053
// note that thresholds N1, N2 are chosen in a way that we can reuse them
1052-
for (; created < N1; ++created)
1054+
for (; created < OTHER_N1; ++created)
10531055
{
10541056
this->addOther(randomService());
10551057
}
10561058

1057-
for (; created < N2; ++created)
1059+
for (; created < OTHER_N2; ++created)
10581060
{
10591061
this->addOther(randomService("Spitz"));
10601062
}

0 commit comments

Comments
 (0)