src/dpdk/drivers/net/failsafe/failsafe_intr.c
int failsafe_rx_intr_install_subdevice(struct sub_device *sdev)
{
	int rc;
	int qid;
	struct rte_eth_dev *fsdev;
	struct rxq **rxq;
	const struct rte_intr_conf *const intr_conf =
				&ETH(sdev)->data->dev_conf.intr_conf;

	fsdev = fs_dev(sdev);
	rxq = (struct rxq **)fsdev->data->rx_queues;
	if (intr_conf->rxq == 0)
		return 0;
	rc = failsafe_eth_rx_intr_ctl_subdevice(sdev, RTE_INTR_EVENT_ADD);
	if (rc)
		return rc;
	/* enable interrupts on already-enabled queues */
	for (qid = 0; qid < ETH(sdev)->data->nb_rx_queues; qid++) {
		if (rxq[qid]->enable_events) {
			int ret = rte_eth_dev_rx_intr_enable(PORT_ID(sdev),
							     qid);
			if (ret && (ret != -ENOTSUP)) {
				ERROR("Failed to enable interrupts on "
				      "port %d queue %d", PORT_ID(sdev), qid);
				rc = ret;
			}
		}
	}
	return rc;
}
/**
 * Install Rx interrupts subsystem for a subdevice.
 * This is a support for dynamically adding subdevices.
 *
 * @param sdev
 *   Pointer to subdevice structure.
 *
 * @return
 *   0 on success, negative errno value otherwise and rte_errno is set.
 */
Install Rx interrupts subsystem for a subdevice.
This is a support for dynamically adding subdevices.

@param sdev
Pointer to subdevice structure.

@return
0 on success, negative errno value otherwise and rte_errno is set.
Install Rx interrupts subsystem for a subdevice . This is a support for dynamically adding subdevices . @param sdev Pointer to subdevice structure . @return 0 on success negative errno value otherwise and rte_errno is set .
int failsafe_rx_intr_install_subdevice(struct sub_device *sdev)
{
	int rc;
	int qid;
	struct rte_eth_dev *fsdev;
	struct rxq **rxq;
	const struct rte_intr_conf *const intr_conf =
				&ETH(sdev)->data->dev_conf.intr_conf;
	fsdev = fs_dev(sdev);
	rxq = (struct rxq **)fsdev->data->rx_queues;
	if (intr_conf->rxq == 0)
		return 0;
	rc = failsafe_eth_rx_intr_ctl_subdevice(sdev, RTE_INTR_EVENT_ADD);
	if (rc)
		return rc;
	for (qid = 0; qid < ETH(sdev)->data->nb_rx_queues; qid++) {
		if (rxq[qid]->enable_events) {
			int ret = rte_eth_dev_rx_intr_enable(PORT_ID(sdev),
							     qid);
			if (ret && (ret != -ENOTSUP)) {
				ERROR("Failed to enable interrupts on "
				      "port %d queue %d", PORT_ID(sdev), qid);
				rc = ret;
			}
		}
	}
	return rc;
}
int failsafe_rx_intr_install_subdevice ( struct sub_device * sdev ) { int rc ; int qid ; struct rte_eth_dev * fsdev ; struct rxq * * rxq ; const struct rte_intr_conf * const intr_conf = & ETH ( sdev ) -> data -> dev_conf . intr_conf ; fsdev = fs_dev ( sdev ) ; rxq = ( struct rxq * * ) fsdev -> data -> rx_queues ; if ( intr_conf -> rxq == 0 ) return 0 ; rc = failsafe_eth_rx_intr_ctl_subdevice ( sdev , RTE_INTR_EVENT_ADD ) ; if ( rc ) return rc ; for ( qid = 0 ; qid < ETH ( sdev ) -> data -> nb_rx_queues ; qid ++ ) { if ( rxq [ qid ] -> enable_events ) { int ret = rte_eth_dev_rx_intr_enable ( PORT_ID ( sdev ) , qid ) ; if ( ret && ( ret != - ENOTSUP ) ) { ERROR ( " " " " , PORT_ID ( sdev ) , qid ) ; rc = ret ; } } } return rc ; }
Install Rx interrupts subsystem for a subdevice.
Install Rx interrupts subsystem for a subdevice .
/* enable interrupts on already-enabled queues */