netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Mitch Williams <mitch.a.williams@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Catherine Sullivan <catherine.sullivan@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next v3 02/15] i40evf: correctly program RSS HLUT table
Date: Wed, 19 Mar 2014 20:29:52 -0700	[thread overview]
Message-ID: <1395286205-9676-3-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1395286205-9676-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Mitch Williams <mitch.a.williams@intel.com>

The HLUT programming loop in in i40evf_configure_rss was a) overly-
complicated, and b) just plain broken. Most of the entries ended up being
not written at all, so most of the flows ended up at queue zero.

Refactor the HLUT programming loop to simply walk through the registers
and write four values to each one, incrementing through the number of
available queues.

Change-ID: I75766179bc67e4e997187794f3144e28c83fd00d
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
v3:
- change macro to a function to get the next queue

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d62e27f..ffda565 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1414,6 +1414,13 @@ restart_watchdog:
 	schedule_work(&adapter->adminq_task);
 }
 
+static int next_queue(struct i40evf_adapter *adapter, int j)
+{
+	j += 1;
+
+	return j >= adapter->vsi_res->num_queue_pairs ? 0 : j;
+}
+
 /**
  * i40evf_configure_rss - Prepare for RSS if used
  * @adapter: board private structure
@@ -1444,15 +1451,13 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter)
 	wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32));
 
 	/* Populate the LUT with max no. of queues in round robin fashion */
-	for (i = 0, j = 0; i < I40E_VFQF_HLUT_MAX_INDEX; i++, j++) {
-		if (j == adapter->vsi_res->num_queue_pairs)
-			j = 0;
-		/* lut = 4-byte sliding window of 4 lut entries */
-		lut = (lut << 8) | (j &
-			 ((0x1 << 8) - 1));
-		/* On i = 3, we have 4 entries in lut; write to the register */
-		if ((i & 3) == 3)
-			wr32(hw, I40E_VFQF_HLUT(i >> 2), lut);
+	j = adapter->vsi_res->num_queue_pairs;
+	for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
+		lut = next_queue(adapter, j);
+		lut |= next_queue(adapter, j) << 8;
+		lut |= next_queue(adapter, j) << 16;
+		lut |= next_queue(adapter, j) << 24;
+		wr32(hw, I40E_VFQF_HLUT(i), lut);
 	}
 	i40e_flush(hw);
 }
-- 
1.8.3.1

  parent reply	other threads:[~2014-03-20  3:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20  3:29 [net-next v3 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-20  3:29 ` [net-next v3 01/15] i40e: support VF link state ndo Jeff Kirsher
2014-03-20  3:29 ` Jeff Kirsher [this message]
2014-03-20  3:29 ` [net-next v3 03/15] i40evf: use min_t Jeff Kirsher
2014-03-20  3:29 ` [net-next v3 04/15] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control Jeff Kirsher
2014-03-20  3:29 ` [net-next v3 05/15] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open() Jeff Kirsher
2014-03-20  3:29 ` [net-next v3 06/15] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
2014-03-20  3:29 ` [net-next v3 07/15] i40e/i40evf: reduce context descriptors Jeff Kirsher
2014-03-20  3:29 ` [net-next v3 08/15] i40e: potential array underflow in i40e_vc_process_vf_msg() Jeff Kirsher
2014-03-20  3:29 ` [net-next v3 09/15] i40e/i40evf: Bump build versions Jeff Kirsher
2014-03-20  3:30 ` [net-next v3 10/15] e1000e: Fix Hardware Unit Hang Jeff Kirsher
2014-03-20  3:30 ` [net-next v3 11/15] e1000e: Fix Explicitly set Transmit Control Register Jeff Kirsher
2014-03-20  3:30 ` [net-next v3 12/15] igb: Add register defines needed for time sync functions Jeff Kirsher
2014-03-20  3:30 ` [net-next v3 13/15] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check Jeff Kirsher
2014-03-20  3:30 ` [net-next v3 14/15] ixgbevf: Indicate removal state explicitly Jeff Kirsher
2014-03-20  3:30 ` [net-next v3 15/15] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit Jeff Kirsher
2014-03-20  3:56 ` [net-next v3 00/15][pull request] Intel Wired LAN Driver Updates David Miller

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=1395286205-9676-3-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=catherine.sullivan@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=mitch.a.williams@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.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).