Netdev List
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@nvidia.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
	Paolo Abeni <pabeni@redhat.com>
Cc: Alexei Lazar <alazar@nvidia.com>,
	Carolina Jubran <cjubran@nvidia.com>,
	Gal Pressman <gal@nvidia.com>, Kees Cook <kees@kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	<oss-drivers@corigine.com>, Simon Horman <horms@kernel.org>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: [PATCH net-next V2] net/dcb: Validate bandwidth for non-ETS traffic classes
Date: Sun, 11 Oct 2026 11:39:29 +0300	[thread overview]
Message-ID: <20261011083929.739261-1-tariqt@nvidia.com> (raw)

From: Alexei Lazar <alazar@nvidia.com>

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>
---
 drivers/net/ethernet/netronome/nfp/nic/dcb.c | 3 ---
 net/dcb/dcbnl.c                              | 9 +++++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

V2:
- Generalized per Jakub's suggestion.

V1:
https://lore.kernel.org/all/20260622112925.624795-3-tariqt@nvidia.com/

diff --git a/drivers/net/ethernet/netronome/nfp/nic/dcb.c b/drivers/net/ethernet/netronome/nfp/nic/dcb.c
index bb498ac6bd7d..91fbfa3708fc 100644
--- a/drivers/net/ethernet/netronome/nfp/nic/dcb.c
+++ b/drivers/net/ethernet/netronome/nfp/nic/dcb.c
@@ -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;
 		}
 	}
 
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 35164bfa563d..ab71f5312876 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -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;

base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
-- 
2.44.0


             reply	other threads:[~2026-10-11  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11  8:39 Tariq Toukan [this message]
2026-10-12  8:40 ` [PATCH net-next V2] net/dcb: Validate bandwidth for non-ETS traffic classes netdev-bot+sashiko

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=20261011083929.739261-1-tariqt@nvidia.com \
    --to=tariqt@nvidia.com \
    --cc=alazar@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cjubran@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gal@nvidia.com \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@corigine.com \
    --cc=pabeni@redhat.com \
    /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