Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/ixgbe Sync with the remaining part of FreeBSD r3...
details: https://anonhg.NetBSD.org/src/rev/c501403291d4
branches: trunk
changeset: 321757:c501403291d4
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Wed Apr 04 08:13:07 2018 +0000
description:
Sync with the remaining part of FreeBSD r328265 except sfp_reinit stuff:
- Always schedule module intterrupt in ixgbe_config_link() when a device is
SFP+ based.
- Use not loop index but txr->me in ixv_initialize_{transmit,receive}_units().
It's required for VMDQ but NetBSD doesn't use it, so it's not a bug in
NetBSD.
- Simplify ixgbe_bp_wd_set(). No functional change.
- Whitespace.
diffstat:
sys/dev/pci/ixgbe/if_bypass.c | 51 ++++++++++----------------
sys/dev/pci/ixgbe/if_fdir.c | 2 +-
sys/dev/pci/ixgbe/if_sriov.c | 14 +++---
sys/dev/pci/ixgbe/ix_txrx.c | 4 +-
sys/dev/pci/ixgbe/ixgbe.c | 71 +++++++++++++++++-------------------
sys/dev/pci/ixgbe/ixgbe.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_82598.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_82598.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_82599.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_82599.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_api.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_api.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_common.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_common.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_dcb.c | 2 +-
sys/dev/pci/ixgbe/ixgbe_dcb.h | 2 +-
sys/dev/pci/ixgbe/ixgbe_dcb_82598.c | 2 +-
sys/dev/pci/ixgbe/ixgbe_dcb_82598.h | 2 +-
sys/dev/pci/ixgbe/ixgbe_dcb_82599.c | 2 +-
sys/dev/pci/ixgbe/ixgbe_dcb_82599.h | 2 +-
sys/dev/pci/ixgbe/ixgbe_fdir.h | 2 +-
sys/dev/pci/ixgbe/ixgbe_mbx.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_mbx.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_osdep.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_osdep.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_phy.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_phy.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_rss.h | 2 +-
sys/dev/pci/ixgbe/ixgbe_sriov.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_type.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_vf.c | 4 +-
sys/dev/pci/ixgbe/ixgbe_vf.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_x540.c | 2 +-
sys/dev/pci/ixgbe/ixgbe_x540.h | 2 +-
sys/dev/pci/ixgbe/ixv.c | 62 ++++++++++++++++---------------
35 files changed, 144 insertions(+), 156 deletions(-)
diffs (truncated from 1117 to 300 lines):
diff -r a5bdc647d21d -r c501403291d4 sys/dev/pci/ixgbe/if_bypass.c
--- a/sys/dev/pci/ixgbe/if_bypass.c Wed Apr 04 06:30:09 2018 +0000
+++ b/sys/dev/pci/ixgbe/if_bypass.c Wed Apr 04 08:13:07 2018 +0000
@@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 320688 2017-07-05 17:27:03Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 327031 2017-12-20 18:15:06Z erj $*/
#include "ixgbe.h"
@@ -168,13 +168,13 @@
error = hw->mac.ops.bypass_rw(hw,
BYPASS_PAGE_CTL0, &state);
ixgbe_bypass_mutex_clear(adapter);
- if (error)
+ if (error != 0)
return (error);
state = (state >> BYPASS_STATUS_OFF_SHIFT) & 0x3;
node.sysctl_data = &state;
error = sysctl_lookup(SYSCTLFN_CALL(&node));
- if ((error) || (newp == NULL))
+ if ((error != 0) || (newp == NULL))
return (error);
/* Sanity check new state */
@@ -452,7 +452,7 @@
struct ixgbe_hw *hw = &adapter->hw;
int error, tmp;
static int timeout = 0;
- u32 mask, arg = BYPASS_PAGE_CTL0;
+ u32 mask, arg;
/* Get the current hardware value */
ixgbe_bypass_mutex_enter(adapter);
@@ -472,48 +472,38 @@
if ((error) || (newp == NULL))
return (error);
- mask = BYPASS_WDT_ENABLE_M;
+ arg = 0x1 << BYPASS_WDT_ENABLE_SHIFT;
+ mask = BYPASS_WDT_ENABLE_M | BYPASS_WDT_VALUE_M;
switch (timeout) {
case 0: /* disables the timer */
+ arg = BYPASS_PAGE_CTL0;
+ mask = BYPASS_WDT_ENABLE_M;
break;
case 1:
- arg = BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT;
- arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
- mask |= BYPASS_WDT_VALUE_M;
+ arg |= BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT;
break;
case 2:
- arg = BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT;
- arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
- mask |= BYPASS_WDT_VALUE_M;
+ arg |= BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT;
break;
case 3:
- arg = BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT;
- arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
- mask |= BYPASS_WDT_VALUE_M;
+ arg |= BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT;
break;
case 4:
- arg = BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT;
- arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
- mask |= BYPASS_WDT_VALUE_M;
+ arg |= BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT;
break;
case 8:
- arg = BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT;
- arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
- mask |= BYPASS_WDT_VALUE_M;
+ arg |= BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT;
break;
case 16:
- arg = BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT;
- arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
- mask |= BYPASS_WDT_VALUE_M;
+ arg |= BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT;
break;
case 32:
- arg = BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT;
- arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT;
- mask |= BYPASS_WDT_VALUE_M;
+ arg |= BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT;
break;
default:
return (EINVAL);
}
+
/* Set the new watchdog */
ixgbe_bypass_mutex_enter(adapter);
error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, mask, arg);
@@ -559,7 +549,8 @@
error = IXGBE_BYPASS_FW_WRITE_FAILURE;
break;
}
- if (hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd)) {
+ error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd);
+ if (error != 0) {
error = IXGBE_ERR_INVALID_ARGUMENT;
break;
}
@@ -724,7 +715,7 @@
/* Another log command can now run */
while (atomic_cas_uint(&adapter->bypass.log, 1, 0) == 0)
usec_delay(3000);
- return(error);
+ return (error);
unlock_err:
ixgbe_bypass_mutex_clear(adapter);
@@ -745,9 +736,9 @@
{
struct ixgbe_hw *hw = &adapter->hw;
device_t dev = adapter->dev;
- u32 mask, value, sec, year;
struct sysctllog **log;
const struct sysctlnode *rnode, *cnode;
+ u32 mask, value, sec, year;
if (!(adapter->feat_cap & IXGBE_FEATURE_BYPASS))
return;
@@ -825,7 +816,5 @@
ixgbe_bp_wd_reset, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL);
adapter->feat_en |= IXGBE_FEATURE_BYPASS;
-
- return;
} /* ixgbe_bypass_init */
diff -r a5bdc647d21d -r c501403291d4 sys/dev/pci/ixgbe/if_fdir.c
--- a/sys/dev/pci/ixgbe/if_fdir.c Wed Apr 04 06:30:09 2018 +0000
+++ b/sys/dev/pci/ixgbe/if_fdir.c Wed Apr 04 08:13:07 2018 +0000
@@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_fdir.c 320688 2017-07-05 17:27:03Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_fdir.c 327031 2017-12-20 18:15:06Z erj $*/
#include "ixgbe.h"
diff -r a5bdc647d21d -r c501403291d4 sys/dev/pci/ixgbe/if_sriov.c
--- a/sys/dev/pci/ixgbe/if_sriov.c Wed Apr 04 06:30:09 2018 +0000
+++ b/sys/dev/pci/ixgbe/if_sriov.c Wed Apr 04 08:13:07 2018 +0000
@@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 320688 2017-07-05 17:27:03Z erj $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/
#include "ixgbe.h"
#include "ixgbe_sriov.h"
@@ -90,26 +90,26 @@
/* Support functions for SR-IOV/VF management */
static inline void
-ixgbe_send_vf_msg(struct ixgbe_hw *hw, struct ixgbe_vf *vf, u32 msg)
+ixgbe_send_vf_msg(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
{
if (vf->flags & IXGBE_VF_CTS)
msg |= IXGBE_VT_MSGTYPE_CTS;
- hw->mbx.ops.write(hw, &msg, 1, vf->pool);
+ adapter->hw.mbx.ops.write(&adapter->hw, &msg, 1, vf->pool);
}
static inline void
ixgbe_send_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
{
msg &= IXGBE_VT_MSG_MASK;
- ixgbe_send_vf_msg(&adapter->hw, vf, msg | IXGBE_VT_MSGTYPE_ACK);
+ ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_ACK);
}
static inline void
ixgbe_send_vf_nack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg)
{
msg &= IXGBE_VT_MSG_MASK;
- ixgbe_send_vf_msg(&adapter->hw, vf, msg | IXGBE_VT_MSGTYPE_NACK);
+ ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_NACK);
}
static inline void
@@ -205,7 +205,7 @@
for (int i = 0; i < adapter->num_vfs; i++) {
vf = &adapter->vfs[i];
if (vf->flags & IXGBE_VF_ACTIVE)
- ixgbe_send_vf_msg(&adapter->hw, vf, IXGBE_PF_CONTROL_MSG);
+ ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG);
}
} /* ixgbe_ping_all_vfs */
@@ -775,7 +775,7 @@
ixgbe_vf_enable_transmit(adapter, vf);
ixgbe_vf_enable_receive(adapter, vf);
- ixgbe_send_vf_msg(&adapter->hw, vf, IXGBE_PF_CONTROL_MSG);
+ ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG);
} /* ixgbe_init_vf */
void
diff -r a5bdc647d21d -r c501403291d4 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c Wed Apr 04 06:30:09 2018 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c Wed Apr 04 08:13:07 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.38 2018/04/02 05:02:55 knakahara Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.39 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
@@ -32,7 +32,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 321476 2017-07-25 14:38:30Z sbruno $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 327031 2017-12-20 18:15:06Z erj $*/
/*
* Copyright (c) 2011 The NetBSD Foundation, Inc.
diff -r a5bdc647d21d -r c501403291d4 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Apr 04 06:30:09 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Apr 04 08:13:07 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.143 2018/04/04 06:30:09 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.144 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
@@ -32,7 +32,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 320916 2017-07-12 17:35:32Z sbruno $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 327031 2017-12-20 18:15:06Z erj $*/
/*
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
/************************************************************************
* Driver version
************************************************************************/
-char ixgbe_driver_version[] = "3.2.12-k";
+char ixgbe_driver_version[] = "4.0.0-k";
/************************************************************************
@@ -669,7 +669,6 @@
IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum);
- return;
} /* ixgbe_initialize_receive_units */
/************************************************************************
@@ -680,9 +679,10 @@
{
struct tx_ring *txr = adapter->tx_rings;
struct ixgbe_hw *hw = &adapter->hw;
+ int i;
/* Setup the Base and Length of the Tx Descriptor Ring */
- for (int i = 0; i < adapter->num_queues; i++, txr++) {
+ for (i = 0; i < adapter->num_queues; i++, txr++) {
u64 tdba = txr->txdma.dma_paddr;
u32 txctrl = 0;
int j = txr->me;
@@ -827,7 +827,7 @@
/*
* Initialize the shared code
*/
- if (ixgbe_init_shared_code(hw)) {
+ if (ixgbe_init_shared_code(hw) != 0) {
aprint_error_dev(dev, "Unable to initialize the shared code\n");
error = ENXIO;
goto err_out;
@@ -1466,23 +1466,23 @@
switch (hw->mac.type) {
case ixgbe_mac_82598EB:
if (hw->phy.type == ixgbe_phy_nl)
- return TRUE;
- return FALSE;
+ return (TRUE);
+ return (FALSE);
case ixgbe_mac_82599EB:
switch (hw->mac.ops.get_media_type(hw)) {
case ixgbe_media_type_fiber:
case ixgbe_media_type_fiber_qsfp:
- return TRUE;
+ return (TRUE);
default:
- return FALSE;
+ return (FALSE);
Home |
Main Index |
Thread Index |
Old Index