[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1374080612.3861.13.camel@bwh-desktop.uk.level5networks.com>
Date: Wed, 17 Jul 2013 18:03:32 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Laura Mihaela Vasilescu <laura.vasilescu@...edu.org>
CC: <netdev@...r.kernel.org>, <jeffrey.t.kirsher@...el.com>,
<carolyn.wyborny@...el.com>, <anjali.singhai@...el.com>
Subject: Re: [PATCH 2/2] igb: Expose RSS indirection table for ethtool
On Wed, 2013-07-17 at 17:52 +0100, Ben Hutchings wrote:
[...]
> > +static int igb_get_rss_table(struct net_device *netdev, u32 *rxfh_indir_tbl)
> > +{
> > + struct igb_adapter *adapter = netdev_priv(netdev);
> > + struct e1000_hw *hw = &adapter->hw;
> > + int i;
> > +
> > + for (i = 0; i < IGB_RETA_SIZE; i++)
> > + rxfh_indir_tbl[i] = rd32(E1000_RETA(i));
>
> Unpack each register into entries i*4, i*4+1, i*4+2, i*4+3.
>
> > +
> > + return 0;
> > +}
> > +
> > +static int igb_set_rss_table(struct net_device *netdev, const u32 *rxfh_indir_tbl)
> > +{
> > + struct igb_adapter *adapter = netdev_priv(netdev);
> > + struct e1000_hw *hw = &adapter->hw;
> > + int i;
> > +
> > + for (i = 0; i < IGB_RETA_SIZE; i++)
> > + wr32(E1000_RETA(i), rxfh_indir_tbl[i]);
>
> Pack entries i*4, i*4+1, i*4+2, i*4+3 into each register (as in
> igb_setup_mrqc()).
[...]
Also, the indirection table should be preserved in the driver across
hardware resets, although it may need to be reset if the number of RX
queues changes.
Commit 90415477bf13 'tg3: Make the RSS indir tbl admin configurable' is
a good example of how to do this properly.
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