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

Function mlx5_flow_validate_action_queue

dpdk/drivers/net/mlx5/mlx5_flow.c:2137–2173  ·  view source on GitHub ↗

* Validate the queue action. * * @param[in] action * Pointer to the queue action. * @param[in] action_flags * Bit-fields that holds the actions detected until now. * @param[in] dev * Pointer to the Ethernet device structure. * @param[in] attr * Attributes of flow that includes this action. * @param[out] error * Pointer to error structure. * * @return * 0 on success, a neg

Source from the content-addressed store, hash-verified

2135 * 0 on success, a negative errno value otherwise and rte_errno is set.
2136 */
2137int
2138mlx5_flow_validate_action_queue(const struct rte_flow_action *action,
2139 uint64_t action_flags,
2140 struct rte_eth_dev *dev,
2141 const struct rte_flow_attr *attr,
2142 struct rte_flow_error *error)
2143{
2144 struct mlx5_priv *priv = dev->data->dev_private;
2145 const struct rte_flow_action_queue *queue = action->conf;
2146
2147 if (action_flags & MLX5_FLOW_FATE_ACTIONS)
2148 return rte_flow_error_set(error, EINVAL,
2149 RTE_FLOW_ERROR_TYPE_ACTION, NULL,
2150 "can't have 2 fate actions in"
2151 " same flow");
2152 if (attr->egress)
2153 return rte_flow_error_set(error, ENOTSUP,
2154 RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, NULL,
2155 "queue action not supported for egress.");
2156 if (mlx5_is_external_rxq(dev, queue->index))
2157 return 0;
2158 if (!priv->rxqs_n)
2159 return rte_flow_error_set(error, EINVAL,
2160 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2161 NULL, "No Rx queues configured");
2162 if (queue->index >= priv->rxqs_n)
2163 return rte_flow_error_set(error, EINVAL,
2164 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2165 &queue->index,
2166 "queue index out of range");
2167 if (mlx5_rxq_get(dev, queue->index) == NULL)
2168 return rte_flow_error_set(error, EINVAL,
2169 RTE_FLOW_ERROR_TYPE_ACTION_CONF,
2170 &queue->index,
2171 "queue is not configured");
2172 return 0;
2173}
2174
2175/**
2176 * Validate queue numbers for device RSS.

Callers 4

flow_dv_validateFunction · 0.85
flow_verbs_validateFunction · 0.85

Calls 3

rte_flow_error_setFunction · 0.85
mlx5_is_external_rxqFunction · 0.85
mlx5_rxq_getFunction · 0.85

Tested by

no test coverage detected