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: <20210211124719.GE1463@shell.armlinux.org.uk>
Date:   Thu, 11 Feb 2021 12:47:19 +0000
From:   Russell King - ARM Linux admin <linux@...linux.org.uk>
To:     stefanc@...vell.com
Cc:     netdev@...r.kernel.org, thomas.petazzoni@...tlin.com,
        davem@...emloft.net, nadavh@...vell.com, ymarkman@...vell.com,
        linux-kernel@...r.kernel.org, kuba@...nel.org, mw@...ihalf.com,
        andrew@...n.ch, atenart@...nel.org, devicetree@...r.kernel.org,
        robh+dt@...nel.org, sebastian.hesselbarth@...il.com,
        gregory.clement@...tlin.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v13 net-next 07/15] net: mvpp2: add FCA periodic timer
 configurations

On Thu, Feb 11, 2021 at 12:48:54PM +0200, stefanc@...vell.com wrote:
> @@ -751,6 +760,10 @@
>  #define MVPP2_TX_FIFO_THRESHOLD(kb)	\
>  		((kb) * 1024 - MVPP2_TX_FIFO_THRESHOLD_MIN)
>  
> +/* MSS Flow control */
> +#define FC_QUANTA		0xFFFF
> +#define FC_CLK_DIVIDER		100

You later change the number of tabs for these definitions in a later
patch. Would it be better to start having the correct number of tabs?

> +
>  /* RX buffer constants */
>  #define MVPP2_SKB_SHINFO_SIZE \
>  	SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index 5730900..761f745 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -1280,6 +1280,49 @@ static void mvpp22_gop_init_10gkr(struct mvpp2_port *port)
>  	writel(val, mpcs + MVPP22_MPCS_CLK_RESET);
>  }
>  
> +static void mvpp22_gop_fca_enable_periodic(struct mvpp2_port *port, bool en)
> +{
> +	struct mvpp2 *priv = port->priv;
> +	void __iomem *fca = priv->iface_base + MVPP22_FCA_BASE(port->gop_id);
> +	u32 val;

net likes to have reverse christmas tree variables. I think you should
clean this up. However...

> +
> +	val = readl(fca + MVPP22_FCA_CONTROL_REG);
> +	val &= ~MVPP22_FCA_ENABLE_PERIODIC;
> +	if (en)
> +		val |= MVPP22_FCA_ENABLE_PERIODIC;
> +	writel(val, fca + MVPP22_FCA_CONTROL_REG);

	if (en)
		val = MVPP22_FCA_ENABLE_PERIODIC;
	else
		val = 0;

	mvpp2_modify(priv->iface_base + MVPP22_FCA_BASE(port->gop_id) +
		     MVPP22_FCA_CONTROL_REG, MVPP22_FCA_ENABLE_PERIODIC, val);

avoids the need for "fca".

> +}
> +
> +static void mvpp22_gop_fca_set_timer(struct mvpp2_port *port, u32 timer)
> +{
> +	struct mvpp2 *priv = port->priv;
> +	void __iomem *fca = priv->iface_base + MVPP22_FCA_BASE(port->gop_id);
> +	u32 lsb, msb;

Same reverse christmas tree issue here.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