Commit 7de85b04 authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

mlxsw: spectrum_qdisc: Index future FIFOs by band number

mlxsw used to hold an array of qdiscs indexed by the TC number. In the
previous patch, it was changed to allocate child qdiscs dynamically, and
they are now indexed by band number. Follow suit with the array of future
FIFOs.
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5cbd9602
...@@ -962,7 +962,7 @@ static int __mlxsw_sp_setup_tc_fifo(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -962,7 +962,7 @@ static int __mlxsw_sp_setup_tc_fifo(struct mlxsw_sp_port *mlxsw_sp_port,
{ {
struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc; struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc;
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc; struct mlxsw_sp_qdisc *mlxsw_sp_qdisc;
int tclass, child_index; unsigned int band;
u32 parent_handle; u32 parent_handle;
mlxsw_sp_qdisc = mlxsw_sp_qdisc_find(mlxsw_sp_port, p->parent, false); mlxsw_sp_qdisc = mlxsw_sp_qdisc_find(mlxsw_sp_port, p->parent, false);
...@@ -977,13 +977,12 @@ static int __mlxsw_sp_setup_tc_fifo(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -977,13 +977,12 @@ static int __mlxsw_sp_setup_tc_fifo(struct mlxsw_sp_port *mlxsw_sp_port,
qdisc_state->future_handle = parent_handle; qdisc_state->future_handle = parent_handle;
} }
child_index = TC_H_MIN(p->parent); band = TC_H_MIN(p->parent) - 1;
tclass = MLXSW_SP_PRIO_CHILD_TO_TCLASS(child_index); if (band < IEEE_8021QAZ_MAX_TCS) {
if (tclass < IEEE_8021QAZ_MAX_TCS) {
if (p->command == TC_FIFO_REPLACE) if (p->command == TC_FIFO_REPLACE)
qdisc_state->future_fifos[tclass] = true; qdisc_state->future_fifos[band] = true;
else if (p->command == TC_FIFO_DESTROY) else if (p->command == TC_FIFO_DESTROY)
qdisc_state->future_fifos[tclass] = false; qdisc_state->future_fifos[band] = false;
} }
} }
if (!mlxsw_sp_qdisc) if (!mlxsw_sp_qdisc)
...@@ -1117,7 +1116,7 @@ __mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port, ...@@ -1117,7 +1116,7 @@ __mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port,
} }
if (handle == qdisc_state->future_handle && if (handle == qdisc_state->future_handle &&
qdisc_state->future_fifos[tclass]) { qdisc_state->future_fifos[band]) {
err = mlxsw_sp_qdisc_replace(mlxsw_sp_port, TC_H_UNSPEC, err = mlxsw_sp_qdisc_replace(mlxsw_sp_port, TC_H_UNSPEC,
child_qdisc, child_qdisc,
&mlxsw_sp_qdisc_ops_fifo, &mlxsw_sp_qdisc_ops_fifo,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment