From 682dedb2e1a7de3ac2168eb342b371b68be9bf60 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Tue, 18 Jun 2024 12:00:07 +0200 Subject: [PATCH] nic_router: lower packet-batch count to 50 The previous default packet-batch count of 150 () was choosen with the only goal of preventing starvation by huge amounts of packets from one session. However, there is something else to keep in mind. A packet that is found to require ARP sends an ARP request and becomes blocked after having consumed resources. This means, that, in the worst case, the router used to send 150 ARP requests and consume resources 150 times before making it even possible for the outer world to react and cause resources to be freed. With this additional scenario in mind, the default batch size should be significantly lower. Ref #4534 --- repos/os/src/server/nic_router/README | 2 +- repos/os/src/server/nic_router/configuration.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/os/src/server/nic_router/README b/repos/os/src/server/nic_router/README index 88803c68f8..e004e9ae46 100644 --- a/repos/os/src/server/nic_router/README +++ b/repos/os/src/server/nic_router/README @@ -837,7 +837,7 @@ this can lead to starvation of the other interfaces. Thus, the maximum number of packets handled per signal is limited by default. This limit can be configured as follows (default value shown): -! +! When set to zero, the limit is deactivated, meaning that the router always handles all available packets of an interface. diff --git a/repos/os/src/server/nic_router/configuration.cc b/repos/os/src/server/nic_router/configuration.cc index 7737d8b5a6..72338fe5d1 100644 --- a/repos/os/src/server/nic_router/configuration.cc +++ b/repos/os/src/server/nic_router/configuration.cc @@ -91,7 +91,7 @@ Configuration::Configuration(Env &env, Interface_list &interfaces) : _alloc { alloc }, - _max_packets_per_signal { node.attribute_value("max_packets_per_signal", (unsigned long)150) }, + _max_packets_per_signal { node.attribute_value("max_packets_per_signal", (unsigned long)50) }, _verbose { node.attribute_value("verbose", false) }, _verbose_packets { node.attribute_value("verbose_packets", false) }, _verbose_packet_drop { node.attribute_value("verbose_packet_drop", false) },