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

Function flow_hw_validate_attributes

dpdk/drivers/net/mlx5/mlx5_flow_hw.c:9314–9344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9312}
9313
9314static int
9315flow_hw_validate_attributes(const struct rte_flow_port_attr *port_attr,
9316 uint16_t nb_queue,
9317 const struct rte_flow_queue_attr *queue_attr[],
9318 struct rte_flow_error *error)
9319{
9320 uint32_t size;
9321 unsigned int i;
9322
9323 if (port_attr == NULL)
9324 return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
9325 "Port attributes must be non-NULL");
9326
9327 if (nb_queue == 0)
9328 return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
9329 "At least one flow queue is required");
9330
9331 if (queue_attr == NULL)
9332 return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
9333 "Queue attributes must be non-NULL");
9334
9335 size = queue_attr[0]->size;
9336 for (i = 1; i < nb_queue; ++i) {
9337 if (queue_attr[i]->size != size)
9338 return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
9339 NULL,
9340 "All flow queues must have the same size");
9341 }
9342
9343 return 0;
9344}
9345
9346/**
9347 * Configure port HWS resources.

Callers 1

flow_hw_configureFunction · 0.85

Calls 1

rte_flow_error_setFunction · 0.85

Tested by

no test coverage detected