This patch series introduces infrastructure and user-facing improvements
for multi-table routing in OVS. The main motivation is to enable more
advanced routing scenarios, such as policy-based routing with source
address selectors. For example, this can be used to support
OVN-Kubernetes multi-VTEP topology where nodes may have multiple SR-IOV
network adapters and to facilitate selection of which VTEP to use to
send/receive the packets to/from the wire.

The core of this series adds support for multiple routing tables within
OVS. This is a prerequisite for importing non-default routing tables
from the kernel and enables advanced routing lookups that consider
parameters beyond just the destination address (e.g., source address).

Additional routing tables are now created by reading the Routing Policy
Database (RPDB) from the kernel. Only tables referenced by RPDB rules
with a table lookup action are imported, and rule priorities and table
IDs are preserved. The current implementation supports RPDB rules with a
source address selector (`[not] from IP`).

User interface changes:

- The `ovs-appctl ovs/route/show` command now accepts an optional
  `table=ID` or `table=all` parameter, allowing users to display routes
  from specific or all tables.

- The `ovs-appctl ovs/route/add` and `ovs/route/del` commands accept a
  `table=ID` parameter for adding or deleting user routes in non-default
  tables.

- A new `ovs-appctl ovs/rule/show` command is introduced to display the
  internal routing rules database, sorted by priority.

- The `ovs-appctl ovs/route/lookup` command now supports an optional
  `src=IP` parameter for lookups that match on source IP address.

Performance optimization:

  A back-off mechanism is added to the periodic router reset logic. This
  reduces CPU usage under high update rates and large numbers of
  routes/rules by dynamically increasing the delay between full router
  table dumps, based on the duration of the last reset.

Example usage:

- Show all routes, including those from non-default tables:

  ovs-appctl ovs/route/show table=all

- Add a route to a specific table:

  ovs-appctl ovs/route/add 10.7.7.0/24 br-phy0 table=10

- Show routing rules:

  ovs-appctl ovs/rule/show

- Lookup a route with a source IP:

  ovs-appctl ovs/route/lookup 10.0.0.5 src=10.0.0.2

Dima Chumak (8):
  route-table: Export is_standard_table_id().
  ovs-router: Add infrastructure for multi-table routing.
  route-table: Introduce multi-table route lookup.
  ovs-router: Add 'table=ID' parameter in ovs/route/show.
  ovs-router: Introduce ovs/rule/show command.
  ovs-router: Add 'table=ID' parameter in ovs/route/{add,del}.
  ovs-router: Add 'src=IP' parameter in ovs/route/lookup.
  router-table: Add back-off to periodic router reset.

 NEWS                         |   7 +
 lib/netdev-dummy.c           |   6 +-
 lib/ovs-router.c             | 535 ++++++++++++++++++++++++++++++-----
 lib/ovs-router.h             |  38 ++-
 lib/packets.c                |  20 ++
 lib/packets.h                |   2 +
 lib/route-table.c            | 287 +++++++++++++++++--
 lib/route-table.h            |  18 +-
 tests/ovs-router.at          |   4 +
 tests/system-route.at        | 107 +++++++
 tests/test-lib-route-table.c |   5 +-
 11 files changed, 934 insertions(+), 95 deletions(-)

-- 
2.49.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to