Push all the queue operations in the queue to the NIC. */
| 3255 | |
| 3256 | /** Push all the queue operations in the queue to the NIC. */ |
| 3257 | int |
| 3258 | port_queue_flow_push(portid_t port_id, queueid_t queue_id) |
| 3259 | { |
| 3260 | struct rte_port *port; |
| 3261 | struct rte_flow_error error; |
| 3262 | int ret = 0; |
| 3263 | |
| 3264 | if (port_id_is_invalid(port_id, ENABLED_WARN) || |
| 3265 | port_id == (portid_t)RTE_PORT_ALL) |
| 3266 | return -EINVAL; |
| 3267 | port = &ports[port_id]; |
| 3268 | |
| 3269 | if (queue_id >= port->queue_nb) { |
| 3270 | printf("Queue #%u is invalid\n", queue_id); |
| 3271 | return -EINVAL; |
| 3272 | } |
| 3273 | |
| 3274 | memset(&error, 0x55, sizeof(error)); |
| 3275 | ret = rte_flow_push(port_id, queue_id, &error); |
| 3276 | if (ret < 0) { |
| 3277 | printf("Failed to push operations in the queue\n"); |
| 3278 | return -EINVAL; |
| 3279 | } |
| 3280 | printf("Queue #%u operations pushed\n", queue_id); |
| 3281 | return ret; |
| 3282 | } |
| 3283 | |
| 3284 | /** Calculate the hash result for a given pattern in a given table. */ |
| 3285 | int |
no test coverage detected