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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Sep 2012 17:45:10 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Giuseppe CAVALLARO <peppe.cavallaro@...com>
CC:	<netdev@...r.kernel.org>, <davem@...emloft.net>
Subject: Re: [net-next.git 5/8] stmmac: get/set coalesce parameters via
 ethtool

On Mon, 2012-09-10 at 09:38 +0200, Giuseppe CAVALLARO wrote:
> This patch is to get/set the tx/rx coalesce parameters
> via ethtool interface.
> 
> Tests have been done on several platform with
> different GMAC chips w/o w/ RX watchdog feature.
[...]
> +static int stmmac_set_coalesce(struct net_device *dev,
> +			       struct ethtool_coalesce *ec)
> +{
> +	struct stmmac_priv *priv = netdev_priv(dev);
> +	unsigned int rx_riwt;
> +
> +	/* No rx interrupts will be generated if both are zero */
> +	if (ec->rx_coalesce_usecs == 0)
> +		return -EINVAL;
> +
> +	/* No tx interrupts will be generated if both are zero */
> +	if ((ec->tx_coalesce_usecs == 0) &&
> +	    (ec->tx_max_coalesced_frames == 0))
> +		return -EINVAL;
> +
> +	if ((ec->tx_coalesce_usecs > STMMAC_COAL_TX_TIMER) ||
> +	    (ec->tx_max_coalesced_frames > STMMAC_TX_MAX_FRAMES))
> +		return -EINVAL;
[...]

You should also check that the settings you don't support
(rx_max_coalesced_frames, use_adaptive_rx_coalesce,
use_adaptive_tx_coalesce, *_irq) are equal to 0.  (This isn't done
consistently in all drivers - but I believe best practice is to reject
rather than quietly ignoring settings you don't support.)

I don't have time to review the other changes properly, but at a quick
look they seem to be OK.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
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