From patchwork Fri Oct 27 20:21:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 159149 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp862950vqb; Fri, 27 Oct 2023 13:22:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkGaMxCaAuQ0ahhBXdSgThZmZNX9wG/Gj+6igU6zNhGz+ycMasEQj5NIjQy8QVnD4kHVCo X-Received: by 2002:a81:9b95:0:b0:5a2:20ec:40be with SMTP id s143-20020a819b95000000b005a220ec40bemr3757477ywg.29.1698438139536; Fri, 27 Oct 2023 13:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698438139; cv=none; d=google.com; s=arc-20160816; b=fZLIORqSprsYR9UTOY+gyIM6NUMHHX5mgtzxNMKrE4J6Nh575yNTZKOMUQ65Mg2H/q FRcL+kT8AZXBs2+LnYUTniVGgshrNtca3LwgLm0TaV0dMfE0S1SYhzFYPjlRsWouI2ez ZsWOzSAPSJZ6BVUzOD0o86kELFgeiFKlXZ5aCZ6uaOBvPNeTbm1NDqDEK50JsvT3fjrf wGa0lIxn/WMDtZDNF8WR9p7Q2Wd827+UEoJfMBc4o4TSl1LlZHssmnb8WFPF0BV4stdu WA4jawXqdvrqc+tkDculhCkilG1KPPu/tEgjdf08jegFz5pQPOd/ggz8fUOoJI38TRy8 Qbqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=v2aSxynAJWD4w6QHvLKwVWJJOGC7WprRqk+AbZ7X+LM=; fh=keuXzro17w1EX7MbkvFc3mwOPfStnOmeFHd6JYQGOsk=; b=T4OD1V2je8peaEAZw6AihKTp5M7woG+z0SypHUefWR8rOqzESG5O9NDYcpcJWdCQlm CByBKz50bq+sM6Mjl8tXWC0DzAwgbAYn6qImaMHeOU8jxftyqCWddBtiYNRVPMLczKAT 9ORRl/GTkWzzRSehW6t8HPfdipw86tK6rZSWQ3CLHarQnizZO/viI6Gsw2rqRH4AK01B Olem/bsn3dzAZOPQHGft7AshkUImiIUCvx5rDViGJQEc4ZJtbI/QoXuahe4xcJh6hWLs 6qlDBM67oeKla97RHwXCHAsaQW9DPncZN1SA248oW/Bopu+KYoiu5OL2+ehB0hDbclix wZPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H9+pruVO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s124-20020a817782000000b005a7aa3faa68si3553453ywc.138.2023.10.27.13.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 13:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H9+pruVO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8D1E38339644; Fri, 27 Oct 2023 13:22:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346397AbjJ0UVr (ORCPT + 27 others); Fri, 27 Oct 2023 16:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjJ0UVp (ORCPT ); Fri, 27 Oct 2023 16:21:45 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 146D61AA for ; Fri, 27 Oct 2023 13:21:43 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5079f6efd64so3416264e87.2 for ; Fri, 27 Oct 2023 13:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698438101; x=1699042901; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=v2aSxynAJWD4w6QHvLKwVWJJOGC7WprRqk+AbZ7X+LM=; b=H9+pruVOxJQDYQWtfYdTgN9im65ZC/k2Aej8bvWnA8mneXDCan37cuh/6U7HJUwX/U KJq9+NygGgSqeVtkDo/mweJ2/0lWzlM5wfaj7Cmv0GbmNi7D/P21RPTywUAPjAF7zva/ qvSM+tWLU9KFaPX2/SgPk949/hr7dagG7Lc9imwkcDbS4HubCS+STWqI/lHYc9KPBCqW GUNJBFFJnFSNfzyBk/TGFLpar3eT/nZgFPiWbl4e8B5OFEAJ8zippCG4h5HcvUFvh0iK melPNEZmNNxgKEcGeoUhMRCeCnLm3CcbOZgLPoaWz09XyTj7bt3WihWCZJ9luNtHMwoy sFMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698438101; x=1699042901; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v2aSxynAJWD4w6QHvLKwVWJJOGC7WprRqk+AbZ7X+LM=; b=bEEqRX7UvKLSeOHNVejvKCEUYJcs8zN7v8qxrMxJnlDEnlJ5DDdOlZ2KzvheijCAVv jcwLvazEFyAhXPzx3aPFrg7UprrPWMlb2V9CZ2HXx5/qzR2f+i+2qrV00XHx73vLQXde IhaGDHYPZq12mR3mhx7K6Ai12EgepFJrlOTgzo4M/6H/TftQ0bz0tPzr6vT/QR6gg7mp lA0Voa0dsDngiQrZ7OXV0LVB2kfiR9IlTb0IGQ8/IqnRvlHI+w7ofqyhL3vxcD7xP0Tu kljvgx/vNsoic0f5TxGxHua90yueF+PpfHSS3Qxc2tkGgjCpUMEMaj3x67SFCULxMmu4 wXUg== X-Gm-Message-State: AOJu0YziE77Kxg06XE5bZM673zhAdWJSILEyoFW/w1f3EO/t9Ki8aKm+ /cQ8cPSLexi5xT/yq0AZYsaMuFD01brEhIs4S5I= X-Received: by 2002:ac2:4850:0:b0:507:a1e0:22f4 with SMTP id 16-20020ac24850000000b00507a1e022f4mr2496829lfy.29.1698438100941; Fri, 27 Oct 2023 13:21:40 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id r3-20020ac25a43000000b00507a3b0eb34sm388178lfn.264.2023.10.27.13.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 13:21:40 -0700 (PDT) From: Linus Walleij Date: Fri, 27 Oct 2023 22:21:39 +0200 Subject: [PATCH] dsa: tag_rtl4_a: Bump min packet size MIME-Version: 1.0 Message-Id: <20231027-fix-rtl8366rb-v1-1-d565d905535a@linaro.org> X-B4-Tracking: v=1; b=H4sIANIbPGUC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2NDAyNz3bTMCt2ikhwLYzOzoiTdVHNTo6QUU0sDw+REJaCegqJUoAKwedG xtbUATWVsMF8AAAA= To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 13:22:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780941470507883710 X-GMAIL-MSGID: 1780941470507883710 It was reported that the "LuCI" web UI was not working properly with a device using the RTL8366RB switch. Disabling the egress port tagging code made the switch work again, but this is not a good solution as we want to be able to direct traffic to a certain port. It turns out that sometimes, but not always, small packets are dropped by the switch for no reason. If we pad the ethernet frames to a minimum of ETH_FRAME_LEN + FCS (1518 bytes) everything starts working fine. As we completely lack datasheet or any insight into how this switch works, this trial-and-error solution is the best we can do. I have tested smaller sizes, ETH_FRAME_LEN doesn't work for example. Fixes: 0e90dfa7a8d8 ("net: dsa: tag_rtl4_a: Fix egress tags") Signed-off-by: Linus Walleij --- net/dsa/tag_rtl4_a.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- base-commit: 58720809f52779dc0f08e53e54b014209d13eebb change-id: 20231027-fix-rtl8366rb-e752bd5901ca Best regards, diff --git a/net/dsa/tag_rtl4_a.c b/net/dsa/tag_rtl4_a.c index c327314b95e3..8b1e81a6377b 100644 --- a/net/dsa/tag_rtl4_a.c +++ b/net/dsa/tag_rtl4_a.c @@ -41,8 +41,11 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, u8 *tag; u16 out; - /* Pad out to at least 60 bytes */ - if (unlikely(__skb_put_padto(skb, ETH_ZLEN, false))) + /* We need to pad out to at least ETH_FRAME_LEN + FCS bytes. This was + * found by trial-and-error. Sometimes smaller frames work, but sadly + * not always. + */ + if (unlikely(__skb_put_padto(skb, ETH_FRAME_LEN + ETH_FCS_LEN, false))) return NULL; netdev_dbg(dev, "add realtek tag to package to port %d\n",