Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp461695rwi; Mon, 31 Oct 2022 03:52:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OMFCT1J2LdTkV3aKncxz0XWDickGFkWIY6bvXWMAEkXetBOn8PQE0Q+Hbqp/63xWaN9NV X-Received: by 2002:a17:902:8685:b0:186:cb66:d77b with SMTP id g5-20020a170902868500b00186cb66d77bmr13936283plo.39.1667213534992; Mon, 31 Oct 2022 03:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667213534; cv=none; d=google.com; s=arc-20160816; b=aVOpmbqN+srt6sBKd+PtGR9fI5TRxO4Ji1glq9Vb+HzeMrPAUClk7SjzWjVK3tnOuk 4C59xvqerO6m1hiyB4hwC6KJSCQFACxNTLjh1rT16WXEuRQku0oIZvbeECpJffZG2MPu RZKLt35JzA6vm6iT6en5wGb/W74cPCLI+pcTkr1lXb+V255lewMN0+mDXG1YovyCChR+ 0fbCYsOjclIxElMfNZ4mqI1rryqEf9GiIs12/erMFa+j2deq6K0ePXK8tdY+iH8a8lqd jLv6jyYOIO+Yux2FXLIDtrRviEtdqu0mbzHtmsHq/hWgY0tglZlkcOc+IM6M4BH0L+jz xydA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=kplOqr2afCmzQsj/iLHJTCW4+QXUXiE20vhaK8aUN8A=; b=OahNz66K8dlZHmNfFSrGb8GlZS+unBf7s8f31f60vYeF0q1bI80dwqVcn+Ebs1tBD6 N9NPs7toinh1YVMMHqq3mwDTQgAHWd4RQkWFjSdxtosiY+IfxdYQMl7kHOaKG6igOBQP B3Vmsjlxqgfx8G/X2VkfjxiN/U5jYnTJ1bIEdXx6DKcr2zsJGSSE6rDmENRkcpmZyArk uWISRJraNRB7S+LvNbnEUyn2DplsNK0jC55JLNB2vH7WB9qRyq1E+wq6raHt35TcYBQf Yhebufjniqupxf3Viyv9Ztjm6q4w88PMJ5NKG3Qgwf0wUEcdbo8HcqAhllxnXTcllBcg uaFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a056a0016cc00b00562be85e93asi9397429pfc.374.2022.10.31.03.52.01; Mon, 31 Oct 2022 03:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbiJaKn7 convert rfc822-to-8bit (ORCPT + 98 others); Mon, 31 Oct 2022 06:43:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbiJaKn4 (ORCPT ); Mon, 31 Oct 2022 06:43:56 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41BADD97 for ; Mon, 31 Oct 2022 03:43:54 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-6-rBZvUtp9O5ulsghvKmsCxA-1; Mon, 31 Oct 2022 10:43:50 +0000 X-MC-Unique: rBZvUtp9O5ulsghvKmsCxA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 31 Oct 2022 10:43:47 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.042; Mon, 31 Oct 2022 10:43:47 +0000 From: David Laight To: 'Horatiu Vultur' , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "UNGLinuxDriver@microchip.com" Subject: RE: [PATCH net v2 0/3] net: lan966x: Fixes for when MTU is changed Thread-Topic: [PATCH net v2 0/3] net: lan966x: Fixes for when MTU is changed Thread-Index: AQHY7Kcu7Ao/FHDvc0OFOxRqKUrPo64oT9Iw Date: Mon, 31 Oct 2022 10:43:47 +0000 Message-ID: References: <20221030213636.1031408-1-horatiu.vultur@microchip.com> In-Reply-To: <20221030213636.1031408-1-horatiu.vultur@microchip.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Horatiu Vultur > Sent: 30 October 2022 21:37 > > There were multiple problems in different parts of the driver when > the MTU was changed. > The first problem was that the HW was missing to configure the correct > value, it was missing ETH_HLEN and ETH_FCS_LEN. The second problem was > when vlan filtering was enabled/disabled, the MRU was not adjusted > corretly. While the last issue was that the FDMA was calculated wrongly > the correct maximum MTU. IIRC all these lengths are 1514, 1518 and maybe 1522? How long are the actual receive buffers? I'd guess they have to be rounded up to a whole number of cache lines (especially on non-coherent systems) so are probably 1536 bytes. If driver does support 8k+ jumbo frames just set the hardware frame length to match the receive buffer size. There is no real need to exactly police the receive MTU. There are definitely situations where the transmit MTU has to be limited (eg to avoid ptmu blackholes) but where some systems still send 'full sized' packets. There is also the possibility of receiving PPPoE encapsulated full sized ethernet packets. I can remember how big that header is - something like 8 bytes. There is no real reason to discard them if they'd fit in the buffer. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)