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.
This commit is contained in:
msaitoh 2018-04-04 08:13:07 +00:00
parent 2bd987c2e0
commit a06ca63375
35 changed files with 142 additions and 154 deletions

View File

@ -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 @@ ixgbe_bp_set_state(SYSCTLFN_ARGS)
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 @@ ixgbe_bp_wd_set(SYSCTLFN_ARGS)
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 @@ ixgbe_bp_wd_set(SYSCTLFN_ARGS)
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 @@ ixgbe_bp_wd_reset(SYSCTLFN_ARGS)
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 @@ ixgbe_bp_log(SYSCTLFN_ARGS)
/* 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 @@ ixgbe_bypass_init(struct adapter *adapter)
{
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_bypass_init(struct adapter *adapter)
ixgbe_bp_wd_reset, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL);
adapter->feat_en |= IXGBE_FEATURE_BYPASS;
return;
} /* ixgbe_bypass_init */

View File

@ -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"

View File

@ -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 @@ ixgbe_align_all_queue_indices(struct adapter *adapter)
/* 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 @@ ixgbe_ping_all_vfs(struct adapter *adapter)
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_init_vf(struct adapter *adapter, struct ixgbe_vf *vf)
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

View File

@ -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.

View File

@ -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_initialize_receive_units(struct adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum);
return;
} /* ixgbe_initialize_receive_units */
/************************************************************************
@ -680,9 +679,10 @@ ixgbe_initialize_transmit_units(struct adapter *adapter)
{
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 @@ ixgbe_attach(device_t parent, device_t dev, void *aux)
/*
* 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 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
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);
}
case ixgbe_mac_X550EM_x:
case ixgbe_mac_X550EM_a:
if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
return TRUE;
return FALSE;
return (TRUE);
return (FALSE);
default:
return FALSE;
return (FALSE);
}
} /* ixgbe_is_sfp */
@ -1500,16 +1500,14 @@ ixgbe_config_link(struct adapter *adapter)
if (sfp) {
if (hw->phy.multispeed_fiber) {
hw->mac.ops.setup_sfp(hw);
ixgbe_enable_tx_laser(hw);
kpreempt_disable();
softint_schedule(adapter->msf_si);
kpreempt_enable();
} else {
}
kpreempt_disable();
softint_schedule(adapter->mod_si);
kpreempt_enable();
}
} else {
struct ifmedia *ifm = &adapter->media;
@ -1517,7 +1515,7 @@ ixgbe_config_link(struct adapter *adapter)
err = ixgbe_check_link(hw, &adapter->link_speed,
&adapter->link_up, FALSE);
if (err)
goto out;
return;
/*
* Check if it's the first call. If it's the first call,
@ -1529,14 +1527,12 @@ ixgbe_config_link(struct adapter *adapter)
err = hw->mac.ops.get_link_capabilities(hw, &autoneg,
&negotiate);
if (err)
goto out;
return;
if (hw->mac.ops.setup_link)
err = hw->mac.ops.setup_link(hw, autoneg,
adapter->link_up);
}
out:
return;
} /* ixgbe_config_link */
/************************************************************************
@ -1695,6 +1691,7 @@ ixgbe_add_hw_stats(struct adapter *adapter)
struct ixgbe_hw *hw = &adapter->hw;
struct ixgbe_hw_stats *stats = &adapter->stats.pf;
const char *xname = device_xname(dev);
int i;
/* Driver Statistics */
evcnt_attach_dynamic(&adapter->efbig_tx_dma_setup, EVCNT_TYPE_MISC,
@ -1726,7 +1723,7 @@ ixgbe_add_hw_stats(struct adapter *adapter)
evcnt_attach_dynamic(&adapter->phy_sicount, EVCNT_TYPE_INTR,
NULL, xname, "external PHY softint");
for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
for (i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
#ifdef LRO
struct lro_ctrl *lro = &rxr->lro;
#endif /* LRO */
@ -2312,7 +2309,6 @@ ixgbe_get_slot_info(struct adapter *adapter)
device_t dev = adapter->dev;
struct ixgbe_hw *hw = &adapter->hw;
u32 offset;
// struct ixgbe_mac_info *mac = &hw->mac;
u16 link;
int bus_info_valid = TRUE;
@ -2789,7 +2785,7 @@ ixgbe_media_change(struct ifnet *ifp)
return (EINVAL);
if (hw->phy.media_type == ixgbe_media_type_backplane)
return (ENODEV);
return (EPERM);
/*
* We don't actually need to check against the supported
@ -3049,8 +3045,7 @@ ixgbe_eitr_write(struct ix_queue *que, uint32_t itr)
else
itr |= IXGBE_EITR_CNT_WDIS;
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix),
itr);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), itr);
}
@ -3722,7 +3717,7 @@ ixgbe_init_locked(struct adapter *adapter)
u32 txdctl, mhadd;
u32 rxdctl, rxctrl;
u32 ctrl_ext;
int err = 0;
int i, j, err;
/* XXX check IFF_UP and IFF_RUNNING, power-saving state! */
@ -3760,7 +3755,9 @@ ixgbe_init_locked(struct adapter *adapter)
}
ixgbe_init_hw(hw);
ixgbe_initialize_iov(adapter);
ixgbe_initialize_transmit_units(adapter);
/* Setup Multicast table */
@ -3795,7 +3792,7 @@ ixgbe_init_locked(struct adapter *adapter)
}
/* Now enable all the queues */
for (int i = 0; i < adapter->num_queues; i++) {
for (i = 0; i < adapter->num_queues; i++) {
txr = &adapter->tx_rings[i];
txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me));
txdctl |= IXGBE_TXDCTL_ENABLE;
@ -3812,7 +3809,7 @@ ixgbe_init_locked(struct adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl);
}
for (int i = 0, j = 0; i < adapter->num_queues; i++) {
for (i = 0; i < adapter->num_queues; i++) {
rxr = &adapter->rx_rings[i];
rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me));
if (hw->mac.type == ixgbe_mac_82598EB) {
@ -3826,7 +3823,7 @@ ixgbe_init_locked(struct adapter *adapter)
}
rxdctl |= IXGBE_RXDCTL_ENABLE;
IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), rxdctl);
for (; j < 10; j++) {
for (j = 0; j < 10; j++) {
if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)) &
IXGBE_RXDCTL_ENABLE)
break;
@ -3874,7 +3871,7 @@ ixgbe_init_locked(struct adapter *adapter)
callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter);
/* Set up MSI-X routing */
/* Set up MSI/MSI-X routing */
if (adapter->feat_en & IXGBE_FEATURE_MSIX) {
ixgbe_configure_ivars(adapter);
/* Set up auto-mask */
@ -3908,6 +3905,9 @@ ixgbe_init_locked(struct adapter *adapter)
/* Set moderation on the Link interrupt */
IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR);
/* Enable power to the phy. */
ixgbe_set_phy_power(hw, TRUE);
/* Config/Enable Link */
ixgbe_config_link(adapter);
@ -4601,6 +4601,7 @@ ixgbe_update_link_status(struct adapter *adapter)
/* Update DMA coalescing config */
ixgbe_config_dmac(adapter);
if_link_state_change(ifp, LINK_STATE_UP);
if (adapter->feat_en & IXGBE_FEATURE_SRIOV)
ixgbe_ping_all_vfs(adapter);
}
@ -4725,7 +4726,6 @@ ixgbe_enable_intr(struct adapter *adapter)
IXGBE_WRITE_FLUSH(hw);
return;
} /* ixgbe_enable_intr */
/************************************************************************
@ -4895,8 +4895,6 @@ ixgbe_free_pciintr_resources(struct adapter *adapter)
adapter->osdep.nintrs);
adapter->osdep.intrs = NULL;
}
return;
} /* ixgbe_free_pciintr_resources */
/************************************************************************
@ -4914,7 +4912,6 @@ ixgbe_free_pci_resources(struct adapter *adapter)
adapter->osdep.mem_size);
}
return;
} /* ixgbe_free_pci_resources */
/************************************************************************

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe.h,v 1.40 2018/04/02 05:02:55 knakahara Exp $ */
/* $NetBSD: ixgbe.h,v 1.41 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 327031 2017-12-20 18:15:06Z erj $*/
/*
* Copyright (c) 2011 The NetBSD Foundation, Inc.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_82598.c,v 1.10 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_82598.c,v 1.11 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_type.h"
#include "ixgbe_82598.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_82598.h,v 1.7 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_82598.h,v 1.8 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_82598_H_
#define _IXGBE_82598_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_82599.c,v 1.17 2018/03/30 06:44:30 msaitoh Exp $ */
/* $NetBSD: ixgbe_82599.c,v 1.18 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_type.h"
#include "ixgbe_82599.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_82599.h,v 1.6 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_82599.h,v 1.7 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_82599_H_
#define _IXGBE_82599_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_api.c,v 1.18 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_api.c,v 1.19 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_api.h"
#include "ixgbe_common.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_api.h,v 1.12 2018/03/30 03:58:20 knakahara Exp $ */
/* $NetBSD: ixgbe_api.h,v 1.13 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_API_H_
#define _IXGBE_API_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_common.c,v 1.20 2018/03/30 06:44:30 msaitoh Exp $ */
/* $NetBSD: ixgbe_common.c,v 1.21 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 327031 2017-12-20 18:15:06Z erj $*/
#include "ixgbe_common.h"
#include "ixgbe_phy.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_common.h,v 1.11 2018/03/30 06:44:30 msaitoh Exp $ */
/* $NetBSD: ixgbe_common.h,v 1.12 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_COMMON_H_
#define _IXGBE_COMMON_H_

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_type.h"

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_DCB_H_
#define _IXGBE_DCB_H_

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_type.h"

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_DCB_82598_H_
#define _IXGBE_DCB_82598_H_

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_type.h"

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_DCB_82599_H_
#define _IXGBE_DCB_82599_H_

View File

@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_fdir.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_fdir.h 327031 2017-12-20 18:15:06Z erj $*/
#ifndef _IXGBE_FDIR_H_
#define _IXGBE_FDIR_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_mbx.c,v 1.9 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_mbx.c,v 1.10 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_type.h"
#include "ixgbe_mbx.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_mbx.h,v 1.12 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_mbx.h,v 1.13 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_MBX_H_
#define _IXGBE_MBX_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_osdep.c,v 1.3 2018/03/15 06:48:51 msaitoh Exp $ */
/* $NetBSD: ixgbe_osdep.c,v 1.4 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
@ -32,7 +32,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.c 327031 2017-12-20 18:15:06Z erj $*/
#include "ixgbe_osdep.h"
#include "ixgbe.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_osdep.h,v 1.20 2018/03/15 06:48:51 msaitoh Exp $ */
/* $NetBSD: ixgbe_osdep.h,v 1.21 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 327031 2017-12-20 18:15:06Z erj $*/
#ifndef _IXGBE_OSDEP_H_
#define _IXGBE_OSDEP_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_phy.c,v 1.15 2018/03/15 06:48:51 msaitoh Exp $ */
/* $NetBSD: ixgbe_phy.c,v 1.16 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 327031 2017-12-20 18:15:06Z erj $*/
#include "ixgbe_api.h"
#include "ixgbe_common.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_phy.h,v 1.10 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_phy.h,v 1.11 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_PHY_H_
#define _IXGBE_PHY_H_

