Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1131652rdf; Sat, 4 Nov 2023 07:37:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRp9yW5EI1gFIZpI+gyDVdbg/Bk94STOjjeHSbItxoD8xMpIDBK+WN5OGpii3/UAH0yWew X-Received: by 2002:a05:6a21:4995:b0:180:e069:57fd with SMTP id ax21-20020a056a21499500b00180e06957fdmr14296969pzc.36.1699108654811; Sat, 04 Nov 2023 07:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699108654; cv=none; d=google.com; s=arc-20160816; b=FUkrWcwUE3V2q5UnbI1arZceAzPYhUl6YVtr1yEelnF1R1Ibdx2pM/qfyPk4jorZTc L9+nPUj4VN6VzxVGcAdqvcqJ4hBDnatlRyBU+RrcYdPSaP4IObV7u7Xvqu+lCgj0HQVN cgea8Sr/DmFWcuhllx3XhInvMsfywvOnavSQrLkAoxaoToLtjUh6UzsjdKjbjb83aezz 3JVQcZAxXpOnXmx2ZR1s7g5Xcm1228JBxmw4hvfmbLkaE7F9i1GFutiwvfu0TWW59QdN ldzqXHsdAtmqZ6SY5LIiQIqUoze0L52RiLgeaGZ0nZVJkILiwuCmLAlvM9Sw0o2buk2h Yk2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=l8mmV4gmP9xOvUkDg9Vq1tdSD8CwyMqEbz/ZFux3m5o=; fh=2YKzA2yVQd7HuQq3hOkoZhBH8PGg5ags6UDKgwNkN4I=; b=lzLwmy90dLNERKey3M1uA0SF6hIEZR8+J4YpRA+zcyJ0l8G0evz3wpoOTEUdCkPejg fHvbvO8sNITqdKMQHt+U78PWYEJdsUmODniR+ugMO0C311nBAfvPbFEioXzPPB6IYE2R P9okaH6I0cZ+yhk+9gML345CAYj7XuD47o/zgGljC6TIIU0gk5daDz31NvIBUQGfY675 duQHtmpMk/hj8ffP++AU74ndC7rvWWzSaxNE+j4hZdrBssZQDbqamJbNwZlCI18blaHW JEdcqV6BsAmxjAW977jzOUfrKVuzD0D3MLAs53O3kwEqnvWzIFr655sZ86/vMHWWAzK3 KrbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wPc6SAdO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id p3-20020a62ab03000000b006c2d6527398si3725642pff.349.2023.11.04.07.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 07:37:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wPc6SAdO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 85420807D795; Sat, 4 Nov 2023 07:37:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232294AbjKDOhT (ORCPT + 99 others); Sat, 4 Nov 2023 10:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbjKDOhS (ORCPT ); Sat, 4 Nov 2023 10:37:18 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D441194; Sat, 4 Nov 2023 07:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=l8mmV4gmP9xOvUkDg9Vq1tdSD8CwyMqEbz/ZFux3m5o=; b=wPc6SAdOG5dS9SxpEOMlfCr/N5 Np/SfR6Fboau0RZv1mp9ROt1iM5GVkMARST2VMySjGDCzbREbbUsm/WGu1amA7b8DjJ27k+wjq5ZS bhy96f5f72WlSDAgAfos33UPd2aSZ5SDUF8zW+ay7D8BYBS8aQ4ku9Yx58yhXoScCCqU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qzHli-000sL5-1L; Sat, 04 Nov 2023 15:36:58 +0100 Date: Sat, 4 Nov 2023 15:36:58 +0100 From: Andrew Lunn To: Linus Walleij Cc: Hans Ulli Kroll , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Vladimir Oltean , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 1/4] net: ethernet: cortina: Fix MTU max setting Message-ID: <11cf3d6f-91fc-41bb-b780-1d967f388981@lunn.ch> References: <20231104-gemini-largeframe-fix-v1-0-9c5513f22f33@linaro.org> <20231104-gemini-largeframe-fix-v1-1-9c5513f22f33@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231104-gemini-largeframe-fix-v1-1-9c5513f22f33@linaro.org> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Sat, 04 Nov 2023 07:37:32 -0700 (PDT) > + if (mtu > MTU_SIZE_BIT_MASK) { > + netdev_err(netdev, "%s: MTU too big, max size 2047 bytes, capped\n", __func__); > + mtu = MTU_SIZE_BIT_MASK; > + } So this should not actually happen. If it does, some protocol above is ignoring the MTU. And if that happens, you are going to spam the log at line rate. Packets which are truncated are also pretty useless. They are likely to be dropped by the receiver when the CRC fails. So i would suggest drop them here, and increment a counter. > #define SOF_EOF_BIT_MASK 0x3fffffff > -#define SOF_BIT 0x80000000 > -#define EOF_BIT 0x40000000 > -#define EOFIE_BIT BIT(29) > -#define MTU_SIZE_BIT_MASK 0x1fff > +#define SOF_BIT BIT(31) /* Start of Frame */ > +#define EOF_BIT BIT(30) /* End of Frame */ > +#define EOFIE_BIT BIT(29) /* End of Frame Interrupt Enable */ > +#define MTU_SIZE_BIT_MASK 0x7ff /* Max MTU 2047 bytes */ Apart from the MTU_SIZE_BIT_MASK, this looks mostly unrelated. Andrew --- pw-bot: cr