}
static bool
-match(const struct cls_rule *wild, const flow_t *fixed)
+match(const struct cls_rule *wild, const struct flow *fixed)
{
int f_idx;
}
static struct cls_rule *
-tcls_lookup(const struct tcls *cls, const flow_t *flow, int include)
+tcls_lookup(const struct tcls *cls, const struct flow *flow, int include)
{
size_t i;
static struct cls_rule *
lookup_with_include_bits(const struct classifier *cls,
- const flow_t *flow, int include)
+ const struct flow *flow, int include)
{
switch (include) {
case CLS_INC_WILD:
static void
compare_classifiers(struct classifier *cls, struct tcls *tcls)
{
+ static const int confidence = 500;
unsigned int i;
assert(classifier_count(cls) == tcls->n_rules);
assert(classifier_count_exact(cls) == tcls_count_exact(tcls));
- for (i = 0; i < N_FLOW_VALUES; i++) {
+ for (i = 0; i < confidence; i++) {
struct cls_rule *cr0, *cr1;
- flow_t flow;
+ struct flow flow;
unsigned int x;
int include;
- x = i;
+ x = rand () % N_FLOW_VALUES;
flow.nw_src = nw_src_values[get_value(&x, N_NW_SRC_VALUES)];
flow.nw_dst = nw_dst_values[get_value(&x, N_NW_DST_VALUES)];
flow.tun_id = tun_id_values[get_value(&x, N_TUN_ID_VALUES)];
ETH_ADDR_LEN);
flow.nw_proto = nw_proto_values[get_value(&x, N_NW_PROTO_VALUES)];
flow.nw_tos = nw_tos_values[get_value(&x, N_NW_TOS_VALUES)];
- memset(flow.reserved, 0, sizeof flow.reserved);
for (include = 1; include <= 3; include++) {
cr0 = lookup_with_include_bits(cls, &flow, include);
if (!hmap_is_empty(&cls->tables[i])) {
found_tables++;
}
- HMAP_FOR_EACH (bucket, struct cls_bucket, hmap_node, &cls->tables[i]) {
+ HMAP_FOR_EACH (bucket, hmap_node, &cls->tables[i]) {
found_buckets++;
assert(!list_is_empty(&bucket->rules));
found_rules += list_size(&bucket->rules);
const struct cls_field *f;
struct test_rule *rule;
uint32_t wildcards;
- flow_t flow;
+ struct flow flow;
wildcards = 0;
memset(&flow, 0, sizeof flow);