Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp952683rwb; Fri, 13 Jan 2023 06:15:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXvXj/yp2wgqJJSnkDoVDeKAMTWFaqypOdXzgik9I/EKbh9zz/FYm0Gh5SLuOf+2x4VMFS0o X-Received: by 2002:a17:906:5a71:b0:84d:4a2b:73b9 with SMTP id my49-20020a1709065a7100b0084d4a2b73b9mr14911697ejc.59.1673619304330; Fri, 13 Jan 2023 06:15:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673619304; cv=none; d=google.com; s=arc-20160816; b=V27k4JkJ9vgqKQcOFE7kZF48ElXHPB0wt/Y1YZVio+HBVxJ69JbYQitcCvhPemEexY kdXFxMxSeUtBUjF3o+w2rVkeJ727TbbyP22y7k7YSY4NDptpfbWrrFQDq7BDidy6qmBS 7DNqES+npPG3snOfGIRRvZYhixivTOAHRjvvIQosxaMsPwMTnv4ZRPRHdQMXaU5EPxQj CJIeriaGxj1fn4fkdacRNDpoKIRYhPxdYxjyZiekUSnFNOxgXeOsyiggbH2wCK7dFR33 4ZaRRQciY+5SmtTO0aM1a4adbX8vO/YssHu7PvLT3WqWFMiC3iXCjR1bFdQGIW8oILEg hrbw== 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=5I4m/EnweQ5SqB1DHqUreYhEufcWoW7oFYxI0NTJspA=; b=VytPJ2/L1aDsETNl2ruMJJw1DoN+zLJmUMHLWVUn8f1jgO/iAFbCOGdZEJAunKkfek lbtSjyDIJ4AF2s3fdLODQk08TIDqA2x3XB0SQVBWLXwUBKYfFVq9xf8KncOHujB5x90C CW1MFhVNN3AngNl/pMe1WsGABMIBlZNUECRQKbxI2gTzU6gMoPc3lSlDU1URxHghCHTm VsigruDLE12IirVSvvyXTBZAhjmqRfzhx3b2zjmHX0FGId64zWcGytqoKURg6I15g8EV gNjA7gvSNLYiMMvbQGE4ptVv5iBf1KftPg7LBGpuc8Dt+wKg/uTthhnmZk5DqakREX/I W/gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cX9POSfg; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr19-20020a1709073f9300b0086bfaaa9eddsi313451ejc.450.2023.01.13.06.14.50; Fri, 13 Jan 2023 06:15:04 -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=@gmail.com header.s=20210112 header.b=cX9POSfg; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241108AbjAMOC7 (ORCPT + 53 others); Fri, 13 Jan 2023 09:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241770AbjAMOCA (ORCPT ); Fri, 13 Jan 2023 09:02:00 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 740B0E0E7; Fri, 13 Jan 2023 05:59:34 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id mp20so5912272ejc.7; Fri, 13 Jan 2023 05:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=5I4m/EnweQ5SqB1DHqUreYhEufcWoW7oFYxI0NTJspA=; b=cX9POSfg1VNn+g1+ero6V6UjGb7H9mLduuabZEeInSH2IW4z75eYg//ouJP/FYhwV1 u7LD20+3n7/F3YRjpN/VfJ3R5PWj3jRuJB4YFXiVv114C0Ljmr2d2nt51iaSqgVAVsTh SRF/qEmiPDgTjPP69y0uF/OzdAkf10qPlIylu+HvoQjizlqUWoJNLArSnfC07dUh5NWY U3AAwu+qOjE2ltBqUPQ0TwD1umnNM0JC+DFpunyB5cokiwJF4z36rKHu5olEJjqOyQ5B 5efik53s5GngQ7TUN8ssyE+TZujB5oSD9rFErny+eVGGrc2bIETL3vm41FVNRFd+Iqal h4BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=5I4m/EnweQ5SqB1DHqUreYhEufcWoW7oFYxI0NTJspA=; b=WUhzo5FSvQuPyCZr6ii1V5/SCQnpNKU7XF5eIAdkLxXs7ry7FVga7qfYOAswn8qaIE boRyZwY3jK40dnwfF1D7iiXfMLnpHEeS+SYgUmp/aFVxVFNz/Z5XfW6aIUxDfJdyNuXv QbNjuLFEQPQu1UjhGJAmrnAaoOhT8w1MRdQcqNe8YOklmsLH7WkSP2K55ovRypCEWf3M /Wo4FzFu+XeEQ4s+9Jo7faA3Qd2BpLfn8B/wVpc/JS14TwPYQocG/5xCaspMuXvh4xSr g5FB2M4jsR5a4OzK3QBIXF+lHbdjOsfO9En1Rh9BR50NpUE0nZ/SSsc3mrmdsAi4KOPQ dIsQ== X-Gm-Message-State: AFqh2kqSj6XfpncaY4vCadwUuoAteq/hnpJtBeRxsljcAQBdeLRpRozr x4SM1P7lqfCiyBm/T4XzdGQ= X-Received: by 2002:a17:907:73c1:b0:7e7:4dd7:bc0c with SMTP id es1-20020a17090773c100b007e74dd7bc0cmr65354966ejc.66.1673618372910; Fri, 13 Jan 2023 05:59:32 -0800 (PST) Received: from skbuf ([188.26.184.223]) by smtp.gmail.com with ESMTPSA id 17-20020a170906329100b007c0bb571da5sm8473751ejw.41.2023.01.13.05.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 05:59:32 -0800 (PST) Date: Fri, 13 Jan 2023 15:59:30 +0200 From: Vladimir Oltean To: Lukasz Majewski Cc: Andrew Lunn , 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: <20230113135930.27hpr5uxtrv77z44@skbuf> 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 On Fri, Jan 13, 2023 at 02:20:17PM +0100, Lukasz Majewski wrote: > 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 suspect that looking at the DSA code which calls these methods will answer a lot of your questions. ds->ops->port_max_mtu() is only called for user ports. As for ds->ops->port_change_mtu(), this will always be called with the requested L2 payload length (default 1500) on user ports, and with the maximum among user ports for DSA and CPU ports.