View File

@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_rss.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_rss.h 324518 2017-10-11 05:55:52Z sephe $*/
#ifndef _IXGBE_RSS_H_
#define _IXGBE_RSS_H_

View File

@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_sriov.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_sriov.h 327031 2017-12-20 18:15:06Z erj $*/
#ifndef _IXGBE_SRIOV_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_type.h,v 1.32 2018/03/15 06:48:51 msaitoh Exp $ */
/* $NetBSD: ixgbe_type.h,v 1.33 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 327031 2017-12-20 18:15:06Z erj $*/
#ifndef _IXGBE_TYPE_H_
#define _IXGBE_TYPE_H_

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_vf.c,v 1.15 2017/12/06 04:08:50 msaitoh Exp $ */
/* $NetBSD: ixgbe_vf.c,v 1.16 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_api.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe_vf.h,v 1.12 2018/03/15 06:48:51 msaitoh Exp $ */
/* $NetBSD: ixgbe_vf.h,v 1.13 2018/04/04 08:13:07 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@ -33,7 +33,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.h 327031 2017-12-20 18:15:06Z erj $*/
#ifndef _IXGBE_VF_H_
#define _IXGBE_VF_H_

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.c 326022 2017-11-20 19:36:21Z pfg $*/
#include "ixgbe_x540.h"
#include "ixgbe_type.h"

