lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b3d54ac-2b74-cf21-eb83-5a7ec58feb83@microchip.com>
Date: Sat, 13 May 2023 08:51:47 +0000
From: <Claudiu.Beznea@...rochip.com>
To: <Daire.McNamara@...rochip.com>, <Nicolas.Ferre@...rochip.com>,
	<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <netdev@...r.kernel.org>, <Conor.Dooley@...rochip.com>
Subject: Re: [PATCH v4 1/1] net: macb: Shorten max_tx_len to 4KiB - 56 on mpfs

On 12.05.2023 15:20, daire.mcnamara@...rochip.com wrote:
> From: Daire McNamara <daire.mcnamara@...rochip.com>
> 
> On mpfs, with SRAM configured for 4 queues, setting max_tx_len
> to GEM_TX_MAX_LEN=0x3f0 results multiple AMBA errors.
> Setting max_tx_len to (4KiB - 56) removes those errors.
> 
> The details are described in erratum 1686 by Cadence
> 
> The max jumbo frame size is also reduced for mpfs to (4KiB - 56).
> 
> Signed-off-by: Daire McNamara <daire.mcnamara@...rochip.com>

Reviewed-by: Claudiu Beznea <claudiu.beznea@...rochip.com>


> ---
>  drivers/net/ethernet/cadence/macb.h      |  1 +
>  drivers/net/ethernet/cadence/macb_main.c | 12 +++++++++---
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
> index 14dfec4db8f9..989e7c5db9b9 100644
> --- a/drivers/net/ethernet/cadence/macb.h
> +++ b/drivers/net/ethernet/cadence/macb.h
> @@ -1175,6 +1175,7 @@ struct macb_config {
>  			    struct clk **hclk, struct clk **tx_clk,
>  			    struct clk **rx_clk, struct clk **tsu_clk);
>  	int	(*init)(struct platform_device *pdev);
> +	unsigned int		max_tx_length;
>  	int	jumbo_max_len;
>  	const struct macb_usrio_config *usrio;
>  };
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 66e30561569e..3a46b75ae54f 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4095,14 +4095,12 @@ static int macb_init(struct platform_device *pdev)
>  
>  	/* setup appropriated routines according to adapter type */
>  	if (macb_is_gem(bp)) {
> -		bp->max_tx_length = GEM_MAX_TX_LEN;
>  		bp->macbgem_ops.mog_alloc_rx_buffers = gem_alloc_rx_buffers;
>  		bp->macbgem_ops.mog_free_rx_buffers = gem_free_rx_buffers;
>  		bp->macbgem_ops.mog_init_rings = gem_init_rings;
>  		bp->macbgem_ops.mog_rx = gem_rx;
>  		dev->ethtool_ops = &gem_ethtool_ops;
>  	} else {
> -		bp->max_tx_length = MACB_MAX_TX_LEN;
>  		bp->macbgem_ops.mog_alloc_rx_buffers = macb_alloc_rx_buffers;
>  		bp->macbgem_ops.mog_free_rx_buffers = macb_free_rx_buffers;
>  		bp->macbgem_ops.mog_init_rings = macb_init_rings;
> @@ -4839,7 +4837,8 @@ static const struct macb_config mpfs_config = {
>  	.clk_init = macb_clk_init,
>  	.init = init_reset_optional,
>  	.usrio = &macb_default_usrio,
> -	.jumbo_max_len = 10240,
> +	.max_tx_length = 4040, /* Cadence Erratum 1686 */
> +	.jumbo_max_len = 4040,
>  };
>  
>  static const struct macb_config sama7g5_gem_config = {
> @@ -4989,6 +4988,13 @@ static int macb_probe(struct platform_device *pdev)
>  	if (macb_config)
>  		bp->jumbo_max_len = macb_config->jumbo_max_len;
>  
> +	if (!hw_is_gem(bp->regs, bp->native_io))
> +		bp->max_tx_length = MACB_MAX_TX_LEN;
> +	else if (macb_config->max_tx_length)
> +		bp->max_tx_length = macb_config->max_tx_length;
> +	else
> +		bp->max_tx_length = GEM_MAX_TX_LEN;
> +
>  	bp->wol = 0;
>  	if (of_property_read_bool(np, "magic-packet"))
>  		bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;

Powered by blists - more mailing lists