From patchwork Fri Sep 9 06:28:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 1675882 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Sc/IeEY8; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=mork.no header.i=@mork.no header.a=rsa-sha256 header.s=b header.b=nZv3IRT1; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MP5n0127Xz1yj1 for ; Fri, 9 Sep 2022 16:34:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KnIO74YPESyrXCqVRW4aRO9tRhmSLXff+7rX8J14h/c=; b=Sc/IeEY8YzX3Ro Lefm167eSKkKQVRtM2iTl0UdwDY/1qOBy+EnD6jBIEGU1ewp1Cy7xQoo6ldrUjuGbAQubDNXCE6fP Js3JKQ8tBCcM4HjdjScDY0KGju9gCVj98nZcRp38UmC/WictWG7X7p5TBOYlSFvPWNxE/YinpJGoN yXupusDcG+FdUeI6Xr7dHjD3rKx+hoyUtEhBKHiw2Nl0YtR5frUx2HtCXWDUQX++cIfF1xuc0dgt2 rCDg0VwqR7mdY3S0nWrBPXRCCZh3Zxx++8O02aWDIFZ4V6NVCqMW9lIUW9RxEEdx5lUKsNmBh6PzR GqHieQtdZHay86ApbwGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXVz-00DJd7-GT; Fri, 09 Sep 2022 06:29:24 +0000 Received: from louie.mork.no ([2001:41c8:51:8a:feff:ff:fe00:e5]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWXVN-00DJCY-7U for openwrt-devel@lists.openwrt.org; Fri, 09 Sep 2022 06:28:47 +0000 Received: from canardo.dyn.mork.no ([IPv6:2a01:799:c9e:d400:0:0:0:1]) (authenticated bits=0) by louie.mork.no (8.15.2/8.15.2) with ESMTPSA id 2896SLMV1039984 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Fri, 9 Sep 2022 07:28:23 +0100 Received: from canardo.dyn.mork.no (ip6-localhost [IPv6:0:0:0:0:0:0:0:1]) by canardo.dyn.mork.no (8.15.2/8.15.2) with ESMTPS id 2896SGNp1511623 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Fri, 9 Sep 2022 08:28:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1662704896; bh=aVw7wStdhIEJJYn76TZqHXSnGvx3v+/YlHi8QhUcRXQ=; h=From:To:Cc:Subject:Date:Message-Id:From; b=nZv3IRT1ZTUnCkq7MF+cxHmTzfAYe7NoaPYCXaTIGKyCsEDzf691CsfimPeA5V3m7 eOcFItdlf3e5+gzFdlTzkrgt1jaLOblNbWcm6FWm5fUWZZmrsz4eVpBJ2BcwE5FUlj Ikl0DiHYopXd4RaMi1QNZwssidd7AI6o5x0N4hG0= Received: (from bjorn@localhost) by canardo.dyn.mork.no (8.15.2/8.15.2/Submit) id 2896SGPA1511622; Fri, 9 Sep 2022 08:28:16 +0200 From: =?utf-8?q?Bj=C3=B8rn_Mork?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?q?Bj=C3=B8rn_Mork?= , Jan Hoffmann Subject: [PATCH] realtek: fix RTL839x receive tag decoding Date: Fri, 9 Sep 2022 08:28:13 +0200 Message-Id: <20220909062813.1511575-1-bjorn@mork.no> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on canardo.dyn.mork.no X-Virus-Scanned: clamav-milter 0.103.6 at canardo X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_232845_436105_43CEC6E3 X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -0.2 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__The_previous_fixup_was_incomplete=2C_a?= =?unknown-8bit?q?nd_the_offsets_for_the?= =?unknown-8bit?q?_queue_and_crc=5Ferror_cpu=5Ftag_bitfields_were_still_wrong?= =?unknown-8bit?q?_on_RTL839x=2E_Fixes=3A?= =?unknown-8bit?q?_545c6113c93b_=28=22realtek=3A_fix_RTL838x_receive_tag_deco?= =?unknown-8bit?q?ding=22=29_Suggested-by=3A?= =?unknown-8bit?q?_Jan_Hoffmann_=3Cjan=403e8=2Eeu=3E_Signed-off-by=3A_Bj=C3?= =?unknown-8bit?q?=B8rn_Mork_=3Cbjorn=40mork=2Eno=3E_---_Jan?= =?unknown-8bit?q?_pointed_put_that_I_missed_two_fields_on_the_=5B=2E=2E=2E?= =?unknown-8bit?q?=5D_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E2_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_0=2E0_SPF=5FNONE_______________SPF=3A_sender_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E0_SPF=5FHELO=5FPASS__________SPF=3A_HELO_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The previous fixup was incomplete, and the offsets for the queue and crc_error cpu_tag bitfields were still wrong on RTL839x. Fixes: 545c6113c93b ("realtek: fix RTL838x receive tag decoding") Suggested-by: Jan Hoffmann Signed-off-by: Bjørn Mork --- Jan pointed put that I missed two fields on the RTL839x. Sloppy. Fix those as well. This time even without complaints from checkpatch :-) But build tested only. I don't have any 839x and I don't know how to verify these features anyway. Bjørn .../realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c index d9ade6552698..e96c5a7216f8 100644 --- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c @@ -282,9 +282,9 @@ bool rtl839x_decode_tag(struct p_hdr *h, struct dsa_tag *t) { /* cpu_tag[0] is reserved. Fields are off-by-one */ t->reason = h->cpu_tag[5] & 0x1f; - t->queue = (h->cpu_tag[3] & 0xe000) >> 13; + t->queue = (h->cpu_tag[4] & 0xe000) >> 13; t->port = h->cpu_tag[1] & 0x3f; - t->crc_error = h->cpu_tag[3] & BIT(2); + t->crc_error = h->cpu_tag[4] & BIT(6); pr_debug("Reason: %d\n", t->reason); if ((t->reason >= 7 && t->reason <= 13) || // NIC_RX_REASON_RMA