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>] [day] [month] [year] [list]
Message-ID: <392788e2-6d6b-44c7-83eb-151d1fde0b49@BN1BFFO11FD052.protection.gbl>
Date:	Fri, 10 Apr 2015 11:50:58 +0200
From:	Michal Simek <michal.simek@...inx.com>
To:	Harini Katakam <harini.katakam@...inx.com>,
	<nicolas.ferre@...el.com>, <davem@...emloft.net>,
	<robh+dt@...nel.org>, <pawel.moll@....com>, <mark.rutland@....com>,
	<ijc+devicetree@...lion.org.uk>, <galak@...eaurora.org>,
	<boris.brezillon@...e-electrons.com>,
	<alexandre.belloni@...e-electrons.com>,
	<harinikatakamlinux@...il.com>
CC:	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<devicetree@...r.kernel.org>, <harinik@...inx.com>,
	<punnaia@...inx.com>
Subject: Re: [net-next PATCH 2/3] net: macb: Add support for jumbo frames

On 04/10/2015 11:17 AM, Harini Katakam wrote:
> Check for "cdns,zynqmp-gem" compatible string and enable jumbo frame support
> in NWCFG register, update descriptor length masks and registers accordingly.
> Jumbo max length register should be set according to support in SoC; it is
> set to 10240 for Zynq Ultrascale ZynqMPSoC.
> 
> Signed-off-by: Harini Katakam <harinik@...inx.com>
> Reviewed-by: Punnaiah Choudary Kalluri <punnaia@...inx.com>
> ---
>  drivers/net/ethernet/cadence/macb.c |   19 ++++++++++++++++---
>  drivers/net/ethernet/cadence/macb.h |    8 ++++++++
>  2 files changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index 448a323..85de91d 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -779,7 +779,7 @@ static int gem_rx(struct macb *bp, int budget)
>  		}
>  		/* now everything is ready for receiving packet */
>  		bp->rx_skbuff[entry] = NULL;
> -		len = MACB_BFEXT(RX_FRMLEN, ctrl);
> +		len = ctrl & bp->rx_frm_len_mask;
>  
>  		netdev_vdbg(bp->dev, "gem_rx %u (len %u)\n", entry, len);
>  
> @@ -825,7 +825,7 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
>  	struct macb_dma_desc *desc;
>  
>  	desc = macb_rx_desc(bp, last_frag);
> -	len = MACB_BFEXT(RX_FRMLEN, desc->ctrl);
> +	len = desc->ctrl & bp->rx_frm_len_mask;
>  
>  	netdev_vdbg(bp->dev, "macb_rx_frame frags %u - %u (len %u)\n",
>  		macb_rx_ring_wrap(first_frag),
> @@ -1630,7 +1630,10 @@ static void macb_init_hw(struct macb *bp)
>  	config |= MACB_BF(RBOF, NET_IP_ALIGN);	/* Make eth data aligned */
>  	config |= MACB_BIT(PAE);		/* PAuse Enable */
>  	config |= MACB_BIT(DRFCS);		/* Discard Rx FCS */
> -	config |= MACB_BIT(BIG);		/* Receive oversized frames */
> +	if (bp->isjumbo)
> +		config |= MACB_BIT(JFRAME);	/* Enable jumbo frames */
> +	else
> +		config |= MACB_BIT(BIG);	/* Receive oversized frames */
>  	if (bp->dev->flags & IFF_PROMISC)
>  		config |= MACB_BIT(CAF);	/* Copy All Frames */
>  	else if (macb_is_gem(bp) && bp->dev->features & NETIF_F_RXCSUM)
> @@ -1639,8 +1642,13 @@ static void macb_init_hw(struct macb *bp)
>  		config |= MACB_BIT(NBC);	/* No BroadCast */
>  	config |= macb_dbw(bp);
>  	macb_writel(bp, NCFGR, config);
> +	if (bp->isjumbo && bp->jumbo_max_len)
> +		gem_writel(bp, JML, bp->jumbo_max_len);
>  	bp->speed = SPEED_10;
>  	bp->duplex = DUPLEX_HALF;
> +	bp->rx_frm_len_mask = MACB_RX_FRMLEN_MASK;
> +	if (bp->isjumbo)
> +		bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK;
>  
>  	macb_configure_dma(bp);
>  
> @@ -2759,6 +2767,11 @@ static int macb_probe(struct platform_device *pdev)
>  	bp->pclk = pclk;
>  	bp->hclk = hclk;
>  	bp->tx_clk = tx_clk;
> +	if (of_device_is_compatible(pdev->dev.of_node, "cdns,zynqmp-gem")) {
> +		bp->isjumbo = 1;
> +		bp->jumbo_max_len = GEM_ZYNQMP_JUMBO_MAX;
> +	}

Not like this.

Nicolas will look at the rest but I think you should extend "struct
macb_config" and add that setup there instead of checking compatible
string here.
Maybe isjumbo can be hadled via caps bit already present in this
structure but please wait for others.

Thanks,
Michal

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