AltraMayor / gatekeeper

The first open-source DDoS protection system
https://github.com/AltraMayor/gatekeeper/wiki
GNU General Public License v3.0
1.34k stars 232 forks source link

lib/net: give an informative error when not enough queues #692

Closed AltraMayor closed 4 months ago

AltraMayor commented 4 months ago

While tuning the number of instances of the functional blocks, the configuration may exceed the maximum number of queues that the NICs support. When this happens, the error message in the log is not informative. For example:

Ethdev port_id=0 nb_rx_queues=43 > 8
Main/0 2024-06-25 17:07:22 ERR init_iface(back): failed to configure interface (errno=22): Invalid argument

This commit identifies the problem and gives a helpful error message:

Main/0 2024-06-25 17:38:22 ERR check_if_queues(back): the current configuration requires 43 RX queues, but the interface supports at most 8 RX queues. It may be possible to reduce the number of instances of the GK or GT functional block to reduce the number of queues. If not, more capable NICs are needed.
Main/0 2024-06-25 17:38:22 ERR init_iface(back): interface doesn't support a critical hardware capability (errno=28): No space left on device

This pull request closes #620.