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

Function sfc_flow_parse_actions

dpdk/drivers/net/sfc/sfc_flow.c:1607–1758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1605}
1606
1607static int
1608sfc_flow_parse_actions(struct sfc_adapter *sa,
1609 const struct rte_flow_action actions[],
1610 struct rte_flow *flow,
1611 struct rte_flow_error *error)
1612{
1613 int rc;
1614 struct sfc_flow_spec *spec = &flow->spec;
1615 struct sfc_flow_spec_filter *spec_filter = &spec->filter;
1616 const unsigned int dp_rx_features = sa->priv.dp_rx->features;
1617 const uint64_t rx_metadata = sa->negotiated_rx_metadata;
1618 uint32_t actions_set = 0;
1619 const uint32_t fate_actions_mask = (1UL << RTE_FLOW_ACTION_TYPE_QUEUE) |
1620 (1UL << RTE_FLOW_ACTION_TYPE_RSS) |
1621 (1UL << RTE_FLOW_ACTION_TYPE_DROP);
1622 const uint32_t mark_actions_mask = (1UL << RTE_FLOW_ACTION_TYPE_MARK) |
1623 (1UL << RTE_FLOW_ACTION_TYPE_FLAG);
1624
1625 if (actions == NULL) {
1626 rte_flow_error_set(error, EINVAL,
1627 RTE_FLOW_ERROR_TYPE_ACTION_NUM, NULL,
1628 "NULL actions");
1629 return -rte_errno;
1630 }
1631
1632 for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
1633 switch (actions->type) {
1634 case RTE_FLOW_ACTION_TYPE_VOID:
1635 SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_VOID,
1636 actions_set);
1637 break;
1638
1639 case RTE_FLOW_ACTION_TYPE_QUEUE:
1640 SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_QUEUE,
1641 actions_set);
1642 if ((actions_set & fate_actions_mask) != 0)
1643 goto fail_fate_actions;
1644
1645 rc = sfc_flow_parse_queue(sa, actions->conf, flow);
1646 if (rc != 0) {
1647 rte_flow_error_set(error, EINVAL,
1648 RTE_FLOW_ERROR_TYPE_ACTION, actions,
1649 "Bad QUEUE action");
1650 return -rte_errno;
1651 }
1652 break;
1653
1654 case RTE_FLOW_ACTION_TYPE_RSS:
1655 SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_RSS,
1656 actions_set);
1657 if ((actions_set & fate_actions_mask) != 0)
1658 goto fail_fate_actions;
1659
1660 rc = sfc_flow_parse_rss(sa, actions->conf, flow);
1661 if (rc != 0) {
1662 rte_flow_error_set(error, -rc,
1663 RTE_FLOW_ERROR_TYPE_ACTION, actions,
1664 "Bad RSS action");

Callers 1

Calls 4

rte_flow_error_setFunction · 0.85
sfc_flow_parse_queueFunction · 0.85
sfc_flow_parse_rssFunction · 0.85
sfc_flow_parse_markFunction · 0.85

Tested by

no test coverage detected