Subject: Re: [PATCH net-next v10 18/22] io_uring/zcrx: set pp memory provider for an rx queue

From: Jakub Kicinski <[email-masked]>
Date: Wed, 15 Jan 2025 17:12:57 -0800

On Wed,  8 Jan 2025 14:06:39 -0800 David Wei wrote:
> +	ASSERT_RTNL();
> +
> +	if (ifq_idx >= dev->num_rx_queues)

_real_ rx queues.

We don't allow configuring disabled queues today.

> +		return -EINVAL;
> +	ifq_idx = array_index_nospec(ifq_idx, dev->num_rx_queues);
> +
> +	rxq = __netif_get_rx_queue(ifq->dev, ifq_idx);
> +	if (rxq->mp_params.mp_priv)
> +		return -EEXIST;
> +
> +	ifq->if_rxq = ifq_idx;
> +	rxq->mp_params.mp_ops = &io_uring_pp_zc_ops;
> +	rxq->mp_params.mp_priv = ifq;
> +	ret = netdev_rx_queue_restart(ifq->dev, ifq->if_rxq);
> +	if (ret)
> +		goto fail;

Hm. Could you move all this (and the rtnl_lock() in the caller) 
to a helper under net/ ? Or does something io_uring-y here need 
to be protected by rtnl_lock()?