All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580
@ 2010-07-01 23:37 Jeff Kirsher
  2010-07-01 23:38 ` [net-next-2.6 PATCH 2/5] igb: Use only a single Tx queue in SR-IOV mode Jeff Kirsher
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Jeff Kirsher @ 2010-07-01 23:37 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Nicholas Nunley, Jeff Kirsher

From: Nick Nunley <nicholasx.d.nunley@intel.com>

82580 NICs can have up to 4 functions. This fixes phy accesses
to use the correct locks for functions 2 and 3.

Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/e1000_82575.c   |    8 ++++++++
 drivers/net/igb/e1000_defines.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 86438b5..06251a9 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -295,6 +295,10 @@ static s32 igb_acquire_phy_82575(struct e1000_hw *hw)
 
 	if (hw->bus.func == E1000_FUNC_1)
 		mask = E1000_SWFW_PHY1_SM;
+	else if (hw->bus.func == E1000_FUNC_2)
+		mask = E1000_SWFW_PHY2_SM;
+	else if (hw->bus.func == E1000_FUNC_3)
+		mask = E1000_SWFW_PHY3_SM;
 
 	return igb_acquire_swfw_sync_82575(hw, mask);
 }
@@ -312,6 +316,10 @@ static void igb_release_phy_82575(struct e1000_hw *hw)
 
 	if (hw->bus.func == E1000_FUNC_1)
 		mask = E1000_SWFW_PHY1_SM;
+	else if (hw->bus.func == E1000_FUNC_2)
+		mask = E1000_SWFW_PHY2_SM;
+	else if (hw->bus.func == E1000_FUNC_3)
+		mask = E1000_SWFW_PHY3_SM;
 
 	igb_release_swfw_sync_82575(hw, mask);
 }
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index 24d9be6..90bc29d 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -164,6 +164,8 @@
 #define E1000_SWFW_EEP_SM   0x1
 #define E1000_SWFW_PHY0_SM  0x2
 #define E1000_SWFW_PHY1_SM  0x4
+#define E1000_SWFW_PHY2_SM  0x20
+#define E1000_SWFW_PHY3_SM  0x40
 
 /* FACTPS Definitions */
 /* Device Control */


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

* [net-next-2.6 PATCH 2/5] igb: Use only a single Tx queue in SR-IOV mode
  2010-07-01 23:37 [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 Jeff Kirsher
@ 2010-07-01 23:38 ` Jeff Kirsher
  2010-07-02  5:50   ` David Miller
  2010-07-01 23:38 ` [net-next-2.6 PATCH 3/5] igb: Fix Tx hangs seen when loading igb with max_vfs > 7 Jeff Kirsher
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Jeff Kirsher @ 2010-07-01 23:38 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, stable, Greg Rose, Jeff Kirsher

From: Greg Rose <gregory.v.rose@intel.com>

The 82576 expects the second rx queue in any pool to receive L2 switch
loop back packets sent from the second tx queue in another pool.  The
82576 VF driver does not enable the second rx queue so if the PF driver
sends packets destined to a VF from its second tx queue then the VF
driver will never see them.  In SR-IOV mode limit the number of tx queues
used by the PF driver to one. This patch fixes a bug reported in which
the PF cannot communciate with the VF and should be considered for 2.6.34
stable.

CC: stable@kernel.org
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 3881918..e79689e 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -630,9 +630,6 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
 			for (; i < adapter->rss_queues; i++)
 				adapter->rx_ring[i]->reg_idx = rbase_offset +
 				                               Q_IDX_82576(i);
-			for (; j < adapter->rss_queues; j++)
-				adapter->tx_ring[j]->reg_idx = rbase_offset +
-				                               Q_IDX_82576(j);
 		}
 	case e1000_82575:
 	case e1000_82580:
@@ -996,7 +993,10 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
 
 	/* Number of supported queues. */
 	adapter->num_rx_queues = adapter->rss_queues;
-	adapter->num_tx_queues = adapter->rss_queues;
+	if (adapter->vfs_allocated_count)
+		adapter->num_tx_queues = 1;
+	else
+		adapter->num_tx_queues = adapter->rss_queues;
 
 	/* start with one vector for every rx queue */
 	numvecs = adapter->num_rx_queues;


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

