Improve feature arc order constraint specification 34/16034/2
authorDave Barach <dave@barachs.net>
Mon, 19 Nov 2018 14:31:48 +0000 (09:31 -0500)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 19 Nov 2018 22:58:46 +0000 (22:58 +0000)
commit2dd192b76774beb9c7960527fb3f397a2848f679
treec6a424f4734cceb7cd9f51705d065871d3224568
parent6c01dceea5c612373453db7f1ccda589a2cd782e
Improve feature arc order constraint specification

Add the VNET_FEATURE_ARC_ORDER macro, which allows specification of
bulk order constraints. Here's an example:

VNET_FEATURE_ARC_ORDER(ip4_unicast_arc_order, static) = {
  .arc_name = "ip4-unicast",
  .node_names = VNET_FEATURES ("ip4-flow-classify",
                               "ip4-inacl",
                               "ip4-source-check-via-rx",
                               "ip4-source-check-via-any",
                               "ip4-source-and-port-range-check-rx",
                               "ip4-policer-classify",
                               "ipsec4-input",
                               "vpath-input-ip4",
                               "ip4-vxlan-bypass",
                               "ip4-not-enabled",
                               "ip4-lookup"),
};

Simply list feature nodes in the desired order, and you're
done. Multiple macro instances per are are fine / expected /
tested.

Under the covers: generate "a before b" tuples by chain-dragging
across the ordered list. No need to touch existing per-feature
constraints.

Fixed a long-broken "you lose!" error message.

Change-Id: I259282e426fd305e22c8d65886787c41a1d348d3
Signed-off-by: Dave Barach <dave@barachs.net>
src/vnet/feature/feature.c
src/vnet/feature/feature.h
src/vnet/feature/registration.c