aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2025-01-07 23:26:28 +0100
committerJakub Kicinski <kuba@kernel.org>2025-01-11 13:09:10 -0800
commit7d0da8f862340c5f42f0062b8560b8d0971a6ac4 (patch)
tree84d0e53f16bf71440623200d37fd2c2b34d63d38
parentnet/smc: delete pointless divide by one (diff)
downloadwireguard-linux-7d0da8f862340c5f42f0062b8560b8d0971a6ac4.tar.xz
wireguard-linux-7d0da8f862340c5f42f0062b8560b8d0971a6ac4.zip
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: 20bf7d07c956 ("net: airoha: Add sched ETS offload support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Link: https://patch.msgid.link/20250107-airoha-ets-fix-chan-v1-1-97f66ed3a068@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/mediatek/airoha_eth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mediatek/airoha_eth.c b/drivers/net/ethernet/mediatek/airoha_eth.c
index b9f1c42f0a40..a30c417d66f2 100644
--- a/drivers/net/ethernet/mediatek/airoha_eth.c
+++ b/drivers/net/ethernet/mediatek/airoha_eth.c
@@ -2840,11 +2840,14 @@ static int airoha_qdma_get_tx_ets_stats(struct airoha_gdm_port *port,
static int airoha_tc_setup_qdisc_ets(struct airoha_gdm_port *port,
struct tc_ets_qopt_offload *opt)
{
- int channel = TC_H_MAJ(opt->handle) >> 16;
+ int channel;
if (opt->parent == TC_H_ROOT)
return -EINVAL;
+ channel = TC_H_MAJ(opt->handle) >> 16;
+ channel = channel % AIROHA_NUM_QOS_CHANNELS;
+
switch (opt->command) {
case TC_ETS_REPLACE:
return airoha_qdma_set_tx_ets_sched(port, channel, opt);