* [net-next-2.6 PATCH 3/5] igb: Fix Tx hangs seen when loading igb with max_vfs > 7.
  2010-07-01 23:37 [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 Jeff Kirsher
  2010-07-01 23:38 ` [net-next-2.6 PATCH 2/5] igb: Use only a single Tx queue in SR-IOV mode Jeff Kirsher
@ 2010-07-01 23:38 ` Jeff Kirsher
  2010-07-02  5:50   ` David Miller
  2010-07-01 23:39 ` [net-next-2.6 PATCH 4/5] igb: correct link test not being run when link is down Jeff Kirsher
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Jeff Kirsher @ 2010-07-01 23:38 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Emil Tantilov, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

Check the value of max_vfs at the time of assignment of vfs_allocated_count.

The previous check in igb_probe_vfs was too late as by that time the rx/tx
rings were initialized with the wrong offset.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_main.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index e79689e..d811462 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2091,9 +2091,6 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
 #ifdef CONFIG_PCI_IOV
 	struct pci_dev *pdev = adapter->pdev;
 
-	if (adapter->vfs_allocated_count > 7)
-		adapter->vfs_allocated_count = 7;
-
 	if (adapter->vfs_allocated_count) {
 		adapter->vf_data = kcalloc(adapter->vfs_allocated_count,
 		                           sizeof(struct vf_data_storage),
@@ -2258,7 +2255,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
 
 #ifdef CONFIG_PCI_IOV
 	if (hw->mac.type == e1000_82576)
-		adapter->vfs_allocated_count = max_vfs;
+		adapter->vfs_allocated_count = (max_vfs > 7) ? 7 : max_vfs;
 
 #endif /* CONFIG_PCI_IOV */
 	adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());


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

* [net-next-2.6 PATCH 4/5] igb: correct link test not being run when link is down
  2010-07-01 23:37 [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 Jeff Kirsher
  2010-07-01 23:38 ` [net-next-2.6 PATCH 2/5] igb: Use only a single Tx queue in SR-IOV mode Jeff Kirsher
  2010-07-01 23:38 ` [net-next-2.6 PATCH 3/5] igb: Fix Tx hangs seen when loading igb with max_vfs > 7 Jeff Kirsher
@ 2010-07-01 23:39 ` Jeff Kirsher
  2010-07-02  5:50   ` David Miller
  2010-07-01 23:39 ` [net-next-2.6 PATCH 5/5] igb: Add comment Jeff Kirsher
  2010-07-02  5:49 ` [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 David Miller
  4 siblings, 1 reply; 10+ messages in thread
From: Jeff Kirsher @ 2010-07-01 23:39 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Alexander Duyck, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

The igb online link test was always reporting pass because instead of
checking for if_running it was checking for netif_carrier_ok.

This change corrects the test so that it is run if the interface is running
instead of checking for netif carrier ok.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_ethtool.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index f2ebf92..26bf6a1 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1823,12 +1823,10 @@ static void igb_diag_test(struct net_device *netdev,
 		dev_info(&adapter->pdev->dev, "online testing starting\n");
 
 		/* PHY is powered down when interface is down */
-		if (!netif_carrier_ok(netdev)) {
+		if (if_running && igb_link_test(adapter, &data[4]))
+			eth_test->flags |= ETH_TEST_FL_FAILED;
+		else
 			data[4] = 0;
-		} else {
-			if (igb_link_test(adapter, &data[4]))
-				eth_test->flags |= ETH_TEST_FL_FAILED;
-		}
 
 		/* Online tests aren't run; pass by default */
 		data[0] = 0;


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

* [net-next-2.6 PATCH 5/5] igb: Add comment
  2010-07-01 23:37 [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2010-07-01 23:39 ` [net-next-2.6 PATCH 4/5] igb: correct link test not being run when link is down Jeff Kirsher
@ 2010-07-01 23:39 ` Jeff Kirsher
  2010-07-02  5:50   ` David Miller
  2010-07-02  5:49 ` [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 David Miller
  4 siblings, 1 reply; 10+ messages in thread
From: Jeff Kirsher @ 2010-07-01 23:39 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Greg Rose, Jeff Kirsher

From: Greg Rose <gregory.v.rose@intel.com>

Add explanatory comment to avoid confusion when a pointer is set
to the second word of an array instead of the customary cast of a
pointer to the beginning of the array.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index d811462..9cb04e2 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -4974,6 +4974,10 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
 
 static int igb_set_vf_mac_addr(struct igb_adapter *adapter, u32 *msg, int vf)
 {
+	/*
+	 * The VF MAC Address is stored in a packed array of bytes
+	 * starting at the second 32 bit word of the msg array
+	 */
 	unsigned char *addr = (char *)&msg[1];
 	int err = -1;
 


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

* Re: [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580
  2010-07-01 23:37 [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2010-07-01 23:39 ` [net-next-2.6 PATCH 5/5] igb: Add comment Jeff Kirsher
@ 2010-07-02  5:49 ` David Miller
  4 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-07-02  5:49 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, nicholasx.d.nunley

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 01 Jul 2010 16:37:54 -0700

> From: Nick Nunley <nicholasx.d.nunley@intel.com>
> 
> 82580 NICs can have up to 4 functions. This fixes phy accesses
> to use the correct locks for functions 2 and 3.
> 
> Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

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

* Re: [net-next-2.6 PATCH 2/5] igb: Use only a single Tx queue in SR-IOV mode
  2010-07-01 23:38 ` [net-next-2.6 PATCH 2/5] igb: Use only a single Tx queue in SR-IOV mode Jeff Kirsher
@ 2010-07-02  5:50   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-07-02  5:50 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, stable, gregory.v.rose

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 01 Jul 2010 16:38:16 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> The 82576 expects the second rx queue in any pool to receive L2 switch
> loop back packets sent from the second tx queue in another pool.  The
> 82576 VF driver does not enable the second rx queue so if the PF driver
> sends packets destined to a VF from its second tx queue then the VF
> driver will never see them.  In SR-IOV mode limit the number of tx queues
> used by the PF driver to one. This patch fixes a bug reported in which
> the PF cannot communciate with the VF and should be considered for 2.6.34
> stable.
> 
> CC: stable@kernel.org
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

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

* Re: [net-next-2.6 PATCH 3/5] igb: Fix Tx hangs seen when loading igb with max_vfs > 7.
  2010-07-01 23:38 ` [net-next-2.6 PATCH 3/5] igb: Fix Tx hangs seen when loading igb with max_vfs > 7 Jeff Kirsher
@ 2010-07-02  5:50   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-07-02  5:50 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, emil.s.tantilov

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 01 Jul 2010 16:38:40 -0700

> From: Emil Tantilov <emil.s.tantilov@intel.com>
> 
> Check the value of max_vfs at the time of assignment of vfs_allocated_count.
> 
> The previous check in igb_probe_vfs was too late as by that time the rx/tx
> rings were initialized with the wrong offset.
> 
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

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

* Re: [net-next-2.6 PATCH 4/5] igb: correct link test not being run when link is down
  2010-07-01 23:39 ` [net-next-2.6 PATCH 4/5] igb: correct link test not being run when link is down Jeff Kirsher
@ 2010-07-02  5:50   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-07-02  5:50 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, alexander.h.duyck

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 01 Jul 2010 16:39:01 -0700

> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> The igb online link test was always reporting pass because instead of
> checking for if_running it was checking for netif_carrier_ok.
> 
> This change corrects the test so that it is run if the interface is running
> instead of checking for netif carrier ok.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

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

* Re: [net-next-2.6 PATCH 5/5] igb: Add comment
  2010-07-01 23:39 ` [net-next-2.6 PATCH 5/5] igb: Add comment Jeff Kirsher
@ 2010-07-02  5:50   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-07-02  5:50 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, gregory.v.rose

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 01 Jul 2010 16:39:23 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> Add explanatory comment to avoid confusion when a pointer is set
> to the second word of an array instead of the customary cast of a
> pointer to the beginning of the array.
> 
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

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

end of thread, other threads:[~2010-07-02  5:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-01 23:37 [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 Jeff Kirsher
2010-07-01 23:38 ` [net-next-2.6 PATCH 2/5] igb: Use only a single Tx queue in SR-IOV mode Jeff Kirsher
2010-07-02  5:50   ` David Miller
2010-07-01 23:38 ` [net-next-2.6 PATCH 3/5] igb: Fix Tx hangs seen when loading igb with max_vfs > 7 Jeff Kirsher
2010-07-02  5:50   ` David Miller
2010-07-01 23:39 ` [net-next-2.6 PATCH 4/5] igb: correct link test not being run when link is down Jeff Kirsher
2010-07-02  5:50   ` David Miller
2010-07-01 23:39 ` [net-next-2.6 PATCH 5/5] igb: Add comment Jeff Kirsher
2010-07-02  5:50   ` David Miller
2010-07-02  5:49 ` [net-next-2.6 PATCH 1/5] igb: fix PHY config access on 82580 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.