case RTE_FLOW_ITEM_TYPE_ETH:
*mask = &rte_flow_item_eth_mask;
- *size = sizeof(struct rte_flow_item_eth);
+ *size = sizeof(struct rte_ether_hdr);
return 1; /* TRUE */
case RTE_FLOW_ITEM_TYPE_VLAN:
*mask = &rte_flow_item_vlan_mask;
- *size = sizeof(struct rte_flow_item_vlan);
+ *size = sizeof(struct rte_vlan_hdr);
return 1;
case RTE_FLOW_ITEM_TYPE_IPV4:
*mask = &rte_flow_item_ipv4_mask;
- *size = sizeof(struct rte_flow_item_ipv4);
+ *size = sizeof(struct rte_ipv4_hdr);
return 1;
case RTE_FLOW_ITEM_TYPE_IPV6:
*mask = &rte_flow_item_ipv6_mask;
- *size = sizeof(struct rte_flow_item_ipv6);
+ *size = sizeof(struct rte_ipv6_hdr);
return 1;
case RTE_FLOW_ITEM_TYPE_ICMP:
* Both *tmask* and *fmask* are byte arrays of size *tsize* and *fsize*
* respectively.
* They are located within a larger buffer at offsets *toffset* and *foffset*
- * respectivelly. Both *tmask* and *fmask* represent bitmasks for the larger
+ * respectively. Both *tmask* and *fmask* represent bitmasks for the larger
* buffer.
* Question: are the two masks equivalent?
*
{
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;
action,
"QUEUE: Invalid RX queue ID");
- sprintf(name, "RXQ%u", (uint32_t)conf->index);
+ snprintf(name, sizeof(name), "RXQ%u",
+ (uint32_t)conf->index);
status = softnic_pipeline_port_out_find(softnic,
pipeline->name,
action,
"RSS: Invalid RX queue ID");
- sprintf(name, "RXQ%u",
+ snprintf(name, sizeof(name), "RXQ%u",
(uint32_t)conf->queue[i]);
status = softnic_pipeline_port_out_find(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,
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[e_RTE_METER_GREEN] =
- softnic_table_action_policer(m->params.action[RTE_MTR_GREEN]);
- rule_action->mtr.mtr[0].policer[e_RTE_METER_YELLOW] =
- softnic_table_action_policer(m->params.action[RTE_MTR_YELLOW]);
- rule_action->mtr.mtr[0].policer[e_RTE_METER_RED] =
- softnic_table_action_policer(m->params.action[RTE_MTR_RED]);
+ rule_action->mtr.mtr[0].policer[RTE_COLOR_GREEN] =
+ policy->policer[RTE_COLOR_GREEN];
+ rule_action->mtr.mtr[0].policer[RTE_COLOR_YELLOW] =
+ policy->policer[RTE_COLOR_YELLOW];
+ rule_action->mtr.mtr[0].policer[RTE_COLOR_RED] =
+ policy->policer[RTE_COLOR_RED];
rule_action->mtr.tc_mask = 1;
rule_action->action_mask |= 1 << RTE_TABLE_ACTION_MTR;
break;
item,
"VXLAN ENCAP: first encap item should be ether");
}
- ether_addr_copy(&spec.eth.dst,
+ rte_ether_addr_copy(&spec.eth.dst,
&rule_action->encap.vxlan.ether.da);
- ether_addr_copy(&spec.eth.src,
+ rte_ether_addr_copy(&spec.eth.src,
&rule_action->encap.vxlan.ether.sa);
item++;
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,