Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp971185rwb; Fri, 13 Jan 2023 06:27:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXvA7ksfJmaqAFt4D/GQ1qMLwXX/qIndgCubb6aB//oacym15Z9YP3+EIbND6HqyA8ssYs+n X-Received: by 2002:aa7:9284:0:b0:581:6069:5c00 with SMTP id j4-20020aa79284000000b0058160695c00mr60321245pfa.28.1673620046399; Fri, 13 Jan 2023 06:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673620046; cv=none; d=google.com; s=arc-20160816; b=e5O0QJadE/293ROAEbmPzAM1PlV/NxXP5tuSTu12nmjfDm5tl316grAV+0w8Q6bUHf qXUzH3OZ6OzR2PhsXxGsV2tnjN7W2xQu6sGJ0f17B0OpH2WOoPYLhOitI7l4zyZ+skZb mauM2wFDABAFDBJCDxxo5G0K0UYKUYMbaFvblBVZ4ixoWvlJIFpjVvCidk3vTlwzc5gB 01TmZlcxOCDKFxxwQKrEVcJE426A+7puuw6P/4Ha9AxiqyAgWUEyrwIjjW4yXXJy/jj3 +ruM4AqDai+yHVRwaKL1iMyrr3idapoRaKo265d6Fd91HqIm8t5JDFnFYPoL9vrqfQf3 +pNw== 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=TsFuSkwR1WlHnCqE1Bje3dfaKMH46M3DRmRqT/WlQow=; b=GONImBNoQlN709xcqiji6X1KvODc6AxlmHjR3wcBM1uGzmMNJbM0Nhshz7lCHjAS/a i1GlQfWtfjNjqj1aY+Nxp1rah2E/B7DrJCticLFqSqIb2cxCNu8ICwZwEidW0nG2h2Cr 2P8/hfdF5hAc8w1rRcbxvXvoF6hWa5pNYZIjNHf8PyTVrd0AKhrv7BTEDi+/oLL2NHCY RX4ghVfnmGlrk7vIAuin6ZyB5vyieIW8Jvy5rR7I9K7aXHwuG6hMQDvzVEaymZLsr7kk 1HYsW6DjtMPhkkwU/rxq1P6UTuYanujHViDnUvuhbMQUgAxFhWdxfe3N13rG277Yhuek /pcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=G23umAhl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck5-20020a056a00328500b0058208fdb51asi19975702pfb.27.2023.01.13.06.27.19; Fri, 13 Jan 2023 06:27:26 -0800 (PST) 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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=G23umAhl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241168AbjAMN5K (ORCPT + 51 others); Fri, 13 Jan 2023 08:57:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237550AbjAMN4n (ORCPT ); Fri, 13 Jan 2023 08:56:43 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F7EBD0; Fri, 13 Jan 2023 05:53:26 -0800 (PST) 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=TsFuSkwR1WlHnCqE1Bje3dfaKMH46M3DRmRqT/WlQow=; b=G23umAhl+TT9CsE3I2NGNOA/gR 9ZIz+nKz0V2p3Mtxlq67IyRIWo3+z0o2UC4QXKnySEeydWyqpTWwfxUWzQdxBA4mW6SRBTgeIyYsB id7C23royuWvIg1RsXg/siSXUu/Ewr9zVVbiCCxrb6EVnnCTcYs21XI5rayGJxJzg/Us=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pGKUV-0020Nc-Mz; Fri, 13 Jan 2023 14:53:07 +0100 Date: Fri, 13 Jan 2023 14:53:07 +0100 From: Andrew Lunn To: Lukasz Majewski Cc: Vladimir Oltean , Eric Dumazet , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Russell King , Paolo Abeni , Alexander Duyck , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/3] dsa: marvell: Provide per device information about max frame size Message-ID: References: <20230106101651.1137755-1-lukma@denx.de> <20230106101651.1137755-1-lukma@denx.de> <20230106145109.mrv2n3ppcz52jwa2@skbuf> <20230113131331.28ba7997@wsk> <20230113122754.52qvl3pvwpdy5iqk@skbuf> <20230113142017.78184ce1@wsk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113142017.78184ce1@wsk> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 > I tend to agree... The number of switched which suppor 1522 B max frame > is only six. This may be why the problem was not noticed. > > The fixed function maybe should look like below: > > > static int mv88e6xxx_get_max_mtu(struct dsa_switch *ds, int port) > { > .... > > > int max_mtu; > > max_mtu = chip->info->max_frame_size - VLAN_ETH_HLEN - > ETH_FCS_LE; > > if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port)) > max_mtu -= EDSA_HLEN; > > return max_mtu; > } > > Comments more than welcome. I would suggest some comments are added, explaining what is going on here. Given the number of Fixes: tags in this area, it is clearly tricky to get right, given how different switches operate. I've not looked back to the email archive, but i have a vague recollection that it could be some switches don't impose the MTU limit on CPU and DSA ports, just the user ports. So the value reported for those ports can actually be bigger than then the max mtu, in order to accommodate the DSA header. Andrew