Skip to content

Commit

Permalink
net: airoha: Enforce ETS Qdisc priomap
Browse files Browse the repository at this point in the history
EN7581 SoC supports fixed QoS band priority where WRR queues have lowest
priorities with respect to SP ones.
E.g: WRR0, WRR1, .., WRRm, SP0, SP1, .., SPn

Enforce ETS Qdisc priomap according to the hw capabilities.

Suggested-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Davide Caratti <dcaratti@redhat.com>
Link: https://patch.msgid.link/20250112-airoha_ets_priomap-v1-1-fb616de159ba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Lorenzo Bianconi authored and Jakub Kicinski committed Jan 14, 2025
1 parent 62507e3 commit b56e4d6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions drivers/net/ethernet/mediatek/airoha_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2793,7 +2793,7 @@ static int airoha_qdma_set_tx_ets_sched(struct airoha_gdm_port *port,
struct tc_ets_qopt_offload_replace_params *p = &opt->replace_params;
enum tx_sched_mode mode = TC_SCH_SP;
u16 w[AIROHA_NUM_QOS_QUEUES] = {};
int i, nstrict = 0;
int i, nstrict = 0, nwrr, qidx;

if (p->bands > AIROHA_NUM_QOS_QUEUES)
return -EINVAL;
Expand All @@ -2807,7 +2807,20 @@ static int airoha_qdma_set_tx_ets_sched(struct airoha_gdm_port *port,
if (nstrict == AIROHA_NUM_QOS_QUEUES - 1)
return -EINVAL;

for (i = 0; i < p->bands - nstrict; i++)
/* EN7581 SoC supports fixed QoS band priority where WRR queues have
* lowest priorities with respect to SP ones.
* e.g: WRR0, WRR1, .., WRRm, SP0, SP1, .., SPn
*/
nwrr = p->bands - nstrict;
qidx = nstrict && nwrr ? nstrict : 0;
for (i = 1; i <= p->bands; i++) {
if (p->priomap[i % AIROHA_NUM_QOS_QUEUES] != qidx)
return -EINVAL;

qidx = i == nwrr ? 0 : qidx + 1;
}

for (i = 0; i < nwrr; i++)
w[i] = p->weights[nstrict + i];

if (!nstrict)
Expand Down

0 comments on commit b56e4d6

Please sign in to comment.