mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-10-26 10:57:38 +08:00
net/dcb: Validate bandwidth for non-ETS traffic classes
The IEEE 802.1Qaz standard defines that bandwidth allocation percentages only apply to ETS traffic classes. Reject ETS configurations that specify non-zero bandwidth for non-ETS traffic classes. Placing this check in dcbnl_ieee_set() enforces the constraint uniformly for all drivers rather than relying on each driver to validate it independently. Drop the equivalent check from NFP's dcb_ets_check(). Keep ETS bandwidth-sum validation unchanged. Signed-off-by: Alexei Lazar <alazar@nvidia.com> Reviewed-by: Carolina Jubran <cjubran@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20261011083929.739261-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
1 parent
819d596387
commit
0e36a335c8
2 files changed
+9
-3
No files matched your search
@@ -218,9 +218,6 @@ static int dcb_ets_check(struct net_device *dev, struct ieee_ets *ets)
|
||||
if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_ETS) {
|
||||
ets_exists = true;
|
||||
sum += ets->tc_tx_bw[i];
|
||||
} else if (ets->tc_tx_bw[i]) {
|
||||
nfp_warn(app->cpp, "ETS BW for strict/vendor TC must be 0.");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1578,6 +1578,15 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh,
|
||||
|
||||
if (ieee[DCB_ATTR_IEEE_ETS] && ops->ieee_setets) {
|
||||
struct ieee_ets *ets = nla_data(ieee[DCB_ATTR_IEEE_ETS]);
|
||||
|
||||
/* IEEE 802.1Qaz: BW allocation applies only to ETS TCs */
|
||||
for (int i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
|
||||
if (ets->tc_tsa[i] != IEEE_8021QAZ_TSA_ETS &&
|
||||
ets->tc_tx_bw[i]) {
|
||||
err = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
err = ops->ieee_setets(netdev, ets);
|
||||
if (err)
|
||||
goto err;
|
||||
|
||||
Reference in new issue
Block a user