Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev/pci/ixgbe Pull up the following revisions (via pa...
details: https://anonhg.NetBSD.org/src/rev/87a44bdcf8f8
branches: netbsd-8
changeset: 452700:87a44bdcf8f8
user: martin <martin%NetBSD.org@localhost>
date: Mon Jul 22 17:53:35 2019 +0000
description:
Pull up the following revisions (via patch), requested by msaitoh in
ticket #1301:
sys/dev/pci/ixgbe/if_sriov.c 1.5-1.6
sys/dev/pci/ixgbe/ix_txrx.c 1.53-1.54
sys/dev/pci/ixgbe/ixgbe_x550.h 1.5
sys/dev/pci/ixgbe/ixgbe.c 1.169-1.170,1.176,1.179,1.181,1.185-1.186,1.188-1.192 via patch
sys/dev/pci/ixgbe/ixgbe.h 1.53,1.55
sys/dev/pci/ixgbe/ixgbe_82599.c 1.21
sys/dev/pci/ixgbe/ixgbe_api.c 1.22-1.23
sys/dev/pci/ixgbe/ixgbe_api.h 1.14-1.15
sys/dev/pci/ixgbe/ixgbe_x550.c 1.14-1.15
sys/dev/pci/ixgbe/ixgbe_common.c 1.23
sys/dev/pci/ixgbe/ixgbe_common.h 1.14
sys/dev/pci/ixgbe/ixgbe_mbx.c 1.11
sys/dev/pci/ixgbe/ixgbe_mbx.h 1.14
sys/dev/pci/ixgbe/ixgbe_netmap.c 1.2
sys/dev/pci/ixgbe/ixgbe_features.h 1.2
sys/dev/pci/ixgbe/ixgbe_netbsd.c 1.9
sys/dev/pci/ixgbe/ixgbe_netbsd.h 1.9-1.10
sys/dev/pci/ixgbe/ixgbe_phy.c 1.18
sys/dev/pci/ixgbe/ixgbe_type.h 1.37,1.39-1.40
sys/dev/pci/ixgbe/ixgbe_vf.c 1.18
sys/dev/pci/ixgbe/ixv.c 1.112-1.114,1.117,1.119 via patch
Sync ixgbe up to 20190717 except ETHERCAP or ixv's VLAN stuff:
- Add firmware recovery mode for X550, X550A(Xeon D) and X550EM(C3000).
- Remove IXGBE_DEV_ID_82599_LS(0x154f) support again.
- On X550EMU, use ixgbe_identify_sfp_module_X550em() instead of
ixgbe_identify_module_generic(). ixgbe_identify_sfp_module_X550em()
has extra check (e.g. exclude 1G copper).
- It's not required to calculate unused queues' statistics.
- Remove ETHERCAP_VLAN_HWFILTER's definition.
- Match 82598_BX(0x1508), 82599_KR(0x1517), 82599_SFP_EM(0x1507),
X550EM_X_XFI(0x15b0), X550EM_A_QSFP(0x15ca) and
X550EM_A_QSFP_N(0x15cc)
- Add missing XFI support into ixgbe_get_link_capabilities_X550em().
- Other than IXGBE_VF_RESET should wait ACK, so use
ixgbevf_write_msg_read_ack() instead of write_posted() in
ixgbe_update_mc_addr_list_vf().
- When ixv_check_link() failed in the watchdog function, reset the
interface.
- Remove RXCSUM register modification in
ixv_initialize_receive_units(). It seems it's not required.
- Remove some debug printf in ixv_print_debug_info().
- Calculate vector's bit location correctly when the vector >= 31
in ixgbe_allocate_msix().
- Fix hung queue check when the queue number >= 31.
- On ENETRESET case, not continue and quit the ifflags_cb() function
because if_init() will do the same thing.
- Fix bugs in unused code.
- Fix typo in comment.
- Fix typo in unused code.
- Whitespace fixes. KNF.
diffstat:
sys/dev/pci/ixgbe/if_sriov.c | 16 +
sys/dev/pci/ixgbe/ix_txrx.c | 21 +-
sys/dev/pci/ixgbe/ixgbe.c | 665 ++++++++++++++++++++++--------------
sys/dev/pci/ixgbe/ixgbe.h | 38 +-
sys/dev/pci/ixgbe/ixgbe_82599.c | 5 +-
sys/dev/pci/ixgbe/ixgbe_api.c | 28 +-
sys/dev/pci/ixgbe/ixgbe_api.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_common.c | 69 +++-
sys/dev/pci/ixgbe/ixgbe_common.h | 3 +-
sys/dev/pci/ixgbe/ixgbe_features.h | 3 +-
sys/dev/pci/ixgbe/ixgbe_mbx.c | 45 ++-
sys/dev/pci/ixgbe/ixgbe_mbx.h | 3 +-
sys/dev/pci/ixgbe/ixgbe_netbsd.c | 18 +-
sys/dev/pci/ixgbe/ixgbe_netbsd.h | 4 +-
sys/dev/pci/ixgbe/ixgbe_netmap.c | 3 +-
sys/dev/pci/ixgbe/ixgbe_phy.c | 3 +-
sys/dev/pci/ixgbe/ixgbe_type.h | 34 +-
sys/dev/pci/ixgbe/ixgbe_vf.c | 7 +-
sys/dev/pci/ixgbe/ixgbe_x550.c | 29 +-
sys/dev/pci/ixgbe/ixgbe_x550.h | 1 +
sys/dev/pci/ixgbe/ixv.c | 272 +++++++-------
21 files changed, 824 insertions(+), 447 deletions(-)
diffs (truncated from 3233 to 300 lines):
diff -r 0f90913adfea -r 87a44bdcf8f8 sys/dev/pci/ixgbe/if_sriov.c
--- a/sys/dev/pci/ixgbe/if_sriov.c Mon Jul 22 17:47:16 2019 +0000
+++ b/sys/dev/pci/ixgbe/if_sriov.c Mon Jul 22 17:53:35 2019 +0000
@@ -250,6 +250,20 @@
} /* ixgbe_vf_set_default_vlan */
+static void
+ixgbe_clear_vfmbmem(struct ixgbe_hw *hw, struct ixgbe_vf *vf)
+{
+ uint32_t vf_index = IXGBE_VF_INDEX(vf->pool);
+ uint16_t mbx_size = hw->mbx.size;
+ uint16_t i;
+
+ IXGBE_CORE_LOCK_ASSERT(adapter);
+
+ for (i = 0; i < mbx_size; ++i)
+ IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_index), i, 0x0);
+} /* ixgbe_clear_vfmbmem */
+
+
static boolean_t
ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf)
{
@@ -305,6 +319,8 @@
// XXX clear multicast addresses
ixgbe_clear_rar(&adapter->hw, vf->rar_index);
+ ixgbe_clear_vfmbmem(&adapter->hw, vf);
+ ixgbe_toggle_txdctl(&adapter->hw, IXGBE_VF_INDEX(vf->pool));
vf->api_ver = IXGBE_API_VER_UNKNOWN;
} /* ixgbe_process_vf_reset */
diff -r 0f90913adfea -r 87a44bdcf8f8 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c Mon Jul 22 17:47:16 2019 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c Mon Jul 22 17:53:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.15 2019/03/01 17:33:24 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.16 2019/07/22 17:53:35 martin Exp $ */
/******************************************************************************
@@ -233,7 +233,7 @@
i = (cpu_index(curcpu()) % ncpu) % adapter->num_queues;
/* Check for a hung queue and pick alternative */
- if (((1 << i) & adapter->active_queues) == 0)
+ if (((1ULL << i) & adapter->active_queues) == 0)
i = ffs64(adapter->active_queues);
txr = &adapter->tx_rings[i];
@@ -694,7 +694,7 @@
* netmap_idx_n2k() handles wraparounds properly.
*/
if ((adapter->feat_en & IXGBE_FEATURE_NETMAP) && slot) {
- int si = netmap_idx_n2k(&na->tx_rings[txr->me], i);
+ int si = netmap_idx_n2k(na->tx_rings[txr->me], i);
netmap_load_map(na, txr->txtag,
txbuf->map, NMB(na, slot + si));
}
@@ -1105,7 +1105,7 @@
if ((adapter->feat_en & IXGBE_FEATURE_NETMAP) &&
(adapter->ifp->if_capenable & IFCAP_NETMAP)) {
struct netmap_adapter *na = NA(adapter->ifp);
- struct netmap_kring *kring = &na->tx_rings[txr->me];
+ struct netmap_kring *kring = na->tx_rings[txr->me];
txd = txr->tx_base;
bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map,
BUS_DMASYNC_POSTREAD);
@@ -1123,9 +1123,8 @@
* - the driver ignores tx interrupts unless netmap_mitigate=0
* or the slot has the DD bit set.
*/
- if (!netmap_mitigate ||
- (kring->nr_kflags < kring->nkr_num_slots &&
- txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) {
+ if (kring->nr_kflags < kring->nkr_num_slots &&
+ txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD) {
netmap_tx_irq(ifp, txr->me);
}
return false;
@@ -1405,7 +1404,7 @@
static int
ixgbe_allocate_receive_buffers(struct rx_ring *rxr)
{
- struct adapter *adapter = rxr->adapter;
+ struct adapter *adapter = rxr->adapter;
device_t dev = adapter->dev;
struct ixgbe_rx_buf *rxbuf;
int bsize, error;
@@ -1530,7 +1529,7 @@
* an mbuf, so end the block with a continue;
*/
if ((adapter->feat_en & IXGBE_FEATURE_NETMAP) && slot) {
- int sj = netmap_idx_n2k(&na->rx_rings[rxr->me], j);
+ int sj = netmap_idx_n2k(na->rx_rings[rxr->me], j);
uint64_t paddr;
void *addr;
@@ -1827,7 +1826,7 @@
u16 len;
u16 vtag = 0;
bool eop;
-
+
/* Sync the ring. */
ixgbe_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
@@ -2307,7 +2306,7 @@
/*
* Next the RX queues...
- */
+ */
rsize = roundup2(adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc),
DBA_ALIGN);
for (int i = 0; i < adapter->num_queues; i++, rxconf++) {
diff -r 0f90913adfea -r 87a44bdcf8f8 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Mon Jul 22 17:47:16 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Mon Jul 22 17:53:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.29 2019/04/01 12:35:38 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.30 2019/07/22 17:53:35 martin Exp $ */
/******************************************************************************
@@ -81,7 +81,7 @@
* Driver version
************************************************************************/
static const char ixgbe_driver_version[] = "4.0.1-k";
-
+/* XXX NetBSD: + 3.3.10 */
/************************************************************************
* PCI Device ID Table
@@ -100,14 +100,17 @@
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598, 0, 0, 0},
+ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_BX, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_DA_DUAL_PORT, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_CX4_DUAL_PORT, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, 0, 0, 0},
+ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KR, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, 0, 0, 0},
+ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_EM, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0},
@@ -127,8 +130,11 @@
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_1G_T, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, 0, 0, 0},
+ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_XFI, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR_L, 0, 0, 0},
+ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_QSFP, 0, 0, 0},
+ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_QSFP_N, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP_N, 0, 0, 0},
{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII, 0, 0, 0},
@@ -152,38 +158,39 @@
/************************************************************************
* Function prototypes
************************************************************************/
-static int ixgbe_probe(device_t, cfdata_t, void *);
-static void ixgbe_attach(device_t, device_t, void *);
-static int ixgbe_detach(device_t, int);
+static int ixgbe_probe(device_t, cfdata_t, void *);
+static void ixgbe_attach(device_t, device_t, void *);
+static int ixgbe_detach(device_t, int);
#if 0
-static int ixgbe_shutdown(device_t);
+static int ixgbe_shutdown(device_t);
#endif
static bool ixgbe_suspend(device_t, const pmf_qual_t *);
static bool ixgbe_resume(device_t, const pmf_qual_t *);
static int ixgbe_ifflags_cb(struct ethercom *);
-static int ixgbe_ioctl(struct ifnet *, u_long, void *);
+static int ixgbe_ioctl(struct ifnet *, u_long, void *);
static void ixgbe_ifstop(struct ifnet *, int);
static int ixgbe_init(struct ifnet *);
static void ixgbe_init_locked(struct adapter *);
-static void ixgbe_stop(void *);
-static void ixgbe_init_device_features(struct adapter *);
-static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
+static void ixgbe_stop(void *);
+static void ixgbe_init_device_features(struct adapter *);
+static void ixgbe_check_fan_failure(struct adapter *, u32, bool);
static void ixgbe_add_media_types(struct adapter *);
-static void ixgbe_media_status(struct ifnet *, struct ifmediareq *);
-static int ixgbe_media_change(struct ifnet *);
-static int ixgbe_allocate_pci_resources(struct adapter *,
+static void ixgbe_media_status(struct ifnet *, struct ifmediareq *);
+static int ixgbe_media_change(struct ifnet *);
+static int ixgbe_allocate_pci_resources(struct adapter *,
const struct pci_attach_args *);
-static void ixgbe_free_softint(struct adapter *);
+static void ixgbe_free_softint(struct adapter *);
static void ixgbe_get_slot_info(struct adapter *);
-static int ixgbe_allocate_msix(struct adapter *,
+static int ixgbe_allocate_msix(struct adapter *,
const struct pci_attach_args *);
-static int ixgbe_allocate_legacy(struct adapter *,
+static int ixgbe_allocate_legacy(struct adapter *,
const struct pci_attach_args *);
-static int ixgbe_configure_interrupts(struct adapter *);
+static int ixgbe_configure_interrupts(struct adapter *);
static void ixgbe_free_pciintr_resources(struct adapter *);
static void ixgbe_free_pci_resources(struct adapter *);
static void ixgbe_local_timer(void *);
static void ixgbe_local_timer1(void *);
+static void ixgbe_recovery_mode_timer(void *);
static int ixgbe_setup_interface(device_t, struct adapter *);
static void ixgbe_config_gpie(struct adapter *);
static void ixgbe_config_dmac(struct adapter *);
@@ -193,18 +200,18 @@
static int ixgbe_setup_low_power_mode(struct adapter *);
static void ixgbe_rearm_queues(struct adapter *, u64);
-static void ixgbe_initialize_transmit_units(struct adapter *);
-static void ixgbe_initialize_receive_units(struct adapter *);
+static void ixgbe_initialize_transmit_units(struct adapter *);
+static void ixgbe_initialize_receive_units(struct adapter *);
static void ixgbe_enable_rx_drop(struct adapter *);
static void ixgbe_disable_rx_drop(struct adapter *);
static void ixgbe_initialize_rss_mapping(struct adapter *);
-static void ixgbe_enable_intr(struct adapter *);
-static void ixgbe_disable_intr(struct adapter *);
-static void ixgbe_update_stats_counters(struct adapter *);
-static void ixgbe_set_promisc(struct adapter *);
-static void ixgbe_set_multi(struct adapter *);
-static void ixgbe_update_link_status(struct adapter *);
+static void ixgbe_enable_intr(struct adapter *);
+static void ixgbe_disable_intr(struct adapter *);
+static void ixgbe_update_stats_counters(struct adapter *);
+static void ixgbe_set_promisc(struct adapter *);
+static void ixgbe_set_multi(struct adapter *);
+static void ixgbe_update_link_status(struct adapter *);
static void ixgbe_set_ivar(struct adapter *, u8, u8, s8);
static void ixgbe_configure_ivars(struct adapter *);
static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
@@ -217,18 +224,18 @@
#endif
static void ixgbe_add_device_sysctls(struct adapter *);
-static void ixgbe_add_hw_stats(struct adapter *);
+static void ixgbe_add_hw_stats(struct adapter *);
static void ixgbe_clear_evcnt(struct adapter *);
static int ixgbe_set_flowcntl(struct adapter *, int);
static int ixgbe_set_advertise(struct adapter *, int);
-static int ixgbe_get_advertise(struct adapter *);
+static int ixgbe_get_advertise(struct adapter *);
/* Sysctl handlers */
static void ixgbe_set_sysctl_value(struct adapter *, const char *,
const char *, int *, int);
static int ixgbe_sysctl_flowcntl(SYSCTLFN_PROTO);
static int ixgbe_sysctl_advertise(SYSCTLFN_PROTO);
-static int ixgbe_sysctl_interrupt_rate_handler(SYSCTLFN_PROTO);
+static int ixgbe_sysctl_interrupt_rate_handler(SYSCTLFN_PROTO);
static int ixgbe_sysctl_dmac(SYSCTLFN_PROTO);
static int ixgbe_sysctl_phy_temp(SYSCTLFN_PROTO);
static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTLFN_PROTO);
@@ -236,12 +243,12 @@
static int ixgbe_sysctl_power_state(SYSCTLFN_PROTO);
static int ixgbe_sysctl_print_rss_config(SYSCTLFN_PROTO);
#endif
-static int ixgbe_sysctl_next_to_check_handler(SYSCTLFN_PROTO);
-static int ixgbe_sysctl_rdh_handler(SYSCTLFN_PROTO);
-static int ixgbe_sysctl_rdt_handler(SYSCTLFN_PROTO);
-static int ixgbe_sysctl_tdt_handler(SYSCTLFN_PROTO);
-static int ixgbe_sysctl_tdh_handler(SYSCTLFN_PROTO);
-static int ixgbe_sysctl_eee_state(SYSCTLFN_PROTO);
+static int ixgbe_sysctl_next_to_check_handler(SYSCTLFN_PROTO);
+static int ixgbe_sysctl_rdh_handler(SYSCTLFN_PROTO);
+static int ixgbe_sysctl_rdt_handler(SYSCTLFN_PROTO);
+static int ixgbe_sysctl_tdt_handler(SYSCTLFN_PROTO);
+static int ixgbe_sysctl_tdh_handler(SYSCTLFN_PROTO);
+static int ixgbe_sysctl_eee_state(SYSCTLFN_PROTO);
static int ixgbe_sysctl_debug(SYSCTLFN_PROTO);
static int ixgbe_sysctl_wol_enable(SYSCTLFN_PROTO);
static int ixgbe_sysctl_wufc(SYSCTLFN_PROTO);
@@ -321,7 +328,7 @@
SYSCTL_INT(_hw_ix, OID_AUTO, flow_control, CTLFLAG_RDTUN,
&ixgbe_flow_control, 0, "Default flow control used for all adapters");
-/* Which pakcet processing uses workqueue or softint */
+/* Which packet processing uses workqueue or softint */
static bool ixgbe_txrx_workqueue = false;
/*
@@ -416,10 +423,10 @@
ixgbe_initialize_rss_mapping(struct adapter *adapter)
{
Home |
Main Index |
Thread Index |
Old Index