[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1416714275.7215.38.camel@decadent.org.uk>
Date: Sun, 23 Nov 2014 03:44:35 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc: davem@...emloft.net, Mitch Williams <mitch.a.williams@...el.com>,
netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
jogreene@...hat.com
Subject: Re: [net-next 13/17] i40evf: refactor ethtool RSS handling
On Fri, 2014-11-21 at 21:55 -0800, Jeff Kirsher wrote:
> From: Mitch Williams <mitch.a.williams@...el.com>
>
> Add support for setting the RSS key as it is now implemented.
>
> Change-ID: I9290ae3ea99d0e46053540650f95e24a24e453f1
> Signed-off-by: Mitch Williams <mitch.a.williams@...el.com>
> Tested-by: Jim Young <jamesx.m.young@...el.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
> ---
> drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 66 ++++++++++++++++------
> 1 file changed, 50 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
> index 69a269b..ed0e4dc 100644
> --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
> @@ -608,6 +608,19 @@ static void i40evf_get_channels(struct net_device *netdev,
> ch->combined_count = adapter->num_active_queues;
> }
>
> +#define I40EVF_HLUT_ARRAY_SIZE ((I40E_VFQF_HLUT_MAX_INDEX + 1) * 4)
> +#define I40EVF_HKEY_ARRAY_SIZE ((I40E_VFQF_HKEY_MAX_INDEX * 1) * 4)
The '* 1' should be '+ 1' as on the previous line?
[...]
> @@ -631,19 +644,28 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
> {
> struct i40evf_adapter *adapter = netdev_priv(netdev);
> struct i40e_hw *hw = &adapter->hw;
> - u32 hlut_val;
> + u32 reg_val;
> int i, j;
> for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
> - hlut_val = rd32(hw, I40E_VFQF_HLUT(i));
> - indir[j++] = hlut_val & 0xff;
> - indir[j++] = (hlut_val >> 8) & 0xff;
> - indir[j++] = (hlut_val >> 16) & 0xff;
> - indir[j++] = (hlut_val >> 24) & 0xff;
> + reg_val = rd32(hw, I40E_VFQF_HLUT(i));
> + indir[j++] = reg_val & 0xff;
> + indir[j++] = (reg_val >> 8) & 0xff;
> + indir[j++] = (reg_val >> 16) & 0xff;
> + indir[j++] = (reg_val >> 24) & 0xff;
> + }
You need an 'if (indir)' around that block now.
> + if (key) {
> + for (i = 0, j = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++) {
> + reg_val = rd32(hw, I40E_VFQF_HKEY(i));
> + key[j++] = (u8)(reg_val & 0xff);
> + key[j++] = (u8)((reg_val >> 8) & 0xff);
> + key[j++] = (u8)((reg_val >> 16) & 0xff);
> + key[j++] = (u8)((reg_val >> 24) & 0xff);
> + }
> }
> return 0;
> }
> -
You should keep the blank line between functions.
[...]
> @@ -687,10 +719,12 @@ static const struct ethtool_ops i40evf_ethtool_ops = {
> .set_coalesce = i40evf_set_coalesce,
> .get_rxnfc = i40evf_get_rxnfc,
> .set_rxnfc = i40evf_set_rxnfc,
> + .get_rxfh_key_size = i40evf_get_rxfh_key_size,
> .get_rxfh_indir_size = i40evf_get_rxfh_indir_size,
> .get_rxfh = i40evf_get_rxfh,
> .set_rxfh = i40evf_set_rxfh,
> .get_channels = i40evf_get_channels,
> +
But you don't need a blank line here.
Ben.
> };
>
> /**
--
Ben Hutchings
Never put off till tomorrow what you can avoid all together.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists