- /* Start expanding. */
- memset(flow_items, 0, sizeof(flow_items));
- user_pattern_size -= sizeof(*item);
- /*
- * Check if the last valid item has spec set
- * and need complete pattern.
- */
- missed_item.type = rte_flow_expand_rss_item_complete(last_item);
- if (missed_item.type != RTE_FLOW_ITEM_TYPE_VOID) {
- next = NULL;
- missed = 1;
- for (i = 0; node->next && node->next[i]; ++i) {
- next = &graph[node->next[i]];
- if (next->type == missed_item.type) {
- flow_items[0].type = missed_item.type;
- flow_items[1].type = RTE_FLOW_ITEM_TYPE_END;
- break;
- }
- next = NULL;
- }
+ shared_action = ops->shared_action_create(&rte_eth_devices[port_id],
+ conf, action, error);
+ if (shared_action == NULL)
+ flow_err(port_id, -rte_errno, error);
+ return shared_action;
+}
+
+int
+rte_flow_shared_action_destroy(uint16_t port_id,
+ struct rte_flow_shared_action *action,
+ struct rte_flow_error *error)
+{
+ int ret;
+ const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+
+ if (unlikely(!ops))
+ return -rte_errno;
+ if (unlikely(!ops->shared_action_destroy))
+ return rte_flow_error_set(error, ENOSYS,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+ NULL, rte_strerror(ENOSYS));
+ ret = ops->shared_action_destroy(&rte_eth_devices[port_id], action,
+ error);
+ return flow_err(port_id, ret, error);
+}
+
+int
+rte_flow_shared_action_update(uint16_t port_id,
+ struct rte_flow_shared_action *action,
+ const struct rte_flow_action *update,
+ struct rte_flow_error *error)
+{
+ int ret;
+ const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+
+ if (unlikely(!ops))
+ return -rte_errno;
+ if (unlikely(!ops->shared_action_update))
+ return rte_flow_error_set(error, ENOSYS,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+ NULL, rte_strerror(ENOSYS));
+ ret = ops->shared_action_update(&rte_eth_devices[port_id], action,
+ update, error);
+ return flow_err(port_id, ret, error);
+}
+
+int
+rte_flow_shared_action_query(uint16_t port_id,
+ const struct rte_flow_shared_action *action,
+ void *data,
+ struct rte_flow_error *error)
+{
+ int ret;
+ const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+
+ if (unlikely(!ops))
+ return -rte_errno;
+ if (unlikely(!ops->shared_action_query))
+ return rte_flow_error_set(error, ENOSYS,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+ NULL, rte_strerror(ENOSYS));
+ ret = ops->shared_action_query(&rte_eth_devices[port_id], action,
+ data, error);
+ return flow_err(port_id, ret, error);
+}
+
+int
+rte_flow_tunnel_decap_set(uint16_t port_id,
+ struct rte_flow_tunnel *tunnel,
+ struct rte_flow_action **actions,
+ uint32_t *num_of_actions,
+ struct rte_flow_error *error)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
+
+ if (unlikely(!ops))
+ return -rte_errno;
+ if (likely(!!ops->tunnel_decap_set)) {
+ return flow_err(port_id,
+ ops->tunnel_decap_set(dev, tunnel, actions,
+ num_of_actions, error),
+ error);