* [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF
@ 2009-12-12 3:40 Jeff Kirsher
2009-12-12 3:41 ` [net-2.6 PATCH 2/2] igbvf: avoid reset storms due to mailbox issues Jeff Kirsher
2009-12-12 6:58 ` [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Jeff Kirsher @ 2009-12-12 3:40 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
This patch changes the handling of collisions between the use of the PF/VF
sides of the mailbox.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/igb_main.c | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 16349ba..78963a0 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -4608,8 +4608,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf);
- if (retval)
+ if (retval) {
+ /* if receive failed revoke VF CTS stats and restart init */
dev_err(&pdev->dev, "Error receiving message from VF\n");
+ vf_data->flags &= ~IGB_VF_FLAG_CTS;
+ if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
+ return;
+ goto out;
+ }
/* this is a message we already processed, do nothing */
if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK))
@@ -4626,12 +4632,10 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
}
if (!(vf_data->flags & IGB_VF_FLAG_CTS)) {
- msgbuf[0] = E1000_VT_MSGTYPE_NACK;
- if (time_after(jiffies, vf_data->last_nack + (2 * HZ))) {
- igb_write_mbx(hw, msgbuf, 1, vf);
- vf_data->last_nack = jiffies;
- }
- return;
+ if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
+ return;
+ retval = -1;
+ goto out;
}
switch ((msgbuf[0] & 0xFFFF)) {
@@ -4656,14 +4660,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
break;
}
+ msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
+out:
/* notify the VF of the results of what it sent us */
if (retval)
msgbuf[0] |= E1000_VT_MSGTYPE_NACK;
else
msgbuf[0] |= E1000_VT_MSGTYPE_ACK;
- msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
-
igb_write_mbx(hw, msgbuf, 1, vf);
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [net-2.6 PATCH 2/2] igbvf: avoid reset storms due to mailbox issues
2009-12-12 3:40 [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF Jeff Kirsher
@ 2009-12-12 3:41 ` Jeff Kirsher
2009-12-12 6:58 ` David Miller
2009-12-12 6:58 ` [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2009-12-12 3:41 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
This change makes it so that reset/interrupt storms can be avoided when
there are mailbox issues. The new behavior is to only allow the device to
trigger mailbox related resets only once every 10 seconds.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igbvf/igbvf.h | 1 +
drivers/net/igbvf/netdev.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
index 3d1ee7a..a1774b2 100644
--- a/drivers/net/igbvf/igbvf.h
+++ b/drivers/net/igbvf/igbvf.h
@@ -276,6 +276,7 @@ struct igbvf_adapter {
unsigned long led_status;
unsigned int flags;
+ unsigned long last_reset;
};
struct igbvf_info {
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index a127620..e9dd95f 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -1469,6 +1469,8 @@ static void igbvf_reset(struct igbvf_adapter *adapter)
memcpy(netdev->perm_addr, adapter->hw.mac.addr,
netdev->addr_len);
}
+
+ adapter->last_reset = jiffies;
}
int igbvf_up(struct igbvf_adapter *adapter)
@@ -1812,11 +1814,15 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter)
s32 ret_val = E1000_SUCCESS;
bool link_active;
+ /* If interface is down, stay link down */
+ if (test_bit(__IGBVF_DOWN, &adapter->state))
+ return false;
+
ret_val = hw->mac.ops.check_for_link(hw);
link_active = !hw->mac.get_link_status;
/* if check for link returns error we will need to reset */
- if (ret_val)
+ if (ret_val && time_after(jiffies, adapter->last_reset + (10 * HZ)))
schedule_work(&adapter->reset_task);
return link_active;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF
2009-12-12 3:40 [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF Jeff Kirsher
2009-12-12 3:41 ` [net-2.6 PATCH 2/2] igbvf: avoid reset storms due to mailbox issues Jeff Kirsher
@ 2009-12-12 6:58 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2009-12-12 6:58 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 11 Dec 2009 19:40:57 -0800
> From: Alexander Duyck <alexander.h.duyck@intel.com>
>
> This patch changes the handling of collisions between the use of the PF/VF
> sides of the mailbox.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-2.6 PATCH 2/2] igbvf: avoid reset storms due to mailbox issues
2009-12-12 3:41 ` [net-2.6 PATCH 2/2] igbvf: avoid reset storms due to mailbox issues Jeff Kirsher
@ 2009-12-12 6:58 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-12-12 6:58 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 11 Dec 2009 19:41:16 -0800
> From: Alexander Duyck <alexander.h.duyck@intel.com>
>
> This change makes it so that reset/interrupt storms can be avoided when
> there are mailbox issues. The new behavior is to only allow the device to
> trigger mailbox related resets only once every 10 seconds.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-12 6:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-12 3:40 [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF Jeff Kirsher
2009-12-12 3:41 ` [net-2.6 PATCH 2/2] igbvf: avoid reset storms due to mailbox issues Jeff Kirsher
2009-12-12 6:58 ` David Miller
2009-12-12 6:58 ` [net-2.6 PATCH 1/2] igb: fix handling of mailbox collisions between PF/VF David Miller
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).