]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: dpaa: stop ignoring TX queues past the number of CPUs
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 13 Jul 2024 22:53:34 +0000 (01:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Jul 2024 03:26:16 +0000 (20:26 -0700)
dpaa_fq_setup() iterates through the queues allocated by dpaa_alloc_all_fqs()
and saved in &priv->dpaa_fq_list.

The allocation for FQ_TYPE_TX looks as follows:

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

Thus, iterating again through FQ_TYPE_TX queues in dpaa_fq_setup() and
counting them will never yield an egress_cnt larger than the allocated
size, dpaa_max_num_txqs().

The comparison serves no purpose since it is always true; 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-4-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

index ea1fcee77f9bf7c86821efc19a05dc2757489c8a..f844c9261571938f43a79a323e6f03a9765e46cd 100644 (file)
@@ -971,11 +971,7 @@ static int dpaa_fq_setup(struct dpaa_priv *priv,
                case FQ_TYPE_TX:
                        dpaa_setup_egress(priv, fq, tx_port,
                                          &fq_cbs->egress_ern);
-                       /* If we have more Tx queues than the number of cores,
-                        * just ignore the extra ones.
-                        */
-                       if (egress_cnt < dpaa_max_num_txqs())
-                               priv->egress_fqs[egress_cnt++] = &fq->fq_base;
+                       priv->egress_fqs[egress_cnt++] = &fq->fq_base;
                        break;
                case FQ_TYPE_TX_CONF_MQ:
                        priv->conf_fqs[conf_cnt++] = &fq->fq_base;