nic_router: lower packet-batch count to 50

The previous default packet-batch count of 150 (<config
max_packets_per_signal>) 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
This commit is contained in:
Martin Stein 2024-06-18 12:00:07 +02:00 committed by Norman Feske
parent e93f5fe8e0
commit 682dedb2e1
2 changed files with 2 additions and 2 deletions

View File

@ -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):
! <config max_packets_per_signal="150">
! <config max_packets_per_signal="50">
When set to zero, the limit is deactivated, meaning that the router always
handles all available packets of an interface.

View File

@ -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) },