]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: dpaa: no need to make sure all CPUs receive a corresponding Tx queue
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 13 Jul 2024 22:53:35 +0000 (01:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Jul 2024 03:26:16 +0000 (20:26 -0700)
commit6d2338205d78bb27ec2a3e035a4c2867320a0719
tree50b06e5326ef595b18dd3702b9da40fd46bf4bc4
parente3672a6d5e89589b734fdbf1e79528b7bcafd11f
net: dpaa: no need to make sure all CPUs receive a corresponding Tx queue

dpaa_fq_setup() iterates through the &priv->dpaa_fq_list elements
allocated by dpaa_alloc_all_fqs(). This includes a call to:

if (!dpaa_fq_alloc(dev, 0, dpaa_max_num_txqs(), list, FQ_TYPE_TX))
goto fq_alloc_failed;

which gives us dpaa_max_num_txqs() elements of FQ_TYPE_TX type.

The code block which we are deleting runs after an earlier iteration
through &priv->dpaa_fq_list. So at the end of this iteration (for which
there is no early break), egress_cnt will be unconditionally equal to
dpaa_max_num_txqs().

In other words, dpaa_alloc_all_fqs() has already allocated TX queues for
all possible CPUs and the maximal number of traffic classes, and we've
already iterated once through them all.

The while() condition is dead code, remove it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Link: https://patch.msgid.link/20240713225336.1746343-5-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c