From patchwork Sun Nov 5 20:57:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13446145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53CCFC4332F for ; Sun, 5 Nov 2023 20:57:59 +0000 (UTC) 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:Cc:To:MIME-Version:Message-Id:Date: Subject: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=NO292kS8cb00yIfSU9x5Zf7jLMMD/Cb9nKhczwV7KuI=; b=cWm22joIK8MEUP ze2Q+fRfR86a53DG46VUIpqWZlLOFE1lrqZwMc33a+QJFHbtn1oMEgK3zGZ5sS2WUrmR+OmvyD7OJ Dz5g3uQbAAgw1PL0UMbBoMswd5ffwsc5BK65NnmYvQJDkrz/+nKyoWLjdOG5FAtk7oSbA8oWsCem3 x4NXfevG9fGEuuXJBAF6fLPhzfJlLGBIJhEeJwDnatDM6ld0vMlGBlHjUy6w2GLjn9jnr9alOLzAu ok8YAUlArXCi7r/rZf0VbFdr3MNeSSjEDb0tmSLYv3jyJJfBwlRBRt+YLyYLMWFdZSPqrx4KcgLnR 6OCnNkC+x9D+0wurCPWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qzkBX-00FVvF-21; Sun, 05 Nov 2023 20:57:31 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qzkBV-00FVuo-16 for linux-arm-kernel@lists.infradead.org; Sun, 05 Nov 2023 20:57:30 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5094cb3a036so4562569e87.2 for ; Sun, 05 Nov 2023 12:57:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699217847; x=1699822647; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=WFkRCO5Gr31wYYObvH3M58yivJORulviaRB/LYrXXJQ=; b=d5SF5SZLScGrxpZDjLbaiQn4T3vRx9iUY5IWezRgWt25J5Kr/yZUCFqOqBBcmTpJkE M+r9wJW1qs6oDDCFIT+Dt607iXGJ+n2bqbPcpkaQ5IuPH/I818oPyMq7aVZFfMqirvw9 pYviL4VPY22VRGlKZfimF+Fh8ti9XhTcUPSQEVqfTOJXdQh92mts2G93iiIgcHXOr4NQ w1Ecs2zpPD28EgtyothOatOfqFRclB0yXsr3rO9aOAIovjiZ9q5f5ziJfBwNn2vMMiWp uXCDpCj+Dh2aW7dx791v+eZVjDTjUidKkqI4fk05Zgi+kJDC0zC2/7fu7MgJDCmj6VMQ /yug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699217847; x=1699822647; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WFkRCO5Gr31wYYObvH3M58yivJORulviaRB/LYrXXJQ=; b=H2bjJ2+3hRQ8R75UoEMHbE+fgWHi9bCjyVeYxodrjmr4GB7yPjt/XMUQfffJnVkG7Y n4Scw4iOjTUzN/nm92z88FZGkB2RjDb9N3wlwPqG4nRwqtmy1Yri173SxnLJXSYkQ+u9 ZEKm3EfeMMKFai2hWpzhhzQel24TC8Pbk/yDxXbZnnC1uHfHEyGj51AtjMGlCAy1LcDH gSM84jVrYofyfcqyLjUyIIjWIOKlZoLFbQQ3cZFa7gpgcyOpTIubckpTXhUji2cRJWlc +V5FFq1P1KlZ8vT6VcG86fljyYi4AvJ4NCL2FKSbMkFjNHsmV2asBD0PmJdfw3m0PdDL QbqA== X-Gm-Message-State: AOJu0YzVhHdcqkxSfaKPP1CzzfbMiNIPuVv7SedcJWQL0qN1pnX6kUnF rjtF+OccQEClxZd+P9bNkyFjLA== X-Google-Smtp-Source: AGHT+IGGCnq8W4xy+A703Avtfw1jtmjghCdQJdWIjjPpOpvf4AdSuEWf3pw2aCu+fr2p82NwWqsyhg== X-Received: by 2002:a05:6512:969:b0:509:377a:26d9 with SMTP id v9-20020a056512096900b00509377a26d9mr10364957lft.8.1699217846755; Sun, 05 Nov 2023 12:57:26 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id d12-20020ac24c8c000000b00507c72697d0sm931873lfl.303.2023.11.05.12.57.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 12:57:26 -0800 (PST) From: Linus Walleij Subject: [PATCH net v2 0/4] Fix large frames in the Gemini ethernet driver Date: Sun, 05 Nov 2023 21:57:22 +0100 Message-Id: <20231105-gemini-largeframe-fix-v2-0-cd3a5aa6c496@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIALIBSGUC/4WNTQqDMBCFryKzboqTKP1Z9R7FRRoncUCTMhFpk dy9wQt0+b7H+94OmYQpw73ZQWjjzCnWoE8NuMnGQIrHmkG32iC2nQq0cGQ1WwnkxS6kPH+Uw86 M2l2u+Oqhbt9CFR/eJ0RaYahw4rwm+R5fGx7VH+2GqlU31/dovNbemMfM0Uo6JwkwlFJ+9/O3g sAAAAA= To: Hans Ulli Kroll , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= , Vladimir Oltean , Andrew Lunn Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231105_125729_385080_B99A5260 X-CRM114-Status: GOOD ( 11.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is the result of a bug hunt for a problem with the RTL8366RB DSA switch leading me wrong all over the place. I am indebted to Vladimir Oltean who as usual pointed out where the real problem was, many thanks! Tryig to actually use big ("jumbo") frames on this hardware uncovered the real bugs. Then I tested it on the DSA switch and it indeed fixes the issue. Signed-off-by: Linus Walleij --- Changes in v2: - Don't check for oversized MTU request: the framework makes sure it doesn't happen. - Drop unrelated BIT() macro cleanups (I might send these later for net-next) - Use a special error code if the skbuff is too big and fail gracefully is this happens. - Do proper checksum of the frame using a software fallback when the frame is too long for hardware checksumming. - Link to v1: https://lore.kernel.org/r/20231104-gemini-largeframe-fix-v1-0-9c5513f22f33@linaro.org --- Linus Walleij (4): net: ethernet: cortina: Fix MTU max setting net: ethernet: cortina: Fix max RX frame define net: ethernet: cortina: Protect against oversized frames net: ethernet: cortina: Handle large frames drivers/net/ethernet/cortina/gemini.c | 39 ++++++++++++++++++++++++++++------- drivers/net/ethernet/cortina/gemini.h | 4 ++-- 2 files changed, 34 insertions(+), 9 deletions(-) --- base-commit: e85fd73c7d9630d392f451fcf69a457c8e3f21dd change-id: 20231104-gemini-largeframe-fix-c143d2c781b5 Best regards,