Here is the patch :
diff -burN orig/ixgbe_ethtool.c new/ixgbe_ethtool.c
--- orig/ixgbe_ethtool.c 2014-12-03 10:48:02.947990480 +0100
+++ new/ixgbe_ethtool.c 2014-12-03 10:47:30.759991212 +0100
@@ -825,6 +825,84 @@
regs_buff[1128] = IXGBE_READ_REG(hw, IXGBE_MFLCN);
}
+static u32 ixgbe_get_rxfh_indir_size(struct net_device *netdev)
+{
+ return IXGBE_RETA_SIZE;
+}
+
+static int ixgbe_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key)
+{
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
+ struct ixgbe_hw *hw = &adapter->hw;
+ int i, j, d, indices_multi;
+ u32 reta = 0;
+
+ /* Read out the redirection table as follows:
+ * 82598: 128 (8 bit wide) entries containing pair of 4 bit RSS indices
+ * 82599/X540: 128 (8 bit wide) entries containing 4 bit RSS index
+ */
+ if (adapter->hw.mac.type == ixgbe_mac_82598EB)
+ indices_multi = 0x11;
+ else
+ indices_multi = 0x1;
+
+
+ /* Read out the redirection table */
+ for (i = 0, j = 0; i < IXGBE_RETA_SIZE / 4; i++) {
+ reta = IXGBE_READ_REG(hw, IXGBE_RETA(i));
+ j+=4;
+ for (d = 1; d < 5; d++) {
+ indir[j - d] = (reta & 0xFF) / indices_multi;
+ reta = reta >> 8;
+ }
+ }
+ return 0;
+}
+
+static int ixgbe_set_rxfh(struct net_device *netdev, const u32 *indir,
+ const u8 *key)
+{
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
+ struct ixgbe_hw *hw = &adapter->hw;
+ u32 reta = 0;
+ int i, indices_multi;
+ u32 num_queues;
+
+ num_queues = adapter->num_rx_queues;
+
+ /*
+ * Allow at least 2 queues w/ SR-IOV.
+ */
+ if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) && (num_queues < 2))
+ num_queues = 2;
+
+ /* Verify user input. */
+ for (i = 0; i < IXGBE_RETA_SIZE; i++)
+ if (indir[i] >= num_queues)
+ return -EINVAL;
+
+ /* Fill out the redirection table as follows:
+ * 82598: 128 (8 bit wide) entries containing pair of 4 bit RSS
indices
+ * 82599/X540: 128 (8 bit wide) entries containing 4 bit RSS index
+ */
+ if (adapter->hw.mac.type == ixgbe_mac_82598EB)
+ indices_multi = 0x11;
+ else
+ indices_multi = 0x1;
+
+ /* Fill out the redirection table */
+ for (i = 0; i < IXGBE_RETA_SIZE; i++) {
+ reta = (reta << 8) | (indir[i] * indices_multi);
+ if ((i & 3) == 3) {
+ if (i < 128)
+ IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta);
+ }
+ }
+ return 0;
+}
+
+
+
static int ixgbe_get_eeprom_len(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -3461,6 +3539,9 @@
.get_eeprom_len = ixgbe_get_eeprom_len,
.get_eeprom = ixgbe_get_eeprom,
.set_eeprom = ixgbe_set_eeprom,
+ .get_rxfh_indir_size = ixgbe_get_rxfh_indir_size,
+ .get_rxfh = ixgbe_get_rxfh,
+ .set_rxfh = ixgbe_set_rxfh,
.get_ringparam = ixgbe_get_ringparam,
.set_ringparam = ixgbe_set_ringparam,
.get_pauseparam = ixgbe_get_pauseparam,
diff -burN orig/ixgbe_type.h new/ixgbe_type.h
--- orig/ixgbe_type.h 2014-12-03 10:47:47.891990822 +0100
+++ new/ixgbe_type.h 2014-12-03 10:47:30.759991212 +0100
@@ -336,6 +336,7 @@
#define IXGBE_IMIREXT(_i) (0x05AA0 + ((_i) * 4)) /* 8 of these (0-7) */
#define IXGBE_IMIRVP 0x05AC0
#define IXGBE_VMD_CTL 0x0581C
+#define IXGBE_RETA_SIZE 128
#define IXGBE_RETA(_i) (0x05C00 + ((_i) * 4)) /* 32 of these (0-31) */
#define IXGBE_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* 10 of these (0-9) */
*Tom Barbette*
PhD Student at Université de Liège (ULg)
*Bât. B28 Montefiore - Research Unit in Networking*
*Grande Traverse 10*
*4000 Liège*
*BELGIUM*
Phone: +32 4 366 *91 75*
GSM: +32 479 60 94 63
Office: B37 (Math) 1.13
GPS: 50.586605 5.560066
2014-12-03 13:37 GMT+01:00 Jeff Kirsher <jeffrey.t.kirs...@intel.com>:
> On Wed, 2014-12-03 at 11:06 +0100, Tom Barbette wrote:
> > Hi list,
> >
> > Here is a very small patch to enable the use of "ethtool --show-rxfh"
> > and
> > "ethtool --set-rxfh" with ixgbe. I've tested it with my X520 cards,
> > but it
> > should be good with all cards as it's kind of a simple merge from igb
> > and
> > the existing code for initialisation of the rx indirection table in
> > ixgbe...
> >
> > If someone would need use cases :
> > - Allow changing the number of queue used for RSS whithout resetting.
> > To
> > let more queues available for flow director, or because straffic
> > slowed
> > down and you want more cores to go to sleep.
> > - Use the weight mode of ethtool to dynamicly load balance flows
> > overwhelming some queues.
> >
> > Thanks for your review,
> >
> > *Tom Barbette*
> > PhD Student at Université de Liège (ULg)
>
> Attached patches get stripped automatically on this mailing list. So if
> you want to submit a patch to this mailing list, you will need to send
> it inline.
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit
http://communities.intel.com/community/wired