netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: Amir Vadai <amirv@mellanox.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Ben Hutchings <ben@decadent.org.uk>,
	netdev <netdev@vger.kernel.org>,
	"Solarflare linux maintainers" <linux-net-drivers@solarflare.com>,
	Shradha Shah <sshah@solarflare.com>
Subject: Re: [PATCH net-next V2 1/2] ethtool: Support for configurable RSS hash function
Date: Tue, 2 Dec 2014 15:14:20 +0000	[thread overview]
Message-ID: <547DD74C.9070603@solarflare.com> (raw)
In-Reply-To: <1417530049-6943-2-git-send-email-amirv@mellanox.com>

On 02/12/14 14:20, Amir Vadai wrote:
> diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
> index cad258a..2ac07c9 100644
> --- a/drivers/net/ethernet/sfc/ethtool.c
> +++ b/drivers/net/ethernet/sfc/ethtool.c
> @@ -1086,19 +1086,29 @@ static u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
>  		0 : ARRAY_SIZE(efx->rx_indir_table));
>  }
>  
> -static int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key)
> +static int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
> +				u8 *hfunc)
>  {
>  	struct efx_nic *efx = netdev_priv(net_dev);
>  
> -	memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table));
> +	if (hfunc)
> +		*hfunc = ETH_RSS_HASH_UNKNOWN;
This should be ETH_RSS_HASH_TOP, especially as that's what you test
against in the _set_ function below.
(I don't know if we responded to your query.  If not, I can confirm
we're using Toeplitz.)
> +	if (indir)
> +		memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table));
>  	return 0;
>  }
>  
> -static int efx_ethtool_set_rxfh(struct net_device *net_dev,
> -				const u32 *indir, const u8 *key)
> +static int efx_ethtool_set_rxfh(struct net_device *net_dev, const u32 *indir,
> +				const u8 *key, const u8 hfunc)
>  {
>  	struct efx_nic *efx = netdev_priv(net_dev);
>  
> +	/* We do not allow change in unsupported parameters */
> +	if (key ||
> +	    (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP))
> +		return -EOPNOTSUPP;
> +	if (!indir)
> +		return 0;
>  	memcpy(efx->rx_indir_table, indir, sizeof(efx->rx_indir_table));
>  	efx->type->rx_push_rss_config(efx);
>  	return 0;
-Edward

  reply	other threads:[~2014-12-02 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 14:20 [PATCH net-next V2 0/2] ethtool, net/mlx4_en: RSS hash function selection Amir Vadai
2014-12-02 14:20 ` [PATCH net-next V2 1/2] ethtool: Support for configurable RSS hash function Amir Vadai
2014-12-02 15:14   ` Edward Cree [this message]
2014-12-02 15:21     ` Eyal Perry
2014-12-02 14:20 ` [PATCH net-next V2 2/2] net/mlx4_en: " Amir Vadai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=547DD74C.9070603@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=amirv@mellanox.com \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=sshah@solarflare.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).