platform: dump only selected route protocols
Summary
When doing a dump of routes, we want to exclude routes having protocols we do not care about. Since the netlink socket has STRICT_CHK enabled, we can request multiple dumps for the protocols we need.
While doing 6 dumps is less efficient than doing 1, it normally doesn't matter. However, the new implementation is more efficient when there are e.g. millions of BGP routes that can be excluded from the results.
Resolves: https://issues.redhat.com/browse/RHEL-29902
Checklist
Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:
-
the subject for all commits is concise and explicative -
the message for all commits explains the reason for the change -
the source is properly formatted -
any relevant documentation is up to date -
you have added unit tests if applicable -
the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.