Lines Matching defs:chain

12  * into the chain number. This is UAPI.
24 static int ocelot_chain_to_block(int chain, bool ingress)
29 if (chain == 0)
34 /* Backwards compatibility with older, single-chain tc-flower
37 if (chain == 0)
41 if (chain == VCAP_IS1_CHAIN(lookup))
46 if (chain == VCAP_IS2_CHAIN(lookup, pag))
52 /* Caller must ensure this is a valid IS1 or IS2 chain first,
55 static int ocelot_chain_to_lookup(int chain)
57 /* Backwards compatibility with older, single-chain tc-flower
60 if (chain == 0)
63 return (chain / VCAP_LOOKUP) % 10;
66 /* Caller must ensure this is a valid IS2 chain first,
69 static int ocelot_chain_to_pag(int chain)
73 /* Backwards compatibility with older, single-chain tc-flower
76 if (chain == 0)
79 lookup = ocelot_chain_to_lookup(chain);
81 /* calculate PAG value as chain index relative to the first PAG */
82 return chain - VCAP_IS2_CHAIN(lookup, 0);
85 static bool ocelot_is_goto_target_valid(int goto_target, int chain,
95 if (chain == 0)
103 if (chain == VCAP_IS1_CHAIN(0))
106 if (chain == VCAP_IS1_CHAIN(1))
111 * value encoding a VCAP IS2 target chain.
113 if (chain == VCAP_IS1_CHAIN(2)) {
125 if (chain == VCAP_IS2_CHAIN(0, pag))
133 ocelot_find_vcap_filter_that_points_at(struct ocelot *ocelot, int chain)
139 block_id = ocelot_chain_to_block(chain, true);
148 filter->goto_target == chain)
153 if (filter->goto_target == chain)
168 int i, chain, egress_port;
175 chain = f->common.chain_index;
176 filter->block_id = ocelot_chain_to_block(chain, ingress);
178 NL_SET_ERR_MSG_MOD(extack, "Cannot offload to this chain");
182 filter->lookup = ocelot_chain_to_lookup(chain);
184 filter->pag = ocelot_chain_to_pag(chain);
366 chain == 0) {
374 if (!ocelot_is_goto_target_valid(filter->goto_target, chain, ingress) &&
696 int chain = f->common.chain_index;
699 if (chain && !ocelot_find_vcap_filter_that_points_at(ocelot, chain)) {
700 NL_SET_ERR_MSG_MOD(extack, "No default GOTO action points to this chain");