From: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
To: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,
aleksandr.loktionov@intel.com
Cc: netdev@vger.kernel.org
Subject: [PATCH iwl-net 10/10] ice: allow setting min_tx_rate to 0 to resolve VF bandwidth oversubscription
Date: Fri, 3 Apr 2026 07:40:28 +0200 [thread overview]
Message-ID: <20260403054029.3789616-11-aleksandr.loktionov@intel.com> (raw)
In-Reply-To: <20260403054029.3789616-1-aleksandr.loktionov@intel.com>
ice_set_vf_bw() refuses to accept any min_tx_rate value when the
total guaranteed bandwidth is already oversubscribed, even when the
requested value is 0. This makes it impossible to recover from an
oversubscribed state via "ip link set <pf> vf <id> min_tx_rate 0".
Allow a zero min_tx_rate to bypass the oversubscription check so
users can always clear the guaranteed rate. Additionally print an
informational message when the oversubscription guard fires to help
diagnose why a non-zero request was rejected.
Fixes: 4ecc8633056b ("ice: Add support for VF rate limiting")
Cc: stable@vger.kernel.org
Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
drivers/net/ethernet/intel/ice/ice_sriov.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index 7e00e09..6e3bec7 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -1507,6 +1507,12 @@ ice_min_tx_rate_oversubscribed(struct ice_vf *vf, int min_tx_rate)
all_vfs_min_tx_rate -= vf->min_tx_rate;
if (all_vfs_min_tx_rate + min_tx_rate > link_speed_mbps) {
+ if (ice_calc_all_vfs_min_tx_rate(vf->pf) > link_speed_mbps) {
+ dev_info(ice_pf_to_dev(vf->pf),
+ "The sum of min_tx_rate for all VFs is greater than the link speed\n");
+ dev_info(ice_pf_to_dev(vf->pf),
+ "Set min_tx_rate to 0 on VFs to resolve oversubscription\n");
+ }
dev_err(ice_pf_to_dev(vf->pf), "min_tx_rate of %d Mbps on VF %u would cause oversubscription of %d Mbps based on the current link speed %d Mbps\n",
min_tx_rate, vf->vf_id,
all_vfs_min_tx_rate + min_tx_rate - link_speed_mbps,
@@ -1556,7 +1562,7 @@ ice_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
goto out_put_vf;
}
- if (ice_min_tx_rate_oversubscribed(vf, min_tx_rate)) {
+ if (min_tx_rate && ice_min_tx_rate_oversubscribed(vf, min_tx_rate)) {
ret = -EINVAL;
goto out_put_vf;
}
--
2.52.0
next prev parent reply other threads:[~2026-04-03 5:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 5:40 [PATCH iwl-net 0/10] ice: bug fixes -- no link, tc-flower, VF rate Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 1/10] ice: fix mirroring to VSI list Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 2/10] ice: update FW on all DCB changes Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 3/10] ice: disallow service task to run while driver is unloading Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 4/10] ice: error out on CONNECTED state for input pin Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 5/10] ice: add 10000baseCR_Full to advertised link speed map Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 6/10] ice: check PHY autoneg capability before rejecting ethtool autoneg setting Aleksandr Loktionov
2026-04-10 18:58 ` Tony Nguyen
2026-04-03 5:40 ` [PATCH iwl-net 7/10] ice: fix missing 50G single-lane ethtool link speed mappings Aleksandr Loktionov
2026-04-03 5:40 ` [PATCH iwl-net 8/10] ice: set ETS TLV willing bit in default MIB sent to firmware Aleksandr Loktionov
2026-04-06 20:22 ` Ertman, David M
2026-04-03 5:40 ` [PATCH iwl-net 9/10] ice: select inner TCP dummy packet when matching on ip_proto TCP without explicit L4 field Aleksandr Loktionov
2026-04-03 5:40 ` Aleksandr Loktionov [this message]
2026-04-10 18:58 ` [PATCH iwl-net 10/10] ice: allow setting min_tx_rate to 0 to resolve VF bandwidth oversubscription Tony Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260403054029.3789616-11-aleksandr.loktionov@intel.com \
--to=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox