[dpdk-dev] [PATCH v2 1/5] ethdev: add rx interrupt enable/disable functions

Stephen Hemminger stephen at networkplumber.org
Wed Feb 4 00:42:36 CET 2015


On Tue,  3 Feb 2015 16:18:27 +0800
Zhou Danny <danny.zhou at intel.com> wrote:

> +
> +int
> +rte_eth_dev_rx_queue_intr_enable(uint8_t port_id,
> +				uint16_t queue_id)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	if (port_id >= nb_ports) {
> +		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> +		return (-ENODEV);
> +	}
> +
> +	dev = &rte_eth_devices[port_id];
> +	if (dev == NULL) {
> +		PMD_DEBUG_TRACE("Invalid port device\n");
> +		return (-ENODEV);
> +	}
> +
> +	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_enable, -ENOTSUP);
> +	(*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id);
> +	return 0;

The interrupt setup might fail for device specific reasons.
You should give the device specific function a chance to
return error as well.


More information about the dev mailing list