summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorpkelsey <pkelsey@FreeBSD.org>2015-07-15 00:35:50 +0000
committerpkelsey <pkelsey@FreeBSD.org>2015-07-15 00:35:50 +0000
commit01b9094f41a2a23a33781eb883218f9e68918117 (patch)
tree2b490af7500974e2ac77a31f4ce924754c3a046b /sys/dev
parentf362cc00d222cfef7763d20ba35254fafdc0680f (diff)
downloadFreeBSD-src-01b9094f41a2a23a33781eb883218f9e68918117.zip
FreeBSD-src-01b9094f41a2a23a33781eb883218f9e68918117.tar.gz
Fix igxbe SRIOV VF (if_ixv) initialization bugs. The MAC address for
an if_ixv instance can now set at creation time, and the receive ring tail pointer is correctly initialized (previously, things still worked because the receive ring tail pointer was being fixed up as a side effect of other activity). Differential Revision: https://reviews.freebsd.org/D2922 Reviewed by: erj, gnn Approved by: jmallett (mentor) Sponsored by: Norse Corp, Inc.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ixgbe/if_ix.c4
-rw-r--r--sys/dev/ixgbe/if_ixv.c8
-rw-r--r--sys/dev/ixgbe/ixgbe_vf.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index c8ce744..f3ddd32 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -5273,10 +5273,10 @@ ixgbe_vf_api_negotiate(struct adapter *adapter, struct ixgbe_vf *vf,
uint32_t *msg)
{
- switch (msg[0]) {
+ switch (msg[1]) {
case IXGBE_API_VER_1_0:
case IXGBE_API_VER_1_1:
- vf->api_ver = msg[0];
+ vf->api_ver = msg[1];
ixgbe_send_vf_ack(adapter, vf, msg[0]);
break;
default:
diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c
index cc2d63f..db0f244 100644
--- a/sys/dev/ixgbe/if_ixv.c
+++ b/sys/dev/ixgbe/if_ixv.c
@@ -1665,10 +1665,6 @@ ixv_initialize_receive_units(struct adapter *adapter)
reg |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF;
IXGBE_WRITE_REG(hw, IXGBE_VFSRRCTL(i), reg);
- /* Set the Tail Pointer */
- IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me),
- adapter->num_rx_desc - 1);
-
/* Set the processing limit */
rxr->process_limit = ixv_rx_process_limit;
@@ -1687,6 +1683,10 @@ ixv_initialize_receive_units(struct adapter *adapter)
msec_delay(1);
}
wmb();
+
+ /* Set the Tail Pointer */
+ IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me),
+ adapter->num_rx_desc - 1);
}
rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM);
diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c
index 2ce4d32..a00b8be 100644
--- a/sys/dev/ixgbe/ixgbe_vf.c
+++ b/sys/dev/ixgbe/ixgbe_vf.c
@@ -225,6 +225,8 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw)
if (ret_val)
return ret_val;
+ msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
+
if (msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK) &&
msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_NACK))
return IXGBE_ERR_INVALID_MAC_ADDR;
OpenPOWER on IntegriCloud