diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-12-12 01:57:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-12 01:57:34 -0500 |
commit | fef45f4ce221fc110f70716a00f40be697c5b254 (patch) | |
tree | a980ffbc75b62f6686eccf23d53c03aa643fefaa /drivers/net/igb | |
parent | ceb0c77e573bb208e282ce9af973a07ab79791e2 (diff) |
igb: fix handling of mailbox collisions between PF/VF
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | 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 16349ba68736..78963a0e128d 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) | |||
4608 | 4608 | ||
4609 | retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf); | 4609 | retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf); |
4610 | 4610 | ||
4611 | if (retval) | 4611 | if (retval) { |
4612 | /* if receive failed revoke VF CTS stats and restart init */ | ||
4612 | dev_err(&pdev->dev, "Error receiving message from VF\n"); | 4613 | dev_err(&pdev->dev, "Error receiving message from VF\n"); |
4614 | vf_data->flags &= ~IGB_VF_FLAG_CTS; | ||
4615 | if (!time_after(jiffies, vf_data->last_nack + (2 * HZ))) | ||
4616 | return; | ||
4617 | goto out; | ||
4618 | } | ||
4613 | 4619 | ||
4614 | /* this is a message we already processed, do nothing */ | 4620 | /* this is a message we already processed, do nothing */ |
4615 | if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK)) | 4621 | 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) | |||
4626 | } | 4632 | } |
4627 | 4633 | ||
4628 | if (!(vf_data->flags & IGB_VF_FLAG_CTS)) { | 4634 | if (!(vf_data->flags & IGB_VF_FLAG_CTS)) { |
4629 | msgbuf[0] = E1000_VT_MSGTYPE_NACK; | 4635 | if (!time_after(jiffies, vf_data->last_nack + (2 * HZ))) |
4630 | if (time_after(jiffies, vf_data->last_nack + (2 * HZ))) { | 4636 | return; |
4631 | igb_write_mbx(hw, msgbuf, 1, vf); | 4637 | retval = -1; |
4632 | vf_data->last_nack = jiffies; | 4638 | goto out; |
4633 | } | ||
4634 | return; | ||
4635 | } | 4639 | } |
4636 | 4640 | ||
4637 | switch ((msgbuf[0] & 0xFFFF)) { | 4641 | switch ((msgbuf[0] & 0xFFFF)) { |
@@ -4656,14 +4660,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf) | |||
4656 | break; | 4660 | break; |
4657 | } | 4661 | } |
4658 | 4662 | ||
4663 | msgbuf[0] |= E1000_VT_MSGTYPE_CTS; | ||
4664 | out: | ||
4659 | /* notify the VF of the results of what it sent us */ | 4665 | /* notify the VF of the results of what it sent us */ |
4660 | if (retval) | 4666 | if (retval) |
4661 | msgbuf[0] |= E1000_VT_MSGTYPE_NACK; | 4667 | msgbuf[0] |= E1000_VT_MSGTYPE_NACK; |
4662 | else | 4668 | else |
4663 | msgbuf[0] |= E1000_VT_MSGTYPE_ACK; | 4669 | msgbuf[0] |= E1000_VT_MSGTYPE_ACK; |
4664 | 4670 | ||
4665 | msgbuf[0] |= E1000_VT_MSGTYPE_CTS; | ||
4666 | |||
4667 | igb_write_mbx(hw, msgbuf, 1, vf); | 4671 | igb_write_mbx(hw, msgbuf, 1, vf); |
4668 | } | 4672 | } |
4669 | 4673 | ||