Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EF62C6FD1D for ; Wed, 15 Mar 2023 18:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232218AbjCOSfI (ORCPT ); Wed, 15 Mar 2023 14:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232559AbjCOSey (ORCPT ); Wed, 15 Mar 2023 14:34:54 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9215F7C3FF; Wed, 15 Mar 2023 11:34:26 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id i24so1118651qtm.6; Wed, 15 Mar 2023 11:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678905265; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uEaLzn/jN+Pjmss+rj58XZA9n+R5W97hS6oiTiEatMI=; b=H9FCfPVsksK7yPtRdNEeUxP5tSiNs6qNh4oY6twLzzpbD+LfsZH75QyGTFL0XkFDkP udkqCuKok+1fF+Ctov42PCZvPnoZP+giBC3EYU2dPqqi0sCA3K7UFEN+EJ0v4wZd5CBf VbecwPzeR/oxRKmSoePOJsPqZp/+ciJTKotK92yri/grt79D+ok5eXq0PY5QMry3uGSD wcJwX2Eh+53QPifZIEEovNIB+CTvvq3IKh+k/qsYPhJniz2BnLj5ua4jeNNKBqTEn97d Nn9rmKK7AMC2+vPXwulM70VLwdcH60pr43iYhxdhEmbLhRjNMlpKnoEotR6XZS8/Nerz XGrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678905265; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uEaLzn/jN+Pjmss+rj58XZA9n+R5W97hS6oiTiEatMI=; b=adqYL8LCG/thXcknA2QitC1TOE+r5KkUdseC5Eqg6mWQ8YCfVZpJUjcSXIvoHDKgyU ZhoveTIQ294R2UwkzIsgaaSrKxtdBPTPBwmzxmM6QpYJDx5bkXQHRsZy1pvLgaoZoSsB GlvEXVsxa3uytH0JBoEdZLPR7VLkaKzjvW/76yxt+pz9dIlu4xkzbczLYCzaym8HfvmP FeAQZZxcxwc9Z//fBj9FglIlGDI48BiizpLeaJnvOWizwFf2vInWXd6QLl2LlQgtW5V6 YGA9qL0lNMQiCmFAfyqNBnaheIb5+QXmd7HOJeg5PwbUDxEHaUK1zX3ETXWkjQ4PsAiW daqA== X-Gm-Message-State: AO0yUKWJmDSYkEEsLrP/wZteAeeCZYJ5++5+mArgiAd45SCH6oLbWfvH emPpKRa0toRlbikMgH8uric= X-Google-Smtp-Source: AK7set96Xl798ubI7hM6CE833RDYyRrXNEc8+ym0JxhW6zonaBN3EDquQ1refgKJsyuY+hgpIahdZA== X-Received: by 2002:ac8:5e4f:0:b0:3bf:d9d2:487d with SMTP id i15-20020ac85e4f000000b003bfd9d2487dmr1584893qtx.8.1678905265448; Wed, 15 Mar 2023 11:34:25 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id l7-20020ac84cc7000000b003c03b33e6f5sm4161601qtv.90.2023.03.15.11.34.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Mar 2023 11:34:24 -0700 (PDT) Message-ID: Date: Wed, 15 Mar 2023 11:34:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH net 1/2] net: dsa: don't error out when drivers return ETH_DATA_LEN in .port_max_mtu() Content-Language: en-US To: Vladimir Oltean , netdev@vger.kernel.org Cc: Andrew Lunn , Murali Krishna Policharla , Lukasz Majewski , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org References: <20230314182405.2449898-1-vladimir.oltean@nxp.com> <20230314182405.2449898-2-vladimir.oltean@nxp.com> From: Florian Fainelli In-Reply-To: <20230314182405.2449898-2-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/23 11:24, Vladimir Oltean wrote: > Currently, when dsa_slave_change_mtu() is called on a user port where > dev->max_mtu is 1500 (as returned by ds->ops->port_max_mtu()), the code > will stumble upon this check: > > if (new_master_mtu > mtu_limit) > return -ERANGE; > > because new_master_mtu is adjusted for the tagger overhead but mtu_limit > is not. > > But it would be good if the logic went through, for example if the DSA > master really depends on an MTU adjustment to accept DSA-tagged frames. > > To make the code pass through the check, we need to adjust mtu_limit for > the overhead as well, if the minimum restriction was caused by the DSA > user port's MTU (dev->max_mtu). A DSA user port MTU and a DSA master MTU > are always offset by the protocol overhead. > > Currently no drivers return 1500 .port_max_mtu(), but this is only > temporary and a bug in itself - mv88e6xxx should have done that, but > since commit b9c587fed61c ("dsa: mv88e6xxx: Include tagger overhead when > setting MTU for DSA and CPU ports") it no longer does. This is a > preparation for fixing that. > > Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports") > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian