MCPcopy Create free account
hub / github.com/F-Stack/f-stack / port_meter_policy_add

Function port_meter_policy_add

dpdk/app/test-pmd/config.c:2207–2234  ·  view source on GitHub ↗

Add port meter policy */

Source from the content-addressed store, hash-verified

2205
2206/** Add port meter policy */
2207int
2208port_meter_policy_add(portid_t port_id, uint32_t policy_id,
2209 const struct rte_flow_action *actions)
2210{
2211 struct rte_mtr_error error;
2212 const struct rte_flow_action *act = actions;
2213 const struct rte_flow_action *start;
2214 struct rte_mtr_meter_policy_params policy;
2215 uint32_t i = 0, act_n;
2216 int ret;
2217
2218 for (i = 0; i < RTE_COLORS; i++) {
2219 for (act_n = 0, start = act;
2220 act->type != RTE_FLOW_ACTION_TYPE_END; act++)
2221 act_n++;
2222 if (act_n > 0)
2223 policy.actions[i] = start;
2224 else
2225 policy.actions[i] = NULL;
2226 act++;
2227 }
2228 ret = rte_mtr_meter_policy_add(port_id,
2229 policy_id,
2230 &policy, &error);
2231 if (ret)
2232 print_mtr_err_msg(&error);
2233 return ret;
2234}
2235
2236struct rte_flow_meter_profile *
2237port_meter_profile_get_by_id(portid_t port_id, uint32_t id)

Callers 1

cmd_flow_parsedFunction · 0.85

Calls 2

rte_mtr_meter_policy_addFunction · 0.85
print_mtr_err_msgFunction · 0.85

Tested by

no test coverage detected