netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Piotr Raczynski <piotr.raczynski@intel.com>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"Andrew Lunn" <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Serge Semin <fancer.lancer@gmail.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Biao Huang <biao.huang@mediatek.com>,
	Yang Yingliang <yangyingliang@huawei.com>,
	<netdev@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	"Jose Abreu" <Jose.Abreu@synopsys.com>
Subject: Re: [PATCH net 09/13] net: stmmac: Remove default maxmtu DT-platform setting
Date: Tue, 14 Mar 2023 12:20:18 +0100	[thread overview]
Message-ID: <ZBBYcnh51WMutdG8@nimitz> (raw)
In-Reply-To: <20230313224237.28757-10-Sergey.Semin@baikalelectronics.ru>

On Tue, Mar 14, 2023 at 01:42:33AM +0300, Serge Semin wrote:
> Initializing maxmtu platform parameter in the stmmac_probe_config_dt()
> method by default makes being pointless the DW MAC-specific maximum MTU
> selection algorithm implemented in the stmmac_dvr_probe() method. At least
> for xGMAC we'll always have a frame MTU limited with 9000 while it
> supports units up to 16KB. Let's remove the default initialization of
> the maxmtu platform setting then. We don't replace it with setting the
> maxmtu with some greater value because a default maximum MTU is
> calculated later in the stmmac_dvr_probe() anyway. That would have been a
> pointless limitation too. Instead from now the main STMMAC driver code
> will consider the out of bounds maxmtu value as invalid and will silently
> replace it with a maximum MTU value specific to the corresponding DW MAC.
> 
> Note this alteration will only affect the xGMAC IP-cores due to the way
> the MTU autodetecion algorithm is implemented. So from now the driver will
> permit DW xGMACs to handle frames up to 16KB length (XGMAC_JUMBO_LEN). As
> before DW GMAC IP-cores of v4.0 and higher and IP-cores with enhanced
> descriptor support will be able to work with frames up to 8KB (JUMBO_LEN).
> The rest of the NICs will support frames of SKB_MAX_HEAD(NET_SKB_PAD +
> NET_IP_ALIGN) size.
> 
> Fixes: 7d9e6c5afab6 ("net: stmmac: Integrate XGMAC into main driver flow")
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c     | 4 ----
>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 -----
>  2 files changed, 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 32aa7953d296..e5cb4edc4e23 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -7252,10 +7252,6 @@ int stmmac_dvr_probe(struct device *device,
>  	if ((priv->plat->maxmtu < ndev->max_mtu) &&
>  	    (priv->plat->maxmtu >= ndev->min_mtu))
>  		ndev->max_mtu = priv->plat->maxmtu;
> -	else if (priv->plat->maxmtu < ndev->min_mtu)
> -		dev_warn(priv->device,
> -			 "%s: warning: maxmtu having invalid value (%d)\n",
> -			 __func__, priv->plat->maxmtu);

Looks fine but by removing plat->maxmtu = JUMBO_LEN; you eliminate the
case of dev_warn here or you remove dev_warn since the driver will be
able to fix the mtu value?
>  
>  	if (flow_ctrl)
>  		priv->flow_ctrl = FLOW_AUTO;	/* RX/TX pause on */
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 067a40fe0a23..857411105a0a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -468,11 +468,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
>  	plat->en_tx_lpi_clockgating =
>  		of_property_read_bool(np, "snps,en-tx-lpi-clockgating");
>  
> -	/* Set the maxmtu to a default of JUMBO_LEN in case the
> -	 * parameter is not present in the device tree.
> -	 */
> -	plat->maxmtu = JUMBO_LEN;
> -
>  	/* Set default value for multicast hash bins */
>  	plat->multicast_filter_bins = HASH_TABLE_SIZE;
>  
> -- 
> 2.39.2
> 
> 

  reply	other threads:[~2023-03-14 11:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 22:42 [PATCH net 00/13] net: stmmac: Fixes bundle #1 Serge Semin
2023-03-13 22:42 ` [PATCH net 01/13] net: phy: realtek: Fix events detection failure in LPI mode Serge Semin
2023-03-14  0:39   ` Andrew Lunn
2023-03-14 11:16     ` Serge Semin
2023-03-13 22:42 ` [PATCH net 02/13] net: stmmac: Omit last desc flag for non-linear jumbos in chain-mode Serge Semin
2023-03-13 22:42 ` [PATCH net 03/13] net: stmmac: Fix extended descriptors usage for " Serge Semin
2023-03-13 22:42 ` [PATCH net 04/13] net: stmmac: dwmac-sun8i: Don't modify chain-mode module parameter Serge Semin
2023-03-13 22:42 ` [PATCH net 05/13] net: stmmac: Enable ATDS for chain-mode Serge Semin
2023-03-14 11:42   ` Piotr Raczynski
2023-03-13 22:42 ` [PATCH net 06/13] net: stmmac: Free temporary Rx SKB on request Serge Semin
2023-03-14 11:26   ` Piotr Raczynski
2023-03-13 22:42 ` [PATCH net 07/13] net: stmmac: Free Rx descs on Tx allocation failure Serge Semin
2023-03-14  9:22   ` Piotr Raczynski
2023-03-13 22:42 ` [PATCH net 08/13] net: stmmac: Fix Rx IC bit setting procedure for Rx-mitigation Serge Semin
2023-03-13 22:42 ` [PATCH net 09/13] net: stmmac: Remove default maxmtu DT-platform setting Serge Semin
2023-03-14 11:20   ` Piotr Raczynski [this message]
2023-03-14 12:03     ` Serge Semin
2023-03-13 22:42 ` [PATCH net 10/13] net: stmmac: Make buf_sz module parameter useful Serge Semin
2023-03-13 22:42 ` [PATCH net 11/13] net: stmmac: gmac4: Use dwmac410_disable_dma_irq for DW MAC v4.10 DMA Serge Semin
2023-03-13 22:42 ` [PATCH net 12/13] net: stmmac: Stop overriding the PTP clock info static instance Serge Semin
2023-03-13 22:42 ` [PATCH net 13/13] net: dwmac-loongson: Perceive zero IRQ as invalid Serge Semin
2023-03-14  8:20   ` Piotr Raczynski
2023-03-14 11:38     ` Serge Semin
2023-03-14 17:33 ` [PATCH net 00/13] net: stmmac: Fixes bundle #1 Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZBBYcnh51WMutdG8@nimitz \
    --to=piotr.raczynski@intel.com \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Jose.Abreu@synopsys.com \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=biao.huang@mediatek.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).