All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [net-next v2 02/15] i40evf: correctly program RSS HLUT table
@ 2014-03-19  8:08 Or Gerlitz
  2014-03-19  8:14 ` Jeff Kirsher
  0 siblings, 1 reply; 4+ messages in thread
From: Or Gerlitz @ 2014-03-19  8:08 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: David Miller, Mitch Williams, netdev, gospo, sassmann,
	Catherine Sullivan

On Wed, Mar 19, 2014 at 5:42 AM, Jeff Kirsher
<jeffrey.t.kirsher@intel.com> wrote:
> 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.

In the V2 cover letter you wrote

dropped patch Mitch's patch "i40evf: correctly program RSS HLUT table"

so what is this patch?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [net-next v2 02/15] i40evf: correctly program RSS HLUT table
  2014-03-19  8:08 [net-next v2 02/15] i40evf: correctly program RSS HLUT table Or Gerlitz
@ 2014-03-19  8:14 ` Jeff Kirsher
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2014-03-19  8:14 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: David Miller, Mitch Williams, netdev, gospo, sassmann,
	Catherine Sullivan

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

On Wed, 2014-03-19 at 10:08 +0200, Or Gerlitz wrote:
> On Wed, Mar 19, 2014 at 5:42 AM, Jeff Kirsher
> <jeffrey.t.kirsher@intel.com> wrote:
> > 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.
> 
> In the V2 cover letter you wrote
> 
> dropped patch Mitch's patch "i40evf: correctly program RSS HLUT table"
> 
> so what is this patch?

Sorry, that was may bad.  In v2 I dropped patch 3 which was "i40evf:
Support RSS option in ethtool" patch.  I referenced the wrong patch in
the cover letter, thanks for noticing that Or.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [net-next v2 02/15] i40evf: correctly program RSS HLUT table
  2014-03-19  3:42 ` [net-next v2 02/15] i40evf: correctly program RSS HLUT table Jeff Kirsher
@ 2014-03-19 18:07   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-03-19 18:07 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: mitch.a.williams, netdev, gospo, sassmann, catherine.sullivan

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 18 Mar 2014 20:42:00 -0700

> +#define NEXT_QUEUE(_j) (++_j >= adapter->vsi_res->num_queue_pairs ? _j = 0 : _j)

I would strong recommend breaking the increment out of the test
and using a function rather than a macro:

static int next_queue(struct i40evf_adapter *adapter, int j)
{
	j += 1;

	return j >= adapter->vsi_res->num_queue_pairs ? 0 : j;
}

 ..

	j = next_queue(adapter, j);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [net-next v2 02/15] i40evf: correctly program RSS HLUT table
  2014-03-19  3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2014-03-19  3:42 ` Jeff Kirsher
  2014-03-19 18:07   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2014-03-19  3:42 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

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>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 17 ++++++++---------
 1 file changed, 8 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..7cb0cda 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1414,6 +1414,7 @@ restart_watchdog:
 	schedule_work(&adapter->adminq_task);
 }
 
+#define NEXT_QUEUE(_j) (++_j >= adapter->vsi_res->num_queue_pairs ? _j = 0 : _j)
 /**
  * i40evf_configure_rss - Prepare for RSS if used
  * @adapter: board private structure
@@ -1444,15 +1445,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(j);
+		lut |= NEXT_QUEUE(j) << 8;
+		lut |= NEXT_QUEUE(j) << 16;
+		lut |= NEXT_QUEUE(j) << 24;
+		wr32(hw, I40E_VFQF_HLUT(i), lut);
 	}
 	i40e_flush(hw);
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-19 18:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-19  8:08 [net-next v2 02/15] i40evf: correctly program RSS HLUT table Or Gerlitz
2014-03-19  8:14 ` Jeff Kirsher
  -- strict thread matches above, loose matches on Subject: below --
2014-03-19  3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-19  3:42 ` [net-next v2 02/15] i40evf: correctly program RSS HLUT table Jeff Kirsher
2014-03-19 18:07   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.