X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsoftnic%2Frte_eth_softnic_flow.c;h=ca70eab6782c38fbb39637c21a24fab381378206;hb=675a6c18746694a8e19a0256b16bd6b3e8dcbfd2;hp=7925bad1c09e779fcb238b4ea38219566d8dfde9;hpb=1ce051a4cc636698359b31008674754690c15e1c;p=dpdk.git diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c index 7925bad1c0..ca70eab678 100644 --- a/drivers/net/softnic/rte_eth_softnic_flow.c +++ b/drivers/net/softnic/rte_eth_softnic_flow.c @@ -1166,6 +1166,7 @@ flow_rule_action_get(struct pmd_internals *softnic, { struct softnic_table_action_profile *profile; struct softnic_table_action_profile_params *params; + struct softnic_mtr_meter_policy *policy; int n_jump_queue_rss_drop = 0; int n_count = 0; int n_mark = 0; @@ -1447,13 +1448,6 @@ flow_rule_action_get(struct pmd_internals *softnic, action, "COUNT: Null configuration"); - if (conf->shared) - return rte_flow_error_set(error, - ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION_CONF, - conf, - "COUNT: Shared counters not supported"); - if (n_count) return rte_flow_error_set(error, ENOTSUP, @@ -1621,15 +1615,25 @@ flow_rule_action_get(struct pmd_internals *softnic, return -1; } } - + /* Meter policy must exist */ + policy = softnic_mtr_meter_policy_find(softnic, + m->params.meter_policy_id); + if (policy == NULL) { + rte_flow_error_set(error, + EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, + "METER: fail to find meter policy"); + return -1; + } /* RTE_TABLE_ACTION_METER */ rule_action->mtr.mtr[0].meter_profile_id = meter_profile_id; rule_action->mtr.mtr[0].policer[RTE_COLOR_GREEN] = - softnic_table_action_policer(m->params.action[RTE_COLOR_GREEN]); + policy->policer[RTE_COLOR_GREEN]; rule_action->mtr.mtr[0].policer[RTE_COLOR_YELLOW] = - softnic_table_action_policer(m->params.action[RTE_COLOR_YELLOW]); + policy->policer[RTE_COLOR_YELLOW]; rule_action->mtr.mtr[0].policer[RTE_COLOR_RED] = - softnic_table_action_policer(m->params.action[RTE_COLOR_RED]); + policy->policer[RTE_COLOR_RED]; rule_action->mtr.tc_mask = 1; rule_action->action_mask |= 1 << RTE_TABLE_ACTION_MTR; break; @@ -2196,7 +2200,8 @@ pmd_flow_flush(struct rte_eth_dev *dev, void *temp; int status; - TAILQ_FOREACH_SAFE(flow, &table->flows, node, temp) { + RTE_TAILQ_FOREACH_SAFE(flow, &table->flows, node, + temp) { /* Rule delete. */ status = softnic_pipeline_table_rule_delete (softnic,