Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src Pull up the following, requested by msaitoh in ticket #1701:
details: https://anonhg.NetBSD.org/src/rev/968cd413756b
branches: netbsd-8
changeset: 990005:968cd413756b
user: martin <martin%NetBSD.org@localhost>
date: Sat Oct 23 11:49:22 2021 +0000
description:
Pull up the following, requested by msaitoh in ticket #1701:
share/man/man4/wm.4 1.42
sys/dev/pci/files.pci 1.434
sys/dev/pci/if_wm.c 1.686-1.687,1.692-1.693,
1.697,1.699-1.703,
1.706-1.715 via patch
sys/dev/pci/if_wmvar.h 1.46
- Add missing drain for pcq in wm_stop_locked().
- Add support for I219V 15-19 and I219LM 16-19.
- Fix Tx stall.
- Use wm_flush_desc_rings() workaround more on I219.
- Change DMA physical address in wm_flush_desc_rings() to match other
OSes.
- Check return value correctly in wm_lv_jumbo_workaround_ich8lan().
- Add new sysctl hw.wmN.debug_flags. This sysctl can be used if
WM_DEBUG is set.
- Add some sysctl values for debugging TX/RX queues.
- WM_EVENT_COUNTER is enabled by default on 64 bit architectures.
- Remove extra unlock/lock processing around if_percpuq_enqueue().
- Refactor rxq->rxq_ptr updating.
- Stop legacy interrupts before calling softint.
- Disable printf()s in wm_flush_desc_rings() because the code is
verified.
- Print I219's version number.
- Uniform INTx/MSI handler's Tx/Rx behavior to MSI-X's one.
- Fix return value of interrupt handler.
- Only print an error about missing I/O BARs for chips that need it.
- Do not return a void value from a void function.
- Add new flag named WM_F_CRC_STRIP and use it. No functional change.
- Whitespace fixes. Fix comments. No functional change.
diffstat:
share/man/man4/wm.4 | 7 +-
sys/dev/pci/files.pci | 4 +-
sys/dev/pci/if_wm.c | 896 +++++++++++++++++++++++++++++-------------------
sys/dev/pci/if_wmvar.h | 5 +-
4 files changed, 549 insertions(+), 363 deletions(-)
diffs (truncated from 2527 to 300 lines):
diff -r 6d1b9bf754fb -r 968cd413756b share/man/man4/wm.4
--- a/share/man/man4/wm.4 Sat Oct 23 11:31:22 2021 +0000
+++ b/share/man/man4/wm.4 Sat Oct 23 11:49:22 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: wm.4,v 1.36.4.2 2018/04/16 14:25:49 martin Exp $
+.\" $NetBSD: wm.4,v 1.36.4.3 2021/10/23 11:49:22 martin Exp $
.\"
.\" Copyright 2002, 2003 Wasabi Systems, Inc.
.\" All rights reserved.
@@ -33,7 +33,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd April 13, 2018
+.Dd February 17, 2021
.Dt WM 4
.Os
.Sh NAME
@@ -202,8 +202,11 @@
.It Dv WM_EVENT_COUNTERS
Enable many event counters such as each Tx drop counter and Rx interrupt
counter.
+In 64 bit architectures, this is enabled by default.
Caution: If this flag is enabled, the number of evcnt entries increase
very much.
+.It Dv WM_DISABLE_EVENT_COUNTERS
+Disable event counters for 64 bit architectures.
.It Dv WM_DISABLE_MSI
If this option is set non-zero value, this driver does not use msi.
The default value is 0.
diff -r 6d1b9bf754fb -r 968cd413756b sys/dev/pci/files.pci
--- a/sys/dev/pci/files.pci Sat Oct 23 11:31:22 2021 +0000
+++ b/sys/dev/pci/files.pci Sat Oct 23 11:49:22 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.pci,v 1.388.4.6 2021/09/15 16:38:00 martin Exp $
+# $NetBSD: files.pci,v 1.388.4.7 2021/10/23 11:49:22 martin Exp $
#
# Config file and device description for machine-independent PCI code.
# Included by ports that need it. Requires that the SCSI files be
@@ -697,7 +697,7 @@
device wm: ether, ifnet, arp, mii, mii_bitbang
attach wm at pci
file dev/pci/if_wm.c wm
-defflag opt_if_wm.h WM_EVENT_COUNTERS
+defflag opt_if_wm.h WM_EVENT_COUNTERS WM_DISABLE_EVENT_COUNTERS
defparam opt_if_wm.h WM_RX_PROCESS_LIMIT_DEFAULT
WM_RX_INTR_PROCESS_LIMIT_DEFAULT
WM_DISABLE_MSI
diff -r 6d1b9bf754fb -r 968cd413756b sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Sat Oct 23 11:31:22 2021 +0000
+++ b/sys/dev/pci/if_wm.c Sat Oct 23 11:49:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.508.4.42 2020/11/16 18:18:14 martin Exp $ */
+/* $NetBSD: if_wm.c,v 1.508.4.43 2021/10/23 11:49:22 martin Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.42 2020/11/16 18:18:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.43 2021/10/23 11:49:22 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -156,11 +156,20 @@
#define WM_DEBUG_NVM __BIT(5)
#define WM_DEBUG_INIT __BIT(6)
#define WM_DEBUG_LOCK __BIT(7)
-int wm_debug = WM_DEBUG_TX | WM_DEBUG_RX | WM_DEBUG_LINK | WM_DEBUG_GMII
- | WM_DEBUG_MANAGE | WM_DEBUG_NVM | WM_DEBUG_INIT | WM_DEBUG_LOCK;
-#define DPRINTF(x, y) do { if (wm_debug & (x)) printf y; } while (0)
+
+#if 0
+#define WM_DEBUG_DEFAULT WM_DEBUG_TX | WM_DEBUG_RX | WM_DEBUG_LINK | \
+ WM_DEBUG_GMII | WM_DEBUG_MANAGE | WM_DEBUG_NVM | WM_DEBUG_INIT | \
+ WM_DEBUG_LOCK
+#endif
+
+#define DPRINTF(sc, x, y) \
+ do { \
+ if ((sc)->sc_debug & (x)) \
+ printf y; \
+ } while (0)
#else
-#define DPRINTF(x, y) __nothing
+#define DPRINTF(sc, x, y) __nothing
#endif /* WM_DEBUG */
#ifdef NET_MPSAFE
@@ -260,7 +269,7 @@
typedef union rxdescs {
wiseman_rxdesc_t sctxu_rxdescs[WM_NRXDESC];
- ext_rxdesc_t sctxu_ext_rxdescs[WM_NRXDESC]; /* 82574 only */
+ ext_rxdesc_t sctxu_ext_rxdescs[WM_NRXDESC]; /* 82574 only */
nq_rxdesc_t sctxu_nq_rxdescs[WM_NRXDESC]; /* 82575 and newer */
} rxdescs_t;
@@ -303,6 +312,12 @@
struct wm_softc;
+#if defined(_LP64) && !defined(WM_DISABLE_EVENT_COUNTERS)
+#if !defined(WM_EVENT_COUNTERS)
+#define WM_EVENT_COUNTERS 1
+#endif
+#endif
+
#ifdef WM_EVENT_COUNTERS
#define WM_Q_EVCNT_DEFINE(qname, evname) \
char qname##_##evname##_evcnt_name[sizeof("qname##XX##evname")]; \
@@ -383,8 +398,8 @@
time_t txq_lastsent;
/* Checksum flags used for previous packet */
- uint32_t txq_last_hw_cmd;
- uint8_t txq_last_hw_fields;
+ uint32_t txq_last_hw_cmd;
+ uint8_t txq_last_hw_fields;
uint16_t txq_last_hw_ipcs;
uint16_t txq_last_hw_tucs;
@@ -471,6 +486,7 @@
struct wm_txqueue wmq_txq;
struct wm_rxqueue wmq_rxq;
+ char sysctlname[32]; /* Name for sysctl */
bool wmq_txrx_use_workqueue;
struct work wmq_cookie;
@@ -621,6 +637,9 @@
struct wm_phyop phy;
struct wm_nvmop nvm;
+#ifdef WM_DEBUG
+ uint32_t sc_debug;
+#endif
};
#define WM_CORE_LOCK(_sc) \
@@ -1023,6 +1042,10 @@
static void wm_set_linkdown_discard(struct wm_softc *);
static void wm_clear_linkdown_discard(struct wm_softc *);
+#ifdef WM_DEBUG
+static int wm_sysctl_debug(SYSCTLFN_PROTO);
+#endif
+
CFATTACH_DECL3_NEW(wm, sizeof(struct wm_softc),
wm_match, wm_attach, wm_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN);
@@ -1550,85 +1573,112 @@
"I219 LM Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM2,
- "I219 LM Ethernet Connection",
+ "I219 LM (2) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM3,
- "I219 LM Ethernet Connection",
+ "I219 LM (3) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM4,
- "I219 LM Ethernet Connection",
+ "I219 LM (4) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM5,
- "I219 LM Ethernet Connection",
+ "I219 LM (5) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM6,
- "I219 LM Ethernet Connection",
+ "I219 LM (6) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM7,
- "I219 LM Ethernet Connection",
+ "I219 LM (7) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM8,
- "I219 LM Ethernet Connection",
+ "I219 LM (8) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM9,
- "I219 LM Ethernet Connection",
+ "I219 LM (9) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM10,
- "I219 LM Ethernet Connection",
+ "I219 LM (10) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM11,
- "I219 LM Ethernet Connection",
+ "I219 LM (11) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM12,
- "I219 LM Ethernet Connection",
+ "I219 LM (12) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM13,
- "I219 LM Ethernet Connection",
+ "I219 LM (13) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM14,
- "I219 LM Ethernet Connection",
+ "I219 LM (14) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM15,
- "I219 LM Ethernet Connection",
+ "I219 LM (15) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM16,
+ "I219 LM (16) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM17,
+ "I219 LM (17) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM18,
+ "I219 LM (18) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM19,
+ "I219 LM (19) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V,
"I219 V Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V2,
- "I219 V Ethernet Connection",
+ "I219 V (2) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V4,
- "I219 V Ethernet Connection",
+ "I219 V (4) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V5,
- "I219 V Ethernet Connection",
+ "I219 V (5) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V6,
- "I219 V Ethernet Connection",
+ "I219 V (6) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V7,
- "I219 V Ethernet Connection",
+ "I219 V (7) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V8,
- "I219 V Ethernet Connection",
+ "I219 V (8) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V9,
- "I219 V Ethernet Connection",
+ "I219 V (9) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V10,
- "I219 V Ethernet Connection",
+ "I219 V (10) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V11,
- "I219 V Ethernet Connection",
+ "I219 V (11) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V12,
- "I219 V Ethernet Connection",
+ "I219 V (12) Ethernet Connection",
WM_T_PCH_SPT, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V13,
- "I219 V Ethernet Connection",
+ "I219 V (13) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V14,
- "I219 V Ethernet Connection",
+ "I219 V (14) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V15,
+ "I219 V (15) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V16,
+ "I219 V (16) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V17,
+ "I219 V (17) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V18,
+ "I219 V (18) Ethernet Connection",
+ WM_T_PCH_CNP, WMP_F_COPPER },
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V19,
+ "I219 V (19) Ethernet Connection",
WM_T_PCH_CNP, WMP_F_COPPER },
{ 0, 0,
NULL,
@@ -1834,6 +1884,9 @@
uint32_t link_mode;
uint32_t reg;
+#if defined(WM_DEBUG) && defined(WM_DEBUG_DEFAULT)
+ sc->sc_debug = WM_DEBUG_DEFAULT;
+#endif
sc->sc_dev = self;
Home |
Main Index |
Thread Index |
Old Index