From c0b709bf438ba9d197d369f55e4a97603fd4a705 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Tue, 6 Jan 2026 13:25:40 +0000 Subject: net: pass queue rx page size from memory provider Allow memory providers to configure rx queues with a custom receive page size. It's passed in struct pp_memory_provider_params, which is copied into the queue, so it's preserved across queue restarts. Then, it's propagated to the driver in a new queue config parameter. Drivers should explicitly opt into using it by setting QCFG_RX_PAGE_SIZE, in which case they should implement ndo_default_qcfg, validate the size on queue restart and honour the current config in case of a reset. Signed-off-by: Pavel Begunkov --- net/core/netdev_rx_queue.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'net/core/netdev_rx_queue.c') diff --git a/net/core/netdev_rx_queue.c b/net/core/netdev_rx_queue.c index 86d1c0a925e3..b81cad90ba2f 100644 --- a/net/core/netdev_rx_queue.c +++ b/net/core/netdev_rx_queue.c @@ -30,12 +30,21 @@ int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq_idx) !qops->ndo_queue_mem_alloc || !qops->ndo_queue_start) return -EOPNOTSUPP; + if (WARN_ON_ONCE(qops->supported_params && !qops->ndo_default_qcfg)) + return -EINVAL; + netdev_assert_locked(dev); memset(&qcfg, 0, sizeof(qcfg)); if (qops->ndo_default_qcfg) qops->ndo_default_qcfg(dev, &qcfg); + if (rxq->mp_params.rx_page_size) { + if (!(qops->supported_params & QCFG_RX_PAGE_SIZE)) + return -EOPNOTSUPP; + qcfg.rx_page_size = rxq->mp_params.rx_page_size; + } + new_mem = kvzalloc(qops->ndo_queue_mem_size, GFP_KERNEL); if (!new_mem) return -ENOMEM; -- cgit v1.2.3