Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11045846rwl; Mon, 2 Jan 2023 12:50:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXu6cUoHGHDkFzr3U2OIaGU4q/Vp74h/WQlIPv6UYjJ/bJbA0armSyAaZRAwfIetpHYEqvHb X-Received: by 2002:a05:6a21:3294:b0:9d:efbe:a122 with SMTP id yt20-20020a056a21329400b0009defbea122mr65281889pzb.50.1672692603253; Mon, 02 Jan 2023 12:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672692603; cv=none; d=google.com; s=arc-20160816; b=wCnD4uTpPCAz6pGgR12TbF8/P0VUI3JQq+4MxzlrxvqT4KRJ0G47XTqV9oyLxpkRrn /UOfa8oDDkB7t1QUrf/VrxZxv4910arFWs/GqXNqkT9jkN8h0SNYZtLQGyQ7u7fmAroy kcPKP+vw/CHGcvK72yvUAuobrQVJBtwhGS/3Iu+5hVLpOD1ss4tdiWemBLm97MXA/Wuz XEVp+/NUToQF8Ji5wB6zBfRf+X7rqBjzbIF0+zEcW1uOJfPEzB2sY3/eaBRBz9uTDKT9 W4PKwzy6FbVONS+LYeK/TsIyn5DFPDGaJXLWLQLlWNmN+Fxt7Qoel61rBR5+S9XGdWeM Fmag== 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=pksXG0NslpwTCVv33v4zdHkjHzxWpLEtSPoxEy9Fp/s=; b=YMwn26FfJTKudBUJwPu7Ocjo6p53YkMXQnJuES1Chv1iBsU44y20vw0cQA5Chbbh6B NhVieoR3MtHseSJcMkhiK3FKoEOWOH30WpwWz7j9IARjOJ7NKKkB/cX+kAy+oQHpxOWQ ZS1bVgWerbYtXWFRljjetxDpYVCv8vkau74JHap96jbrhL88f1Ste9CuwCVz0aeCIYLh 5WJdBRA0/cCvkQdJupzKKp71IUcrCr8+pv7sXbvpZuoRAp4V1EnLTpukVP7cTpCapOeo 7mNs9qCOFYWetmPtWJm+MAEikkxsI2qQIRssc8rVByf3UHkHNOupcENCN4fdZ3wDANcp n5rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=wUzNrkx7; 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 a10-20020a65418a000000b004786f5e24f9si29407033pgq.94.2023.01.02.12.49.55; Mon, 02 Jan 2023 12:50:03 -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=wUzNrkx7; 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 S232106AbjABT6R (ORCPT + 61 others); Mon, 2 Jan 2023 14:58:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjABT6Q (ORCPT ); Mon, 2 Jan 2023 14:58:16 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 451EC766B; Mon, 2 Jan 2023 11:58:15 -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=pksXG0NslpwTCVv33v4zdHkjHzxWpLEtSPoxEy9Fp/s=; b=wUzNrkx7Vb5D04xcNnaVUPab2c rcuWod9t7A5QmoKr5Gz2SKjNYaHZ2NKnobxaGali9eydH+aHsqwXuiH6rjzo44stYqKKPsTlyXCqw r/kuD6fhJHIESnqvFwoQsJaDsQTZraUZ2BDm8DwiOV1ruve0e4Q6D+EMcK2zVW7DtZpA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pCQwc-000xcG-L3; Mon, 02 Jan 2023 20:58:02 +0100 Date: Mon, 2 Jan 2023 20:58:02 +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 v3 1/3] dsa: marvell: Provide per device information about max frame size Message-ID: References: <20230102150209.985419-1-lukma@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230102150209.985419-1-lukma@denx.de> 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 On Mon, Jan 02, 2023 at 04:02:07PM +0100, Lukasz Majewski wrote: > Different Marvell DSA switches support different size of max frame > bytes to be sent. > > For example mv88e6185 supports max 1632 bytes, which is now in-driver > standard value. On the other hand - mv88e6250 supports 2048 bytes. > > As this value is internal and may be different for each switch IC, > new entry in struct mv88e6xxx_info has been added to store it. > > Signed-off-by: Lukasz Majewski > > --- > Changes for v2: > - Define max_frame_size with default value of 1632 bytes, > - Set proper value for the mv88e6250 switch SoC (linkstreet) family > > Changes for v3: > - Add default value for 1632B of the max frame size (to avoid problems > with not defined values) I would add a WARN_ON_ONCE(!chip->info->max_frame_size) so a missing value is detected. You can then skip the complexity of a default. Andrew