View File

@ -31,7 +31,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.h 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.h 326022 2017-11-20 19:36:21Z pfg $*/
#ifndef _IXGBE_X540_H_
#define _IXGBE_X540_H_

View File

@ -1,4 +1,4 @@
/*$NetBSD: ixv.c,v 1.90 2018/03/30 03:58:20 knakahara Exp $*/
/*$NetBSD: ixv.c,v 1.91 2018/04/04 08:13:07 msaitoh Exp $*/
/******************************************************************************
@ -32,7 +32,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 320688 2017-07-05 17:27:03Z erj $*/
/*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 328265 2018-01-22 20:56:21Z erj $*/
#ifdef _KERNEL_OPT
@ -734,7 +734,7 @@ ixv_init_locked(struct adapter *adapter)
hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV);
/* Get the latest mac address, User can use a LAA */
memcpy(hw->mac.addr, CLLADDR(adapter->ifp->if_sadl),
memcpy(hw->mac.addr, CLLADDR(ifp->if_sadl),
IXGBE_ETH_LENGTH_OF_ADDRESS);
hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, 1);
@ -879,7 +879,7 @@ ixv_rearm_queues(struct adapter *adapter, u64 queues)
/************************************************************************
* ixv_msix_que - MSI Queue Interrupt Service routine
* ixv_msix_que - MSI-X Queue Interrupt Service routine
************************************************************************/
static int
ixv_msix_que(void *arg)
@ -1570,38 +1570,39 @@ ixv_initialize_transmit_units(struct adapter *adapter)
{
struct tx_ring *txr = adapter->tx_rings;
struct ixgbe_hw *hw = &adapter->hw;
int i;
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, txdctl;
int j = txr->me;
/* Set WTHRESH to 8, burst writeback */
txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i));
txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(j));
txdctl |= (8 << 16);
IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), txdctl);
IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(j), txdctl);
/* Set the HW Tx Head and Tail indices */
IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDH(i), 0);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDT(i), 0);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDH(j), 0);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDT(j), 0);
/* Set Tx Tail register */
txr->tail = IXGBE_VFTDT(i);
txr->tail = IXGBE_VFTDT(j);
/* Set Ring parameters */
IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(i),
IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(j),
(tdba & 0x00000000ffffffffULL));
IXGBE_WRITE_REG(hw, IXGBE_VFTDBAH(i), (tdba >> 32));
IXGBE_WRITE_REG(hw, IXGBE_VFTDLEN(i),
IXGBE_WRITE_REG(hw, IXGBE_VFTDBAH(j), (tdba >> 32));
IXGBE_WRITE_REG(hw, IXGBE_VFTDLEN(j),
adapter->num_tx_desc * sizeof(struct ixgbe_legacy_tx_desc));
txctrl = IXGBE_READ_REG(hw, IXGBE_VFDCA_TXCTRL(i));
txctrl = IXGBE_READ_REG(hw, IXGBE_VFDCA_TXCTRL(j));
txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN;
IXGBE_WRITE_REG(hw, IXGBE_VFDCA_TXCTRL(i), txctrl);
IXGBE_WRITE_REG(hw, IXGBE_VFDCA_TXCTRL(j), txctrl);
/* Now enable */
txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i));
txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(j));
txdctl |= IXGBE_TXDCTL_ENABLE;
IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), txdctl);
IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(j), txdctl);
}
return;
@ -1741,13 +1742,14 @@ ixv_initialize_receive_units(struct adapter *adapter)
for (int i = 0; i < adapter->num_queues; i++, rxr++) {
u64 rdba = rxr->rxdma.dma_paddr;
u32 reg, rxdctl;
int j = rxr->me;
/* Disable the queue */
rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i));
rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j));
rxdctl &= ~IXGBE_RXDCTL_ENABLE;
IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl);
for (int j = 0; j < 10; j++) {
if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)) &
IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(j), rxdctl);
for (int k = 0; k < 10; k++) {
if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)) &
IXGBE_RXDCTL_ENABLE)
msec_delay(1);
else
@ -1755,10 +1757,10 @@ ixv_initialize_receive_units(struct adapter *adapter)
}
wmb();
/* Setup the Base and Length of the Rx Descriptor Ring */
IXGBE_WRITE_REG(hw, IXGBE_VFRDBAL(i),
IXGBE_WRITE_REG(hw, IXGBE_VFRDBAL(j),
(rdba & 0x00000000ffffffffULL));
IXGBE_WRITE_REG(hw, IXGBE_VFRDBAH(i), (rdba >> 32));
IXGBE_WRITE_REG(hw, IXGBE_VFRDLEN(i),
IXGBE_WRITE_REG(hw, IXGBE_VFRDBAH(j), (rdba >> 32));
IXGBE_WRITE_REG(hw, IXGBE_VFRDLEN(j),
adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc));
/* Reset the ring indices */
@ -1766,21 +1768,21 @@ ixv_initialize_receive_units(struct adapter *adapter)
IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me), 0);
/* Set up the SRRCTL register */
reg = IXGBE_READ_REG(hw, IXGBE_VFSRRCTL(i));
reg = IXGBE_READ_REG(hw, IXGBE_VFSRRCTL(j));
reg &= ~IXGBE_SRRCTL_BSIZEHDR_MASK;
reg &= ~IXGBE_SRRCTL_BSIZEPKT_MASK;
reg |= bufsz;
reg |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF;
IXGBE_WRITE_REG(hw, IXGBE_VFSRRCTL(i), reg);
IXGBE_WRITE_REG(hw, IXGBE_VFSRRCTL(j), reg);
/* Capture Rx Tail index */
rxr->tail = IXGBE_VFRDT(rxr->me);
/* Do the queue enabling last */
rxdctl |= IXGBE_RXDCTL_ENABLE | IXGBE_RXDCTL_VME;
IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl);
IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(j), rxdctl);
for (int k = 0; k < 10; k++) {
if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)) &
if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)) &
IXGBE_RXDCTL_ENABLE)
break;
msec_delay(1);