Lines Matching refs:cls

89 		   struct rte_flow_classifier *cls,  in rte_flow_classify_validate()  argument
104 if (cls == NULL) { in rte_flow_classify_validate()
132 memset(&cls->ntuple_filter, 0, sizeof(cls->ntuple_filter)); in rte_flow_classify_validate()
162 ret = parse_filter(attr, items, actions, &cls->ntuple_filter, error); in rte_flow_classify_validate()
259 struct rte_flow_classifier *cls; in rte_flow_classifier_create() local
272 cls = rte_zmalloc_socket("FLOW_CLASSIFIER", in rte_flow_classifier_create()
276 if (cls == NULL) { in rte_flow_classifier_create()
284 strlcpy(cls->name, params->name, RTE_FLOW_CLASSIFIER_MAX_NAME_SZ); in rte_flow_classifier_create()
286 cls->socket_id = params->socket_id; in rte_flow_classifier_create()
288 return cls; in rte_flow_classifier_create()
299 rte_flow_classifier_free(struct rte_flow_classifier *cls) in rte_flow_classifier_free() argument
304 if (cls == NULL) { in rte_flow_classifier_free()
312 for (i = 0; i < cls->num_tables; i++) { in rte_flow_classifier_free()
313 struct rte_cls_table *table = &cls->tables[i]; in rte_flow_classifier_free()
319 rte_free(cls); in rte_flow_classifier_free()
325 rte_table_check_params(struct rte_flow_classifier *cls, in rte_table_check_params() argument
328 if (cls == NULL) { in rte_table_check_params()
360 if (cls->num_tables == RTE_FLOW_CLASSIFY_TABLE_MAX) { in rte_table_check_params()
371 rte_flow_classify_table_create(struct rte_flow_classifier *cls, in rte_flow_classify_table_create() argument
380 ret = rte_table_check_params(cls, params); in rte_flow_classify_table_create()
388 h_table = params->ops->f_create(params->arg_create, cls->socket_id, in rte_flow_classify_table_create()
397 table = &cls->tables[cls->num_tables]; in rte_flow_classify_table_create()
399 cls->num_tables++; in rte_flow_classify_table_create()
412 allocate_acl_ipv4_5tuple_rule(struct rte_flow_classifier *cls) in allocate_acl_ipv4_5tuple_rule() argument
425 rule->u.key.key_add.priority = cls->ntuple_filter.priority; in allocate_acl_ipv4_5tuple_rule()
427 cls->ntuple_filter.proto_mask; in allocate_acl_ipv4_5tuple_rule()
429 cls->ntuple_filter.proto; in allocate_acl_ipv4_5tuple_rule()
430 rule->rules.u.ipv4_5tuple.proto = cls->ntuple_filter.proto; in allocate_acl_ipv4_5tuple_rule()
431 rule->rules.u.ipv4_5tuple.proto_mask = cls->ntuple_filter.proto_mask; in allocate_acl_ipv4_5tuple_rule()
434 cls->ntuple_filter.src_ip_mask; in allocate_acl_ipv4_5tuple_rule()
436 cls->ntuple_filter.src_ip; in allocate_acl_ipv4_5tuple_rule()
437 rule->rules.u.ipv4_5tuple.src_ip_mask = cls->ntuple_filter.src_ip_mask; in allocate_acl_ipv4_5tuple_rule()
438 rule->rules.u.ipv4_5tuple.src_ip = cls->ntuple_filter.src_ip; in allocate_acl_ipv4_5tuple_rule()
441 cls->ntuple_filter.dst_ip_mask; in allocate_acl_ipv4_5tuple_rule()
443 cls->ntuple_filter.dst_ip; in allocate_acl_ipv4_5tuple_rule()
444 rule->rules.u.ipv4_5tuple.dst_ip_mask = cls->ntuple_filter.dst_ip_mask; in allocate_acl_ipv4_5tuple_rule()
445 rule->rules.u.ipv4_5tuple.dst_ip = cls->ntuple_filter.dst_ip; in allocate_acl_ipv4_5tuple_rule()
448 cls->ntuple_filter.src_port_mask; in allocate_acl_ipv4_5tuple_rule()
450 cls->ntuple_filter.src_port; in allocate_acl_ipv4_5tuple_rule()
452 cls->ntuple_filter.src_port_mask; in allocate_acl_ipv4_5tuple_rule()
453 rule->rules.u.ipv4_5tuple.src_port = cls->ntuple_filter.src_port; in allocate_acl_ipv4_5tuple_rule()
456 cls->ntuple_filter.dst_port_mask; in allocate_acl_ipv4_5tuple_rule()
458 cls->ntuple_filter.dst_port; in allocate_acl_ipv4_5tuple_rule()
460 cls->ntuple_filter.dst_port_mask; in allocate_acl_ipv4_5tuple_rule()
461 rule->rules.u.ipv4_5tuple.dst_port = cls->ntuple_filter.dst_port; in allocate_acl_ipv4_5tuple_rule()
478 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls, in rte_flow_classify_table_entry_add() argument
502 ret = rte_flow_classify_validate(cls, attr, pattern, actions, error); in rte_flow_classify_table_entry_add()
508 rule = allocate_acl_ipv4_5tuple_rule(cls); in rte_flow_classify_table_entry_add()
512 cls->table_mask |= table_type; in rte_flow_classify_table_entry_add()
533 for (i = 0; i < cls->num_tables; i++) { in rte_flow_classify_table_entry_add()
534 struct rte_cls_table *table = &cls->tables[i]; in rte_flow_classify_table_entry_add()
560 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls, in rte_flow_classify_table_entry_delete() argument
566 if (!cls || !rule) in rte_flow_classify_table_entry_delete()
570 for (i = 0; i < cls->num_tables; i++) { in rte_flow_classify_table_entry_delete()
571 struct rte_cls_table *table = &cls->tables[i]; in rte_flow_classify_table_entry_delete()
589 flow_classifier_lookup(struct rte_flow_classifier *cls, in flow_classifier_lookup() argument
601 (void **)cls->entries); in flow_classifier_lookup()
604 cls->nb_pkts = nb_pkts; in flow_classifier_lookup()
606 cls->nb_pkts = 0; in flow_classifier_lookup()
612 action_apply(struct rte_flow_classifier *cls, in action_apply() argument
623 for (i = 0; i < cls->nb_pkts; i++) { in action_apply()
624 if (rule->id == cls->entries[i]->rule_id) in action_apply()
638 rte_flow_classifier_query(struct rte_flow_classifier *cls, in rte_flow_classifier_query() argument
648 if (!cls || !rule || !stats || !pkts || nb_pkts == 0) in rte_flow_classifier_query()
652 for (i = 0; i < cls->num_tables; i++) { in rte_flow_classifier_query()
653 struct rte_cls_table *table = &cls->tables[i]; in rte_flow_classifier_query()
656 ret = flow_classifier_lookup(cls, table, in rte_flow_classifier_query()
659 ret = action_apply(cls, rule, stats); in rte_flow_classifier_query()