Get generic flow operations structure from a port. */
| 332 | |
| 333 | /* Get generic flow operations structure from a port. */ |
| 334 | const struct rte_flow_ops * |
| 335 | rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error) |
| 336 | { |
| 337 | struct rte_eth_dev *dev = &rte_eth_devices[port_id]; |
| 338 | const struct rte_flow_ops *ops; |
| 339 | int code; |
| 340 | |
| 341 | if (unlikely(!rte_eth_dev_is_valid_port(port_id))) |
| 342 | code = ENODEV; |
| 343 | else if (unlikely(dev->dev_ops->flow_ops_get == NULL)) |
| 344 | /* flow API not supported with this driver dev_ops */ |
| 345 | code = ENOSYS; |
| 346 | else |
| 347 | code = dev->dev_ops->flow_ops_get(dev, &ops); |
| 348 | if (code == 0 && ops == NULL) |
| 349 | /* flow API not supported with this device */ |
| 350 | code = ENOSYS; |
| 351 | |
| 352 | if (code != 0) { |
| 353 | rte_flow_error_set(error, code, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, |
| 354 | NULL, rte_strerror(code)); |
| 355 | return NULL; |
| 356 | } |
| 357 | return ops; |
| 358 | } |
| 359 | |
| 360 | /* Check whether a flow rule can be created on a given port. */ |
| 361 | int |
no test coverage detected