Lines Matching full:chain

12  * into the chain number. This is UAPI.
24 static int ocelot_chain_to_block(int chain, bool ingress) in ocelot_chain_to_block() argument
29 if (chain == 0) in ocelot_chain_to_block()
34 /* Backwards compatibility with older, single-chain tc-flower in ocelot_chain_to_block()
37 if (chain == 0) in ocelot_chain_to_block()
41 if (chain == VCAP_IS1_CHAIN(lookup)) in ocelot_chain_to_block()
46 if (chain == VCAP_IS2_CHAIN(lookup, pag)) in ocelot_chain_to_block()
52 /* Caller must ensure this is a valid IS1 or IS2 chain first,
55 static int ocelot_chain_to_lookup(int chain) in ocelot_chain_to_lookup() argument
57 return (chain / VCAP_LOOKUP) % 10; in ocelot_chain_to_lookup()
60 /* Caller must ensure this is a valid IS2 chain first,
63 static int ocelot_chain_to_pag(int chain) in ocelot_chain_to_pag() argument
65 int lookup = ocelot_chain_to_lookup(chain); in ocelot_chain_to_pag()
67 /* calculate PAG value as chain index relative to the first PAG */ in ocelot_chain_to_pag()
68 return chain - VCAP_IS2_CHAIN(lookup, 0); in ocelot_chain_to_pag()
71 static bool ocelot_is_goto_target_valid(int goto_target, int chain, in ocelot_is_goto_target_valid() argument
81 if (chain == 0) in ocelot_is_goto_target_valid()
89 if (chain == VCAP_IS1_CHAIN(0)) in ocelot_is_goto_target_valid()
92 if (chain == VCAP_IS1_CHAIN(1)) in ocelot_is_goto_target_valid()
97 * value encoding a VCAP IS2 target chain. in ocelot_is_goto_target_valid()
99 if (chain == VCAP_IS1_CHAIN(2)) { in ocelot_is_goto_target_valid()
111 if (chain == VCAP_IS2_CHAIN(0, pag)) in ocelot_is_goto_target_valid()
119 ocelot_find_vcap_filter_that_points_at(struct ocelot *ocelot, int chain) in ocelot_find_vcap_filter_that_points_at() argument
125 block_id = ocelot_chain_to_block(chain, true); in ocelot_find_vcap_filter_that_points_at()
134 filter->goto_target == chain) in ocelot_find_vcap_filter_that_points_at()
139 if (filter->goto_target == chain) in ocelot_find_vcap_filter_that_points_at()
154 int i, chain, egress_port; in ocelot_flower_parse_action() local
161 chain = f->common.chain_index; in ocelot_flower_parse_action()
162 filter->block_id = ocelot_chain_to_block(chain, ingress); in ocelot_flower_parse_action()
164 NL_SET_ERR_MSG_MOD(extack, "Cannot offload to this chain"); in ocelot_flower_parse_action()
168 filter->lookup = ocelot_chain_to_lookup(chain); in ocelot_flower_parse_action()
170 filter->pag = ocelot_chain_to_pag(chain); in ocelot_flower_parse_action()
351 chain == 0) { in ocelot_flower_parse_action()
359 if (!ocelot_is_goto_target_valid(filter->goto_target, chain, ingress) && in ocelot_flower_parse_action()
679 int chain = f->common.chain_index; in ocelot_cls_flower_replace() local
682 if (chain && !ocelot_find_vcap_filter_that_points_at(ocelot, chain)) { in ocelot_cls_flower_replace()
683 NL_SET_ERR_MSG_MOD(extack, "No default GOTO action points to this chain"); in ocelot_cls_flower_replace()