All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error
@ 2010-03-24 19:35 Jeff Kirsher
  2010-03-24 19:36 ` [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up Jeff Kirsher
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeff Kirsher @ 2010-03-24 19:35 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Greg Rose, Jeff Kirsher

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

In the Tx mapping function if a DMA error occurred then the unwind of
previously mapped sections would improperly check an unsigned int if
it was less than zero.  Changed the index variable to signed to avoid
the error.

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

 drivers/net/ixgbevf/ixgbevf_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 9aaebd3..55f74b3 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -2921,9 +2921,10 @@ static int ixgbevf_tx_map(struct ixgbevf_adapter *adapter,
 	struct ixgbevf_tx_buffer *tx_buffer_info;
 	unsigned int len;
 	unsigned int total = skb->len;
-	unsigned int offset = 0, size, count = 0, i;
+	unsigned int offset = 0, size, count = 0;
 	unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
 	unsigned int f;
+	int i;
 
 	i = tx_ring->next_to_use;
 


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

* [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up
  2010-03-24 19:35 [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error Jeff Kirsher
@ 2010-03-24 19:36 ` Jeff Kirsher
  2010-03-26 18:57   ` David Miller
  2010-03-24 19:36 ` [net-2.6 PATCH 3/3] ixgbe: Change where clear_to_send_flag is reset to zero Jeff Kirsher
  2010-03-26 18:56 ` [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error David Miller
  2 siblings, 1 reply; 7+ messages in thread
From: Jeff Kirsher @ 2010-03-24 19:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Greg Rose, Jeff Kirsher

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

VFs running in guest VMs do not respond in as timely a manner to
PF indication it is going down as they do when running in the host
domain.  If the adapter is in SR-IOV mode insert a two second delay
to guarantee that all VFs have had time to respond to the PF reset.
In any case resetting the PF while VFs are active should be
discouraged but if it must be done then there will be a two
second delay to help synchronize resets among the PF and all the
VFs.

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

 drivers/net/ixgbe/ixgbe_main.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 90565d8..2f8c348 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3036,6 +3036,14 @@ void ixgbe_reinit_locked(struct ixgbe_adapter *adapter)
 	while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
 		msleep(1);
 	ixgbe_down(adapter);
+	/*
+	 * If SR-IOV enabled then wait a bit before bringing the adapter
+	 * back up to give the VFs time to respond to the reset.  The
+	 * two second wait is based upon the watchdog timer cycle in
+	 * the VF driver.
+	 */
+	if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
+		msleep(2000);
 	ixgbe_up(adapter);
 	clear_bit(__IXGBE_RESETTING, &adapter->state);
 }


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

* [net-2.6 PATCH 3/3] ixgbe: Change where clear_to_send_flag is reset to zero.
  2010-03-24 19:35 [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error Jeff Kirsher
  2010-03-24 19:36 ` [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up Jeff Kirsher
@ 2010-03-24 19:36 ` Jeff Kirsher
  2010-03-26 18:58   ` David Miller
  2010-03-26 18:56 ` [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error David Miller
  2 siblings, 1 reply; 7+ messages in thread
From: Jeff Kirsher @ 2010-03-24 19:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Greg Rose, Jeff Kirsher

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

The clear_to_send flag is being cleared before the call to ping all
the VFs.  It should be called after pinging all the VFs.

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

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

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 2f8c348..315622f 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3224,13 +3224,15 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
 
 	/* disable receive for all VFs and wait one second */
 	if (adapter->num_vfs) {
-		for (i = 0 ; i < adapter->num_vfs; i++)
-			adapter->vfinfo[i].clear_to_send = 0;
-
 		/* ping all the active vfs to let them know we are going down */
 		ixgbe_ping_all_vfs(adapter);
+
 		/* Disable all VFTE/VFRE TX/RX */
 		ixgbe_disable_tx_rx(adapter);
+
+		/* Mark all the VFs as inactive */
+		for (i = 0 ; i < adapter->num_vfs; i++)
+			adapter->vfinfo[i].clear_to_send = 0;
 	}
 
 	/* disable receives */


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

* Re: [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error
  2010-03-24 19:35 [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error Jeff Kirsher
  2010-03-24 19:36 ` [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up Jeff Kirsher
  2010-03-24 19:36 ` [net-2.6 PATCH 3/3] ixgbe: Change where clear_to_send_flag is reset to zero Jeff Kirsher
@ 2010-03-26 18:56 ` David Miller
  2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2010-03-26 18:56 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 24 Mar 2010 12:35:42 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> In the Tx mapping function if a DMA error occurred then the unwind of
> previously mapped sections would improperly check an unsigned int if
> it was less than zero.  Changed the index variable to signed to avoid
> the error.
> 
> 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] 7+ messages in thread

* Re: [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up
  2010-03-24 19:36 ` [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up Jeff Kirsher
@ 2010-03-26 18:57   ` David Miller
  2010-03-26 19:45     ` Rose, Gregory V
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2010-03-26 18:57 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 24 Mar 2010 12:36:08 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> VFs running in guest VMs do not respond in as timely a manner to
> PF indication it is going down as they do when running in the host
> domain.  If the adapter is in SR-IOV mode insert a two second delay
> to guarantee that all VFs have had time to respond to the PF reset.
> In any case resetting the PF while VFs are active should be
> discouraged but if it must be done then there will be a two
> second delay to help synchronize resets among the PF and all the
> VFs.
> 
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied, but...

I know why you might need to do this, but this is going to completely
explode if someone tries to, f.e. bring up thousands of these
interfaces.

Maybe that's not practical, but is, say, 30?  With a 2 second delay
each that's a full minute hanging at the command line or the bootup
scripts.

My point is that this behavior is basically extremely undesirable.

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

* Re: [net-2.6 PATCH 3/3] ixgbe: Change where clear_to_send_flag is reset to zero.
  2010-03-24 19:36 ` [net-2.6 PATCH 3/3] ixgbe: Change where clear_to_send_flag is reset to zero Jeff Kirsher
@ 2010-03-26 18:58   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2010-03-26 18:58 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 24 Mar 2010 12:36:27 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> The clear_to_send flag is being cleared before the call to ping all
> the VFs.  It should be called after pinging all the VFs.
> 
> 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] 7+ messages in thread

* RE: [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up
  2010-03-26 18:57   ` David Miller
@ 2010-03-26 19:45     ` Rose, Gregory V
  0 siblings, 0 replies; 7+ messages in thread
From: Rose, Gregory V @ 2010-03-26 19:45 UTC (permalink / raw)
  To: David Miller, Kirsher, Jeffrey T; +Cc: netdev, gospo

>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Friday, March 26, 2010 11:58 AM
>To: Kirsher, Jeffrey T
>Cc: netdev@vger.kernel.org; gospo@redhat.com; Rose, Gregory V
>Subject: Re: [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay
>before bring the adapter up
>
>
>
> My point is that this behavior is basically extremely undesirable.

No argument from me there.  We've been discussing design changes to maintain a little more state in the driver so that we wouldn't have to reset the entire device every time someone makes a minor configuration change.  However, I have no target date for that.  I agree that at some point in systems with a large number of interfaces this behavior becomes untenable.

- Greg


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

end of thread, other threads:[~2010-03-26 19:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24 19:35 [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error Jeff Kirsher
2010-03-24 19:36 ` [net-2.6 PATCH 2/3] ixgbe: In SR-IOV mode insert delay before bring the adapter up Jeff Kirsher
2010-03-26 18:57   ` David Miller
2010-03-26 19:45     ` Rose, Gregory V
2010-03-24 19:36 ` [net-2.6 PATCH 3/3] ixgbe: Change where clear_to_send_flag is reset to zero Jeff Kirsher
2010-03-26 18:58   ` David Miller
2010-03-26 18:56 ` [net-2.6 PATCH 1/3] ixgbevf: Fix signed/unsigned int error 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.