From nobody Sat Feb 7 11:38:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F073231062E; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760681493; cv=none; b=EezTcz3p1C+ivryLe7Q0VqmnWtI0wO09nkdbjTzNoFLzm3JF7q65YtVoleO870CnbRegZw5zfxroRjXjLHjrU9iBzUGbC0ckatlniM+7Vq16HjwHFu1bxBte9TpD3bfXoM3zbIJ+6CIaqnm9RDxmoxxIl8yv4ezKdxBJCvv5HXk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760681493; c=relaxed/simple; bh=jUVEbKS16TGx2Muh86hLCxq0Nm8NYW02YAqm3vPLILw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WTj+0RnXgk1rHrN4Mf22Sx3AJzRN0fDbxvywR2R6ate7XvzVSvzELqXYUUeCTkVTCfniunlr5rNbWoiEKNXttGMOI31NSimjCCJtDOO6CGDxu2oelu2NQA6fgM3E8T250lsainNcE6X/i1ywDyM6jAQ7vM3ogom2GHfGwdQVPrM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Hdq6QNi0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Hdq6QNi0" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8A94CC113D0; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760681492; bh=jUVEbKS16TGx2Muh86hLCxq0Nm8NYW02YAqm3vPLILw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Hdq6QNi0xde8h8eGHVLeFv9S18G5Mc4wflqLl+kHkPfaA4MY/i5Qhjb8lcWe39+fY cLzn3N44f9H3XpLhdSCrpd0sWzwHGmzb71E4rvF2F6zyNr9Mq6B2uxMXEBjuZ7i14t KSafTrPnmCtCcaNydDh84KM7UCgA1bh98qU/Eok3f73k3Y85C+EFxMuZNX32JVbpSG dwKB8YntQgOrlRjLvhCwlCux7PnyzQRVj9xskMWtoN7sZdPMcsMu4Rmgheod9ev0jj HETreLUPAPc3f8ut1rypKviEXaangQOJ8NB2dF3f3YjXC3Vz3Hilmzgusv4zrh/BiY dcISyS+tbxFeQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8232FCCD184; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) From: Rohan G Thomas via B4 Relay Date: Fri, 17 Oct 2025 14:11:19 +0800 Subject: [PATCH net v3 1/3] net: stmmac: vlan: Disable 802.1AD tag insertion offload Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251017-qbv-fixes-v3-1-d3a42e32646a@altera.com> References: <20251017-qbv-fixes-v3-0-d3a42e32646a@altera.com> In-Reply-To: <20251017-qbv-fixes-v3-0-d3a42e32646a@altera.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Jose Abreu , Rohan G Thomas , Boon Khai Ng Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rohan G Thomas X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760681491; l=4281; i=rohan.g.thomas@altera.com; s=20250815; h=from:subject:message-id; bh=0616UyoDlligJPpSZE/pfPD+6seIJyoif/vrOJ0b/GI=; b=EfsGbkXO7Y+nZ9tKoxqEDUGS3y+G6JMMb82kXSkJw56OqgcgzvPRgBxj9WPiwoDnEM3YysNx+ enrELze0XAeAjo0y+v30qGo5cUty7Vu7oldF9z6nwCvsRYmiUMuLdYN X-Developer-Key: i=rohan.g.thomas@altera.com; a=ed25519; pk=5yZXkXswhfUILKAQwoIn7m6uSblwgV5oppxqde4g4TY= X-Endpoint-Received: by B4 Relay for rohan.g.thomas@altera.com/20250815 with auth_id=494 X-Original-From: Rohan G Thomas Reply-To: rohan.g.thomas@altera.com From: Rohan G Thomas The DWMAC IP's VLAN tag insertion offload does not support inserting STAG (802.1AD) and CTAG (802.1Q) types in bytes 13 and 14 using the same MAC_VLAN_Incl and MAC_VLAN_Inner_Incl register configurations. Currently, MAC_VLAN_Incl is configured to offload only STAG type insertion. However, the DWMAC IP inserts a CTAG type when the inner VLAN ID field of the descriptor is not configured, and a STAG type when it is configured. This behavior is not documented and leads to inconsistent double VLAN tagging. Additionally, an unexpected CTAG with VLAN ID 0 is inserted, resulting in frames like: Frame 1: 110 bytes on wire (880 bits), 110 bytes captured (880 bits) Ethernet II, Src: (), Dst: () IEEE 802.1ad, ID: 100 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 0 (unexpected) 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 200 Internet Protocol Version 4, Src: 192.168.4.10, Dst: 192.168.4.11 Internet Control Message Protocol To avoid this undocumented and incorrect behavior, disable 802.1AD tag insertion offload. Also, don't set CSVL bit. As per the data book, when this bit is set, S-VLAN type (0x88A8) is inserted in the 13th and 14th bytes of transmitted packets and when this bit is reset, C-VLAN type (0x8100) is inserted in the 13th and 14th bytes of transmitted packets. Fixes: 30d932279dc2 ("net: stmmac: Add support for VLAN Insertion Offload") Fixes: e94e3f3b51ce ("net: stmmac: Add support for VLAN Insertion Offload i= n GMAC4+") Fixes: 1d2c7a5fee31 ("net: stmmac: Refactor VLAN implementation") Signed-off-by: Rohan G Thomas Reviewed-by: Boon Khai Ng --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 19 +++++-------------- drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 650d75b73e0b0ecd02d35dd5d6a8742d45188c47..dedaaef3208bfadc105961029f7= 9d0d26c3289d8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4089,18 +4089,11 @@ static int stmmac_release(struct net_device *dev) static bool stmmac_vlan_insert(struct stmmac_priv *priv, struct sk_buff *s= kb, struct stmmac_tx_queue *tx_q) { - u16 tag =3D 0x0, inner_tag =3D 0x0; - u32 inner_type =3D 0x0; + u16 tag =3D 0x0; struct dma_desc *p; =20 - if (!priv->dma_cap.vlins) + if (!priv->dma_cap.vlins || !skb_vlan_tag_present(skb)) return false; - if (!skb_vlan_tag_present(skb)) - return false; - if (skb->vlan_proto =3D=3D htons(ETH_P_8021AD)) { - inner_tag =3D skb_vlan_tag_get(skb); - inner_type =3D STMMAC_VLAN_INSERT; - } =20 tag =3D skb_vlan_tag_get(skb); =20 @@ -4109,7 +4102,7 @@ static bool stmmac_vlan_insert(struct stmmac_priv *pr= iv, struct sk_buff *skb, else p =3D &tx_q->dma_tx[tx_q->cur_tx]; =20 - if (stmmac_set_desc_vlan_tag(priv, p, tag, inner_tag, inner_type)) + if (stmmac_set_desc_vlan_tag(priv, p, tag, 0x0, 0x0)) return false; =20 stmmac_set_tx_owner(priv, p); @@ -7573,11 +7566,9 @@ int stmmac_dvr_probe(struct device *device, ndev->features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; ndev->features |=3D NETIF_F_HW_VLAN_STAG_FILTER; } - if (priv->dma_cap.vlins) { + if (priv->dma_cap.vlins) ndev->features |=3D NETIF_F_HW_VLAN_CTAG_TX; - if (priv->dma_cap.dvlan) - ndev->features |=3D NETIF_F_HW_VLAN_STAG_TX; - } + #endif priv->msg_enable =3D netif_msg_init(debug, default_msg_level); =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_vlan.c index 0b6f6228ae35db3d855d8d386c3806a007a9d176..ff02a79c00d4f52a458edde1bcc= 08a0895b2c1c1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c @@ -212,7 +212,7 @@ static void vlan_enable(struct mac_device_info *hw, u32= type) =20 value =3D readl(ioaddr + VLAN_INCL); value |=3D VLAN_VLTI; - value |=3D VLAN_CSVL; /* Only use SVLAN */ + value &=3D ~VLAN_CSVL; /* Only use CVLAN */ value &=3D ~VLAN_VLC; value |=3D (type << VLAN_VLC_SHIFT) & VLAN_VLC; writel(value, ioaddr + VLAN_INCL); --=20 2.43.7 From nobody Sat Feb 7 11:38:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08D1D310631; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760681493; cv=none; b=FBZ+EVLcOYFCRu5Ad6OPJuYD1lsMu9YtYaKkUOOXgv5mKOqjhZGGc0xJzozIU4Hgd/UbtkaYjHHzq72HeD84ghtEp0QrO//UJZoobBszHGtlitqyUeFLp5pFXhDvmaAPnlrkwEMH3E04/4voyBQIXuuiXzxRbsFoMaqKRfv6Y1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760681493; c=relaxed/simple; bh=kiZ/E3EReHUX0M1b+8d/q62Wo1VPS2A4vlagRzx83LQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Misui6HJmGOB7zqXMzNwYuEe7Mq5tEF1YyMgPsN4HqogaGKyY/5w/HCKUsMSl3zzBd4HaOUUvb+ZodyRp2Y+gasw82Vjp5khjn6JH8wsNTeOGlatWPZQT4/tIXVTh6LXdVpet5PenGpj7sf38f+txFZbsAsOcU1xcwaQCaVVY5g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VV9GcW2B; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VV9GcW2B" Received: by smtp.kernel.org (Postfix) with ESMTPS id 99E9FC4CEE7; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760681492; bh=kiZ/E3EReHUX0M1b+8d/q62Wo1VPS2A4vlagRzx83LQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=VV9GcW2BRCikIQ/H/scyfCtOqIlylreOp9hSMMar9qBsNRDjR2FfDavrq1orN+xUv iDCpag2j+5thSXgq8CSbVvzzcinNNVzIk82q0zKtQ3cyVB2pTSvpWQJjVyX4MWZy/o HNgAKnmZ3qTn9bWZ2myXJoSqNdYI2u9QKeQxFS+krIxmS5NgT9U9QkYdjIKPQmzIpj hNqxD7jMhVq1QR1w3YKWdo5tju09UCubQaZVxyhaKcQmIDcgDxkVp7LM3yZ+3nPHj/ oe3PykmzNnrpP7ysKNuMLGCfHgC9khHuDejK+58Fy54bDqVb2+zUsQiNreIyHP88nX i3PNqg0ah3WdA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90A87CCD199; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) From: Rohan G Thomas via B4 Relay Date: Fri, 17 Oct 2025 14:11:20 +0800 Subject: [PATCH net v3 2/3] net: stmmac: Consider Tx VLAN offload tag length for maxSDU Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251017-qbv-fixes-v3-2-d3a42e32646a@altera.com> References: <20251017-qbv-fixes-v3-0-d3a42e32646a@altera.com> In-Reply-To: <20251017-qbv-fixes-v3-0-d3a42e32646a@altera.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Jose Abreu , Rohan G Thomas , Boon Khai Ng Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rohan G Thomas , Matthew Gerlach X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760681491; l=2216; i=rohan.g.thomas@altera.com; s=20250815; h=from:subject:message-id; bh=jcxjbVsIAOtq9pkhXrGNK9OcxDQoYMmKdVWnGqUpw8w=; b=Sf2ajyE8ADotRUn+QZuwv0vYNgHn1PxaIwhGA+1sNu7EqNI5uMqNDQLYoGjwMAydQpYdRHBmB cWANmRpfenMDn0Q5bBFAHqTWti0xS4jdZW2KTBb06OTgtKIwsk+KSni X-Developer-Key: i=rohan.g.thomas@altera.com; a=ed25519; pk=5yZXkXswhfUILKAQwoIn7m6uSblwgV5oppxqde4g4TY= X-Endpoint-Received: by B4 Relay for rohan.g.thomas@altera.com/20250815 with auth_id=494 X-Original-From: Rohan G Thomas Reply-To: rohan.g.thomas@altera.com From: Rohan G Thomas On hardware with Tx VLAN offload enabled, add the VLAN tag length to the skb length before checking the Qbv maxSDU if Tx VLAN offload is requested for the packet. Add 4 bytes for 802.1Q tag. Fixes: c5c3e1bfc9e0 ("net: stmmac: Offload queueMaxSDU from tc-taprio") Signed-off-by: Rohan G Thomas Reviewed-by: Matthew Gerlach --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index dedaaef3208bfadc105961029f79d0d26c3289d8..23bf4a3d324b7f8e8c3067ed4d4= 7b436a89c97d3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4500,6 +4500,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, s= truct net_device *dev) bool has_vlan, set_ic; int entry, first_tx; dma_addr_t des; + u32 sdu_len; =20 tx_q =3D &priv->dma_conf.tx_queue[queue]; txq_stats =3D &priv->xstats.txq_stats[queue]; @@ -4516,13 +4517,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, = struct net_device *dev) return stmmac_tso_xmit(skb, dev); } =20 - if (priv->est && priv->est->enable && - priv->est->max_sdu[queue] && - skb->len > priv->est->max_sdu[queue]){ - priv->xstats.max_sdu_txq_drop[queue]++; - goto max_sdu_err; - } - if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 1)) { if (!netif_tx_queue_stopped(netdev_get_tx_queue(dev, queue))) { netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, @@ -4535,8 +4529,18 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, = struct net_device *dev) return NETDEV_TX_BUSY; } =20 + sdu_len =3D skb->len; /* Check if VLAN can be inserted by HW */ has_vlan =3D stmmac_vlan_insert(priv, skb, tx_q); + if (has_vlan) + sdu_len +=3D VLAN_HLEN; + + if (priv->est && priv->est->enable && + priv->est->max_sdu[queue] && + skb->len > priv->est->max_sdu[queue]){ + priv->xstats.max_sdu_txq_drop[queue]++; + goto max_sdu_err; + } =20 entry =3D tx_q->cur_tx; first_entry =3D entry; --=20 2.43.7 From nobody Sat Feb 7 11:38:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08D9C310635; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760681493; cv=none; b=lTuXOj0+qEH/oVPWcg+/oDvCu2a7sOedLjGUT4hAJnOgvDsPtD4zZla31uLyY97AtjOSOg7vaZl1buIhS5i0kPZXWxnUR1LfpJD/LilDYUgiX2CyodyBmO3BwNCtQ6xyRF+FZm1bGnC5i/fd7l9svP30xGTg2BKAajgFlxa8sKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760681493; c=relaxed/simple; bh=NTA7XXehFna8Lnz9z9hQDJQmt5EcD5cxGnspoWjl5V8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iBdJZAUvAXRPDQvTXKdO8GemFoJqEqMa6+1wa571bDoCkdb4CG/Mb2Mn2wKedcFCz84xggkYoXx8J3H+JaF4f+lyR86A+CoH8iYJjx2O7ljSH0Tp9iQZenYAFR3xzb3XKfqShX7YAfMh0WzlTqAE9CSwH6TZQrpprouHAluD9oA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NDT2h+jN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NDT2h+jN" Received: by smtp.kernel.org (Postfix) with ESMTPS id A785AC116B1; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760681492; bh=NTA7XXehFna8Lnz9z9hQDJQmt5EcD5cxGnspoWjl5V8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=NDT2h+jN4Fo/V782pJVCyAoFMDQnca+b11ea9IbVH3hZjx0JvKZtsDb6BBFbxJjEW KgBXOBYWrEY29jdKBiR3vbIBwAvxiCfFNcudI8kD5AngbnR6YCXGd7Gm/Un9geOOhy D77x5NWxRh1HnfG5BNY2cWp5KPcDogJIY8suYnFlWyVt8y6Y1DXGOic69Oiyeaku6O jiFtYZC1AUghnKzEeE8N/MiZXcEBeLnF3tKQAUsTXa2lO5xM7Z9LrWnpYHdCdguVeL bcGn/MEskl7O9AeiTXgrczZsx8a2QjKycNOYotd5N4YdFzfYbTDfRO3+PgA6xYZSvE hyX8lEwLBY9nA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F8C4CCD1A2; Fri, 17 Oct 2025 06:11:32 +0000 (UTC) From: Rohan G Thomas via B4 Relay Date: Fri, 17 Oct 2025 14:11:21 +0800 Subject: [PATCH net v3 3/3] net: stmmac: est: Fix GCL bounds checks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251017-qbv-fixes-v3-3-d3a42e32646a@altera.com> References: <20251017-qbv-fixes-v3-0-d3a42e32646a@altera.com> In-Reply-To: <20251017-qbv-fixes-v3-0-d3a42e32646a@altera.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Jose Abreu , Rohan G Thomas , Boon Khai Ng Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rohan G Thomas , Matthew Gerlach X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1760681491; l=1340; i=rohan.g.thomas@altera.com; s=20250815; h=from:subject:message-id; bh=mX5G4ROq0gDY4G0a4Qm/T3N17XaJr2mEhgFfcjCdoJk=; b=z8V58A1VlIr5ekLOqI6PBxwoKAM5sCuB+v2xtlazP8QRxqeoIu3e4AOJzUJiniz/MDLjGmNFn YWFLDF9+3quBrbhbs5cVU0EvUePkFdXCjLg7rESERbIkmMEmkC4wGuz X-Developer-Key: i=rohan.g.thomas@altera.com; a=ed25519; pk=5yZXkXswhfUILKAQwoIn7m6uSblwgV5oppxqde4g4TY= X-Endpoint-Received: by B4 Relay for rohan.g.thomas@altera.com/20250815 with auth_id=494 X-Original-From: Rohan G Thomas Reply-To: rohan.g.thomas@altera.com From: Rohan G Thomas Fix the bounds checks for the hw supported maximum GCL entry count and gate interval time. Fixes: b60189e0392f ("net: stmmac: Integrate EST with TAPRIO scheduler API") Signed-off-by: Rohan G Thomas Reviewed-by: Matthew Gerlach --- drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/= ethernet/stmicro/stmmac/stmmac_tc.c index 97e89a604abd7a01bb8e904c38f10716e0a911c1..3b4d4696afe96afe58e0c936429= f51c22ae145be 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c @@ -981,7 +981,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv, if (qopt->cmd =3D=3D TAPRIO_CMD_DESTROY) goto disable; =20 - if (qopt->num_entries >=3D dep) + if (qopt->num_entries > dep) return -EINVAL; if (!qopt->cycle_time) return -ERANGE; @@ -1012,7 +1012,7 @@ static int tc_taprio_configure(struct stmmac_priv *pr= iv, s64 delta_ns =3D qopt->entries[i].interval; u32 gates =3D qopt->entries[i].gate_mask; =20 - if (delta_ns > GENMASK(wid, 0)) + if (delta_ns > GENMASK(wid - 1, 0)) return -ERANGE; if (gates > GENMASK(31 - wid, 0)) return -ERANGE; --=20 2.43.7