From mboxrd@z Thu Jan 1 00:00:00 1970 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 9ECB5C4332F for ; Thu, 9 Nov 2023 10:46:52 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I/3PR+t3plGtTFt2hyvrCZF00WW1Tk9pBkSi6gzC2B8=; b=3iJoXLr/iK/Rgu semtQ90NrFK2bxE0Wl3KNA4Xp8WjfNhhQxEWGV2QJySk/uF0y6PTasBX0zE4JjGJZ1ufdb6ncAPms rBoZsZOs6vgdO0HI0GhzWSm88h1Dp0d8euj+x5vpCPVqG1k5v/kULPLv3Q755fyWK2EcrIKl+4q4Q WrC5mZ2nsuebwnrGEcyW587i92HOdBHcpIR6l6WoXx57A0uJHa0Y5AbSZA9QShtcOkLXsgoquhrt5 h/u1Sn+cgEE5cNiz7+4owS6HfUvYMVnq3SVzxCiHqJyIFpQcJQb1/52cXg1X9EkA0z4iT5FAQ/tfg 06pBbrAGc3IzXfrGDTSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r12YO-005ygx-34; Thu, 09 Nov 2023 10:46:28 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r12YL-005yg7-2g for linux-arm-kernel@lists.infradead.org; Thu, 09 Nov 2023 10:46:27 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4083cd3917eso4857565e9.3 for ; Thu, 09 Nov 2023 02:46:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699526783; x=1700131583; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KpLnGcL7z550OA6Od3q20GZe6eCKJcNkkGQivJY18I0=; b=HWfp9wgtmICnjP1ZB8tNGHS2csvXSBGHPwzbpEYegYDaxEmF+WpQIyGEKKTh36ZKbJ 2oMF7qpd6Ert95yALxKUkNpjKtVag0FmU0TyeBTWZwZKrRtRUy0WtATxbPe52zkLlciL q9TfUC6m0u1Es1OGgM5htnsMqJA/ey7VLcyOoppzSSw1WMxDeYSGqyQ8a3AK6LzCEk3t Wsv2DR9HIByCo3CJroK1yBFLKYsju6UF3aj7O2CX0ejGnYW/miPmVnOPOqOSxzdemrOj ZcMV+QoyTxSXC58U5T7fTiZ4YdTI9kyVmTKUXmlmI7P8REirEZA8c/9FEkNoXOKpRuCQ H/wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699526783; x=1700131583; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KpLnGcL7z550OA6Od3q20GZe6eCKJcNkkGQivJY18I0=; b=mM+EudEAlz3e2zMJ2ThhWWtoqw9l6faOQpOvhG8diWosX3VOEY7xH57oxcB37SUYRn gbsY464NjBtl3VQQW13c6Rlas4ROeyam+Jon5pM6Fn6FJ8/TNyIBL5Q5ofcV+O75TwRP 5/UZUwejIdGyijsQ59ta+dOiFGk6NbfEp+eNPna0DiL4KTd98NT5qp05c8BPD7wM3Vy2 NyDcZfho0EeuED6rmntAo49HBy6YPUuBvOPnEZH3DY3cXu5t5YPiig4v5+XcBGexbJbQ CRnuDYc3m3Hcw3AkYoce9SNXAZm6pRh37AHafPf/hzTB3E6xuaZzaR/aKZSlYWUlkpm4 htXQ== X-Gm-Message-State: AOJu0YxCZveR55/u6EnZj0eMqMUdkbeBFhjESLMeEusbAGt8hOct8i0/ XLwPdlKMNxeJXSTphJ+xOy8= X-Google-Smtp-Source: AGHT+IHf8qzUppDBrSoPXBM/VDZwRt3WOHBn5t2FBLRRKU7xChEdrEBlWkoG8LUpk7JiZHdripVrHQ== X-Received: by 2002:a05:600c:4f8d:b0:408:ff28:a4ad with SMTP id n13-20020a05600c4f8d00b00408ff28a4admr3832883wmq.33.1699526782065; Thu, 09 Nov 2023 02:46:22 -0800 (PST) Received: from skbuf ([188.26.57.160]) by smtp.gmail.com with ESMTPSA id ba15-20020a0560001c0f00b0032326908972sm7154085wrb.17.2023.11.09.02.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 02:46:21 -0800 (PST) Date: Thu, 9 Nov 2023 12:46:19 +0200 From: Vladimir Oltean To: Linus Walleij Cc: Hans Ulli Kroll , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Andrew Lunn , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v4 2/3] net: ethernet: cortina: Handle large frames Message-ID: <20231109104619.3dfcy3dbx2ffe3k4@skbuf> References: <20231109-gemini-largeframe-fix-v4-0-6e611528db08@linaro.org> <20231109-gemini-largeframe-fix-v4-2-6e611528db08@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231109-gemini-largeframe-fix-v4-2-6e611528db08@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_024625_893618_7BA3AF94 X-CRM114-Status: GOOD ( 21.62 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 09, 2023 at 10:03:13AM +0100, Linus Walleij wrote: > The Gemini ethernet controller provides hardware checksumming > for frames up to 1514 bytes including ethernet headers but not > FCS. > > If we start sending bigger frames (after first bumping up the MTU > on both interfaces sending and receiving the frames), truncated > packets start to appear on the target such as in this tcpdump > resulting from ping -s 1474: > > 23:34:17.241983 14:d6:4d:a8:3c:4f (oui Unknown) > bc:ae:c5:6b:a8:3d (oui Unknown), > ethertype IPv4 (0x0800), length 1514: truncated-ip - 2 bytes missing! > (tos 0x0, ttl 64, id 32653, offset 0, flags [DF], proto ICMP (1), length 1502) > OpenWrt.lan > Fecusia: ICMP echo request, id 1672, seq 50, length 1482 > > If we bypass the hardware checksumming and provide a software > fallback, everything starts working fine up to the max TX MTU > of 2047 bytes, for example ping -s2000 192.168.1.2: > > 00:44:29.587598 bc:ae:c5:6b:a8:3d (oui Unknown) > 14:d6:4d:a8:3c:4f (oui Unknown), > ethertype IPv4 (0x0800), length 2042: > (tos 0x0, ttl 64, id 51828, offset 0, flags [none], proto ICMP (1), length 2028) > Fecusia > OpenWrt.lan: ICMP echo reply, id 1683, seq 4, length 2008 > > The bit enabling to bypass hardware checksum (or any of the > "TSS" bits) are undocumented in the hardware reference manual. > The entire hardware checksum unit appears undocumented. The > conclusion that we need to use the "bypass" bit was found by > trial-and-error. > > Since no hardware checksum will happen, we slot in a software > checksum fallback. > > Check for the condition where we need to compute checksum on the > skb with either hardware or software using == CHECKSUM_PARTIAL instead > of != CHECKSUM_NONE which is an incomplete check according to > . > > On the D-Link DIR-685 router this fixes a bug on the conduit > interface to the RTL8366RB DSA switch: as the switch needs to add > space for its tag it increases the MTU on the conduit interface > to 1504 and that means that when the router sends packages > of 1500 bytes these get an extra 4 bytes of DSA tag and the > transfer fails because of the erroneous hardware checksumming, > affecting such basic functionality as the LuCI web interface. > > Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") > Signed-off-by: Linus Walleij > --- Reviewed-by: Vladimir Oltean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel