[PATCH v3] examples/kni: add interrupt mode to receive packets

Stephen Hemminger stephen at networkplumber.org
Fri Apr 8 17:15:52 CEST 2022


On Fri,  8 Apr 2022 17:12:06 +0800
Tianli Lai <laitianli at tom.com> wrote:
> +	if (status[lcore].wakeup) {
> +		RTE_LOG(INFO, APP,
> +				"lcore %u sleeps until interrupt triggers\n",
> +				rte_lcore_id());
> +	}

Shouldn't the be at DEBUG level.

> +		/* initialize spinlock for each port */
> +		rte_spinlock_init(&(locks[i]));

This comment seems rather obvious and unneeded.

> +static void
> +turn_on_off_intr(uint16_t port_id, uint16_t queue_id, bool on)
> +{
> +	rte_spinlock_lock(&(locks[port_id]));
> +	if (on)
> +		rte_eth_dev_rx_intr_enable(port_id, queue_id);
> +	else
> +		rte_eth_dev_rx_intr_disable(port_id, queue_id);
> +	rte_spinlock_unlock(&(locks[port_id]));
> +}

Since Rx queue can not safely shared between cores, why do you need
lock at all?


More information about the dev mailing list