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: introduce a trivial netdev_queue_config()

We may choose to extend or reimplement the logic which renders
the per-queue config. The drivers should not poke directly into
the queue state. Add a helper for drivers to use when they want
to query the config for a specific queue.

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

+39 -3
+3 -3
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 4326 4326 4327 4327 for (i = 0; i < bp->cp_nr_rings; i++) { 4328 4328 struct bnxt_napi *bnapi = bp->bnapi[i]; 4329 + struct netdev_queue_config qcfg; 4329 4330 struct bnxt_ring_mem_info *rmem; 4330 4331 struct bnxt_cp_ring_info *cpr; 4331 4332 struct bnxt_rx_ring_info *rxr; 4332 4333 struct bnxt_tx_ring_info *txr; 4333 4334 struct bnxt_ring_struct *ring; 4334 - struct netdev_rx_queue *rxq; 4335 4335 4336 4336 if (!bnapi) 4337 4337 continue; ··· 4349 4349 if (!rxr) 4350 4350 goto skip_rx; 4351 4351 4352 - rxq = __netif_get_rx_queue(bp->dev, i); 4353 - rxr->rx_page_size = rxq->qcfg.rx_page_size; 4352 + netdev_queue_config(bp->dev, i, &qcfg); 4353 + rxr->rx_page_size = qcfg.rx_page_size; 4354 4354 4355 4355 ring = &rxr->rx_ring_struct; 4356 4356 rmem = &ring->ring_mem;
+3
include/net/netdev_queues.h
··· 170 170 unsigned int supported_params; 171 171 }; 172 172 173 + void netdev_queue_config(struct net_device *dev, int rxq, 174 + struct netdev_queue_config *qcfg); 175 + 173 176 bool netif_rxq_has_unreadable_mp(struct net_device *dev, int idx); 174 177 175 178 /**
+1
net/core/Makefile
··· 19 19 20 20 obj-y += net-sysfs.o 21 21 obj-y += hotdata.o 22 + obj-y += netdev_config.o 22 23 obj-y += netdev_rx_queue.o 23 24 obj-y += netdev_queues.o 24 25 obj-$(CONFIG_PAGE_POOL) += page_pool.o page_pool_user.o
+32
net/core/netdev_config.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + 3 + #include <linux/netdevice.h> 4 + #include <net/netdev_queues.h> 5 + #include <net/netdev_rx_queue.h> 6 + 7 + /** 8 + * netdev_queue_config() - get configuration for a given queue 9 + * @dev: net_device instance 10 + * @rxq_idx: index of the queue of interest 11 + * @qcfg: queue configuration struct (output) 12 + * 13 + * Render the configuration for a given queue. This helper should be used 14 + * by drivers which support queue configuration to retrieve config for 15 + * a particular queue. 16 + * 17 + * @qcfg is an output parameter and is always fully initialized by this 18 + * function. Some values may not be set by the user, drivers may either 19 + * deal with the "unset" values in @qcfg, or provide the callback 20 + * to populate defaults in queue_management_ops. 21 + */ 22 + void netdev_queue_config(struct net_device *dev, int rxq_idx, 23 + struct netdev_queue_config *qcfg) 24 + { 25 + struct netdev_queue_config *stored; 26 + 27 + memset(qcfg, 0, sizeof(*qcfg)); 28 + 29 + stored = &__netif_get_rx_queue(dev, rxq_idx)->qcfg; 30 + qcfg->rx_page_size = stored->rx_page_size; 31 + } 32 + EXPORT_SYMBOL(netdev_queue_config);