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  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]
Date:   Tue, 18 Aug 2020 22:00:52 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     David Awogbemila <awogbemila@...gle.com>
Cc:     netdev@...r.kernel.org, Kuo Zhao <kuozhao@...gle.com>,
        Yangchun Fu <yangchun@...gle.com>
Subject: Re: [PATCH net-next 01/18] gve: Get and set Rx copybreak via ethtool

On Tue, Aug 18, 2020 at 12:44:00PM -0700, David Awogbemila wrote:
> From: Kuo Zhao <kuozhao@...gle.com>
> 
> This adds support for getting and setting the RX copybreak
> value via ethtool.
> 
> Reviewed-by: Yangchun Fu <yangchun@...gle.com>
> Signed-off-by: Kuo Zhao <kuozhao@...gle.com>
> Signed-off-by: David Awogbemila <awogbemila@...gle.com>
> ---
>  drivers/net/ethernet/google/gve/gve_ethtool.c | 34 +++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
> index d8fa816f4473..469d3332bcd6 100644
> --- a/drivers/net/ethernet/google/gve/gve_ethtool.c
> +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
> @@ -230,6 +230,38 @@ static int gve_user_reset(struct net_device *netdev, u32 *flags)
>  	return -EOPNOTSUPP;
>  }


Hi David.

> +static int gve_get_tunable(struct net_device *netdev,
> +			   const struct ethtool_tunable *etuna, void *value)
> +{
> +	struct gve_priv *priv = netdev_priv(netdev);
> +
> +	switch (etuna->id) {
> +	case ETHTOOL_RX_COPYBREAK:
> +		*(u32 *)value = priv->rx_copybreak;
> +		return 0;
> +	default:
> +		return -EINVAL;

EOPNOTSUPP would be better. Other tunables are not invalid, they are
simply not supported by this driver.

> +	}
> +}
> +
> +static int gve_set_tunable(struct net_device *netdev,
> +			   const struct ethtool_tunable *etuna, const void *value)
> +{
> +	struct gve_priv *priv = netdev_priv(netdev);
> +	u32 len;
> +
> +	switch (etuna->id) {
> +	case ETHTOOL_RX_COPYBREAK:
> +		len = *(u32 *)value;
> +		if (len > PAGE_SIZE / 2)
> +			return -EINVAL;
> +		priv->rx_copybreak = len;
> +		return 0;
> +	default:
> +		return -EINVAL;

Same here.

     Andrew

Powered by blists - more mailing lists