public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
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 <kuba@kernel.org>
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	[thread overview]
Message-ID: <20260122005113.2476634-4-kuba@kernel.org> (raw)
In-Reply-To: <20260122005113.2476634-1-kuba@kernel.org>

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 <kuba@kernel.org>
---
 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


  parent reply	other threads:[~2026-01-22  0:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22  0:51 [PATCH net-next 0/6] net: restore the structure of driver-facing qcfg API Jakub Kicinski
2026-01-22  0:51 ` [PATCH net-next 1/6] eth: bnxt: always set the queue mgmt ops Jakub Kicinski
2026-01-22  8:04   ` Subbaraya Sundeep
2026-01-22 15:36     ` Jakub Kicinski
2026-01-22 16:31       ` Subbaraya Sundeep
2026-01-22  0:51 ` [PATCH net-next 2/6] net: introduce a trivial netdev_queue_config() Jakub Kicinski
2026-01-22  8:12   ` Subbaraya Sundeep
2026-01-22 15:36     ` Jakub Kicinski
2026-01-22  0:51 ` Jakub Kicinski [this message]
2026-01-22  0:51 ` [PATCH net-next 4/6] net: use netdev_queue_config() for mp restart Jakub Kicinski
2026-01-22 15:06   ` Dragos Tatulea
2026-01-22 15:46     ` Jakub Kicinski
2026-01-22 16:28       ` Dragos Tatulea
2026-01-23  1:41         ` Jakub Kicinski
2026-01-22  0:51 ` [PATCH net-next 5/6] net: add queue config validation callback Jakub Kicinski
2026-01-22  0:51 ` [PATCH net-next 6/6] eth: bnxt: plug bnxt_validate_qcfg() into qops Jakub Kicinski
2026-01-23 21:20 ` [PATCH net-next 0/6] net: restore the structure of driver-facing qcfg API patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260122005113.2476634-4-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=asml.silence@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox