]> git.ipfire.org Git - thirdparty/linux.git/commit
net: macb: remove bp->queue_mask
authorThéo Lebrun <theo.lebrun@bootlin.com>
Tue, 14 Oct 2025 15:25:11 +0000 (17:25 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 23:59:27 +0000 (16:59 -0700)
commit39a913db6a47fd988353cf83f0ccd6a1ee6e2db3
treebbc04aafef7de8fe47db4ef3e59e5a374b36aa9c
parent02d11c610555657f8524a56bab6856fa8d6ace71
net: macb: remove bp->queue_mask

The low 16 bits of GEM_DCFG6 tell us which queues are enabled in HW. In
theory, there could be holes in the bitfield. In practice, the macb
driver would fail if there were holes as most loops iterate upon
bp->num_queues. Only macb_init() iterated correctly.

 - Drop bp->queue_mask field.
 - Error out at probe if a hole is in the queue mask.
 - Rely upon bp->num_queues for iteration.
 - As we drop the queue_mask probe local variable, fix RCT.
 - Compute queue_mask on the fly for TAPRIO using bp->num_queues.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://patch.msgid.link/20251014-macb-cleanup-v1-10-31cd266e22cd@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/cadence/macb_main.c