From patchwork Wed Jan 22 22:26:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 2037753 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=bpGWsyMV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=kqEQW3HF; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Yddym4522z20Hh for ; Thu, 23 Jan 2025 09:28:47 +1100 (AEDT) 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=b0TJEjkPh8xmeU+6IP1GlUAMwl9+629qCzzXOjPBR+k=; b=bpGWsyMVi88Wtt Rn/7ps5Nm4p/1EsSeRx3Kn//3ztWTN4HobFt1DFDiL0HgfRyIoA9DBa1XbWBDTecfLVrbCcJOBroO KNnK0D9QyUBZrbB8Wr7PawbQLvMbJ5xf4Gl5dOlYa6dHjIYMvgTWJcnPFMTA9sO0CVWegi5qhHTv9 bHmG2jx/uImIB6G5FkIvI87DrLoCF0vRREkf1io0WvNmMppVWd03C23hUVkgoV7Km1ZNh5oxFzs/s Ll33kklpHB/g1+2MXWQUyFlLmLaJACAq3icp/eNyUgqhe2UGYv1hCuHK9Gtz30BaRfxEfwiK7NNdb h3S4BZ//fXqVYa7MhQng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tajBr-0000000BJNa-3Q2g; Wed, 22 Jan 2025 22:27:15 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tajBo-0000000BJKz-49uf for openwrt-devel@lists.openwrt.org; Wed, 22 Jan 2025 22:27:14 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so3087955e9.0 for ; Wed, 22 Jan 2025 14:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737584832; x=1738189632; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TOdDCpSPzdvzdJDN+qcivoFng7qPMaXiXpU61Tj6hfc=; b=kqEQW3HFOKBHP+/Qrqcj0I5eveBMD6+vppX7Ijh4CFvCKJCh6ZVGxJTGeh9BqYgDLA 0n9FcJr5D3Um6ZTJa2tpu2JtYg6ywFBPPpKn3p1SWlcQwDyCYTqIe5xn+8eGESGnp+co qJODL1GRYjKkrbus6axpGgY/0pWyWutrn3CVK054Ku+771vUjpuCv6vmyP08cp8as8en fQXdBG33gCdLN1aN3qzSIs82iocrDZlfiSJbPZHtIhLRiW7bgmnMv2Yuh/EH7dys/En4 RYBguBtwZV8K+OCKC8l7fa2vX3BgXyS1b33aJdF2smztnWSyzkvITsPkCClqfktJ2DL3 FJaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737584832; x=1738189632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TOdDCpSPzdvzdJDN+qcivoFng7qPMaXiXpU61Tj6hfc=; b=Ih2uFfnAmO8e6jeruIIoo9Wl6Ukdwj2Y3t/pwKiZkKmWj7JcIgskflQCZAiIwVx4ip 6gnPoCSGF10YQ+fq0ZFFM3KVOrdUKVa+V/KRPNdgJjvZRLdMS9YQ5JI94KDVKbEvv+t1 Ckl0PsdQYc7GjwoqRW2+V46Vt3d1K/Cynkf+TOIP1AnpywXdB99A8QliTNgrcHgIizsO BJ/k7wx2UOFF1KwfWuzrwMMmvZwtD22l/cya1p4XcMXm3kprJj4nWGD1ad2XFIoiC5NK GWLhlvb2qN3cfKiQagqbzMq0nxePKCbHfd73ShWkrLrvUnP5p7ySjCOA1cYnL10YK1Hf UOOw== X-Gm-Message-State: AOJu0YwEB0omt9fUf6+vnDXej+6YbMZrNyTm5XlkAtnQsfcJgoVt3GoX 8ZElGLKuNYpskvRGeWCPtIjV9JiOuyEpc61IsQjuMg+m9dIrB/DI X-Gm-Gg: ASbGncukkJR5xAL+geuRsL3ieMztNHQkXIAjjACj/r9VaEj/fYONsvfSeJS+69QykyQ CdZo9hw6/cCTvP53uN18A6ULw9woMQ29wh3sCPJ5sMWpLWTalhlV/81BjdOEQ/HRW2yVjI/tymd bWax4DJUGYqc23UvmWfYjpeQALC8CtZJ6A/lJZGCssZI9h3K1Uq+0mCD6kpMK4ErJWeq026dsp9 iUBsULIAvDdReTT2QBlTvh5u1oSKHJaBuvTWy3g9ZbfHAlEy7FwFPuatrO9mtw6oHi+SKcNIP1p m0JXMw== X-Google-Smtp-Source: AGHT+IGkhO8mP5VGE7UGjVdfuGGV7MN+39SamIUwM1siVHCE/Cs2D0KmbH8CV8uuEf5fMOCLW/nYuA== X-Received: by 2002:a05:6000:144e:b0:38a:5ce8:df6d with SMTP id ffacd0b85a97d-38bf56557b5mr19268388f8f.1.1737584831523; Wed, 22 Jan 2025 14:27:11 -0800 (PST) Received: from localhost.localdomain ([69.6.8.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf328864esm17773125f8f.99.2025.01.22.14.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 14:27:10 -0800 (PST) From: Sergey Ryazanov To: Daniel Golle Cc: OpenWrt Development List , Andre Heider , Hauke Mehrtens , Jan Hoffmann , Martin Schiller Subject: [PATCH v4 1/4] kernel: vrx518_tc: fix RX desc phys to virt mapping Date: Thu, 23 Jan 2025 00:26:51 +0200 Message-ID: <20250122222654.21833-2-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122222654.21833-1-ryazanov.s.a@gmail.com> References: <20250122222654.21833-1-ryazanov.s.a@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250122_142713_030265_B3F9FBB3 X-CRM114-Status: GOOD ( 15.66 ) X-Spam-Score: -1.1 (-) 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: It looks like VRX518 returns phys addr of data buffer in the 'data_ptr' field of the RX descriptor and an actual data offset within the buffer in the 'byte_off' field. In order to map the phys address [...] Content analysis details: (-1.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:336 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ryazanov.s.a(at)gmail.com] 1.0 FREEMAIL_REPLY From and body contain different freemails 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 It looks like VRX518 returns phys addr of data buffer in the 'data_ptr' field of the RX descriptor and an actual data offset within the buffer in the 'byte_off' field. In order to map the phys address back to virtual we need the original phys address of the allocated buffer. In the same driver applies offset to phys address before the mapping, what leads to WARN_ON triggering in plat_mem_virt() function with subsequent kernel panic: WARNING: CPU: 0 PID: 0 at .../sw_plat.c:764 0xbf306cd0 [vrx518_tc@8af9f5d0+0x25000] ... Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = aff5701e [00000000] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Noticed in ATM mode, when chip always returns byte_off = 4. In order to fix the issue, pass the phys address to plat_mem_virt() as is and apply byte_off later for proper DMA syncing and on mapped virtual address when copying RXed data into the skb. Run tested with FRITZ!Box 7530 on both ADSL and VDSL (thanks Jan) links. Fixes: 474bbe23b7 ("kernel: add Intel/Lantiq VRX518 TC driver") Tested-by: Jan Hoffmann # VDSL link Reported-and-tested-by: nebibigon93@yandex.ru # ADSL link Signed-off-by: Sergey Ryazanov --- Changes: v3->4: DMA sync the whole data buffer which length is byte_off + data_len --- package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch b/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch index edc97998b7..6596a8b913 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch @@ -855,12 +855,12 @@ This replaces it by a basic working implementation. - continue; + + // this seems to be a pointer to a DS PKT buffer -+ phyaddr = desc->data_ptr + desc->byte_off; ++ phyaddr = desc->data_ptr; + ptr = plat_mem_virt(phyaddr); -+ + len = desc->data_len; + -+ dma_sync_single_range_for_cpu(pdev, phyaddr, 0, len, DMA_FROM_DEVICE); ++ dma_sync_single_for_cpu(pdev, phyaddr, desc->byte_off + len, ++ DMA_FROM_DEVICE); + + skb = netdev_alloc_skb(g_plat_priv->netdev, len); + if (unlikely(!skb)) { @@ -871,7 +871,7 @@ This replaces it by a basic working implementation. - ring_idx_inc(rxout, idx); + + dst = skb_put(skb, len); -+ memcpy(dst, ptr, len); ++ memcpy(dst, ptr + desc->byte_off, len); + + priv->tc_ops.recv(g_plat_priv->netdev, skb); + From patchwork Wed Jan 22 22:26:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 2037755 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=OQSpMgv/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hBK90ezi; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Yddym41zrz20Hg for ; Thu, 23 Jan 2025 09:28:47 +1100 (AEDT) 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=hUVDjJ6tVklurCtWriG17hPaT+Jq13ibGOPUIqgphQ4=; b=OQSpMgv/rwxEyj 585qVjR5fiLC0eEuXOdoK8ZD4t2xJvOKeLO6Cq+Hh7plFKGGwV5F6iFSP4MlaS9KeoOfCI0JU35ZC PYyaCBjP/2vbKOy4ajK1hKvahF12eYWpWMM+uD6KzC9IByBD4OnY9X0pcmDeiMQEh545JkHrTjdsE pqRO64CJSDjehLuirDzYfR8RMckPCmDKHh+jFnQ1R+vBoqPvpiHYrhtAAzyK04+HM4NxiaE3EUr4C //o+FlFpCUhOUyxkioaxwuelAK/viZBi9CRv0i29ltlEWOC9UjA6Xo3MHxqjtbS1tcePDyPXGHYyg zPdUkxC8Uq4Etwl05KmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tajBt-0000000BJOe-104a; Wed, 22 Jan 2025 22:27:17 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tajBq-0000000BJLo-2TIC for openwrt-devel@lists.openwrt.org; Wed, 22 Jan 2025 22:27:15 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-386329da1d9so108200f8f.1 for ; Wed, 22 Jan 2025 14:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737584833; x=1738189633; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4CGIX+1yjTWIBnKwZ2y5X/bgTwnEo140X9euQCutdUE=; b=hBK90eziechfe+5GgK+l8ORrQioNAR4cU0drZ6gQwzBqXi2rql2Yl8dMk+wnmvaqaw sDOGffAWmohO5xD9U8exsm2qbaJg66bxllPmcqLj93ZkLHsvPoR6QRhPkOAmAhCM2X8J K+CB8JlD4G6b8gHjYOcsVZmYRf6NYXC5gQzZoamUMG58nY+p59ltZBkRh1yIMq5QzWlX 9Y+c5ds/tCSu5HMdEDCEUHA5t3OzTU3nM1DWIvRXey8dnHG6FoXaTh3rSXmqQHrpONxA oymeoahFos0FKqADvWUuqkO04xYNGrL6BkGjbdjH+PDy8sK31SKpYvB+XKaCd/Ed8ZfJ RzsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737584833; x=1738189633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4CGIX+1yjTWIBnKwZ2y5X/bgTwnEo140X9euQCutdUE=; b=WlN7cTWDVBCwVZNmCnZig5Whpox79tP94tsxQzPfAXwle1jwSJHgTkUVhL1AbxWNyt TDWn9eWwNC7/2gBvd3dwPagp2QoKEJl1Lf0xqy8ivJ51xHsPSD8msRXXk6KOykmh+uPi b1TxKVM9o6oxyaOzfvBp5RqvrgTfeSY6WGF9gvB+Ht9+A9ROgUUcdKEV0KZMB4wluSNu LpIMeRYvw502P5wfUB1WxGVpFP8hkjtMfO4YmcXtJ7BWT7h4TE7H/5QZ6lq4M16FS5iN o04da75opxtf4S9HsNqTdTwExdflbWtyef9u//GaiiHZZICCDv3gYIBHy0+zumwwvrQr r/VA== X-Gm-Message-State: AOJu0YxgQB3qXG25f7kfuz+yF+6zIo7fAorC25TsqolxmZ0w3qEMJp/l 1/3n9hlwdATdQ29SdnFUjOSvPthYbhRYCt+8pdEDZjDXFollCrKN X-Gm-Gg: ASbGncsbXFDlFEYfYwnWbtXwiY/iO9tt2ZzGzLr7vZUlucZyC/zmbxf1NG2XEvUv4xb OGuV0fNVgIoxUFtsCQ0TLhUVQiK6S5E41xpEWMexPFlBUkDiZxZntxXOENM0tUhcPTFSbCVaO9i cbMi7gMtS52TDzRV1aQ4TPkIoj43dGDPpsQ8r/BMzc2Lhe6EjCWfBw5wZ6BsBRO0AAEXJVguYlo ZJDaQCxq/9V7VTW7Hu3dBmrb1R2/Ds4YplQrap5V22JJwa1Pi0hSqDLlDpsL3Q63nIH6t10UVz2 KYSj4g== X-Google-Smtp-Source: AGHT+IFEmhRihgiaxDKNrloWbLGYXKqMOtKwdbhErFYb5ojs+YiKgcY1XMc7j9yLwV9/kv8cdZ7dMg== X-Received: by 2002:a05:6000:e4a:b0:385:ed16:c91 with SMTP id ffacd0b85a97d-38bf566f3bemr17101611f8f.24.1737584832857; Wed, 22 Jan 2025 14:27:12 -0800 (PST) Received: from localhost.localdomain ([69.6.8.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf328864esm17773125f8f.99.2025.01.22.14.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 14:27:12 -0800 (PST) From: Sergey Ryazanov To: Daniel Golle Cc: OpenWrt Development List , Andre Heider , Hauke Mehrtens , Jan Hoffmann , Martin Schiller Subject: [PATCH v4 2/4] kernel: vrx518_tc: fix ADSL/ATM operation Date: Thu, 23 Jan 2025 00:26:52 +0200 Message-ID: <20250122222654.21833-3-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122222654.21833-1-ryazanov.s.a@gmail.com> References: <20250122222654.21833-1-ryazanov.s.a@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250122_142714_627225_BDF1A7FD X-CRM114-Status: GOOD ( 19.04 ) X-Spam-Score: -1.1 (-) 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: ATM TC layer have some issues which effectively prevent VRX518 from being used as ADSL modem. Specifically, there one crash during the ATM layer configuration and wrong PVC ID selection on packet rece [...] Content analysis details: (-1.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ryazanov.s.a(at)gmail.com] 1.0 FREEMAIL_REPLY From and body contain different freemails 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 ATM TC layer have some issues which effectively prevent VRX518 from being used as ADSL modem. Specifically, there one crash during the ATM layer configuration and wrong PVC ID selection on packet receiving what breaks RX path. Fix both of the issues. Make subif iface registration optional to prevent the crash (see more details in the new patch) and update the hardcoded PVC ID to match the first allocated channel. Run tested with FRITZ!Box 7530. Fixes: 474bbe23b7 ("kernel: add Intel/Lantiq VRX518 TC driver") Reported-and-tested-by: nebibigon93@yandex.ru Signed-off-by: Sergey Ryazanov --- .../lantiq/vrx518_tc/patches/100-compat.patch | 2 +- ...tm_tc-fix-crash-on-subif_reg-absence.patch | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch diff --git a/package/kernel/lantiq/vrx518_tc/patches/100-compat.patch b/package/kernel/lantiq/vrx518_tc/patches/100-compat.patch index d04c1ed5df..81e32369ba 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/100-compat.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/100-compat.patch @@ -166,7 +166,7 @@ - return (skb->DW0 >> 3) & 0xF; +// return (skb->DW0 >> 3) & 0xF; -+ return 1; ++ return 0; /* We use only one connection for now, so return the first connection id */ } static int atm_get_qid_by_vcc(struct net_device *dev, struct sk_buff *skb, diff --git a/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch b/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch new file mode 100644 index 0000000000..87456424c3 --- /dev/null +++ b/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch @@ -0,0 +1,75 @@ +From: Sergey Ryazanov +Date: Fri, 10 Jan 2025 00:57:27 +0000 +Subject: [PATCH] vrx518_tc: atm_tc: fix crash on subif_reg absence + +VRX518 (sw_plat) platform does not provid the subif_reg/subif_unreg ops +in the same time ATM TC layer unconditionally calls them, what leads to +the kernel crash on the atm_hook_mpoa_setup hook invocation from the ATM +stack: + + vrx518_tc:mpoa_setup_sync : sync: conn: 0, vpi: 0, vci: 35, mpoa_type: 0, mpoa_mode: 0 + Unable to handle kernel NULL pointer dereference at virtual address 00000000 + +Subif registration is optional and PTM TC do this only when the +corresponding ops are defined. Do the same for ATM TC and call +subif_reg/subif_unreg only if they are not NULL. + +While at it, move subif related data preparation under the 'if' block +in order to group and isolate that aux code. + +Run tested with FRITZ!Box 7530. + +Signed-off-by: Sergey Ryazanov +--- +--- a/dcdp/atm_tc.c ++++ b/dcdp/atm_tc.c +@@ -1232,8 +1232,9 @@ static void ppe_close(struct atm_vcc *vc + validate_oam_htu_entry(priv, 0); + spin_unlock_bh(&priv->atm_lock); + +- priv->tc_priv->tc_ops.subif_unreg(dev, (!dev) ? dev_name : dev->name, +- priv->conn[cid].subif_id, 0); ++ if (priv->tc_priv->tc_ops.subif_unreg) ++ priv->tc_priv->tc_ops.subif_unreg(dev, (!dev) ? dev_name : dev->name, ++ priv->conn[cid].subif_id, 0); + + memset(conn, 0, sizeof(*conn)); + +@@ -2791,24 +2792,26 @@ static void mpoa_setup_sync(struct atm_p + struct wtx_queue_config_t tx_qcfg; + struct uni_cell_header *cell_header; + struct atm_vcc *vcc; +- struct net_device *dev; +- char dev_name[32]; + + tc_dbg(priv->tc_priv, MSG_INIT, + "sync: conn: %d, vpi: %d, vci: %d, mpoa_type: %d, mpoa_mode: %d\n", + conn, priv->conn[conn].vcc->vpi, priv->conn[conn].vcc->vci, + priv->conn[conn].mpoa_type, priv->conn[conn].mpoa_mode); + +- dev = priv->conn[conn].dev; ++ if (priv->tc_priv->tc_ops.subif_reg) { ++ struct net_device *dev; ++ char dev_name[32]; ++ ++ dev = priv->conn[conn].dev; ++ if (!dev) ++ sprintf(dev_name, "atm_%d%d", ++ priv->conn[conn].vcc->vpi, priv->conn[conn].vcc->vci); + +- if (!dev) +- sprintf(dev_name, "atm_%d%d", +- priv->conn[conn].vcc->vpi, priv->conn[conn].vcc->vci); +- +- priv->tc_priv->tc_ops.subif_reg(dev, (!dev) ? dev_name : dev->name, +- &priv->conn[conn].subif_id, 0); +- tc_dbg(priv->tc_priv, MSG_INIT, +- "conn[%d]subif_id[%x]", conn, priv->conn[conn].subif_id); ++ priv->tc_priv->tc_ops.subif_reg(dev, !dev ? dev_name : dev->name, ++ &priv->conn[conn].subif_id, 0); ++ tc_dbg(priv->tc_priv, MSG_INIT, ++ "conn[%d]subif_id[%x]", conn, priv->conn[conn].subif_id); ++ } + vcc = priv->conn[conn].vcc; + + /* set htu entry */ From patchwork Wed Jan 22 22:26:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 2037752 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=rllGhlWm; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=bF31Bw1x; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Yddym3yHyz20Hd for ; Thu, 23 Jan 2025 09:28:47 +1100 (AEDT) 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=wp0hbfKde8pBEXfoGuZu9nhF2rVBbv0iIG+JHEeLiZQ=; b=rllGhlWmSMsBhO swJkgwuUnSTQa7TkKoRhN3h31ZsRfv5aXOoGVkx2kCyEFnhjOeriK8HaLo13krLnWhIMm05ojcyZp yheT0Myx33jcwMz2g77ZsmMdORJ0moSzcdDI1Lez80MW/B6pTCuFs70IPIA5k/R56kZaEc1t+vcyv XnKvLAxnsJEv5X0t0P/pw9ovIDxeHLd8sAyB28lSaTZzfJqBeOZcz39zVGWwcaTkDddXXsYFhwbwQ bqqFxYCtsnpBet5R9i1qb2okceqBmmd3aOvFjQEeaRGgHvFSsti+7TTQRoaTk/VvSgsmsymSuR9YE DaLh7U2/zPJOslaqh7Ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tajBu-0000000BJPU-2DIh; Wed, 22 Jan 2025 22:27:18 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tajBs-0000000BJN1-0rqH for openwrt-devel@lists.openwrt.org; Wed, 22 Jan 2025 22:27:17 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso1751405e9.0 for ; Wed, 22 Jan 2025 14:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737584834; x=1738189634; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C1rOjgJxInlhwavWvgTG7mWl4kKe0465ALeNxIbElhM=; b=bF31Bw1xcwP+GcPY473rieV/nT3uz5VnKXrarmrIszv7BflNIIDIWB8IFxRf4Z+l// NozvEpkgOhe9Y88k8SF5KB3OvZ2nSRNoM2/JEoNZycXAOs2/9PMX/l9BTD1PsQyqYQSu MmKyInAB9S8CKCLIVBAT87G3mOC7zSVgDDbgTv9xORMzlENnq6SJMjY8chTSQyZV/5pJ eaJxhpVX+7yp8OVEkm9zM7e2uiyYF5RZ7oytevdsVIUH8fZF2Y6nWr9ac1ImTg9N9Ij/ SJpgPz6dkZPxBIfBhuXdlMwPSbVjb4ESysAAgleP75jMdrvMOsx19YNYRidNQgVAbMsn dOTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737584834; x=1738189634; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C1rOjgJxInlhwavWvgTG7mWl4kKe0465ALeNxIbElhM=; b=EyEFgahAXFxC/eE4799ZXoLVHYypLmjRgvR7OijksLSUj4Xqtw/qSGv476xppEI84w PTp/qG7zckO48E5IauyxHT2ilHcEsSmklh1tNrJYgXUUvmWN7qqq1on5taaXcn3JFxgc E/powTbYwh4lc5gFzBdRA4rfxU6HOQ8bGRiDYSq8G3oMFHxpq0A5Z+PPAVSuZNgZTHDP o1rYCXmGC9mk9Jx/1Paq+mLwRoFivV3eGyrn+LQqbJ8q5uCMZ97J3rt6ER2k6E/X9NZD jhTyooCgUTCgLMRaqN+vI/HW34t90rTPcu5atc/aqtWa4sziB421Bh7ppXn7x4oq7ljE sWgg== X-Gm-Message-State: AOJu0Yxi+E4+iRFyR1vzea1DwkyBGxYJjEvPOAJMnc3FA9q+Ko4gZ9Jo A3FH/euTxEGIzm5/3jkS45gvFKnWU48+8Be2I5U8pOpwEsXa9Czz X-Gm-Gg: ASbGnct7M40+wQ0AxuR2eaikXgDXRh1iEir+Orm7u+5f9UkHf6KwBeIeo3ohzNIQ8LZ zUg11PU2siFIzbSbYioS+ihu4JxWfoaeSCc53+Iii8NnxtBIx4dog4gin8RB/l7J0lhvJ04Ki71 Z8ofrshaW4ygLE+Th2ko0mWHuSS4X172EUeN6fZDS6T7Kvf8vBa/Xr2455doVTFD7UWzgiF3LU8 pcJXVFQUWblpImu/wHmAi6HVSHER7LZg7UZv7UXhXjm+DOXrAKwpjTj7NwYwBcUuNgNLg+D8zhy SoNcmg== X-Google-Smtp-Source: AGHT+IG4hhFOeSxNHT8j6pa5vgQmuvj/O+mvPQIEDHTfCni1ysmj3M3SXiJZ9fygc6Z1V7Q94Ak6yQ== X-Received: by 2002:a05:6000:1ac7:b0:382:4f9e:711f with SMTP id ffacd0b85a97d-38bf564d849mr20954943f8f.6.1737584834305; Wed, 22 Jan 2025 14:27:14 -0800 (PST) Received: from localhost.localdomain ([69.6.8.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf328864esm17773125f8f.99.2025.01.22.14.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 14:27:13 -0800 (PST) From: Sergey Ryazanov To: Daniel Golle Cc: OpenWrt Development List , Andre Heider , Hauke Mehrtens , Jan Hoffmann , Martin Schiller , John Crispin Subject: [PATCH v4 3/4] ipq40xx: fix compatibility with linux-atm tools Date: Thu, 23 Jan 2025 00:26:53 +0200 Message-ID: <20250122222654.21833-4-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122222654.21833-1-ryazanov.s.a@gmail.com> References: <20250122222654.21833-1-ryazanov.s.a@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250122_142716_258927_D833FE27 X-CRM114-Status: GOOD ( 30.29 ) X-Spam-Score: -1.1 (-) 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: atm_qos struct should be the same both for user and kernel spaces. Via the __SO_ENCODE() macro it is used to define the SO_ATMQOS socket IOC. During the VRX518 support introduction, the atm_trafprm sturct nested into the atm_qos stucture was update with newer fields that are referenced by the ATM TC layer of the VRX518 TC driver. These new [...] Content analysis details: (-1.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:335 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ryazanov.s.a(at)gmail.com] 1.0 FREEMAIL_REPLY From and body contain different freemails 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 atm_qos struct should be the same both for user and kernel spaces. Via the __SO_ENCODE() macro it is used to define the SO_ATMQOS socket IOC. During the VRX518 support introduction, the atm_trafprm sturct nested into the atm_qos stucture was update with newer fields that are referenced by the ATM TC layer of the VRX518 TC driver. These new fields are intended to communicate information for extra traffic classes supported by the driver. But we are still using vanilla kernel headers to build the toolchain. Due to the atm.h header incoherency br2684ctl from linux-atm tools is incapable to configure the ATM bridge netdev: br2684ctl: Interface "dsl0" created sucessfully br2684ctl: Communicating over ATM 0.1.2, encapsulation: LLC br2684ctl: setsockopt SO_ATMQOS 22 <-- EINVAL errno br2684ctl: Fatal: failed to connect on socket; File descriptor in bad state There are two options to fix this incoherency. (a) update the header file in the toolchain to build linux-atm against updated atm_trafprm and atm_qos structures, or (b) revert atm_trafprm changes. Since there are no actual users of the extra ATM QoS traffic classes, just drop these extra traffic classes from vrx518_tc ATM TC layer and drop the kernel patch updating atm.h. Besides fixing the compatibility with linux-atm tools, removing the kernel patch should simplify kernel updates removing unneeded burden of maintenance. Run tested with FRITZ!Box 7530 with disabled extra traffic classes and then removed them entirely before the submission. CC: John Crispin Fixes: cfd42a0098 ("ipq40xx: add Intel/Lantiq ATM hacks") Suggested-by: Andre Heider Reported-and-tested-by: nebibigon93@yandex.ru Signed-off-by: Sergey Ryazanov --- Changes: v2->3: drop the extra traffic classes entirely together with the kernel patch for atm.h --- ...1-dcdp-atm_tc-drop-extra-qos-classes.patch | 144 ++++++++++++++++++ .../lantiq/vrx518_tc/patches/200-swplat.patch | 12 +- .../lantiq/vrx518_tc/patches/202-napi.patch | 4 +- ...-dcdp-atm_tc-fix-compilation-warning.patch | 6 +- ...tm_tc-fix-crash-on-subif_reg-absence.patch | 4 +- .../patches-6.6/998-lantiq-atm-hacks.patch | 43 ------ 6 files changed, 157 insertions(+), 56 deletions(-) create mode 100644 package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch delete mode 100644 target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch diff --git a/package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch b/package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch new file mode 100644 index 0000000000..5c7b246545 --- /dev/null +++ b/package/kernel/lantiq/vrx518_tc/patches/101-dcdp-atm_tc-drop-extra-qos-classes.patch @@ -0,0 +1,144 @@ +Extra ATM traffic classes requires atm_qos struct extension and a set of +new defines. What itself requires atm.h updates both in the kernel and +in the toolchain. On another hand we do not have any real users of these +traffic classes. + +In absence of real user there are no benefits to support this +functionality. There is only the burden of maintenance of extra patches +all around the building framework. So just drop these extra QoS traffic +classes in order to facilitate maintenance and avoid side effects like +breaking compatibility with existing userspace tools like linux-atm. + +Signed-off-by: Sergey Ryazanov +-- +--- a/dcdp/atm_tc.c ++++ b/dcdp/atm_tc.c +@@ -463,34 +463,9 @@ static void set_qsb(struct atm_priv *pri + /* Weighted Fair Queueing Factor (WFQF) */ + switch (qos->txtp.traffic_class) { + case ATM_CBR: +- case ATM_VBR_RT: + /* real time queue gets weighted fair queueing bypass */ + q_parm_tbl.bit.wfqf = 0; + break; +- case ATM_VBR_NRT: +- case ATM_UBR_PLUS: +- /* WFQF calculation here is based on virtual cell rates, +- to reduce granularity for high rates +- */ +- /* WFQF is maximum cell rate / garenteed cell rate */ +- /* wfqf = qsb_minimum_cell_rate * QSB_WFQ_NONUBR_MAX / +- requested_minimum_peak_cell_rate +- */ +- if (qos->txtp.min_pcr == 0) +- q_parm_tbl.bit.wfqf = QSB_WFQ_NONUBR_MAX; +- else { +- tmp = QSB_GCR_MIN * QSB_WFQ_NONUBR_MAX / +- qos->txtp.min_pcr; +- if (tmp == 0) +- q_parm_tbl.bit.wfqf = 1; +- else if (tmp > QSB_WFQ_NONUBR_MAX) +- q_parm_tbl.bit.wfqf +- = QSB_WFQ_NONUBR_MAX; +- else +- q_parm_tbl.bit.wfqf = tmp; +- } +- break; +- + case ATM_UBR: + default: + q_parm_tbl.bit.wfqf = QSB_WFQ_UBR_BYPASS; +@@ -498,42 +473,9 @@ static void set_qsb(struct atm_priv *pri + } + + /* Sustained Cell Rate (SCR) Leaky Bucket Shaper VBR.0/VBR.1 */ +- if (qos->txtp.traffic_class == ATM_VBR_RT || +- qos->txtp.traffic_class == ATM_VBR_NRT) { +- if (qos->txtp.scr == 0) { +- /* disable shaper */ +- q_vbr_parm_tbl.bit.taus = 0; +- q_vbr_parm_tbl.bit.ts = 0; +- } else { +- /* Cell Loss Priority (CLP) */ +- if ((vcc->atm_options & ATM_ATMOPT_CLP)) +- /* CLP1 */ +- q_parm_tbl.bit.vbr = 1; +- else +- /* CLP0 */ +- q_parm_tbl.bit.vbr = 0; +- /* Rate Shaper Parameter (TS) and +- Burst Tolerance Parameter for SCR (tauS) +- */ +- tmp = ((qsb_clk * param->qsb_tstep) >> 5) / +- qos->txtp.scr + 1; +- q_vbr_parm_tbl.bit.ts +- = tmp > QSB_TP_TS_MAX ? QSB_TP_TS_MAX : tmp; +- tmp = (qos->txtp.mbs - 1) * +- (q_vbr_parm_tbl.bit.ts - +- q_parm_tbl.bit.tp) / 64; +- if (tmp == 0) +- q_vbr_parm_tbl.bit.taus = 1; +- else if (tmp > QSB_TAUS_MAX) +- q_vbr_parm_tbl.bit.taus +- = QSB_TAUS_MAX; +- else +- q_vbr_parm_tbl.bit.taus = tmp; +- } +- } else { +- q_vbr_parm_tbl.bit.taus = 0; +- q_vbr_parm_tbl.bit.ts = 0; +- } ++ /* NB: shaper disabled since there no user interface to activate it */ ++ q_vbr_parm_tbl.bit.taus = 0; ++ q_vbr_parm_tbl.bit.ts = 0; + + /* Queue Parameter Table (QPT) */ + tc_w32(QSB_QPT_SET_MASK, QSB_RTM); +@@ -1064,15 +1006,6 @@ static int ppe_open(struct atm_vcc *vcc) + /* check bandwidth */ + if ((vcc->qos.txtp.traffic_class == ATM_CBR && + vcc->qos.txtp.max_pcr > +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) +- || (vcc->qos.txtp.traffic_class == ATM_VBR_RT && +- vcc->qos.txtp.max_pcr > +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) +- || (vcc->qos.txtp.traffic_class == ATM_VBR_NRT && +- vcc->qos.txtp.scr > +- (port->tx_max_cell_rate - port->tx_used_cell_rate)) +- || (vcc->qos.txtp.traffic_class == ATM_UBR_PLUS && +- vcc->qos.txtp.min_pcr > + (port->tx_max_cell_rate - port->tx_used_cell_rate))) { + tc_dbg(priv->tc_priv, MSG_INIT, "exceed TX line rate\n"); + return -EINVAL; +@@ -1128,15 +1061,8 @@ static int ppe_open(struct atm_vcc *vcc) + /* reserve bandwidth */ + switch (vcc->qos.txtp.traffic_class) { + case ATM_CBR: +- case ATM_VBR_RT: + port->tx_used_cell_rate += vcc->qos.txtp.max_pcr; + break; +- case ATM_VBR_NRT: +- port->tx_used_cell_rate += vcc->qos.txtp.scr; +- break; +- case ATM_UBR_PLUS: +- port->tx_used_cell_rate += vcc->qos.txtp.min_pcr; +- break; + } + + /* update atm_vcc structure */ +@@ -1222,15 +1148,8 @@ static void ppe_close(struct atm_vcc *vc + /* release bandwidth */ + switch (vcc->qos.txtp.traffic_class) { + case ATM_CBR: +- case ATM_VBR_RT: + port->tx_used_cell_rate -= vcc->qos.txtp.max_pcr; + break; +- case ATM_VBR_NRT: +- port->tx_used_cell_rate -= vcc->qos.txtp.scr; +- break; +- case ATM_UBR_PLUS: +- port->tx_used_cell_rate -= vcc->qos.txtp.min_pcr; +- break; + } + + /* idle for a while to let parallel operation finish */ diff --git a/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch b/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch index 6596a8b913..930fa6632c 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/200-swplat.patch @@ -3,7 +3,7 @@ This replaces it by a basic working implementation. --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -603,7 +603,11 @@ static void atm_aca_init(struct atm_priv +@@ -545,7 +545,11 @@ static void atm_aca_init(struct atm_priv cfg = &priv->tc_priv->cfg; txin = ¶m.aca_txin; @@ -15,7 +15,7 @@ This replaces it by a basic working implementation. txin->hd_size_in_dw = cfg->txin.soc_desc_dwsz; txin->pd_desc_base = SB_XBAR_ADDR(__ACA_TX_IN_PD_LIST_BASE); txin->pd_desc_num = __ACA_TX_IN_PD_LIST_NUM; -@@ -625,7 +629,11 @@ static void atm_aca_init(struct atm_priv +@@ -567,7 +571,11 @@ static void atm_aca_init(struct atm_priv txin->soc_cmlt_cnt_addr); txout = ¶m.aca_txout; @@ -27,7 +27,7 @@ This replaces it by a basic working implementation. txout->hd_size_in_dw = cfg->txout.soc_desc_dwsz; txout->pd_desc_base = SB_XBAR_ADDR(__ACA_TX_OUT_PD_LIST_BASE); txout->pd_desc_num = __ACA_TX_OUT_PD_LIST_NUM; -@@ -647,7 +655,11 @@ static void atm_aca_init(struct atm_priv +@@ -589,7 +597,11 @@ static void atm_aca_init(struct atm_priv txout->soc_cmlt_cnt_addr); rxout = ¶m.aca_rxout; @@ -39,7 +39,7 @@ This replaces it by a basic working implementation. rxout->hd_size_in_dw = cfg->rxout.soc_desc_dwsz; rxout->pd_desc_base = SB_XBAR_ADDR(__ACA_RX_OUT_PD_LIST_BASE); rxout->pd_desc_num = __ACA_RX_OUT_PD_LIST_NUM; -@@ -669,7 +681,11 @@ static void atm_aca_init(struct atm_priv +@@ -611,7 +623,11 @@ static void atm_aca_init(struct atm_priv rxout->soc_cmlt_cnt_addr); rxin = ¶m.aca_rxin; @@ -51,7 +51,7 @@ This replaces it by a basic working implementation. rxin->hd_size_in_dw = cfg->rxin.soc_desc_dwsz; rxin->pd_desc_base = SB_XBAR_ADDR(__RX_IN_PD_DES_LIST_BASE); rxin->pd_desc_num = __ACA_RX_IN_PD_LIST_NUM; -@@ -1261,7 +1277,7 @@ static int ppe_ioctl(struct atm_dev *dev +@@ -1180,7 +1196,7 @@ static int ppe_ioctl(struct atm_dev *dev static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb) { int ret, qid, mpoa_pt, mpoa_type, vid; @@ -60,7 +60,7 @@ This replaces it by a basic working implementation. struct atm_priv *priv; if (!vcc) { -@@ -1327,12 +1343,14 @@ static int ppe_send(struct atm_vcc *vcc, +@@ -1246,12 +1262,14 @@ static int ppe_send(struct atm_vcc *vcc, tc_dbg(priv->tc_priv, MSG_TX, "vid: 0x%x, qid: 0x%x\n", vid, qid); diff --git a/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch b/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch index 266beba1a7..75d18138c0 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/202-napi.patch @@ -296,7 +296,7 @@ priv->tc_ops.umt_start = plat_umt_start; --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -3650,7 +3650,7 @@ static void atm_aca_ring_config_init(str +@@ -3569,7 +3569,7 @@ static void atm_aca_ring_config_init(str static int atm_ring_init(struct atm_priv *priv) { atm_aca_ring_config_init(priv); @@ -305,7 +305,7 @@ } static int atm_init(struct tc_priv *tcpriv, u32 ep_id) -@@ -4020,7 +4020,7 @@ void atm_tc_unload(void) +@@ -3939,7 +3939,7 @@ void atm_tc_unload(void) /* unregister device */ if (priv->tc_priv->tc_ops.dev_unreg != NULL) priv->tc_priv->tc_ops.dev_unreg(NULL, diff --git a/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch index bf2d82e2b5..1b70a663cd 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch @@ -1,6 +1,6 @@ --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -746,7 +746,8 @@ static void atm_aca_init(struct atm_priv +@@ -688,7 +688,8 @@ static void atm_aca_init(struct atm_priv ACA_TXOUT_EN | ACA_RXIN_EN | ACA_RXOUT_EN, 1); } @@ -10,7 +10,7 @@ { struct tm nowtm; char tmbuf[64]; -@@ -765,7 +766,8 @@ static int print_datetime(char *buffer, +@@ -707,7 +708,8 @@ static int print_datetime(char *buffer, nowtm.tm_hour, nowtm.tm_min, nowtm.tm_sec); @@ -20,7 +20,7 @@ return 0; } -@@ -967,7 +969,7 @@ void show_atm_pvc(struct seq_file *seq, +@@ -909,7 +911,7 @@ void show_atm_pvc(struct seq_file *seq, char buf[64]; seq_printf(seq, "\tNet device: %s\n", pvc->dev->name); diff --git a/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch b/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch index 87456424c3..f268c0908c 100644 --- a/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch +++ b/package/kernel/lantiq/vrx518_tc/patches/207-dcdp-atm_tc-fix-crash-on-subif_reg-absence.patch @@ -23,7 +23,7 @@ Signed-off-by: Sergey Ryazanov --- --- a/dcdp/atm_tc.c +++ b/dcdp/atm_tc.c -@@ -1232,8 +1232,9 @@ static void ppe_close(struct atm_vcc *vc +@@ -1158,8 +1158,9 @@ static void ppe_close(struct atm_vcc *vc validate_oam_htu_entry(priv, 0); spin_unlock_bh(&priv->atm_lock); @@ -35,7 +35,7 @@ Signed-off-by: Sergey Ryazanov memset(conn, 0, sizeof(*conn)); -@@ -2791,24 +2792,26 @@ static void mpoa_setup_sync(struct atm_p +@@ -2710,24 +2711,26 @@ static void mpoa_setup_sync(struct atm_p struct wtx_queue_config_t tx_qcfg; struct uni_cell_header *cell_header; struct atm_vcc *vcc; diff --git a/target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch b/target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch deleted file mode 100644 index c15a4b3ae3..0000000000 --- a/target/linux/ipq40xx/patches-6.6/998-lantiq-atm-hacks.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: John Crispin -Date: Fri, 3 Aug 2012 10:27:25 +0200 -Subject: [PATCH 04/36] MIPS: lantiq: add atm hack - -Signed-off-by: John Crispin ---- a/include/uapi/linux/atm.h -+++ b/include/uapi/linux/atm.h -@@ -131,8 +131,14 @@ - #define ATM_ABR 4 - #define ATM_ANYCLASS 5 /* compatible with everything */ - -+#define ATM_VBR_NRT ATM_VBR -+#define ATM_VBR_RT 6 -+#define ATM_UBR_PLUS 7 -+#define ATM_GFR 8 -+ - #define ATM_MAX_PCR -1 /* maximum available PCR */ - -+ - struct atm_trafprm { - unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */ - int max_pcr; /* maximum PCR in cells per second */ -@@ -155,6 +161,9 @@ struct atm_trafprm { - unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */ - unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */ - unsigned int spare :9; /* spare bits */ -+ int scr; /* sustained rate in cells per second */ -+ int mbs; /* maximum burst size (MBS) in cells */ -+ int cdv; /* Cell delay variation */ - }; - - struct atm_qos { ---- a/net/atm/proc.c -+++ b/net/atm/proc.c -@@ -141,7 +141,7 @@ static void *vcc_seq_next(struct seq_fil - static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) - { - static const char *const class_name[] = { -- "off", "UBR", "CBR", "VBR", "ABR"}; -+ "off","UBR","CBR","NTR-VBR","ABR","ANY","RT-VBR","UBR+","GFR"}; - static const char *const aal_name[] = { - "---", "1", "2", "3/4", /* 0- 3 */ - "???", "5", "???", "???", /* 4- 7 */ From patchwork Wed Jan 22 22:26:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 2037756 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=uk3xJkki; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=MZWhq8t6; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Yddyq6gSRz20Hd for ; Thu, 23 Jan 2025 09:28:51 +1100 (AEDT) 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=U1D2dedzHC1AJvRniOK6HKRrcfKDBA3E+IJtoGVf1ts=; b=uk3xJkkiTArZ/0 cTpuFpGBjETku9CtzSpklPnJPzPUs8iuklPnv8Xn1QFLj0R4wCfHkT9fKJoetoNZqknqTNDPe88tF R5WRyvRtiJj6gMfTCENJz6P0rHeVHbC0NKLeBJUUZVKh/dY9pOw37kpw0UP+XtIw4ZuHRF0vWget8 IoSXhizgiM3/g75RH+/RzSGYEfDyvvuH6djnxzgDOTRnpSDpjvGEk2wfb6+WHApt8MEgkr+uuGST1 ydG2b3cY2kjgRiVCTmqzerGoXWziuH1DnZCb5zukKCKxmR/t3Pn1XevliHOG/exGKbOv/nG7IxdHp MyLlmXTobgko62920X7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tajBv-0000000BJQ2-2waX; Wed, 22 Jan 2025 22:27:19 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tajBt-0000000BJOB-1g9t for openwrt-devel@lists.openwrt.org; Wed, 22 Jan 2025 22:27:18 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43624b2d453so2591465e9.2 for ; Wed, 22 Jan 2025 14:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737584836; x=1738189636; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SKm6nmv3idiP7gQrqed7N/oNZLvlsaFPdydtBSK1w9w=; b=MZWhq8t6K4QYbeQuOQ5gZfg8OQ3x/lDMtyKMH+cK5lGIlcCqhogKKZ8QrdYk3GBbqp yGvFEuHt4OtXZ/gw4WLPcQv/OFVyMATlWqBleTGUw0MSSRUhNod62DyycfLuAGMcH3n8 ArChNzNl2zaAKoR9SHTB5U8zUQWkgmQSAI3pAXfCOeyGP5n828lbT98EpDx6qVQIpIVh A4eH/5mFbpzMdCDfZrOH0kYSkojDxSEQrP5ZNht/1K1GRXFVy9bGHJ9MiyN1y/i9zjCa 88CV2iygDxCixuDSqx1OyAC0Cgw+eamwl+v/5wFIAu0bKxZXzNvgelM5K3WoTAXksueg PvcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737584836; x=1738189636; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SKm6nmv3idiP7gQrqed7N/oNZLvlsaFPdydtBSK1w9w=; b=Jx+zCA38/qsbnQQWM+0BFKjq8Nq1f89WZZQq50m2CFZD7BwMhvQUoTcZnXNyvzFLNt ypbvnqHwhO+ij7OGdyfSOuCOJ4Do6bl87/8sRtul18Xrkza6SowW5E9UPo73e9/McjV1 Ffl/yI0in/Mvl7wQAtvQsqBUsbVgNLi+4YzMrx/0pUWAcVSxAi/qfTdXtoFqHpDI3Pua uuVP3CKHkMa8PbnzwxIR9fiv8l+/kGGrIIFE6wcnmRB47q+Tcbx/L5gknJr6A7I4BLTI Wt3hBKQO7+OvbQTNCeNTO1FiAl018inpr5xFOB18NGIuIuddsD4u1ry5sh67uXkToRZ6 OjZA== X-Gm-Message-State: AOJu0YyhtUgzdpjiprb6IawaZ4+kxrcAZTP8uGYbbXvjymgCBf87/h2G NTghvlkIVdzPXa8cacUuLNfgIPtoo1pUXQZ37g1FaeSJFVFK+8tK X-Gm-Gg: ASbGncvqFTiiMjTg+4WOaVFld1MLbLs0beq5bU6ycN0rYSvgPs93mM0ugadRXntFokw fBat+lOc7bUUqwiwK8zvY9HnO6Y/TEQzCMXzzNyB/PxsEEXxK8qBYQx8km7jkB/YY5OAlA2G4HZ gdFlcZ2NInqhwVOkQN1MxbBY7uDyiC/4XsfD3izA5UKK1lfCcHse+v0kJtEXw6E8ximNReQgSmS +3xonrdG5tCiKkSIgnYES7EXyb+TaZtu0IRIfGgD1klmTxeht3iBxYO3WhbuR2BNFhNqyodwuLH afaFFg== X-Google-Smtp-Source: AGHT+IG1F4Xx/35vqZ2pjVw1VhTXi9ImN6kQhKxlXfhKymfjq2aBy0cZ+HtnZjK4MyaHEDjdhT+0hA== X-Received: by 2002:a5d:58d1:0:b0:385:e394:37ed with SMTP id ffacd0b85a97d-38bf5659cd5mr17295756f8f.18.1737584835665; Wed, 22 Jan 2025 14:27:15 -0800 (PST) Received: from localhost.localdomain ([69.6.8.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf328864esm17773125f8f.99.2025.01.22.14.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 14:27:15 -0800 (PST) From: Sergey Ryazanov To: Daniel Golle Cc: OpenWrt Development List , Andre Heider , Hauke Mehrtens , Jan Hoffmann , Martin Schiller Subject: [PATCH v4 4/4] kernel: vrx518_tc: bump PKG_RELEASE Date: Thu, 23 Jan 2025 00:26:54 +0200 Message-ID: <20250122222654.21833-5-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122222654.21833-1-ryazanov.s.a@gmail.com> References: <20250122222654.21833-1-ryazanov.s.a@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250122_142717_443029_AE7DE06C X-CRM114-Status: GOOD ( 10.21 ) X-Spam-Score: -2.1 (--) 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: Bump PKG_RELEASE after the previous fixes. Signed-off-by: Sergey Ryazanov --- package/kernel/lantiq/vrx518_tc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/lantiq/vrx518_tc/Makefile b/package/kernel/lantiq/vrx518_tc/Makefile index a5718d9d5b..d92c6d1c63 100644 --- a/package/kernel/lantiq/vrx518_tc/Makefile +++ b/package/kernel [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ryazanov.s.a(at)gmail.com] 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 Bump PKG_RELEASE after the previous fixes. Signed-off-by: Sergey Ryazanov --- package/kernel/lantiq/vrx518_tc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/lantiq/vrx518_tc/Makefile b/package/kernel/lantiq/vrx518_tc/Makefile index a5718d9d5b..d92c6d1c63 100644 --- a/package/kernel/lantiq/vrx518_tc/Makefile +++ b/package/kernel/lantiq/vrx518_tc/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=vrx518_tc PKG_VERSION:=1.5.12.4 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_BASE_NAME:=vrx518_tc_drv UGW_VERSION=8.5.2.10