]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: airoha: Report extack error to the user if airoha_tc_htb_modify_queue() fails
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 3 Jun 2026 10:30:01 +0000 (12:30 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 5 Jun 2026 01:18:41 +0000 (18:18 -0700)
Report an extack error message in airoha_tc_htb_modify_queue routine if
airoha_qdma_set_tx_rate_limit() fails.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/20260603-airoha_tc_htb_modify_queue-err-message-v1-1-33ec3ab997d9@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_eth.c

index 5474d489711042367b98bfca149d111c1b42cbf3..584c4f1a09dc3b2b87041fe055a68042b20a5e75 100644 (file)
@@ -2605,13 +2605,19 @@ static int airoha_tc_htb_modify_queue(struct net_device *dev,
 {
        u32 channel = TC_H_MIN(opt->classid) % AIROHA_NUM_QOS_CHANNELS;
        u32 rate = div_u64(opt->rate, 1000) << 3; /* kbps */
+       int err;
 
        if (opt->parent_classid != TC_HTB_CLASSID_ROOT) {
                NL_SET_ERR_MSG_MOD(opt->extack, "invalid parent classid");
                return -EINVAL;
        }
 
-       return airoha_qdma_set_tx_rate_limit(dev, channel, rate, opt->quantum);
+       err = airoha_qdma_set_tx_rate_limit(dev, channel, rate, opt->quantum);
+       if (err)
+               NL_SET_ERR_MSG_MOD(opt->extack,
+                                  "failed configuring htb offload");
+
+       return err;
 }
 
 static int airoha_tc_htb_alloc_leaf_queue(struct net_device *netdev,