Skip to content

Commit 6d23382

Browse files
vladimirolteankuba-moo
authored andcommitted
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 <[email protected]> Acked-by: Madalin Bucur <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e3672a6 commit 6d23382

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -989,17 +989,6 @@ static int dpaa_fq_setup(struct dpaa_priv *priv,
989989
}
990990
}
991991

992-
/* Make sure all CPUs receive a corresponding Tx queue. */
993-
while (egress_cnt < dpaa_max_num_txqs()) {
994-
list_for_each_entry(fq, &priv->dpaa_fq_list, list) {
995-
if (fq->fq_type != FQ_TYPE_TX)
996-
continue;
997-
priv->egress_fqs[egress_cnt++] = &fq->fq_base;
998-
if (egress_cnt == dpaa_max_num_txqs())
999-
break;
1000-
}
1001-
}
1002-
1003992
kfree(channels);
1004993

1005994
return 0;

0 commit comments

Comments
 (0)