Skip to content

Commit b56e4d6

Browse files
LorenzoBianconikuba-moo
authored andcommitted
net: airoha: Enforce ETS Qdisc priomap
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 <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Reviewed-by: Davide Caratti <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 62507e3 commit b56e4d6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

drivers/net/ethernet/mediatek/airoha_eth.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,7 +2793,7 @@ static int airoha_qdma_set_tx_ets_sched(struct airoha_gdm_port *port,
27932793
struct tc_ets_qopt_offload_replace_params *p = &opt->replace_params;
27942794
enum tx_sched_mode mode = TC_SCH_SP;
27952795
u16 w[AIROHA_NUM_QOS_QUEUES] = {};
2796-
int i, nstrict = 0;
2796+
int i, nstrict = 0, nwrr, qidx;
27972797

27982798
if (p->bands > AIROHA_NUM_QOS_QUEUES)
27992799
return -EINVAL;
@@ -2807,7 +2807,20 @@ static int airoha_qdma_set_tx_ets_sched(struct airoha_gdm_port *port,
28072807
if (nstrict == AIROHA_NUM_QOS_QUEUES - 1)
28082808
return -EINVAL;
28092809

2810-
for (i = 0; i < p->bands - nstrict; i++)
2810+
/* EN7581 SoC supports fixed QoS band priority where WRR queues have
2811+
* lowest priorities with respect to SP ones.
2812+
* e.g: WRR0, WRR1, .., WRRm, SP0, SP1, .., SPn
2813+
*/
2814+
nwrr = p->bands - nstrict;
2815+
qidx = nstrict && nwrr ? nstrict : 0;
2816+
for (i = 1; i <= p->bands; i++) {
2817+
if (p->priomap[i % AIROHA_NUM_QOS_QUEUES] != qidx)
2818+
return -EINVAL;
2819+
2820+
qidx = i == nwrr ? 0 : qidx + 1;
2821+
}
2822+
2823+
for (i = 0; i < nwrr; i++)
28112824
w[i] = p->weights[nstrict + i];
28122825

28132826
if (!nstrict)

0 commit comments

Comments
 (0)