src/dpdk/lib/librte_ethdev/rte_flow.c
const struct rte_flow_ops *
rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error)
{
	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
	const struct rte_flow_ops *ops;
	int code;

	if (unlikely(!rte_eth_dev_is_valid_port(port_id)))
		code = ENODEV;
	else if (unlikely(!dev->dev_ops->filter_ctrl ||
			  dev->dev_ops->filter_ctrl(dev,
						    RTE_ETH_FILTER_GENERIC,
						    RTE_ETH_FILTER_GET,
						    &ops) ||
			  !ops))
		code = ENOSYS;
	else
		return ops;
	rte_flow_error_set(error, code, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
			   NULL, rte_strerror(code));
	return NULL;
}
/* Get generic flow operations structure from a port. */
Get generic flow operations structure from a port.
Get generic flow operations structure from a port .
const struct rte_flow_ops *
rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error)
{
	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
	const struct rte_flow_ops *ops;
	int code;
	if (unlikely(!rte_eth_dev_is_valid_port(port_id)))
		code = ENODEV;
	else if (unlikely(!dev->dev_ops->filter_ctrl ||
			  dev->dev_ops->filter_ctrl(dev,
						    RTE_ETH_FILTER_GENERIC,
						    RTE_ETH_FILTER_GET,
						    &ops) ||
			  !ops))
		code = ENOSYS;
	else
		return ops;
	rte_flow_error_set(error, code, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
			   NULL, rte_strerror(code));
	return NULL;
}
const struct rte_flow_ops * rte_flow_ops_get ( uint16_t port_id , struct rte_flow_error * error ) { struct rte_eth_dev * dev = & rte_eth_devices [ port_id ] ; const struct rte_flow_ops * ops ; int code ; if ( unlikely ( ! rte_eth_dev_is_valid_port ( port_id ) ) ) code = ENODEV ; else if ( unlikely ( ! dev -> dev_ops -> filter_ctrl || dev -> dev_ops -> filter_ctrl ( dev , RTE_ETH_FILTER_GENERIC , RTE_ETH_FILTER_GET , & ops ) || ! ops ) ) code = ENOSYS ; else return ops ; rte_flow_error_set ( error , code , RTE_FLOW_ERROR_TYPE_UNSPECIFIED , NULL , rte_strerror ( code ) ) ; return NULL ; }
Get generic flow operations structure from a port.
Get generic flow operations structure from a port .