From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68CE2311592 for ; Thu, 22 Jan 2026 00:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769043093; cv=none; b=nmA+nH3bFhVibHZQ/Pq7QbH9MmqixyJ4Yir8n+IjRhcp2A1H7bqKpLORWkYgMzxlpVbDRiZq4KWkfx3n3iRGHMvCQ3tXVrtr3eP2d7tkisuWaB28sRDAT90a2c4plgNYj+i4GwadI4HrDVJ2OcvSaSqTae1nBt2u9ImlRUO9nOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769043093; c=relaxed/simple; bh=ReDhAJCdPwGrXsyM0mq8tQmhNwxFBOhBnblfuSRuvBo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QWbimJgJ2FEW/6N0qqG37VUalTBw5jDvY0g3UGMGHzXukTgV8OEAwLsIoI9LldIT2KVPQHSCDduNQitKO7i6UR5PkysX993UuAfhaqM2CpblJdTSQy2249HI9kGES7p6j53C65yJVb3VBWwOisql/pef7RUVTAprYjBiK1iTfZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vCn5LJFv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vCn5LJFv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 920DEC2BC86; Thu, 22 Jan 2026 00:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769043093; bh=ReDhAJCdPwGrXsyM0mq8tQmhNwxFBOhBnblfuSRuvBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vCn5LJFvB3mnbXV77MlnFZn4r/KzSiDLZQRh3jVU2m6d1jLEhevhCNLxrj4hxTHmO O0w2RCv8VvwNNyW+7StyKBJnHNEcLJgCunmk39vOOoLqKjagkLncWeV+YG0fpCgzVH fo8JOiqOpg3NCMY9Yhz1esnCf0q05ILCB7SI2yP/0TZvkGfMJmzuAVrQhFFY0s765b vcNcIzM2TiqaM29DfBzrKkMXIBeRspQcIIRUmAqu9g2lefT1VQsjKFTWcg1YLjbecH Jm84fy7xvSKmMfTCgNaaujJ87xEBSRD++z0t2oCHpWr39KnxpBXt2x4c2FQduvimGE ww3kq4N/JbFxA== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, michael.chan@broadcom.com, sdf@fomichev.me, almasrymina@google.com, dtatulea@nvidia.com, asml.silence@gmail.com, dw@davidwei.uk, daniel@iogearbox.net, Jakub Kicinski Subject: [PATCH net-next 3/6] net: move mp->rx_page_size validation to __net_mp_open_rxq() Date: Wed, 21 Jan 2026 16:51:10 -0800 Message-ID: <20260122005113.2476634-4-kuba@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260122005113.2476634-1-kuba@kernel.org> References: <20260122005113.2476634-1-kuba@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Jakub Kicinski --- net/core/netdev_rx_queue.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/core/netdev_rx_queue.c b/net/core/netdev_rx_queue.c index b81cad90ba2f..03d7531abb3a 100644 --- a/net/core/netdev_rx_queue.c +++ b/net/core/netdev_rx_queue.c @@ -39,11 +39,8 @@ int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq_idx) 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; + if (rxq->mp_params.rx_page_size) qcfg.rx_page_size = rxq->mp_params.rx_page_size; - } new_mem = kvzalloc(qops->ndo_queue_mem_size, GFP_KERNEL); if (!new_mem) @@ -115,6 +112,7 @@ int __net_mp_open_rxq(struct net_device *dev, unsigned int rxq_idx, const struct pp_memory_provider_params *p, struct netlink_ext_ack *extack) { + const struct netdev_queue_mgmt_ops *qops = dev->queue_mgmt_ops; struct netdev_rx_queue *rxq; int ret; @@ -139,6 +137,10 @@ int __net_mp_open_rxq(struct net_device *dev, unsigned int rxq_idx, NL_SET_ERR_MSG(extack, "unable to custom memory provider to device with XDP program attached"); return -EEXIST; } + if (p->rx_page_size && !(qops->supported_params & QCFG_RX_PAGE_SIZE)) { + NL_SET_ERR_MSG(extack, "device does not support: rx_page_size"); + return -EOPNOTSUPP; + } rxq = __netif_get_rx_queue(dev, rxq_idx); if (rxq->mp_params.mp_ops) { -- 2.52.0