From patchwork Sun Jun 19 11:46:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1645132 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=GZqNhTe2; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=EpOMB52y; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQrdC6hffz9sFr for ; Sun, 19 Jun 2022 21:48:15 +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:References:In-Reply-To: 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: List-Owner; bh=VS9C4UZ3JBho15+NFPOfZZ1KcRQo/Arlf8ROeQ429T0=; b=GZqNhTe2vHEEt0 XjOiyDMCc1cj/dst/COzecMJK6Q/0sKh7Ebl5/pNawTwWGU3tgEadg9fQGYQ+tBo5eT6nvqSupPzS RVc+lk/KyRX2kFjazfuu/3c0jGPXy/dYR/6xUA6bT4Gyg4B0BShMoCSBj6HQGsoi0aIvZtP0N97ae XtqSW0puBBDATm3TFvfGZs/xSlvdfqFmHM/SXlsCUNVib+vUSR6kzn/fcFz5IxjctHn0Y3dCSebJ4 8ICeSb55NpGBqeM6nhhikc82/rtmSvjo8239uFD4HmpKPlDcvqm6K+qK8wceTC4jkA21NRtKZvy+i Kp8lSaCFSxwDpJIlDl3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2tNx-00E3JS-53; Sun, 19 Jun 2022 11:46:33 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2tNi-00E3Dc-1L for openwrt-devel@lists.openwrt.org; Sun, 19 Jun 2022 11:46:19 +0000 Received: from terra.. (unknown [IPv6:2a02:a03f:eaf9:8401:aa9f:5d01:1b2a:e3cd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id DEC532EB461; Sun, 19 Jun 2022 13:46:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1655639176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H6icuI3Nr+pHN4+uhoUo8Uwjco3EY8Hm4lZ6i9LOmeQ=; b=EpOMB52yFMTZVWcfjGtULEKq1QvefjJymGh06k1EtTB3bcVxBbXvkjLi8HYeJEUSmvw/Ln OpGnwhtDrhFRzcNf3N0PgttMX8JkHhdk8KztTBNtTmp9MXcvHrIBQlKOuJyAUECuN9IXXw VsJj8lG1nzo4rs0We4HOKc7RwR6BBvIHAzWVZIiILCI7wdb40kyvcfJI62ZU0KdEEL1qg/ chhmO5jF0Ga3nb1ZZpyIHbl92/ADpqZwH3Po6HfR+jJ/OkWYSfLGLwyOhXdQLCz3CCtL7w 9FBMxNrx9kMrvYEo7uQK33Rnid2Hvq4VVholtYqDxXzZjqi91IUNVUr1+xIUVg== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= , Birger Koblitz , Sander Vanheule Subject: [PATCH v2 3/4] realtek: fix port mask on rtl839x Date: Sun, 19 Jun 2022 13:46:07 +0200 Message-Id: X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220619_044618_272002_69F3BE04 X-CRM114-Status: GOOD ( 10.17 ) X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The flags to enable the outgoing port mask is in bits 43, with bit 0 being the leftmost bit of the header. This corresponds to BIT(4) in the third 16-bit value of the header. Correctly set AS_DPM by fixing the off-by-one error. Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from 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 flags to enable the outgoing port mask is in bits 43, with bit 0 being the leftmost bit of the header. This corresponds to BIT(4) in the third 16-bit value of the header. Correctly set AS_DPM by fixing the off-by-one error. Fixes: 9eab76c84e31 ("realtek: Improve TX CPU-Tag usage") Signed-off-by: Sander Vanheule --- .../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 170fc9247bdf..5fa156935798 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 @@ -110,7 +110,8 @@ static void rtl839x_create_tx_header(struct p_hdr *h, unsigned int dest_port, in { // cpu_tag[0] is reserved on the RTL83XX SoCs h->cpu_tag[1] = 0x0100; // RTL8390_CPU_TAG marker - h->cpu_tag[2] = h->cpu_tag[3] = h->cpu_tag[4] = h->cpu_tag[5] = 0; + h->cpu_tag[2] = BIT(4); /* AS_DPM flag */ + h->cpu_tag[3] = h->cpu_tag[4] = h->cpu_tag[5] = 0; // h->cpu_tag[1] |= BIT(1) | BIT(0); // Bypass filter 1/2 if (dest_port >= 32) { dest_port -= 32; @@ -120,7 +121,6 @@ static void rtl839x_create_tx_header(struct p_hdr *h, unsigned int dest_port, in h->cpu_tag[4] = BIT(dest_port) >> 16; h->cpu_tag[5] = BIT(dest_port) & 0xffff; } - h->cpu_tag[2] |= BIT(5); // Enable destination port mask use h->cpu_tag[2] |= BIT(8); // Enable L2 Learning /* Set internal priority (PRI) and enable (AS_PRI) */