On 1/16/25 01:12, Jakub Kicinski wrote:
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.
ok
+ 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
fine
to be protected by rtnl_lock()?
no, io_uring doesn't rely on it
--
Pavel Begunkov