Skip to content

Commit 7d0da8f

Browse files
LorenzoBianconikuba-moo
authored andcommitted
net: airoha: Fix channel configuration for ETS Qdisc
Limit ETS QoS channel to AIROHA_NUM_QOS_CHANNELS in airoha_tc_setup_qdisc_ets() in order to align the configured channel to the value set in airoha_dev_select_queue(). Fixes: 20bf7d0 ("net: airoha: Add sched ETS offload support") Signed-off-by: Lorenzo Bianconi <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 10bc976 commit 7d0da8f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/mediatek/airoha_eth.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2840,11 +2840,14 @@ static int airoha_qdma_get_tx_ets_stats(struct airoha_gdm_port *port,
28402840
static int airoha_tc_setup_qdisc_ets(struct airoha_gdm_port *port,
28412841
struct tc_ets_qopt_offload *opt)
28422842
{
2843-
int channel = TC_H_MAJ(opt->handle) >> 16;
2843+
int channel;
28442844

28452845
if (opt->parent == TC_H_ROOT)
28462846
return -EINVAL;
28472847

2848+
channel = TC_H_MAJ(opt->handle) >> 16;
2849+
channel = channel % AIROHA_NUM_QOS_CHANNELS;
2850+
28482851
switch (opt->command) {
28492852
case TC_ETS_REPLACE:
28502853
return airoha_qdma_set_tx_ets_sched(port, channel, opt);

0 commit comments

Comments
 (0)