src/dpdk/lib/librte_eventdev/rte_event_eth_rx_adapter.c
static int
rxa_nb_intr_vect(struct eth_device_info *dev_info, int rx_queue_id, int add)
{
	uint16_t i;
	int n, s;
	uint16_t nbq;

	nbq = dev_info->dev->data->nb_rx_queues;
	n = 0; /* non shared count */
	s = 0; /* shared count */

	if (rx_queue_id == -1) {
		for (i = 0; i < nbq; i++) {
			if (!rxa_shared_intr(dev_info, i))
				n += add ? !rxa_intr_queue(dev_info, i) :
					rxa_intr_queue(dev_info, i);
			else
				s += add ? !rxa_intr_queue(dev_info, i) :
					rxa_intr_queue(dev_info, i);
		}

		if (s > 0) {
			if ((add && dev_info->nb_shared_intr == 0) ||
				(!add && dev_info->nb_shared_intr))
				n += 1;
		}
	} else {
		if (!rxa_shared_intr(dev_info, rx_queue_id))
			n = add ? !rxa_intr_queue(dev_info, rx_queue_id) :
				rxa_intr_queue(dev_info, rx_queue_id);
		else
			n = add ? !dev_info->nb_shared_intr :
				dev_info->nb_shared_intr == 1;
	}

	return add ? n : -n;
}
/* Calculate change in number of vectors after Rx queue ID is add/deleted */
Calculate change in number of vectors after Rx queue ID is add/deleted
Calculate change in number of vectors after Rx queue ID is add / deleted
static int
rxa_nb_intr_vect(struct eth_device_info *dev_info, int rx_queue_id, int add)
{
	uint16_t i;
	int n, s;
	uint16_t nbq;
	nbq = dev_info->dev->data->nb_rx_queues;
	n = 0; 
	s = 0; 
	if (rx_queue_id == -1) {
		for (i = 0; i < nbq; i++) {
			if (!rxa_shared_intr(dev_info, i))
				n += add ? !rxa_intr_queue(dev_info, i) :
					rxa_intr_queue(dev_info, i);
			else
				s += add ? !rxa_intr_queue(dev_info, i) :
					rxa_intr_queue(dev_info, i);
		}
		if (s > 0) {
			if ((add && dev_info->nb_shared_intr == 0) ||
				(!add && dev_info->nb_shared_intr))
				n += 1;
		}
	} else {
		if (!rxa_shared_intr(dev_info, rx_queue_id))
			n = add ? !rxa_intr_queue(dev_info, rx_queue_id) :
				rxa_intr_queue(dev_info, rx_queue_id);
		else
			n = add ? !dev_info->nb_shared_intr :
				dev_info->nb_shared_intr == 1;
	}
	return add ? n : -n;
}
static int rxa_nb_intr_vect ( struct eth_device_info * dev_info , int rx_queue_id , int add ) { uint16_t i ; int n , s ; uint16_t nbq ; nbq = dev_info -> dev -> data -> nb_rx_queues ; n = 0 ; s = 0 ; if ( rx_queue_id == -1 ) { for ( i = 0 ; i < nbq ; i ++ ) { if ( ! rxa_shared_intr ( dev_info , i ) ) n += add ? ! rxa_intr_queue ( dev_info , i ) : rxa_intr_queue ( dev_info , i ) ; else s += add ? ! rxa_intr_queue ( dev_info , i ) : rxa_intr_queue ( dev_info , i ) ; } if ( s > 0 ) { if ( ( add && dev_info -> nb_shared_intr == 0 ) || ( ! add && dev_info -> nb_shared_intr ) ) n += 1 ; } } else { if ( ! rxa_shared_intr ( dev_info , rx_queue_id ) ) n = add ? ! rxa_intr_queue ( dev_info , rx_queue_id ) : rxa_intr_queue ( dev_info , rx_queue_id ) ; else n = add ? ! dev_info -> nb_shared_intr : dev_info -> nb_shared_intr == 1 ; } return add ? n : - n ; }
Calculate change in number of vectors after Rx queue ID is add/deleted
Calculate change in number of vectors after Rx queue ID is add / deleted
/* non shared count */ /* shared count */