Lines Matching full:chain

13  * into the chain number. This is UAPI.
24 /* PSFP chain and block ID */
28 static int ocelot_chain_to_block(int chain, bool ingress) in ocelot_chain_to_block() argument
33 if (chain == 0) in ocelot_chain_to_block()
38 /* Backwards compatibility with older, single-chain tc-flower in ocelot_chain_to_block()
41 if (chain == 0) in ocelot_chain_to_block()
45 if (chain == VCAP_IS1_CHAIN(lookup)) in ocelot_chain_to_block()
50 if (chain == VCAP_IS2_CHAIN(lookup, pag)) in ocelot_chain_to_block()
53 if (chain == OCELOT_PSFP_CHAIN) in ocelot_chain_to_block()
59 /* Caller must ensure this is a valid IS1 or IS2 chain first,
62 static int ocelot_chain_to_lookup(int chain) in ocelot_chain_to_lookup() argument
64 /* Backwards compatibility with older, single-chain tc-flower in ocelot_chain_to_lookup()
67 if (chain == 0) in ocelot_chain_to_lookup()
70 return (chain / VCAP_LOOKUP) % 10; in ocelot_chain_to_lookup()
73 /* Caller must ensure this is a valid IS2 chain first,
76 static int ocelot_chain_to_pag(int chain) in ocelot_chain_to_pag() argument
80 /* Backwards compatibility with older, single-chain tc-flower in ocelot_chain_to_pag()
83 if (chain == 0) in ocelot_chain_to_pag()
86 lookup = ocelot_chain_to_lookup(chain); in ocelot_chain_to_pag()
88 /* calculate PAG value as chain index relative to the first PAG */ in ocelot_chain_to_pag()
89 return chain - VCAP_IS2_CHAIN(lookup, 0); in ocelot_chain_to_pag()
92 static bool ocelot_is_goto_target_valid(int goto_target, int chain, in ocelot_is_goto_target_valid() argument
102 if (chain == 0) in ocelot_is_goto_target_valid()
111 if (chain == VCAP_IS1_CHAIN(0)) in ocelot_is_goto_target_valid()
114 if (chain == VCAP_IS1_CHAIN(1)) in ocelot_is_goto_target_valid()
119 * value encoding a VCAP IS2 target chain. in ocelot_is_goto_target_valid()
121 if (chain == VCAP_IS1_CHAIN(2)) { in ocelot_is_goto_target_valid()
133 if (chain == VCAP_IS2_CHAIN(0, pag)) in ocelot_is_goto_target_valid()
138 if (chain == VCAP_IS2_CHAIN(1, pag)) in ocelot_is_goto_target_valid()
145 ocelot_find_vcap_filter_that_points_at(struct ocelot *ocelot, int chain) in ocelot_find_vcap_filter_that_points_at() argument
151 block_id = ocelot_chain_to_block(chain, true); in ocelot_find_vcap_filter_that_points_at()
160 filter->goto_target == chain) in ocelot_find_vcap_filter_that_points_at()
165 if (filter->goto_target == chain) in ocelot_find_vcap_filter_that_points_at()
240 int i, chain, egress_port; in ocelot_flower_parse_action() local
249 chain = f->common.chain_index; in ocelot_flower_parse_action()
250 filter->block_id = ocelot_chain_to_block(chain, ingress); in ocelot_flower_parse_action()
252 NL_SET_ERR_MSG_MOD(extack, "Cannot offload to this chain"); in ocelot_flower_parse_action()
256 filter->lookup = ocelot_chain_to_lookup(chain); in ocelot_flower_parse_action()
258 filter->pag = ocelot_chain_to_pag(chain); in ocelot_flower_parse_action()
490 "Gate action can only be offloaded to PSFP chain"); in ocelot_flower_parse_action()
503 chain == 0 || filter->block_id == PSFP_BLOCK_ID) { in ocelot_flower_parse_action()
511 if (!ocelot_is_goto_target_valid(filter->goto_target, chain, ingress) && in ocelot_flower_parse_action()
870 int chain = f->common.chain_index; in ocelot_cls_flower_replace() local
873 if (chain && !ocelot_find_vcap_filter_that_points_at(ocelot, chain)) { in ocelot_cls_flower_replace()
874 NL_SET_ERR_MSG_MOD(extack, "No default GOTO action points to this chain"); in ocelot_cls_flower_replace()
878 block_id = ocelot_chain_to_block(chain, ingress); in ocelot_cls_flower_replace()
880 NL_SET_ERR_MSG_MOD(extack, "Cannot offload to this chain"); in ocelot_cls_flower_replace()
926 NL_SET_ERR_MSG_MOD(extack, "PSFP chain is not supported in HW"); in ocelot_cls_flower_replace()