Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: move mp->rx_page_size validation to __net_mp_open_rxq()

Move mp->rx_page_size validation where the rest of MP input
validation lives. No other caller is modifying mp params so
validation logic in queue restarts is out of place.

Link: https://patch.msgid.link/20260122005113.2476634-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+6 -4
+6 -4
net/core/netdev_rx_queue.c
··· 39 39 if (qops->ndo_default_qcfg) 40 40 qops->ndo_default_qcfg(dev, &qcfg); 41 41 42 - if (rxq->mp_params.rx_page_size) { 43 - if (!(qops->supported_params & QCFG_RX_PAGE_SIZE)) 44 - return -EOPNOTSUPP; 42 + if (rxq->mp_params.rx_page_size) 45 43 qcfg.rx_page_size = rxq->mp_params.rx_page_size; 46 - } 47 44 48 45 new_mem = kvzalloc(qops->ndo_queue_mem_size, GFP_KERNEL); 49 46 if (!new_mem) ··· 112 115 const struct pp_memory_provider_params *p, 113 116 struct netlink_ext_ack *extack) 114 117 { 118 + const struct netdev_queue_mgmt_ops *qops = dev->queue_mgmt_ops; 115 119 struct netdev_rx_queue *rxq; 116 120 int ret; 117 121 ··· 136 138 if (dev_xdp_prog_count(dev)) { 137 139 NL_SET_ERR_MSG(extack, "unable to custom memory provider to device with XDP program attached"); 138 140 return -EEXIST; 141 + } 142 + if (p->rx_page_size && !(qops->supported_params & QCFG_RX_PAGE_SIZE)) { 143 + NL_SET_ERR_MSG(extack, "device does not support: rx_page_size"); 144 + return -EOPNOTSUPP; 139 145 } 140 146 141 147 rxq = __netif_get_rx_queue(dev, rxq_idx);