From mboxrd@z Thu Jan 1 00:00:00 1970 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 451331CDFAC; Sun, 7 Sep 2025 20:11:42 +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=1757275902; cv=none; b=Y7fyJDjMlkv72n5NRThwGorI6nbPKkidjNh9t6wZDHnpSYmcWI5sNfio5BGbWvdK6O9sbGgpdR88RVfXTs2UsfaK9t4xWmi79QEcFlrjaFeWCxIQbQSo9QEhAZwN8BTxFrSWHiJ4AepkUnWLejtNFPMlNWY5jmaBpDB9q+/+4Lw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757275902; c=relaxed/simple; bh=KazUa/4IWJCfb4iC1jktZMAQ7xK2YfDgtMHJerFmqsg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GCnAt4Kcj4m71cuo1C/K68xRpEiksy3rW1MUVHerR+/ovbz1AYVCXb0X9xLyQPp1IPW3fTVwx1PmN4/7GDS4oWYpz2Zd9JdOro0Gq1VaOQYH2IkrPPjedVMeH4rRa0rHOU7sXOZ8efb7V2r21EdRmhPf3lUWVijo9lzdlKJM2+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Bb0JWBAA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Bb0JWBAA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF519C4CEF0; Sun, 7 Sep 2025 20:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757275902; bh=KazUa/4IWJCfb4iC1jktZMAQ7xK2YfDgtMHJerFmqsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bb0JWBAAUgZRKQfNGSZeYURf4nzM+zKs6D6Hqop2cvuZYa9UhUoG2j9sm+S/yh4HE rGyQUqXFfvTNfP0GFgGBLUO3n9YJDC1BvDJgNsNYR2Yr7FfXE+97o8au7syXeA9y8P 55XypR3ruXeN0aFw9Tk8z7ur8W6VmI1oR0nz3P5M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thibaut VARENE , Felix Fietkau , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 09/45] net: ethernet: mtk_eth_soc: fix tx vlan tag for llc packets Date: Sun, 7 Sep 2025 21:57:55 +0200 Message-ID: <20250907195601.233779827@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250907195600.953058118@linuxfoundation.org> References: <20250907195600.953058118@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Fietkau [ Upstream commit d4736737110ffa83d29f1c5d17b26113864205f6 ] When sending llc packets with vlan tx offload, the hardware fails to actually add the tag. Deal with this by fixing it up in software. Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623 ethernet") Reported-by: Thibaut VARENE Signed-off-by: Felix Fietkau Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250831182007.51619-1-nbd@nbd.name Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 7b9f5eba78dcc..6ab4c84bc22ef 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1173,6 +1173,13 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) bool gso = false; int tx_num; + if (skb_vlan_tag_present(skb) && + !eth_proto_is_802_3(eth_hdr(skb)->h_proto)) { + skb = __vlan_hwaccel_push_inside(skb); + if (!skb) + goto dropped; + } + /* normally we can rely on the stack not calling this more than once, * however we have 2 queues running on the same ring so we need to lock * the ring access @@ -1218,8 +1225,9 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) drop: spin_unlock(ð->page_lock); - stats->tx_dropped++; dev_kfree_skb_any(skb); +dropped: + stats->tx_dropped++; return NETDEV_TX_OK; } -- 2.50.1