* Internal flow parse/validate function. * * @param dev[in] * This device pointer. * @param pattern[in] * @param actions[in] * @param error[out] * @param enic_filter[out] * Internal NIC filter structure pointer. * @param enic_action[out] * Internal NIC action structure pointer. */
| 1495 | * Internal NIC action structure pointer. |
| 1496 | */ |
| 1497 | static int |
| 1498 | enic_flow_parse(struct rte_eth_dev *dev, |
| 1499 | const struct rte_flow_attr *attrs, |
| 1500 | const struct rte_flow_item pattern[], |
| 1501 | const struct rte_flow_action actions[], |
| 1502 | struct rte_flow_error *error, |
| 1503 | struct filter_v2 *enic_filter, |
| 1504 | struct filter_action_v2 *enic_action) |
| 1505 | { |
| 1506 | unsigned int ret = 0; |
| 1507 | struct enic *enic = pmd_priv(dev); |
| 1508 | const struct enic_filter_cap *enic_filter_cap; |
| 1509 | const struct enic_action_cap *enic_action_cap; |
| 1510 | const struct rte_flow_action *action; |
| 1511 | |
| 1512 | ENICPMD_FUNC_TRACE(); |
| 1513 | |
| 1514 | memset(enic_filter, 0, sizeof(*enic_filter)); |
| 1515 | memset(enic_action, 0, sizeof(*enic_action)); |
| 1516 | |
| 1517 | if (!pattern) { |
| 1518 | rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM_NUM, |
| 1519 | NULL, "No pattern specified"); |
| 1520 | return -rte_errno; |
| 1521 | } |
| 1522 | |
| 1523 | if (!actions) { |
| 1524 | rte_flow_error_set(error, EINVAL, |
| 1525 | RTE_FLOW_ERROR_TYPE_ACTION_NUM, |
| 1526 | NULL, "No action specified"); |
| 1527 | return -rte_errno; |
| 1528 | } |
| 1529 | |
| 1530 | if (attrs) { |
| 1531 | if (attrs->group) { |
| 1532 | rte_flow_error_set(error, ENOTSUP, |
| 1533 | RTE_FLOW_ERROR_TYPE_ATTR_GROUP, |
| 1534 | NULL, |
| 1535 | "priority groups are not supported"); |
| 1536 | return -rte_errno; |
| 1537 | } else if (attrs->priority) { |
| 1538 | rte_flow_error_set(error, ENOTSUP, |
| 1539 | RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, |
| 1540 | NULL, |
| 1541 | "priorities are not supported"); |
| 1542 | return -rte_errno; |
| 1543 | } else if (attrs->egress) { |
| 1544 | rte_flow_error_set(error, ENOTSUP, |
| 1545 | RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, |
| 1546 | NULL, |
| 1547 | "egress is not supported"); |
| 1548 | return -rte_errno; |
| 1549 | } else if (attrs->transfer) { |
| 1550 | rte_flow_error_set(error, ENOTSUP, |
| 1551 | RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, |
| 1552 | NULL, |
| 1553 | "transfer is not supported"); |
| 1554 | return -rte_errno; |
no test coverage detected