CVS commit: [netbsd-9] src/sys/dev/pci

2024-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr 17 16:24:26 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: if_iwn.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1825):

sys/dev/pci/if_iwn.c: revision 1.100

if_iwn.c: pick up proper firmware for Centrino Wireless-N 130

Both variants should use iwlwifi-6000g2b-6 not iwlwifi-6000g2a-6. (It
seems only two specific product variants use iwlwifi-6000g2a-6. We
could simplify by reversing the sense of the test, as OpenBSD does, but
it doesn't seem to matter much, as what we now match seems to be the
full gamut possible, so the simpler diff was chosen here.)

Addresses PR kern/58105 from wandrien.dev%gmail.com@localhost, with the
PCI_PRODUCT_INTEL_WIFI_LINK_130_1 match tested by the reporter. Code
inspection of the FreeBSD driver indicates we should safely be able to
match PCI_PRODUCT_INTEL_WIFI_LINK_130_2 also.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.91.4.1 src/sys/dev/pci/if_iwn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.91 src/sys/dev/pci/if_iwn.c:1.91.4.1
--- src/sys/dev/pci/if_iwn.c:1.91	Fri Apr 19 19:37:31 2019
+++ src/sys/dev/pci/if_iwn.c	Wed Apr 17 16:24:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.91.4.1 2024/04/17 16:24:26 martin Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.91.4.1 2024/04/17 16:24:26 martin Exp $");
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -775,6 +775,8 @@ iwn5000_attach(struct iwn_softc *sc, pci
 		/* Type 6030 cards return IWN_HW_REV_TYPE_6005 */
 		if (pid == PCI_PRODUCT_INTEL_WIFI_LINK_1030_1 ||
 		pid == PCI_PRODUCT_INTEL_WIFI_LINK_1030_2 ||
+		pid == PCI_PRODUCT_INTEL_WIFI_LINK_130_1  ||
+		pid == PCI_PRODUCT_INTEL_WIFI_LINK_130_2  ||
 		pid == PCI_PRODUCT_INTEL_WIFI_LINK_6230_1 ||
 		pid == PCI_PRODUCT_INTEL_WIFI_LINK_6230_2 ||
 		pid == PCI_PRODUCT_INTEL_WIFI_LINK_6235   ||



CVS commit: [netbsd-9] src/sys/dev/pci

2024-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr 17 16:24:26 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: if_iwn.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1825):

sys/dev/pci/if_iwn.c: revision 1.100

if_iwn.c: pick up proper firmware for Centrino Wireless-N 130

Both variants should use iwlwifi-6000g2b-6 not iwlwifi-6000g2a-6. (It
seems only two specific product variants use iwlwifi-6000g2a-6. We
could simplify by reversing the sense of the test, as OpenBSD does, but
it doesn't seem to matter much, as what we now match seems to be the
full gamut possible, so the simpler diff was chosen here.)

Addresses PR kern/58105 from wandrien.dev%gmail.com@localhost, with the
PCI_PRODUCT_INTEL_WIFI_LINK_130_1 match tested by the reporter. Code
inspection of the FreeBSD driver indicates we should safely be able to
match PCI_PRODUCT_INTEL_WIFI_LINK_130_2 also.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.91.4.1 src/sys/dev/pci/if_iwn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 23 19:45:40 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following, requested by msaitoh in ticket #1802:

sys/dev/pci/if_wm.c 1.794-1.798 via patch
sys/dev/pci/if_wmreg.h  1.131

- Add RQDPC(Receive Queue Drop Packet Count) to iqdrops.
- Drop frames if the RX descriptor ring has no room on multiqueue
  system.
- Improve dmesg output:
  - Print RX packet buffer size.
  - Fix the upper 16bit of Image Unique ID(EtrackID).


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.20 -r1.645.2.21 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.8 -r1.115.2.9 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 23 19:45:40 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following, requested by msaitoh in ticket #1802:

sys/dev/pci/if_wm.c 1.794-1.798 via patch
sys/dev/pci/if_wmreg.h  1.131

- Add RQDPC(Receive Queue Drop Packet Count) to iqdrops.
- Drop frames if the RX descriptor ring has no room on multiqueue
  system.
- Improve dmesg output:
  - Print RX packet buffer size.
  - Fix the upper 16bit of Image Unique ID(EtrackID).


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.20 -r1.645.2.21 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.8 -r1.115.2.9 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.20 src/sys/dev/pci/if_wm.c:1.645.2.21
--- src/sys/dev/pci/if_wm.c:1.645.2.20	Sat Feb  3 12:02:58 2024
+++ src/sys/dev/pci/if_wm.c	Fri Feb 23 19:45:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.20 2024/02/03 12:02:58 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.21 2024/02/23 19:45:40 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.20 2024/02/03 12:02:58 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.21 2024/02/23 19:45:40 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -472,9 +472,9 @@ struct wm_rxqueue {
 	/* RX event counters */
 	WM_Q_EVCNT_DEFINE(rxq, intr);	/* Interrupts */
 	WM_Q_EVCNT_DEFINE(rxq, defer);	/* Rx deferred processing */
-
 	WM_Q_EVCNT_DEFINE(rxq, ipsum);	/* IP checksums checked */
 	WM_Q_EVCNT_DEFINE(rxq, tusum);	/* TCP/UDP cksums checked */
+	WM_Q_EVCNT_DEFINE(rxq, qdrop);	/* Rx queue drop packet */
 #endif
 };
 
@@ -2722,6 +2722,10 @@ alloc_retry:
 	/* Reset the chip to a known state. */
 	wm_reset(sc);
 
+	/* sc->sc_pba is set in wm_reset(). */
+	aprint_verbose_dev(sc->sc_dev, "RX packet buffer size: %uKB\n",
+	sc->sc_pba);
+
 	/*
 	 * Check for I21[01] PLL workaround.
 	 *
@@ -6618,6 +6622,7 @@ wm_update_stats(struct wm_softc *sc)
 	struct ifnet *ifp = >sc_ethercom.ec_if;
 	uint64_t crcerrs, algnerrc, symerrc, mpc, colc,  sec, rlec, rxerrc,
 	cexterr;
+	uint64_t total_qdrop = 0;
 
 	crcerrs = CSR_READ(sc, WMREG_CRCERRS);
 	symerrc = CSR_READ(sc, WMREG_SYMERRC);
@@ -6766,6 +6771,22 @@ wm_update_stats(struct wm_softc *sc)
 		WM_EVCNT_ADD(>sc_ev_lenerrs, CSR_READ(sc, WMREG_LENERRS));
 		WM_EVCNT_ADD(>sc_ev_scvpc, CSR_READ(sc, WMREG_SCVPC));
 		WM_EVCNT_ADD(>sc_ev_hrmpc, CSR_READ(sc, WMREG_HRMPC));
+#ifdef WM_EVENT_COUNTERS
+		for (int i = 0; i < sc->sc_nqueues; i++) {
+			struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
+			uint32_t rqdpc;
+
+			rqdpc = CSR_READ(sc, WMREG_RQDPC(i));
+			/*
+			 * On I210 and newer device, the RQDPC register is not
+			 * cleard on read.
+			 */
+			if ((rqdpc != 0) && (sc->sc_type >= WM_T_I210))
+CSR_WRITE(sc, WMREG_RQDPC(i), 0);
+			WM_Q_EVCNT_ADD(rxq, qdrop, rqdpc);
+			total_qdrop += rqdpc;
+		}
+#endif
 	}
 	if ((sc->sc_type >= WM_T_I350) && !WM_IS_ICHPCH(sc)) {
 		WM_EVCNT_ADD(>sc_ev_tlpic, CSR_READ(sc, WMREG_TLPIC));
@@ -6794,7 +6815,7 @@ wm_update_stats(struct wm_softc *sc)
 	 * If you want to know the nubmer of WMREG_RMBC, you should use such as
 	 * own EVCNT instead of if_iqdrops.
 	 */
-	ifp->if_iqdrops += mpc;
+	ifp->if_iqdrops += mpc + total_qdrop;
 }
 
 void
@@ -6811,6 +6832,8 @@ wm_clear_evcnt(struct wm_softc *sc)
 		WM_Q_EVCNT_STORE(rxq, defer, 0);
 		WM_Q_EVCNT_STORE(rxq, ipsum, 0);
 		WM_Q_EVCNT_STORE(rxq, tusum, 0);
+		if ((sc->sc_type >= WM_T_82575) && !WM_IS_ICHPCH(sc))
+			WM_Q_EVCNT_STORE(rxq, qdrop, 0);
 	}
 
 	/* TX queues */
@@ -8147,9 +8170,10 @@ wm_alloc_txrx_queues(struct wm_softc *sc
 
 		WM_Q_INTR_EVCNT_ATTACH(rxq, intr, rxq, i, xname);
 		WM_Q_INTR_EVCNT_ATTACH(rxq, defer, rxq, i, xname);
-
 		WM_Q_MISC_EVCNT_ATTACH(rxq, ipsum, rxq, i, xname);
 		WM_Q_MISC_EVCNT_ATTACH(rxq, tusum, rxq, i, xname);
+		if ((sc->sc_type >= WM_T_82575) && !WM_IS_ICHPCH(sc))
+			WM_Q_MISC_EVCNT_ATTACH(rxq, qdrop, rxq, i, xname);
 #endif /* WM_EVENT_COUNTERS */
 
 		rx_done++;
@@ -8212,6 +8236,8 @@ wm_free_txrx_queues(struct wm_softc *sc)
 		WM_Q_EVCNT_DETACH(rxq, defer, rxq, i);
 		WM_Q_EVCNT_DETACH(rxq, ipsum, rxq, i);
 		WM_Q_EVCNT_DETACH(rxq, tusum, rxq, i);
+		if ((sc->sc_type >= WM_T_82575) && !WM_IS_ICHPCH(sc))
+			WM_Q_EVCNT_DETACH(rxq, qdrop, rxq, i);
 #endif /* WM_EVENT_COUNTERS */
 
 		wm_free_rx_buffer(sc, rxq);
@@ -8401,6 +8427,8 @@ wm_init_rx_regs(struct wm_softc *sc, str
 		rxq->rxq_descsize * rxq->rxq_ndesc);
 
 		if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) {
+			uint32_t srrctl;
+
 			if (MCLBYTES & ((1 << SRRCTL_BSIZEPKT_SHIFT) - 1))
 panic("%s: MCLBYTES %d unsupported for 82575 "
 "or 

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 12:13:33 UTC 2024

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe.h
ixgbe_type.h ixv.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1792:

sys/dev/pci/ixgbe/ix_txrx.c 1.105-1.116 via patch
sys/dev/pci/ixgbe/ixgbe.c   1.345-1.346,1.349 via 
patch
sys/dev/pci/ixgbe/ixgbe.h   1.94-1.98
sys/dev/pci/ixgbe/ixgbe_type.h  1.62
sys/dev/pci/ixgbe/ixv.c 1.193,1.195-1.196

- Clear the WTHRESH bit field before writing it.
- Optimize ixgbe_txeof().
- Use kmem_zalloc() instead of malloc(,M_ZERO).
- Add QPRDC(Queue Packet Receive Drop Count) into iqdrops.
- No functional change
  - Move assignment of TXD.
  - ixv(4): Remove unused IFF_OACTIVE.
  - Don't include the Flow Director related members to reduce the
size of struct tx_ring. On amd64 and aarch64, the real size is
not changed because of the alignment.
  - The descriptor ring size and the alignment are tested in the
attach function, so it's not required to use
roundup2(size, DBA_ALIGN).
  - Use #ifdef LRO more to reduce the size of struct rx_ring.
  - Change "me" from 32bit to 8bit because the max is 128.
This commit doesn't change the real size of ix_queue, tx_ring
and rx_ring because of the alignment.
  - Th RSC (hardware receive side coalescing) feature has been
disabled all along, so enclose the code with #ifdef RSC.
  - Remove unused.
  - Modify for the readability.
  - Modify comment.
  - Fix comment. Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.14 -r1.54.2.15 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.29 -r1.199.2.30 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.12 -r1.56.2.13 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.41.2.11 -r1.41.2.12 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.125.2.24 -r1.125.2.25 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.14 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.15
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.14	Wed Oct 18 14:05:27 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Sat Feb  3 12:13:32 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.14 2023/10/18 14:05:27 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.15 2024/02/03 12:13:32 martin Exp $ */
 
 /**
 
@@ -64,13 +64,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.14 2023/10/18 14:05:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.15 2024/02/03 12:13:32 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
 #include "ixgbe.h"
 
+#ifdef RSC
 /*
  * HW RSC control:
  *  this feature only works with
@@ -84,7 +85,9 @@ __KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 
  *  to enable.
  */
 static bool ixgbe_rsc_enable = FALSE;
+#endif
 
+#ifdef IXGBE_FDIR
 /*
  * For Flow Director: this is the
  * number of TX packets we sample
@@ -95,6 +98,7 @@ static bool ixgbe_rsc_enable = FALSE;
  * setting this to 0.
  */
 static int atr_sample_rate = 20;
+#endif
 
 #define IXGBE_M_ADJ(sc, rxr, mp)	\
 	if (sc->max_frame_size <= (rxr->mbuf_sz - ETHER_ALIGN))	\
@@ -122,8 +126,9 @@ static __inline void ixgbe_rx_input(stru
 static int   ixgbe_dma_malloc(struct ixgbe_softc *, bus_size_t,
   struct ixgbe_dma_alloc *, int);
 static void  ixgbe_dma_free(struct ixgbe_softc *, struct ixgbe_dma_alloc *);
-
-static void	ixgbe_setup_hw_rsc(struct rx_ring *);
+#ifdef RSC
+static void	 ixgbe_setup_hw_rsc(struct rx_ring *);
+#endif
 
 /
  * ixgbe_legacy_start_locked - Transmit entry point
@@ -406,7 +411,7 @@ ixgbe_drain_all(struct ixgbe_softc *sc)
 static int
 ixgbe_xmit(struct tx_ring *txr, struct mbuf *m_head)
 {
-	struct ixgbe_softc  *sc = txr->sc;
+	struct ixgbe_softc  *sc = txr->sc;
 	struct ixgbe_tx_buf *txbuf;
 	union ixgbe_adv_tx_desc *txd = NULL;
 	struct ifnet	*ifp = sc->ifp;
@@ -487,8 +492,8 @@ retry:
 	}
 
 	/*
-	 * Set up the appropriate offload context
-	 * this will consume the first descriptor
+	 * Set up the appropriate offload context if requested,
+	 * this may consume one TX descriptor.
 	 */
 	error = ixgbe_tx_ctx_setup(txr, m_head, _type_len, _status);
 	if (__predict_false(error)) {
@@ -625,14 +630,8 @@ ixgbe_allocate_transmit_buffers(struct t
 		goto fail;
 	}
 
-	txr->tx_buffers =
-	(struct ixgbe_tx_buf *) malloc(sizeof(struct ixgbe_tx_buf) *
-	sc->num_tx_desc, M_DEVBUF, M_NOWAIT | M_ZERO);
-	if (txr->tx_buffers == NULL) {
-		aprint_error_dev(dev, 

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 12:13:33 UTC 2024

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe.h
ixgbe_type.h ixv.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1792:

sys/dev/pci/ixgbe/ix_txrx.c 1.105-1.116 via patch
sys/dev/pci/ixgbe/ixgbe.c   1.345-1.346,1.349 via 
patch
sys/dev/pci/ixgbe/ixgbe.h   1.94-1.98
sys/dev/pci/ixgbe/ixgbe_type.h  1.62
sys/dev/pci/ixgbe/ixv.c 1.193,1.195-1.196

- Clear the WTHRESH bit field before writing it.
- Optimize ixgbe_txeof().
- Use kmem_zalloc() instead of malloc(,M_ZERO).
- Add QPRDC(Queue Packet Receive Drop Count) into iqdrops.
- No functional change
  - Move assignment of TXD.
  - ixv(4): Remove unused IFF_OACTIVE.
  - Don't include the Flow Director related members to reduce the
size of struct tx_ring. On amd64 and aarch64, the real size is
not changed because of the alignment.
  - The descriptor ring size and the alignment are tested in the
attach function, so it's not required to use
roundup2(size, DBA_ALIGN).
  - Use #ifdef LRO more to reduce the size of struct rx_ring.
  - Change "me" from 32bit to 8bit because the max is 128.
This commit doesn't change the real size of ix_queue, tx_ring
and rx_ring because of the alignment.
  - Th RSC (hardware receive side coalescing) feature has been
disabled all along, so enclose the code with #ifdef RSC.
  - Remove unused.
  - Modify for the readability.
  - Modify comment.
  - Fix comment. Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.14 -r1.54.2.15 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.29 -r1.199.2.30 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.12 -r1.56.2.13 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.41.2.11 -r1.41.2.12 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.125.2.24 -r1.125.2.25 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 12:02:58 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1791):

sys/dev/pci/if_wm.c: revision 1.793

Add Intel I219-{LM,V}(20,21) support.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.19 -r1.645.2.20 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.19 src/sys/dev/pci/if_wm.c:1.645.2.20
--- src/sys/dev/pci/if_wm.c:1.645.2.19	Wed Oct 18 14:29:18 2023
+++ src/sys/dev/pci/if_wm.c	Sat Feb  3 12:02:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.19 2023/10/18 14:29:18 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.20 2024/02/03 12:02:58 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.19 2023/10/18 14:29:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.20 2024/02/03 12:02:58 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1761,6 +1761,12 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM19,
 	  "I219 LM (19) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM20,
+	  "I219 LM (20) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM21,
+	  "I219 LM (21) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM22,
 	  "I219 LM (22) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
@@ -1821,6 +1827,12 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V19,
 	  "I219 V (19) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V20,
+	  "I219 V (20) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V21,
+	  "I219 V (21) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V22,
 	  "I219 V (22) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */



CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 12:02:58 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1791):

sys/dev/pci/if_wm.c: revision 1.793

Add Intel I219-{LM,V}(20,21) support.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.19 -r1.645.2.20 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 11:26:39 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen (ticket #1790)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.21 -r1.1371.2.22 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.21 -r1.1370.2.22 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 11:26:39 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen (ticket #1790)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.21 -r1.1371.2.22 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.21 -r1.1370.2.22 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 11:24:19 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1790):

sys/dev/pci/pcidevs: revision 1.1494
sys/dev/pci/pcidevs: revision 1.1498
sys/dev/pci/pcidevs: revision 1.1499
sys/dev/pci/pcidevs: revision 1.1500
sys/dev/pci/pcidevs: revision 1.1501
sys/dev/pci/pcidevs: revision 1.1502

pcidevs: Add missing I225/I226 series devices
pcidevs: Add Mellanox ConnectX-6 Lx.
add some newer Areca boards in prep for updating driver
Add Intel C26[26] eSPI.
Update Intel Raptor Lake devices.
Add Intel I219-{LM,V}(20,21)


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.21 -r1.1383.2.22 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2024-02-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb  3 11:24:19 UTC 2024

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1790):

sys/dev/pci/pcidevs: revision 1.1494
sys/dev/pci/pcidevs: revision 1.1498
sys/dev/pci/pcidevs: revision 1.1499
sys/dev/pci/pcidevs: revision 1.1500
sys/dev/pci/pcidevs: revision 1.1501
sys/dev/pci/pcidevs: revision 1.1502

pcidevs: Add missing I225/I226 series devices
pcidevs: Add Mellanox ConnectX-6 Lx.
add some newer Areca boards in prep for updating driver
Add Intel C26[26] eSPI.
Update Intel Raptor Lake devices.
Add Intel I219-{LM,V}(20,21)


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.21 -r1.1383.2.22 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.21 src/sys/dev/pci/pcidevs:1.1383.2.22
--- src/sys/dev/pci/pcidevs:1.1383.2.21	Wed Oct 18 14:29:18 2023
+++ src/sys/dev/pci/pcidevs	Sat Feb  3 11:24:19 2024
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.21 2023/10/18 14:29:18 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.22 2024/02/03 11:24:19 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1488,6 +1488,7 @@ product ARECA ARC1170		0x1170	ARC-1170
 product ARECA ARC1200		0x1200	ARC-1200
 product ARECA ARC1200_B		0x1201	ARC-1200 rev B
 product ARECA ARC1202		0x1202	ARC-1202
+product ARECA ARC1203		0x1203	ARC-1203
 product ARECA ARC1210		0x1210	ARC-1210
 product ARECA ARC1214 		0x1214	ARC-1214
 product ARECA ARC1220		0x1220	ARC-1220
@@ -1500,6 +1501,8 @@ product ARECA ARC1381		0x1381	ARC-1381
 product ARECA ARC1680		0x1680	ARC-1680
 product ARECA ARC1681		0x1681	ARC-1681
 product ARECA ARC1880 		0x1880	ARC-1880
+product ARECA ARC1884 		0x1884	ARC-1884
+product ARECA ARC1886 		0x1886	ARC-1886
 
 /* ASIX Electronics products */
 product ASIX AX88140A	0x1400	AX88140A 10/100 Ethernet
@@ -3934,6 +3937,7 @@ product INTEL I219_LM11		0x0d4c	I219-LM 
 product INTEL I219_V11		0x0d4d	I219-V (11) Ethernet Connection
 product INTEL I219_LM10		0x0d4e	I219-LM (10) Ethernet Connection
 product INTEL I219_V10		0x0d4f	I219-V (10) Ethernet Connection
+product INTEL I225_IT		0x0d9f	I225-IT Ethernet Connection
 product INTEL I219_LM12		0x0d53	I219-LM (12) Ethernet Connection
 product INTEL I219_V12		0x0d55	I219-V (12) Ethernet Connection
 product INTEL I219_LM23		0x0dc5	I219-LM (23) Ethernet Connection
@@ -4254,6 +4258,8 @@ product INTEL 82439HX		0x1250	82439HX (T
 product INTEL I226_LM		0x125b	I226-LM Ethernet
 product INTEL I226_V		0x125c	I226-V Ethernet
 product INTEL I226_IT		0x125d	I226-IT Ethernet
+product INTEL I221_V		0x125e	I221-V Ethernet Connection
+product INTEL I226_BLANK_NVM	0x125f	I226 Ethernet Connection (blankNVM)
 product INTEL C3K_X553_10G	0x1306	C3000 X553 10G Ethernet
 product INTEL C3K_X553_1G	0x1307	C3000 X553 1G Ethernet
 product INTEL 82870P2_PPB	0x1460	82870P2 P64H2 PCI-PCI Bridge
@@ -4380,9 +4386,12 @@ product INTEL C3K_X553_SGMII	0x15e4	C300
 product INTEL C3K_X553_SGMII_L	0x15e5	C3000 X553 1GbE SGMII (non-10G SKU)
 product INTEL I225_LM		0x15f2	I225 LM Ethernet
 product INTEL I225_V		0x15f3	I225 V Ethernet
+product INTEL I220_V		0x15f7	I220-V Ethernet Connection
+product INTEL I225_BLANK_NVM	0x15fd	I225 Ethernet Connection (blankNVM)
 product INTEL I219_LM15		0x15f4	I219-LM (15) Ethernet Connection
 product INTEL I219_V15		0x15f5	I219-V (15) Ethernet Connection
 product INTEL I210_SGMII_WOF	0x15f6	I210 Ethernet (SGMII)
+product INTEL I225_I		0x15f8	I225-I Ethernet Connection
 product INTEL I219_LM14		0x15f9	I219-LM (14) Ethernet Connection
 product INTEL I219_V14		0x15fa	I219-V (14) Ethernet Connection
 product INTEL I219_LM13		0x15fb	I219-LM (13) Ethernet Connection
@@ -5415,6 +5424,9 @@ product INTEL XE5_V3_BRA4	0x2ffb  Xeon E
 product INTEL XE5_V3_SADBR1	0x2ffc  Xeon E7 v3/Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers
 product INTEL XE5_V3_SADBR2	0x2ffd  Xeon E7 v3/Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers
 product INTEL XE5_V3_SADBR3	0x2ffe  Xeon E7 v3/Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers
+product INTEL I225_K		0x3100	I225-K Ethernet Connection
+product INTEL I225_K2		0x3101	I225-K2 Ethernet Connection
+product INTEL I226_K		0x3102	I226-K Ethernet Connection
 product INTEL WIFI_LINK_3165_1	0x3165	Dual Band Wireless AC 3165
 product INTEL WIFI_LINK_3165_2	0x3166	Dual Band Wireless AC 3165
 product INTEL GLK_IGD_1		0x3184	UHD Graphics 605
@@ -5951,7 +5963,7 @@ product INTEL ADL_U15_2_4_HOST	0x4609	Al
 product INTEL ADL_U9_2_4_HOST	0x460a	Alder Lake (U9,2+4) Host
 product INTEL ADL_PCIE_RP_0	0x460d	Alder Lake PCIe G5 Root Port 0 (x16)
 product INTEL ADL_XDCI		0x460e	Alder Lake USB-C Device (xDCI)
-product INTEL ADL_S_2_0_HOST	0x4610	Alder Lake 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 26 15:12:10 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: mpii.c

Log Message:
Pull up following revision(s) (requested by buhrow in ticket #1756):

sys/dev/pci/mpii.c: revision 1.30

Fixes for PR kern/57133:

I can now explain why this assert is firing and have a fix for it.  It is a  
regression introduced in R1.22 of mpii.c.

If a request comes in and the IOC returns a 
MPII_SCSIIO_STATUS_CHECK_COND condition, after
 a successful transfer, or one that is a recovered error,
 mpii(4) correctly sets the xs->error to XS_SENSE, but incorrectly sets 
xs->resid to 0 before
 returning the xfer to the upper scsi layers.  Once the upper layers get it, 
they notice the
 XS_SENSE check condition and because it's a retryable error, they increment 
xs_requeuecnt, set
 ERESTART and send the xfer request down to the mpii(4) layer again for a 
retry. What they do
 not do is reset xs->resid equal to xs->datalen.  When the xfer comes down to 
mpii(4) again, the
 assert happens.  The fix is for the mpii(4) driver to leave xs->resid alone 
when it encounters
 a MPII_SCSIIO_STATUS_CHECK_COND condition.

This bug affects NetBSD-10, netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.22.4.1 -r1.22.4.2 src/sys/dev/pci/mpii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mpii.c
diff -u src/sys/dev/pci/mpii.c:1.22.4.1 src/sys/dev/pci/mpii.c:1.22.4.2
--- src/sys/dev/pci/mpii.c:1.22.4.1	Sun Aug  9 14:14:34 2020
+++ src/sys/dev/pci/mpii.c	Thu Oct 26 15:12:10 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.22.4.1 2020/08/09 14:14:34 martin Exp $ */
+/* $NetBSD: mpii.c,v 1.22.4.2 2023/10/26 15:12:10 martin Exp $ */
 /*	$OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $	*/
 /*
  * Copyright (c) 2010, 2012 Mike Belopuhov
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.22.4.1 2020/08/09 14:14:34 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.22.4.2 2023/10/26 15:12:10 martin Exp $");
 
 #include "bio.h"
 
@@ -3225,7 +3225,6 @@ mpii_scsi_cmd_done(struct mpii_ccb *ccb)
 	}
 	
 	KASSERT(xs->error == XS_NOERROR);
-	KASSERT(xs->resid == xs->datalen);
 	KASSERT(xs->status == SCSI_OK);
 	
 	if (ccb->ccb_rcb == NULL) {
@@ -3285,7 +3284,6 @@ mpii_scsi_cmd_done(struct mpii_ccb *ccb)
 			break;
 
 		case MPII_SCSIIO_STATUS_CHECK_COND:
-			xs->resid = 0;
 			xs->error = XS_SENSE;
 			break;
 



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 26 15:12:10 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: mpii.c

Log Message:
Pull up following revision(s) (requested by buhrow in ticket #1756):

sys/dev/pci/mpii.c: revision 1.30

Fixes for PR kern/57133:

I can now explain why this assert is firing and have a fix for it.  It is a  
regression introduced in R1.22 of mpii.c.

If a request comes in and the IOC returns a 
MPII_SCSIIO_STATUS_CHECK_COND condition, after
 a successful transfer, or one that is a recovered error,
 mpii(4) correctly sets the xs->error to XS_SENSE, but incorrectly sets 
xs->resid to 0 before
 returning the xfer to the upper scsi layers.  Once the upper layers get it, 
they notice the
 XS_SENSE check condition and because it's a retryable error, they increment 
xs_requeuecnt, set
 ERESTART and send the xfer request down to the mpii(4) layer again for a 
retry. What they do
 not do is reset xs->resid equal to xs->datalen.  When the xfer comes down to 
mpii(4) again, the
 assert happens.  The fix is for the mpii(4) driver to leave xs->resid alone 
when it encounters
 a MPII_SCSIIO_STATUS_CHECK_COND condition.

This bug affects NetBSD-10, netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.22.4.1 -r1.22.4.2 src/sys/dev/pci/mpii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 18 14:35:17 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1915


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.20 -r1.1371.2.21 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.20 -r1.1370.2.21 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 18 14:29:19 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmvar.h pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1754):

sys/dev/pci/pcidevs: revision 1.1497
sys/dev/pci/if_wm.c: revision 1.790
sys/dev/pci/if_wm.c: revision 1.791
sys/dev/pci/if_wmvar.h: revision 1.51

pcidevs: Add Intel I219{V,LM}({22,23})

wm(4): Add a new workaround for Tiger Lake and newer.
 - Define new WM_T_PCH_TGP and use it for Tiger Lake and newer.
   Note that we don't define WM_T_PCH_ADP because we have no any
   Alder Lake specific workaround yet.
 - Add new workaround for Tiger Lake (and newer) in wm_init_locked()
   to avoid packet loss.

wm(4): Add I219{V,LM}({22,23}) devices (Raptor Lake).


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.18 -r1.645.2.19 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.44.4.6 -r1.44.4.7 src/sys/dev/pci/if_wmvar.h
cvs rdiff -u -r1.1383.2.20 -r1.1383.2.21 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 18 14:29:19 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmvar.h pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1754):

sys/dev/pci/pcidevs: revision 1.1497
sys/dev/pci/if_wm.c: revision 1.790
sys/dev/pci/if_wm.c: revision 1.791
sys/dev/pci/if_wmvar.h: revision 1.51

pcidevs: Add Intel I219{V,LM}({22,23})

wm(4): Add a new workaround for Tiger Lake and newer.
 - Define new WM_T_PCH_TGP and use it for Tiger Lake and newer.
   Note that we don't define WM_T_PCH_ADP because we have no any
   Alder Lake specific workaround yet.
 - Add new workaround for Tiger Lake (and newer) in wm_init_locked()
   to avoid packet loss.

wm(4): Add I219{V,LM}({22,23}) devices (Raptor Lake).


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.18 -r1.645.2.19 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.44.4.6 -r1.44.4.7 src/sys/dev/pci/if_wmvar.h
cvs rdiff -u -r1.1383.2.20 -r1.1383.2.21 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.18 src/sys/dev/pci/if_wm.c:1.645.2.19
--- src/sys/dev/pci/if_wm.c:1.645.2.18	Sun Oct  8 15:28:49 2023
+++ src/sys/dev/pci/if_wm.c	Wed Oct 18 14:29:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.18 2023/10/08 15:28:49 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.19 2023/10/18 14:29:18 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.18 2023/10/08 15:28:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.19 2023/10/18 14:29:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1742,25 +1742,31 @@ static const struct wm_product {
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM13,
 	  "I219 LM (13) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM14,
 	  "I219 LM (14) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM15,
 	  "I219 LM (15) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM16,
 	  "I219 LM (16) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM17,
 	  "I219 LM (17) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM18,
 	  "I219 LM (18) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM19,
 	  "I219 LM (19) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM22,
+	  "I219 LM (22) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM23,
+	  "I219 LM (23) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V,
 	  "I219 V Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
@@ -1796,25 +1802,31 @@ static const struct wm_product {
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V13,
 	  "I219 V (13) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V14,
 	  "I219 V (14) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V15,
 	  "I219 V (15) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V16,
 	  "I219 V (16) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V17,
 	  "I219 V (17) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V18,
 	  "I219 V (18) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V19,
 	  "I219 V (19) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V22,
+	  "I219 V (22) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
+	{ PCI_VENDOR_INTEL,	

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2023-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 18 14:05:28 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82599.c ixgbe_api.c ixgbe_bypass.h ixgbe_common.c
ixgbe_common.h ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_type.h
ixgbe_x540.c ixgbe_x550.c ixv.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1753:

sys/dev/pci/ixgbe/ix_txrx.c 1.103-1.104
sys/dev/pci/ixgbe/ixgbe.c   1.334-1.338,
1.341-1.344 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.90-1.93
sys/dev/pci/ixgbe/ixgbe_82599.c 1.31-1.32
sys/dev/pci/ixgbe/ixgbe_api.c   1.29
sys/dev/pci/ixgbe/ixgbe_bypass.h1.5
sys/dev/pci/ixgbe/ixgbe_common.c1.46-1.47
sys/dev/pci/ixgbe/ixgbe_common.h1.18
sys/dev/pci/ixgbe/ixgbe_dcb.c   1.14-1.15
sys/dev/pci/ixgbe/ixgbe_dcb_82598.c 1.13
sys/dev/pci/ixgbe/ixgbe_type.h  1.59-1.61
sys/dev/pci/ixgbe/ixgbe_x540.c  1.24
sys/dev/pci/ixgbe/ixgbe_x550.c  1.28
sys/dev/pci/ixgbe/ixv.c 1.187-1.192

- ixg(4): Add 82599 LS support once again.
- ixg(4): Filter out spurious link up indication more.
- ixg(4): Print DEVICE_CAPS register.
- ixg(4): Fix a bug that the number of queues is unintentionally
  limited to a small number or wrong error message may be printed
  when two devices' number of MSI-X vectors are different.
- Modify error message of wrong TX/RX descriptor size.
- Enable interrupt after setting IFF_RUNNING.
- Fix a bug that changing hw.ix[gv]X.qY.interrupt_rate would change
  all devices all queues default interrupt rate.
- Cleanup the code.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.13 -r1.54.2.14 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.28 -r1.199.2.29 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.11 -r1.56.2.12 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.21.4.5 -r1.21.4.6 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.23.2.4 -r1.23.2.5 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.1.14.3 -r1.1.14.4 src/sys/dev/pci/ixgbe/ixgbe_bypass.h
cvs rdiff -u -r1.25.2.8 -r1.25.2.9 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.9.4.2 -r1.9.4.3 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r1.7.8.2 -r1.7.8.3 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c
cvs rdiff -u -r1.41.2.10 -r1.41.2.11 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.16.8.4 -r1.16.8.5 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.15.2.7 -r1.15.2.8 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.125.2.23 -r1.125.2.24 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2023-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 18 14:05:28 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82599.c ixgbe_api.c ixgbe_bypass.h ixgbe_common.c
ixgbe_common.h ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_type.h
ixgbe_x540.c ixgbe_x550.c ixv.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1753:

sys/dev/pci/ixgbe/ix_txrx.c 1.103-1.104
sys/dev/pci/ixgbe/ixgbe.c   1.334-1.338,
1.341-1.344 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.90-1.93
sys/dev/pci/ixgbe/ixgbe_82599.c 1.31-1.32
sys/dev/pci/ixgbe/ixgbe_api.c   1.29
sys/dev/pci/ixgbe/ixgbe_bypass.h1.5
sys/dev/pci/ixgbe/ixgbe_common.c1.46-1.47
sys/dev/pci/ixgbe/ixgbe_common.h1.18
sys/dev/pci/ixgbe/ixgbe_dcb.c   1.14-1.15
sys/dev/pci/ixgbe/ixgbe_dcb_82598.c 1.13
sys/dev/pci/ixgbe/ixgbe_type.h  1.59-1.61
sys/dev/pci/ixgbe/ixgbe_x540.c  1.24
sys/dev/pci/ixgbe/ixgbe_x550.c  1.28
sys/dev/pci/ixgbe/ixv.c 1.187-1.192

- ixg(4): Add 82599 LS support once again.
- ixg(4): Filter out spurious link up indication more.
- ixg(4): Print DEVICE_CAPS register.
- ixg(4): Fix a bug that the number of queues is unintentionally
  limited to a small number or wrong error message may be printed
  when two devices' number of MSI-X vectors are different.
- Modify error message of wrong TX/RX descriptor size.
- Enable interrupt after setting IFF_RUNNING.
- Fix a bug that changing hw.ix[gv]X.qY.interrupt_rate would change
  all devices all queues default interrupt rate.
- Cleanup the code.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.13 -r1.54.2.14 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.28 -r1.199.2.29 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.11 -r1.56.2.12 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.21.4.5 -r1.21.4.6 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.23.2.4 -r1.23.2.5 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.1.14.3 -r1.1.14.4 src/sys/dev/pci/ixgbe/ixgbe_bypass.h
cvs rdiff -u -r1.25.2.8 -r1.25.2.9 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.9.4.2 -r1.9.4.3 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r1.7.8.2 -r1.7.8.3 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c
cvs rdiff -u -r1.41.2.10 -r1.41.2.11 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.16.8.4 -r1.16.8.5 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.15.2.7 -r1.15.2.8 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.125.2.23 -r1.125.2.24 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.13 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.14
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.13	Fri Oct 13 18:20:30 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Oct 18 14:05:27 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.13 2023/10/13 18:20:30 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.14 2023/10/18 14:05:27 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.13 2023/10/13 18:20:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.14 2023/10/18 14:05:27 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -846,7 +846,6 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 	u8   ipproto = 0;
 	char *l3d;
 
-
 	/* First check if TSO is to be used */
 	if (mp->m_pkthdr.csum_flags & (M_CSUM_TSOv4 | M_CSUM_TSOv6)) {
 		int rv = ixgbe_tso_setup(txr, mp, cmd_type_len, olinfo_status);
@@ -1282,9 +1281,9 @@ ixgbe_rsc_count(union ixgbe_adv_rx_desc 
 static void
 ixgbe_setup_hw_rsc(struct rx_ring *rxr)
 {
-	struct	ixgbe_softc *sc = rxr->sc;
-	struct	ixgbe_hw *hw = >hw;
-	u32  rscctrl, rdrxctl;
+	struct ixgbe_softc *sc = rxr->sc;
+	struct ixgbe_hw	*hw = >hw;
+	u32		rscctrl, rdrxctl;
 
 	/* If turning LRO/RSC off we need to disable it */
 	if ((sc->ifp->if_capenable & IFCAP_LRO) == 0) {
@@ -1746,9 +1745,9 @@ ixgbe_rx_input(struct rx_ring *rxr, stru
 (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) {
 /*
  * Send to the stack if:
- **  - LRO not enabled, or
- **  - no LRO resources, or
- **  - lro enqueue fails
+ *  - LRO not enabled, or
+ 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 18:42:51 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1750 (Intel 82599 LS and Pericom(Diodes) PCIe switches added)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.19 -r1.1371.2.20 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.19 -r1.1370.2.20 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 18:41:17 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1750):

sys/dev/pci/pcidevs: revision 1.1493
sys/dev/pci/pcidevs: revision 1.1495

Add Intel 82599 LS.
Add Pericom(Diodes) PCIe switches.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.19 -r1.1383.2.20 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.19 src/sys/dev/pci/pcidevs:1.1383.2.20
--- src/sys/dev/pci/pcidevs:1.1383.2.19	Fri Oct 13 17:50:40 2023
+++ src/sys/dev/pci/pcidevs	Fri Oct 13 18:41:17 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.19 2023/10/13 17:50:40 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.20 2023/10/13 18:41:17 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4304,6 +4304,7 @@ product INTEL I350_DA4	 	0x1546	I350 Qua
 product INTEL 82599_SFP_SF_QP	0x154a	82599 10 GbE Controller
 product INTEL XL710_VF		0x154c	XL710 Ethernet Virtual Function
 product INTEL 82599_SFP_SF2	0x154d	82599 (SFP+) 10 GbE Controller
+product INTEL 82599_LS		0x154f	82599 LS 10G Ethernet
 product INTEL 82599EN_SFP	0x1557	82599 10 GbE Controller
 product INTEL 82599_QSFP_SF_QP	0x1558	X520 10 GbE QSFP+
 product INTEL I218_V		0x1559	I218-V Ethernet Connection
@@ -8807,7 +8808,21 @@ product PERICOM PI7C21P100	0x01a7	PI7C21
 product PERICOM PI7C9X20303UL	0x0303	PI7C9X20303UL 3port 3lane PCIe switch
 product PERICOM PI7C9X20505GP	0x0505	PI7C9X20505GP 5port 5lane PCIe switch
 product PERICOM PI7C9X20508GP	0x0508	PI7C9X20508GP 5port 8lane PCIe switch
+product PERICOM PI7C9X2G303EL	0x2303	PI7C9X2G303EL 3port 3lane PCIe Gen2 switch
+product PERICOM PI7C9X2G304EL	0x2304	PI7C9X2G304EL 3port 4lane PCIe Gen2 switch
+product PERICOM PI7C9X2G308GP	0x2308	PI7C9X2G308GP 3port 8lane PCIe Gen2 switch
+product PERICOM PI7C9X2G312GP	0x2312	PI7C9X2G312GP 3port 12lane PCIe Gen2 switch
 product PERICOM PI7C9X2G404SL	0x2404	PI7C9X2G404SL 4port 4lane PCIe Gen2 switch
+product PERICOM PI7C9X2G608GP	0x2608	PI7C9X2G608GP 6port 8lane PCIe Gen2 switch
+product PERICOM PI7C9X2G612GP	0x2612	PI7C9X2G612GP 6port 12lane PCIe Gen2 switch
+product PERICOM PI7C9X2G912GP	0x2912	PI7C9X2G912GP 9port 12lane PCIe Gen2 switch
+product PERICOM PI7C9X2G808PR	0x8608	PI7C9X2G808PR 8port 8lane PCIe Gen2 switch
+product PERICOM PI7C9X2G304EV	0xb304	PI7C9X2G304EV 3port 4lane PCIe Gen2 switch
+product PERICOM PI7C9X2G404EV	0xb404	PI7C9X2G404EV 4port 4lane PCIe Gen2 switch
+product PERICOM PI7C9X3G808GP	0xc008	PI7C9X3G808GP 8port 8lane PCIe Gen3 switch
+product PERICOM PI7C9X3G816GP	0xc016	PI7C9X3G816GP 8port 16lane PCIe Gen3 switch
+product PERICOM PI7C9X3G1224GP	0xc124	PI7C9X3G1224GP 12port 24lane PCIe Gen3 switch
+product PERICOM PI7C9X3G1632GP	0xc232	PI7C9X3G1632GP 16port 32lane PCIe Gen3 switch
 product PERICOM PI7C8140A	0x8140	PI7C8140A 2 port PCI-PCI Bridge
 product PERICOM PI7C8148	0x8148	PI7C8148 Asynchronous 2 port PCI-PCI Bridge
 product PERICOM PI7C8152	0x8152	PI7C8152 2 port PCI-PCI Bridge



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 18:41:17 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1750):

sys/dev/pci/pcidevs: revision 1.1493
sys/dev/pci/pcidevs: revision 1.1495

Add Intel 82599 LS.
Add Pericom(Diodes) PCIe switches.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.19 -r1.1383.2.20 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 18:20:30 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: if_bypass.c if_fdir.c if_sriov.c
ix_txrx.c ixgbe.c ixgbe.h ixgbe_api.h ixgbe_bypass.h ixgbe_common.c
ixgbe_common.h ixgbe_fdir.h ixgbe_netmap.c ixgbe_netmap.h
ixgbe_osdep.c ixgbe_sriov.h ixgbe_type.h ixgbe_x550.c ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1749):

sys/dev/pci/ixgbe/if_bypass.c   1.10
sys/dev/pci/ixgbe/if_fdir.c 1.6 via patch
sys/dev/pci/ixgbe/if_sriov.c1.18 via patch
sys/dev/pci/ixgbe/ix_txrx.c 1.102 via patch
sys/dev/pci/ixgbe/ixgbe.c   1.333,1.339 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.89
sys/dev/pci/ixgbe/ixgbe_api.h   1.17
sys/dev/pci/ixgbe/ixgbe_common.h1.17
sys/dev/pci/ixgbe/ixgbe_bypass.h1.4
sys/dev/pci/ixgbe/ixgbe_common.c1.45
sys/dev/pci/ixgbe/ixgbe_fdir.h  1.5
sys/dev/pci/ixgbe/ixgbe_netmap.h1.3
sys/dev/pci/ixgbe/ixgbe_netmap.c1.6
sys/dev/pci/ixgbe/ixgbe_osdep.c 1.9
sys/dev/pci/ixgbe/ixgbe_sriov.h 1.6
sys/dev/pci/ixgbe/ixgbe_type.h  1.58
sys/dev/pci/ixgbe/ixgbe_x550.c  1.27
sys/dev/pci/ixgbe/ixv.c 1.186 via patch

ixgbe: Rename some definitions, modify comment. No functional change.
 Apply changes from FreeBSD's ix-3.3.31 and ixv-1.5.32.
- struct adapter *adapter -> struct ixgbe_softc *sc
- master -> primary
- black -> block

ixg(4): Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4.8.3 -r1.4.8.4 src/sys/dev/pci/ixgbe/if_bypass.c
cvs rdiff -u -r1.2.8.1 -r1.2.8.2 src/sys/dev/pci/ixgbe/if_fdir.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/dev/pci/ixgbe/if_sriov.c
cvs rdiff -u -r1.54.2.12 -r1.54.2.13 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.27 -r1.199.2.28 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.10 -r1.56.2.11 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.15.2.1 -r1.15.2.2 src/sys/dev/pci/ixgbe/ixgbe_api.h
cvs rdiff -u -r1.1.14.2 -r1.1.14.3 src/sys/dev/pci/ixgbe/ixgbe_bypass.h
cvs rdiff -u -r1.25.2.7 -r1.25.2.8 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.14.2.1 -r1.14.2.2 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.2.8.2 -r1.2.8.3 src/sys/dev/pci/ixgbe/ixgbe_fdir.h
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/dev/pci/ixgbe/ixgbe_netmap.c
cvs rdiff -u -r1.1.14.1 -r1.1.14.2 src/sys/dev/pci/ixgbe/ixgbe_netmap.h
cvs rdiff -u -r1.4.8.4 -r1.4.8.5 src/sys/dev/pci/ixgbe/ixgbe_osdep.c
cvs rdiff -u -r1.3.8.2 -r1.3.8.3 src/sys/dev/pci/ixgbe/ixgbe_sriov.h
cvs rdiff -u -r1.41.2.9 -r1.41.2.10 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.15.2.6 -r1.15.2.7 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.125.2.22 -r1.125.2.23 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 18:00:42 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by abs in ticket #1748):

sys/dev/pci/ahcisata_pci.c: revision 1.71

Add support for ASMEDIA 0x0624
... an AHCI SATA adaptor which identifies itself as an IDE storage device


To generate a diff of this commit:
cvs rdiff -u -r1.55.4.2 -r1.55.4.3 src/sys/dev/pci/ahcisata_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.55.4.2 src/sys/dev/pci/ahcisata_pci.c:1.55.4.3
--- src/sys/dev/pci/ahcisata_pci.c:1.55.4.2	Tue Jan 21 15:19:51 2020
+++ src/sys/dev/pci/ahcisata_pci.c	Fri Oct 13 18:00:42 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.55.4.2 2020/01/21 15:19:51 martin Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.55.4.3 2023/10/13 18:00:42 martin Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55.4.2 2020/01/21 15:19:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55.4.3 2023/10/13 18:00:42 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
@@ -202,6 +202,8 @@ static const struct ahci_pci_quirk ahci_
 	AHCI_PCI_QUIRK_FORCE },
 	{ PCI_VENDOR_ASMEDIA, PCI_PRODUCT_ASMEDIA_ASM1061_12,
 	AHCI_PCI_QUIRK_FORCE },
+	{ PCI_VENDOR_ASMEDIA, PCI_PRODUCT_ASMEDIA_ASM1062_JMB575,
+	AHCI_PCI_QUIRK_FORCE },
 	{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON_SATA,
 	AHCI_PCI_QUIRK_FORCE },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801JI_SATA_AHCI,



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 18:00:42 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: ahcisata_pci.c

Log Message:
Pull up following revision(s) (requested by abs in ticket #1748):

sys/dev/pci/ahcisata_pci.c: revision 1.71

Add support for ASMEDIA 0x0624
... an AHCI SATA adaptor which identifies itself as an IDE storage device


To generate a diff of this commit:
cvs rdiff -u -r1.55.4.2 -r1.55.4.3 src/sys/dev/pci/ahcisata_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 17:52:45 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1748 (add ASMEDIA 0x0624 - ASM1062 + JMB575 Port Multiplier)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.18 -r1.1371.2.19 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.18 -r1.1370.2.19 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 17:52:45 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1748 (add ASMEDIA 0x0624 - ASM1062 + JMB575 Port Multiplier)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.18 -r1.1371.2.19 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.18 -r1.1370.2.19 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 17:50:41 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by abs in ticket #1748):

sys/dev/pci/pcidevs: revision 1.1496

Add entry for ASMEDIA 0x0624 - ASM1062 + JMB575 Port Multiplier


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.18 -r1.1383.2.19 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.18 src/sys/dev/pci/pcidevs:1.1383.2.19
--- src/sys/dev/pci/pcidevs:1.1383.2.18	Mon Aug 21 12:32:25 2023
+++ src/sys/dev/pci/pcidevs	Fri Oct 13 17:50:40 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.18 2023/08/21 12:32:25 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.19 2023/10/13 17:50:40 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1510,6 +1510,7 @@ product ASMEDIA ASM1061_01	0x0601	ASM106
 product ASMEDIA ASM1061_02	0x0602	ASM1061 AHCI SATA III Controller
 product ASMEDIA ASM1061_11	0x0611	ASM1061 AHCI SATA III Controller
 product ASMEDIA ASM1061_12	0x0612	ASM1061 AHCI SATA III Controller
+product ASMEDIA ASM1062_JMB575	0x0624	ASM1062 + JMB575 Port Multiplier
 product ASMEDIA ASM106X		0x0625	ASM106x AHCI SATA III Controller
 product	ASMEDIA	ASM1042		0x1042	ASM1042 USB 3.0 Host Controller
 product ASMEDIA ASM1083		0x1080	ASM1083/1085 PCIe-PCI Bridge



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 13 17:50:41 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by abs in ticket #1748):

sys/dev/pci/pcidevs: revision 1.1496

Add entry for ASMEDIA 0x0624 - ASM1062 + JMB575 Port Multiplier


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.18 -r1.1383.2.19 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  8 15:28:49 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1746):

sys/dev/pci/if_wm.c: revision 1.785
sys/dev/pci/if_wm.c: revision 1.786
sys/dev/pci/if_wm.c: revision 1.787
sys/dev/pci/if_wm.c: revision 1.788
sys/dev/pci/if_wm.c: revision 1.789

wm(4): Use SCVPC and HRMPC for 82575 and newer.
  The SCVPC(SerDes/SGMII Code Violation Packet Count) register and the HRMPC
  (Header Redirection Missed Packet Count) register were added in if_wm.c
  rev. 1.776 but the location in the code were incorrect. Fix them.

wm(4): Add some info to some event counters.
 - The difference between the RUC(Rx Undersize) and RFC(Rx Fragment) is whether
   the CRC is valid or not.
 - The difference between the ROC(Rx Oversize) and RJC(Rx Jabber) is whether
   the CRC is valid or not.
 - LENERRS(Length Errors) is for the length/type field <= 1500.

wm(4): the IAC(Interrupt Assertion Count) register is for 82571 and newer.

wm(4): Modify descriptions of flow control related event counters.

wm(4): Replace /* nothing */ to __nothing for evcnt macros
Prevent empty if bodies for !WM_EVENT_COUNTERS.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.17 -r1.645.2.18 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  8 15:28:49 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1746):

sys/dev/pci/if_wm.c: revision 1.785
sys/dev/pci/if_wm.c: revision 1.786
sys/dev/pci/if_wm.c: revision 1.787
sys/dev/pci/if_wm.c: revision 1.788
sys/dev/pci/if_wm.c: revision 1.789

wm(4): Use SCVPC and HRMPC for 82575 and newer.
  The SCVPC(SerDes/SGMII Code Violation Packet Count) register and the HRMPC
  (Header Redirection Missed Packet Count) register were added in if_wm.c
  rev. 1.776 but the location in the code were incorrect. Fix them.

wm(4): Add some info to some event counters.
 - The difference between the RUC(Rx Undersize) and RFC(Rx Fragment) is whether
   the CRC is valid or not.
 - The difference between the ROC(Rx Oversize) and RJC(Rx Jabber) is whether
   the CRC is valid or not.
 - LENERRS(Length Errors) is for the length/type field <= 1500.

wm(4): the IAC(Interrupt Assertion Count) register is for 82571 and newer.

wm(4): Modify descriptions of flow control related event counters.

wm(4): Replace /* nothing */ to __nothing for evcnt macros
Prevent empty if bodies for !WM_EVENT_COUNTERS.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.17 -r1.645.2.18 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.17 src/sys/dev/pci/if_wm.c:1.645.2.18
--- src/sys/dev/pci/if_wm.c:1.645.2.17	Mon Sep  4 17:55:24 2023
+++ src/sys/dev/pci/if_wm.c	Sun Oct  8 15:28:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.17 2023/09/04 17:55:24 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.18 2023/10/08 15:28:49 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.17 2023/09/04 17:55:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.18 2023/10/08 15:28:49 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -789,13 +789,13 @@ do {	\
 #define WM_Q_EVCNT_ADD(qname, evname, val)		\
 	WM_EVCNT_ADD(&(qname)->qname##_ev_##evname, (val))
 #else /* !WM_EVENT_COUNTERS */
-#define	WM_EVCNT_INCR(ev)	/* nothing */
-#define	WM_EVCNT_STORE(ev, val)	/* nothing */
-#define	WM_EVCNT_ADD(ev, val)	/* nothing */
-
-#define WM_Q_EVCNT_INCR(qname, evname)		/* nothing */
-#define WM_Q_EVCNT_STORE(qname, evname, val)	/* nothing */
-#define WM_Q_EVCNT_ADD(qname, evname, val)	/* nothing */
+#define	WM_EVCNT_INCR(ev)	__nothing
+#define	WM_EVCNT_STORE(ev, val)	__nothing
+#define	WM_EVCNT_ADD(ev, val)	__nothing
+
+#define WM_Q_EVCNT_INCR(qname, evname)		__nothing
+#define WM_Q_EVCNT_STORE(qname, evname, val)	__nothing
+#define WM_Q_EVCNT_ADD(qname, evname, val)	__nothing
 #endif /* !WM_EVENT_COUNTERS */
 
 #define	CSR_READ(sc, reg)		\
@@ -3317,15 +3317,15 @@ alloc_retry:
 
 	if (sc->sc_type >= WM_T_82542_2_1) {
 		evcnt_attach_dynamic(>sc_ev_tx_xoff, EVCNT_TYPE_MISC,
-		NULL, xname, "tx_xoff");
+		NULL, xname, "XOFF Transmitted");
 		evcnt_attach_dynamic(>sc_ev_tx_xon, EVCNT_TYPE_MISC,
-		NULL, xname, "tx_xon");
+		NULL, xname, "XON Transmitted");
 		evcnt_attach_dynamic(>sc_ev_rx_xoff, EVCNT_TYPE_MISC,
-		NULL, xname, "rx_xoff");
+		NULL, xname, "XOFF Received");
 		evcnt_attach_dynamic(>sc_ev_rx_xon, EVCNT_TYPE_MISC,
-		NULL, xname, "rx_xon");
+		NULL, xname, "XON Received");
 		evcnt_attach_dynamic(>sc_ev_rx_macctl, EVCNT_TYPE_MISC,
-		NULL, xname, "rx_macctl");
+		NULL, xname, "FC Received Unsupported");
 	}
 
 	evcnt_attach_dynamic(>sc_ev_scc, EVCNT_TYPE_MISC,
@@ -3370,13 +3370,13 @@ alloc_retry:
 	evcnt_attach_dynamic(>sc_ev_rnbc, EVCNT_TYPE_MISC,
 	NULL, xname, "Rx No Buffers");
 	evcnt_attach_dynamic(>sc_ev_ruc, EVCNT_TYPE_MISC,
-	NULL, xname, "Rx Undersize");
+	NULL, xname, "Rx Undersize (valid CRC)");
 	evcnt_attach_dynamic(>sc_ev_rfc, EVCNT_TYPE_MISC,
-	NULL, xname, "Rx Fragment");
+	NULL, xname, "Rx Fragment (bad CRC)");
 	evcnt_attach_dynamic(>sc_ev_roc, EVCNT_TYPE_MISC,
-	NULL, xname, "Rx Oversize");
+	NULL, xname, "Rx Oversize (valid CRC)");
 	evcnt_attach_dynamic(>sc_ev_rjc, EVCNT_TYPE_MISC,
-	NULL, xname, "Rx Jabber");
+	NULL, xname, "Rx Jabber (bad CRC)");
 	if (sc->sc_type >= WM_T_82540) {
 		evcnt_attach_dynamic(>sc_ev_mgtprc, EVCNT_TYPE_MISC,
 		NULL, xname, "Management Packets RX");
@@ -3409,8 +3409,9 @@ alloc_retry:
 	NULL, xname, "Multicast Packets Tx");
 	evcnt_attach_dynamic(>sc_ev_bptc, EVCNT_TYPE_MISC,
 	NULL, xname, "Broadcast Packets Tx");
-	evcnt_attach_dynamic(>sc_ev_iac, EVCNT_TYPE_MISC,
-	NULL, xname, "Interrupt Assertion");
+	if (sc->sc_type >= WM_T_82571) /* PCIe, 80003 and ICH/PCHs */
+		

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2023-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  8 15:13:10 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82599.c ixgbe_mbx.h ixgbe_type.h ixgbe_vf.c ixgbe_vf.h ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1745):

sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.30
sys/dev/pci/ixgbe/ixv.c: revision 1.184
sys/dev/pci/ixgbe/ixv.c: revision 1.185
sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.32
sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.33
sys/dev/pci/ixgbe/ixgbe.h: revision 1.87
sys/dev/pci/ixgbe/ixgbe.h: revision 1.88
sys/dev/pci/ixgbe/ixgbe.c: revision 1.330
sys/dev/pci/ixgbe/ixgbe.c: revision 1.331
sys/dev/pci/ixgbe/ixgbe.c: revision 1.332
sys/dev/pci/ixgbe/ixgbe_vf.h: revision 1.18
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.101
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.57
sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.20
sys/dev/pci/ixgbe/ixgbe.c: revision 1.327
sys/dev/pci/ixgbe/ixgbe.c: revision 1.328
sys/dev/pci/ixgbe/ixgbe.c: revision 1.329

ixgbe: Reorder some event counters for readability.

ixg(4): Rename some descriptions of event counters.
 - Rename some descriptions from register name to the meaning.
 - For the same meaning's counters, add "(soft)" or "(reg)".
   The former is for a software level counter and the latter is for a
   statistics counter register based.

ixg(4): Count Queue Bytes {Transmit, Receive} counter.

ixg(4): Reorder some flow control related event counters for readability.

ixg(4): Rename some descriptions of flow control related event conters.
Remove obsolete comment.

ixgbe: Fix typo in comment. No functional change.

ixv(4): Improve error check.
 ixgbe_vf.c rev. 1.31 changed the behavior of the ixgbe_check_mac_link_vf()
function. It was from FreeBSD's ixv-1.5.25 to resolve mailbox collision
problem. The change had a problem that error checks have not done at all if
the API version >= 1.5. Fix it. From FreeBSD ixv-1.5.27.

ixv(4): Add new IXGBE_VF_GET_LINK_STATE message support.
 PF can control vf's link state by this change. Note that Linux's PF driver
can't control the link to force up (i.e. ip link set XXX vf Y state enable).
>From FreeBSD ixv-1.5.30.

ixg(4): Update FCTRL after writing multicast filter. Same as other OSes.
 From FreeBSD 395cc55d896654b8f75071e71e856b22aed87da5.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.11 -r1.54.2.12 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.26 -r1.199.2.27 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.9 -r1.56.2.10 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.21.4.4 -r1.21.4.5 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.41.2.8 -r1.41.2.9 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.18.2.6 -r1.18.2.7 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.13.8.3 -r1.13.8.4 src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.125.2.21 -r1.125.2.22 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.11 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.12
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.11	Mon Jan 23 14:04:42 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Sun Oct  8 15:13:09 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.12 2023/10/08 15:13:09 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.12 2023/10/08 15:13:09 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1341,11 +1341,6 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr)
  *  exhaustion are unnecessary, if an mbuf cannot be obtained
  *  it just returns, keeping its placeholder, thus it can simply
  *  be recalled to try again.
- *
- *   XXX NetBSD TODO:
- *- The ixgbe_rxeof() function always preallocates mbuf cluster,
- *  so the ixgbe_refresh_mbufs() function can be simplified.
- *
  /
 static void
 ixgbe_refresh_mbufs(struct rx_ring *rxr, int limit)

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.26 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.27
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.26	Wed Jun 21 19:20:50 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sun Oct  8 15:13:09 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.26 2023/06/21 19:20:50 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.27 2023/10/08 15:13:09 martin Exp 

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2023-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  8 15:13:10 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82599.c ixgbe_mbx.h ixgbe_type.h ixgbe_vf.c ixgbe_vf.h ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1745):

sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.30
sys/dev/pci/ixgbe/ixv.c: revision 1.184
sys/dev/pci/ixgbe/ixv.c: revision 1.185
sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.32
sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.33
sys/dev/pci/ixgbe/ixgbe.h: revision 1.87
sys/dev/pci/ixgbe/ixgbe.h: revision 1.88
sys/dev/pci/ixgbe/ixgbe.c: revision 1.330
sys/dev/pci/ixgbe/ixgbe.c: revision 1.331
sys/dev/pci/ixgbe/ixgbe.c: revision 1.332
sys/dev/pci/ixgbe/ixgbe_vf.h: revision 1.18
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.101
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.57
sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.20
sys/dev/pci/ixgbe/ixgbe.c: revision 1.327
sys/dev/pci/ixgbe/ixgbe.c: revision 1.328
sys/dev/pci/ixgbe/ixgbe.c: revision 1.329

ixgbe: Reorder some event counters for readability.

ixg(4): Rename some descriptions of event counters.
 - Rename some descriptions from register name to the meaning.
 - For the same meaning's counters, add "(soft)" or "(reg)".
   The former is for a software level counter and the latter is for a
   statistics counter register based.

ixg(4): Count Queue Bytes {Transmit, Receive} counter.

ixg(4): Reorder some flow control related event counters for readability.

ixg(4): Rename some descriptions of flow control related event conters.
Remove obsolete comment.

ixgbe: Fix typo in comment. No functional change.

ixv(4): Improve error check.
 ixgbe_vf.c rev. 1.31 changed the behavior of the ixgbe_check_mac_link_vf()
function. It was from FreeBSD's ixv-1.5.25 to resolve mailbox collision
problem. The change had a problem that error checks have not done at all if
the API version >= 1.5. Fix it. From FreeBSD ixv-1.5.27.

ixv(4): Add new IXGBE_VF_GET_LINK_STATE message support.
 PF can control vf's link state by this change. Note that Linux's PF driver
can't control the link to force up (i.e. ip link set XXX vf Y state enable).
>From FreeBSD ixv-1.5.30.

ixg(4): Update FCTRL after writing multicast filter. Same as other OSes.
 From FreeBSD 395cc55d896654b8f75071e71e856b22aed87da5.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.11 -r1.54.2.12 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.26 -r1.199.2.27 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.9 -r1.56.2.10 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.21.4.4 -r1.21.4.5 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.41.2.8 -r1.41.2.9 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.18.2.6 -r1.18.2.7 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.13.8.3 -r1.13.8.4 src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.125.2.21 -r1.125.2.22 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-09-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep  4 17:55:24 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmvar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #344):

sys/dev/pci/if_wmvar.h: revision 1.50
sys/dev/pci/if_wm.c: revision 1.783,1.784 via patch

Delay sending LINK_STATE_UP to prevent dropping packets on I35[04] and I21[01].

 Some (not all) systems use I35[04] or I21[01] don't send packet soon
after linkup. The MAC send a packet to the PHY and any error is not
observed. This behavior causes a problem that gratuitous ARP and/or
IPv6 DAD packet are silently dropped. To avoid this problem, don't
call mii_pollstat() here which will send LINK_STATE_UP notification
to the upper layer. Instead, mii_pollstat() will be called in
wm_gmii_mediastatus() or mii_tick() will be called in wm_tick().

Note that the similar workaround is in Linux's igb driver though it's
only for I21[01].

OK'd by hikaru@ and knakahara@.

Fix #ifdef WM_DEBUG code in wm_gmii_i82544_{read,write}reg_locked.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.16 -r1.645.2.17 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.44.4.5 -r1.44.4.6 src/sys/dev/pci/if_wmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.16 src/sys/dev/pci/if_wm.c:1.645.2.17
--- src/sys/dev/pci/if_wm.c:1.645.2.16	Tue Jun 27 18:32:46 2023
+++ src/sys/dev/pci/if_wm.c	Mon Sep  4 17:55:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.16 2023/06/27 18:32:46 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.17 2023/09/04 17:55:24 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.16 2023/06/27 18:32:46 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.17 2023/09/04 17:55:24 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -550,7 +550,7 @@ struct wm_softc {
 #define	WM_MEDIATYPE_COPPER		0x02
 #define	WM_MEDIATYPE_SERDES		0x03 /* Internal SERDES */
 	int sc_funcid;			/* unit number of the chip (0 to 3) */
-	int sc_flags;			/* flags; see below */
+	u_int sc_flags;			/* flags; see below */
 	int sc_if_flags;		/* last if_flags */
 	int sc_ec_capenable;		/* last ec_capenable */
 	int sc_flowflags;		/* 802.3x flow control flags */
@@ -722,6 +722,7 @@ struct wm_softc {
 	int sc_tbi_linkup;		/* TBI link status */
 	int sc_tbi_serdes_anegticks;	/* autonegotiation ticks */
 	int sc_tbi_serdes_ticks;	/* tbi ticks */
+	struct timeval sc_linkup_delay_time; /* delay LINK_STATE_UP */
 
 	int sc_mchash_type;		/* multicast filter offset */
 
@@ -3084,6 +3085,23 @@ alloc_retry:
 	|| (sc->sc_type == WM_T_I210) || (sc->sc_type == WM_T_I211))
 		sc->sc_flags |= WM_F_CRC_STRIP;
 
+	/*
+	 * Workaround for some chips to delay sending LINK_STATE_UP.
+	 * Some systems can't send packet soon after linkup. See also
+	 * wm_linkintr_gmii(), wm_tick() and wm_gmii_mediastatus().
+	 */
+	switch (sc->sc_type) {
+	case WM_T_I350:
+	case WM_T_I354:
+	case WM_T_I210:
+	case WM_T_I211:
+		if (sc->sc_mediatype == WM_MEDIATYPE_COPPER)
+			sc->sc_flags |= WM_F_DELAY_LINKUP;
+		break;
+	default:
+		break;
+	}
+
 	/* Set device properties (macflags) */
 	prop_dictionary_set_uint32(dict, "macflags", sc->sc_flags);
 
@@ -3877,9 +3895,29 @@ wm_tick(void *arg)
 
 	wm_update_stats(sc);
 
-	if (sc->sc_flags & WM_F_HAS_MII)
-		mii_tick(>sc_mii);
-	else if ((sc->sc_type >= WM_T_82575) && (sc->sc_type <= WM_T_I211)
+	if (sc->sc_flags & WM_F_HAS_MII) {
+		bool dotick = true;
+
+		/*
+		 * Workaround for some chips to delay sending LINK_STATE_UP.
+		 * See also wm_linkintr_gmii() and wm_gmii_mediastatus().
+		 */
+		if ((sc->sc_flags & WM_F_DELAY_LINKUP) != 0) {
+			struct timeval now;
+
+			getmicrotime();
+			if (timercmp(, >sc_linkup_delay_time, <))
+dotick = false;
+			else if (sc->sc_linkup_delay_time.tv_sec != 0) {
+/* Simplify by checking tv_sec only. */
+
+sc->sc_linkup_delay_time.tv_sec = 0;
+sc->sc_linkup_delay_time.tv_usec = 0;
+			}
+		}
+		if (dotick)
+			mii_tick(>sc_mii);
+	} else if ((sc->sc_type >= WM_T_82575) && (sc->sc_type <= WM_T_I211)
 	&& (sc->sc_mediatype == WM_MEDIATYPE_SERDES))
 		wm_serdes_tick(sc);
 	else
@@ -10266,6 +10304,7 @@ wm_linkintr_gmii(struct wm_softc *sc, ui
 	device_t dev = sc->sc_dev;
 	uint32_t status, reg;
 	bool link;
+	bool dopoll = true;
 	int rv;
 
 	KASSERT(WM_CORE_LOCKED(sc));
@@ -10312,7 +10351,46 @@ wm_linkintr_gmii(struct wm_softc *sc, ui
 
 	DPRINTF(sc, WM_DEBUG_LINK, ("%s: LINK: LSC -> mii_pollstat\n",
 		device_xname(dev)));
-	mii_pollstat(>sc_mii);
+	if ((sc->sc_flags & WM_F_DELAY_LINKUP) != 0) {
+		if (link) {
+			/*
+			 * To workaround the problem, it's required to wait
+			 * several hundred miliseconds. The time depend
+			 * on the 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-09-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep  4 17:55:24 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmvar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #344):

sys/dev/pci/if_wmvar.h: revision 1.50
sys/dev/pci/if_wm.c: revision 1.783,1.784 via patch

Delay sending LINK_STATE_UP to prevent dropping packets on I35[04] and I21[01].

 Some (not all) systems use I35[04] or I21[01] don't send packet soon
after linkup. The MAC send a packet to the PHY and any error is not
observed. This behavior causes a problem that gratuitous ARP and/or
IPv6 DAD packet are silently dropped. To avoid this problem, don't
call mii_pollstat() here which will send LINK_STATE_UP notification
to the upper layer. Instead, mii_pollstat() will be called in
wm_gmii_mediastatus() or mii_tick() will be called in wm_tick().

Note that the similar workaround is in Linux's igb driver though it's
only for I21[01].

OK'd by hikaru@ and knakahara@.

Fix #ifdef WM_DEBUG code in wm_gmii_i82544_{read,write}reg_locked.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.16 -r1.645.2.17 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.44.4.5 -r1.44.4.6 src/sys/dev/pci/if_wmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 23 17:14:32 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c ismt.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1723):

sys/dev/pci/ichsmb.c: revision 1.85
sys/dev/pci/ismt.c: revision 1.11

ichsmb(4),ismt(4): Add Snow Ridge support.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.5 -r1.60.4.6 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.6 -r1.6.12.1 src/sys/dev/pci/ismt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Aug 23 17:14:32 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c ismt.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1723):

sys/dev/pci/ichsmb.c: revision 1.85
sys/dev/pci/ismt.c: revision 1.11

ichsmb(4),ismt(4): Add Snow Ridge support.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.5 -r1.60.4.6 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.6 -r1.6.12.1 src/sys/dev/pci/ismt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.60.4.5 src/sys/dev/pci/ichsmb.c:1.60.4.6
--- src/sys/dev/pci/ichsmb.c:1.60.4.5	Sat Jul 29 10:52:20 2023
+++ src/sys/dev/pci/ichsmb.c	Wed Aug 23 17:14:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.60.4.5 2023/07/29 10:52:20 martin Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.60.4.6 2023/08/23 17:14:32 martin Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.5 2023/07/29 10:52:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.6 2023/08/23 17:14:32 martin Exp $");
 
 #include 
 #include 
@@ -137,6 +137,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_GLK_SMB:
 		case PCI_PRODUCT_INTEL_EHL_SMB:
 		case PCI_PRODUCT_INTEL_JSL_SMB:
+		case PCI_PRODUCT_INTEL_SNR_SMB_LEGACY:
 		case PCI_PRODUCT_INTEL_ADL_N_SMB:
 		case PCI_PRODUCT_INTEL_C600_SMBUS:
 		case PCI_PRODUCT_INTEL_C600_SMB_0:

Index: src/sys/dev/pci/ismt.c
diff -u src/sys/dev/pci/ismt.c:1.6 src/sys/dev/pci/ismt.c:1.6.12.1
--- src/sys/dev/pci/ismt.c:1.6	Thu Aug 17 01:24:09 2017
+++ src/sys/dev/pci/ismt.c	Wed Aug 23 17:14:32 2023
@@ -60,7 +60,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ismt/ismt.c 266474 2014-05-20 19:55:06Z jimharris $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.6 2017/08/17 01:24:09 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ismt.c,v 1.6.12.1 2023/08/23 17:14:32 martin Exp $");
 
 #include 
 #include 
@@ -802,6 +802,7 @@ ismt_match(device_t parent, cfdata_t mat
 	case PCI_PRODUCT_INTEL_S1200_SMBUS_1:
 	case PCI_PRODUCT_INTEL_C2000_SMBUS:
 	case PCI_PRODUCT_INTEL_C3K_SMBUS:
+	case PCI_PRODUCT_INTEL_SNR_SMB_HOST:
 		break;
 	default:
 		return 0;



CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:17:30 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1721):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.14.16.2 -r1.14.16.3 src/sys/dev/pci/sdhc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/sdhc_pci.c
diff -u src/sys/dev/pci/sdhc_pci.c:1.14.16.2 src/sys/dev/pci/sdhc_pci.c:1.14.16.3
--- src/sys/dev/pci/sdhc_pci.c:1.14.16.2	Wed Jan 18 19:26:30 2023
+++ src/sys/dev/pci/sdhc_pci.c	Tue Aug 22 16:17:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.14.16.2 2023/01/18 19:26:30 martin Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.14.16.3 2023/08/22 16:17:29 martin Exp $	*/
 /*	$OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.14.16.2 2023/01/18 19:26:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.14.16.3 2023/08/22 16:17:29 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -155,7 +155,8 @@ static const struct sdhc_pci_quirk {
 		0x,
 		0x,
 		~0,
-		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
 	},
 
 	{
@@ -166,6 +167,97 @@ static const struct sdhc_pci_quirk {
 		~0,
 		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
 	},
+
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_C3K_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC2,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_APL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_GLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_3HS_U_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_495_YU_PCIE_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_CMTLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_JSL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_EHL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
 };
 
 static void sdhc_pci_quirk_ti_hack(struct pci_attach_args *);



CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 22 16:17:30 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1721):

sys/dev/pci/sdhc_pci.c: revision 1.21

Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.

This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.14.16.2 -r1.14.16.3 src/sys/dev/pci/sdhc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 21 12:37:04 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen (for ticket #1719)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.17 -r1.1371.2.18 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.17 -r1.1370.2.18 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 21 12:37:04 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen (for ticket #1719)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.17 -r1.1371.2.18 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.17 -r1.1370.2.18 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 21 12:32:26 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1719):

sys/dev/pci/pcidevs: revision 1.1483-1.1492

Add AMD 19h/7xh Root Complex.
pcidevs: add ASMedia ASM106x

Add Intel Snow Ridge devices.

Fix some descriptions of Intel Snow Ridge.

Add Intel I226 devices.

Add device ids of the VX800 chipset and s3 chrome 500 series GPU.
Descriptions mainly aligned with VX800/820 Series System Programming Manual.
fix duplicate definition.

Add some Intel Xeon D-2100 devices. Fix description of Intel 0x37d0.

Simplify descriptions of Snow Ridge internal Ethernet devices.

Rename PCI to PCIE for naming consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.17 -r1.1383.2.18 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.17 src/sys/dev/pci/pcidevs:1.1383.2.18
--- src/sys/dev/pci/pcidevs:1.1383.2.17	Sat Jul 29 10:30:37 2023
+++ src/sys/dev/pci/pcidevs	Mon Aug 21 12:32:25 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.17 2023/07/29 10:30:37 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.18 2023/08/21 12:32:25 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1100,6 +1100,7 @@ product AMD F19_6X_DF_4		0x14e4	19h/6xh 
 product AMD F19_6X_DF_5		0x14e5	19h/6xh Data Fabric 5
 product AMD F19_6X_DF_6		0x14e6	19h/6xh Data Fabric 6
 product AMD F19_6X_DF_7		0x14e7	19h/6xh Data Fabric 7
+product AMD F19_7X_RC		0x14e8	19h/7xh Root Complex
 product AMD F17_AX_XHCI_0	0x1503	17h/Axh USB 3.1 xHCI
 product AMD F17_AX_XHCI_1	0x1504	17h/Axh USB 3.1 xHCI
 product AMD F17_AX_USB_BIOM	0x1505	17h/Axh Secure USB BIOmetric
@@ -1509,6 +1510,7 @@ product ASMEDIA ASM1061_01	0x0601	ASM106
 product ASMEDIA ASM1061_02	0x0602	ASM1061 AHCI SATA III Controller
 product ASMEDIA ASM1061_11	0x0611	ASM1061 AHCI SATA III Controller
 product ASMEDIA ASM1061_12	0x0612	ASM1061 AHCI SATA III Controller
+product ASMEDIA ASM106X		0x0625	ASM106x AHCI SATA III Controller
 product	ASMEDIA	ASM1042		0x1042	ASM1042 USB 3.0 Host Controller
 product ASMEDIA ASM1083		0x1080	ASM1083/1085 PCIe-PCI Bridge
 product	ASMEDIA	ASM1042A	0x1142	ASM1042A USB 3.0 Host Controller
@@ -3875,6 +3877,13 @@ product INTEL WIFI_LINK_7265_2	0x095b	Du
 product INTEL X1000_LB		0x095e	Quark X1000 Legacy Bridge
 product INTEL 80960RM		0x0962	i960 RM PCI-PCI
 product INTEL 80960RN		0x0964	i960 RN PCI-PCI
+product INTEL SNR_IEH		0x0998	Snow Ridge IEH
+product INTEL SNR_M2IIO_VTD	0x09a2	Snow Ridge Mesh2IIO MMAP/VT-d
+product INTEL SNR_M2IIO_RAS	0x09a3	Snow Ridge Mesh2IIO RAS
+product INTEL SNR_M2IIO_PMU	0x09a4	Snow Ridge Mesh2IIO PMU/PMON
+product INTEL SNR_M2IIO_DFX	0x09a5	Snow Ridge Mesh2IIO DFx
+product INTEL SNR_PECI_OOB_MSM	0x09a6	Snow Ridge PECI OOB-MSM
+product INTEL SNR_PECI_OOB_MSM_PMU 0x09a7 Snow Ridge PECI OOB-MSM PMU
 product INTEL CORE4G_D_ULT_GT1	0x0a02	HD Graphics
 product INTEL CORE4G_M_HOST_DRAM 0x0a04	Core 4G (mobile) Host Bridge, DRAM
 product INTEL CORE4G_M_ULT_GT1	0x0a06	HD Graphics (GT1)
@@ -3895,6 +3904,7 @@ product INTEL CORE4G_R_ULT_GT3_2 0x0a2e	
 product INTEL DC_P3520_SSD	0x0a53	SSD DC P3520
 product INTEL DC_P4500_SSD	0x0a54	SSD DC P4500
 product INTEL DC_P4600_SSD	0x0a55	SSD DC P4600
+product INTEL SNR_DMA		0x0b00	Snow Ridge DMA
 product INTEL HASWELL_HOST_DRAM	0x0c00	Haswell Host Bridge, DRAM
 product INTEL HASWELL_PCIE16	0x0c01	Haswell PCI-E x16 Controller
 product INTEL HASWELL_PCIE8	0x0c05	Haswell PCI-E x8 Controller
@@ -4236,6 +4246,9 @@ product INTEL 82441FX		0x1237	82441FX (P
 product INTEL 82380AB		0x123c	82380AB (MISA) Mobile PCI-ISA Bridge
 product INTEL 82380FB		0x124b	82380FB (MPCI2) Mobile PCI-PCI Bridge
 product INTEL 82439HX		0x1250	82439HX (TXC) System Controller
+product INTEL I226_LM		0x125b	I226-LM Ethernet
+product INTEL I226_V		0x125c	I226-V Ethernet
+product INTEL I226_IT		0x125d	I226-IT Ethernet
 product INTEL C3K_X553_10G	0x1306	C3000 X553 10G Ethernet
 product INTEL C3K_X553_1G	0x1307	C3000 X553 1G Ethernet
 product INTEL 82870P2_PPB	0x1460	82870P2 P64H2 PCI-PCI Bridge
@@ -4376,6 +4389,43 @@ product INTEL CORE5G_M_GT2_1	0x1616	HD G
 product INTEL CORE5G_M_GT2_2	0x161e	HD Graphics 5300
 product INTEL CORE5G_M_GT3_15W	0x1626	HD Graphics 6000
 product INTEL CORE5G_M_GT3_28W	0x162b	Iris Graphics 6100
+product INTEL SNR_E882_C_BP	0x1890	E882-C for backplane
+product INTEL SNR_E882_C_QSFP	0x1891	E882-C for QSFP
+product INTEL SNR_E882_C_SFP	0x1892	E882-C for SFP
+product INTEL SNR_E882_C_10GT	0x1893	E882-C/X557-AT 10GBASE-T
+product INTEL SNR_E882_C_1G	0x1894	E882-C 1G
+product INTEL SNR_E882_X	0x1895	E882-X (for BMSM)
+product INTEL SNR_E882_L_BP	0x1897	E882-L for backplane
+product INTEL SNR_E882_L_SFP	0x1898	E882-L for SFP
+product INTEL 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-08-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 21 12:32:26 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1719):

sys/dev/pci/pcidevs: revision 1.1483-1.1492

Add AMD 19h/7xh Root Complex.
pcidevs: add ASMedia ASM106x

Add Intel Snow Ridge devices.

Fix some descriptions of Intel Snow Ridge.

Add Intel I226 devices.

Add device ids of the VX800 chipset and s3 chrome 500 series GPU.
Descriptions mainly aligned with VX800/820 Series System Programming Manual.
fix duplicate definition.

Add some Intel Xeon D-2100 devices. Fix description of Intel 0x37d0.

Simplify descriptions of Snow Ridge internal Ethernet devices.

Rename PCI to PCIE for naming consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.17 -r1.1383.2.18 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-07-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jul 29 10:52:20 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c

Log Message:
Pull up the following revisions, via patch, requested by msaitoh in
ticket #1672:

sys/dev/pci/ichsmb.c1.83-1.84

- Add support Intel 700 series chipset and Alder Lake-N devices.
- Use device_printf() instead of aprint_error_dev() in
  ichsmb_i2c_exec().


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.4 -r1.60.4.5 src/sys/dev/pci/ichsmb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.60.4.4 src/sys/dev/pci/ichsmb.c:1.60.4.5
--- src/sys/dev/pci/ichsmb.c:1.60.4.4	Sat Oct 15 10:29:40 2022
+++ src/sys/dev/pci/ichsmb.c	Sat Jul 29 10:52:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.60.4.4 2022/10/15 10:29:40 martin Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.60.4.5 2023/07/29 10:52:20 martin Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.4 2022/10/15 10:29:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.5 2023/07/29 10:52:20 martin Exp $");
 
 #include 
 #include 
@@ -137,6 +137,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_GLK_SMB:
 		case PCI_PRODUCT_INTEL_EHL_SMB:
 		case PCI_PRODUCT_INTEL_JSL_SMB:
+		case PCI_PRODUCT_INTEL_ADL_N_SMB:
 		case PCI_PRODUCT_INTEL_C600_SMBUS:
 		case PCI_PRODUCT_INTEL_C600_SMB_0:
 		case PCI_PRODUCT_INTEL_C600_SMB_1:
@@ -154,6 +155,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_5HS_LP_SMB:
 		case PCI_PRODUCT_INTEL_6HS_H_SMB:
 		case PCI_PRODUCT_INTEL_6HS_LP_SMB:
+		case PCI_PRODUCT_INTEL_7HS_SMB:
 			return 1;
 		}
 	}
@@ -439,7 +441,7 @@ timeout:
 	st = bus_space_read_1(sc->sc_iot, sc->sc_ioh, LPCIB_SMB_HS);
 	if ((st & LPCIB_SMB_HS_FAILED) == 0) {
 		snprintb(fbuf, sizeof(fbuf), LPCIB_SMB_HS_BITS, st);
-		aprint_error_dev(sc->sc_dev, "abort failed, status %s\n",
+		device_printf(sc->sc_dev, "abort failed, status %s\n",
 		fbuf);
 	}
 	bus_space_write_1(sc->sc_iot, sc->sc_ioh, LPCIB_SMB_HS, st);



CVS commit: [netbsd-9] src/sys/dev/pci

2023-07-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jul 29 10:52:20 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c

Log Message:
Pull up the following revisions, via patch, requested by msaitoh in
ticket #1672:

sys/dev/pci/ichsmb.c1.83-1.84

- Add support Intel 700 series chipset and Alder Lake-N devices.
- Use device_printf() instead of aprint_error_dev() in
  ichsmb_i2c_exec().


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.4 -r1.60.4.5 src/sys/dev/pci/ichsmb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-07-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jul 29 10:30:37 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up the following revisions, via patch, requested by msaitoh in
ticket #1671:

sys/dev/pci/pcidevs 1.1481-1.1482

Add Intel Alder Lake-N, Raptor Lake and 700 series chipset devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.16 -r1.1383.2.17 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.16 src/sys/dev/pci/pcidevs:1.1383.2.17
--- src/sys/dev/pci/pcidevs:1.1383.2.16	Wed Jun 21 22:20:31 2023
+++ src/sys/dev/pci/pcidevs	Sat Jul 29 10:30:37 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.16 2023/06/21 22:20:31 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.17 2023/07/29 10:30:37 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5870,8 +5870,11 @@ product INTEL ADL_U9_2_4_HOST	0x460a	Ald
 product INTEL ADL_PCIE_RP_0	0x460d	Alder Lake PCIe G5 Root Port 0 (x16)
 product INTEL ADL_XDCI		0x460e	Alder Lake USB-C Device (xDCI)
 product INTEL ADL_S_2_0_HOST	0x4610	Alder Lake (S,2+0) Host
+product INTEL ADL_N_8_HOST	0x4617	Alder Lake-N (0+8) Host
 product INTEL ADL_U15_1_4_HOST	0x4619	Alder Lake (U15,1+4) Host
 product INTEL ADL_U9_1_4_HOST	0x461a	Alder Lake (U9,1+4) Host
+product INTEL ADL_N_4_N2_HOST	0x461b	Alder Lake-N (0+4, N200) Host
+product INTEL ADL_N_4_N1_HOST	0x461c	Alder Lake-N (0+4, N100) Host
 product INTEL ADL_DTT		0x461d	Alder Lake Dynamic Tuning Technology
 product INTEL ADL_XHCI		0x461e	Alder Lake USB-C Host (xHCI)
 product INTEL ADL_TBT_PCIE_3	0x461f	Alder Lake Thunderbolt PCIe 3
@@ -5880,6 +5883,7 @@ product INTEL ADL_HX_4_8_HOST	0x4623	Ald
 product INTEL ADL_H_4_4_HOST	0x4629	Alder Lake (H,4+4) Host
 product INTEL ADL_HX_4_4_HOST	0x462b	Alder Lake (HX,4+4) Host
 product INTEL ADL_PCIE_RP_1	0x462d	Alder Lake PCIe G5 Root Port 1 (x8)
+product INTEL ADL_N_IPU		0x462e	Alder Lake-N Image Processing Unit
 product INTEL ADL_TBT_PCIE_2	0x462f	Alder Lake Thunderbolt PCIe 2
 product INTEL ADL_S_4_0_HOST	0x4630	Alder Lake (S,4+0) Host
 product INTEL ADL_HX_8_8_HOST	0x4637	Alder Lake (HX,8+8) Host
@@ -5891,15 +5895,18 @@ product INTEL ADL_H_6_8_HOST	0x4641	Alde
 product INTEL ADL_S_6_4_HOST	0x4648	Alder Lake (S,6+4) Host
 product INTEL ADL_H_6_4_HOST	0x4649	Alder Lake (H,6+4) Host
 product INTEL ADL_PCIE_RP_2	0x464d	Alder Lake PCIe G4 Root Port 2 (x4)
+product INTEL ADL_N_XHCI	0x464e	Alder Lake-N USB Host (xHCI)
 product INTEL ADL_GNA		0x464f	Alder Lake Gauss Newton Algorithm
 product INTEL ADL_S_6_0_HOST	0x4650	Alder Lake (S,6+0) Host
 product INTEL ADL_IPU		0x465d	Alder Lake Image Processing Unit
+product INTEL ADL_N_XDCI	0x465e	Alder Lake-N USB Device (xDCI)
 product INTEL ADL_S_8_8_HOST	0x4660	Alder Lake (S,8+8) Host
 product INTEL ADL_S_8_4_HOST	0x4668	Alder Lake (S,8+4) Host
 product INTEL ADL_TBTDMA_1	0x466d	Alder Lake Thunderbolt DMA 1
 product INTEL ADL_TBT_PCIE_0	0x466e	Alder Lake Thunderbolt PCIe 0
-product INTEL ADL_TRACE		0x466f	Alder Lake Trace Hub (Compute Die?XXX)
+product INTEL ADL_TRACE		0x466f	Alder Lake Trace Hub (Compute Die)
 product INTEL ADL_CLSRAM	0x467d	Alder Lake Crash Log & Telemetry
+product INTEL ADL_N_GNA		0x467e	Alder Lake-N Gauss Newton Algorithm
 product INTEL ADL_VMD		0x467f	Alder Lake Volume Management Device
 product INTEL ADL_IGD_1		0x4680	Alder Lake Graphics (32EU)
 product INTEL ADL_IGD_2		0x4682	Alder Lake Graphics (24EU)
@@ -5914,6 +5921,8 @@ product INTEL ADL_IGD_10	0x46a8	Alder La
 product INTEL ADL_IGD_11	0x46aa	Alder Lake Graphics
 product INTEL ADL_IGD_12	0x46b3	Alder Lake Graphics
 product INTEL ADL_IGD_13	0x46c3	Alder Lake Graphics
+product INTEL ADL_N_IGD_1	0x46d0	Alder Lake Graphics (32EU)
+product INTEL ADL_N_IGD_2	0x46d1	Alder Lake Graphics (24EU)
 product INTEL EHL_ESPI		0x4b00	Elkhart Lake eSPI
 product INTEL EHL_P2SB		0x4b20	Elkhart Lake P2SB
 product INTEL EHL_PMC		0x4b21	Elkhart Lake PMC
@@ -6098,6 +6107,7 @@ product INTEL EP80579_LAN_1	0x5040	EP805
 product INTEL EP80579_LAN_2	0x5044	EP80579 LAN
 product INTEL EP80579_LAN_3	0x5048	EP80579 LAN
 product INTEL 6HS_LP_ESPI	0x5182	600 Series PCH-LP eSPI
+product INTEL 7HS_P_ESPI	0x519d	700 Series PCH-P eSPI
 product INTEL 6HS_LP_P2SB	0x51a0	600 Series PCH-LP P2SB
 product INTEL 6HS_LP_PMC	0x51a1	600 Series PCH-LP PMC
 product INTEL 6HS_LP_SMB	0x51a3	600 Series PCH-LP SMBus
@@ -6123,6 +6133,7 @@ product INTEL 6HS_LP_I2C_4	0x51c5	600 Se
 product INTEL 6HS_LP_I2C_5	0x51c6	600 Series PCH-LP I2C 5
 product INTEL 6HS_LP_UART_2	0x51c7	600 Series PCH-LP UART 2
 product INTEL 6HS_LP_HDA	0x51c8	600 Series PCH-LP HD Audio
+product INTEL 7HS_P_HDA		0x51ca	700 Series PCH HD Audio
 product INTEL 6HS_LP_THC_0	0x51d0	600 Series PCH-LP THC 0
 product INTEL 6HS_LP_THC_1	0x51d1	600 Series PCH-LP THC 1
 product 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-07-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jul 29 10:32:07 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen (ticket #1671)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.16 -r1.1371.2.17 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.16 -r1.1370.2.17 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-07-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jul 29 10:30:37 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up the following revisions, via patch, requested by msaitoh in
ticket #1671:

sys/dev/pci/pcidevs 1.1481-1.1482

Add Intel Alder Lake-N, Raptor Lake and 700 series chipset devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.16 -r1.1383.2.17 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-06-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 27 18:32:46 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Pull up the following revisions, requested by msaitoh in #1656:

sys/dev/pci/if_wm.c 1.768-1.782 via patch
sys/dev/pci/if_wmreg.h  1.129-1.130
sys/dev/pci/if_wmvar.h  1.49

wm(4):
- Rework for event counters:
  - Fix calculation of GORC, GOTC, TOR and TOT counters correctly.
  - Rearrange the order of the registers so that they are roughly
in ascending order.
  - Reorder evcnt_attach_dynamic(), WM_EVCNT_ADD() and evcnt_detach()
to match.
  - IC{TX,RX}*C registers are for older than 82575.
  - Fix a bug that the transmit underrun counter is incorrectly
counted.
  - Don't add "Count" for event counter's description.
  - Some statistics registers were replaced with new counters on newer
chips. Treat 0x403c(CEXTERR->HTDPMC), 0x40fc(TSCTFC->CBRMPC),
0x4124(ICRXOC->HTCBDPC) and from 0x4104 to 0x4124.
  - Add some new counters:
- Circuit Breaker TX Manageability Packet
- Circuit Breaker RX Dropped Packet
- Host Good Octets RX
- Host Good Octets TX
- Length Errors
- SerDes/SGMII Code Violation Packet
- Header Redirection Missed Packet
- EEE TX LPI
- EEE RX LPI
  - Fix prc511's comment and description.
- Add SOICZIFDATA (ifconfig -z) support for evcnt(9).
- Use WM_IS_ICHPCH(). No functional change.
- Fix typo. s/ictxact/ictxatc/. No functional change.
- Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.15 -r1.645.2.16 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.7 -r1.115.2.8 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.44.4.4 -r1.44.4.5 src/sys/dev/pci/if_wmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.15 src/sys/dev/pci/if_wm.c:1.645.2.16
--- src/sys/dev/pci/if_wm.c:1.645.2.15	Mon Jan 23 13:59:04 2023
+++ src/sys/dev/pci/if_wm.c	Tue Jun 27 18:32:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.15 2023/01/23 13:59:04 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.16 2023/06/27 18:32:46 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.15 2023/01/23 13:59:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.16 2023/06/27 18:32:46 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -598,10 +598,10 @@ struct wm_softc {
 	struct evcnt sc_ev_linkintr;	/* Link interrupts */
 
 	/* >= WM_T_82542_2_1 */
-	struct evcnt sc_ev_tx_xoff;	/* Tx PAUSE(!0) frames */
+	struct evcnt sc_ev_rx_xon;	/* Rx PAUSE(0) frames */
 	struct evcnt sc_ev_tx_xon;	/* Tx PAUSE(0) frames */
 	struct evcnt sc_ev_rx_xoff;	/* Rx PAUSE(!0) frames */
-	struct evcnt sc_ev_rx_xon;	/* Rx PAUSE(0) frames */
+	struct evcnt sc_ev_tx_xoff;	/* Tx PAUSE(!0) frames */
 	struct evcnt sc_ev_rx_macctl;	/* Rx Unsupported */
 
 	struct evcnt sc_ev_crcerrs;	/* CRC Error */
@@ -609,15 +609,29 @@ struct wm_softc {
 	struct evcnt sc_ev_symerrc;	/* Symbol Error */
 	struct evcnt sc_ev_rxerrc;	/* Receive Error */
 	struct evcnt sc_ev_mpc;		/* Missed Packets */
-	struct evcnt sc_ev_colc;	/* Collision */
-	struct evcnt sc_ev_sec;		/* Sequence Error */
-	struct evcnt sc_ev_cexterr;	/* Carrier Extension Error */
-	struct evcnt sc_ev_rlec;	/* Receive Length Error */
 	struct evcnt sc_ev_scc;		/* Single Collision */
 	struct evcnt sc_ev_ecol;	/* Excessive Collision */
 	struct evcnt sc_ev_mcc;		/* Multiple Collision */
 	struct evcnt sc_ev_latecol;	/* Late Collision */
+	struct evcnt sc_ev_colc;	/* Collision */
+	struct evcnt sc_ev_cbtmpc;	/* Circuit Breaker Tx Mng. Packet */
 	struct evcnt sc_ev_dc;		/* Defer */
+	struct evcnt sc_ev_tncrs;	/* Tx-No CRS */
+	struct evcnt sc_ev_sec;		/* Sequence Error */
+
+	/* Old */
+	struct evcnt sc_ev_cexterr;	/* Carrier Extension Error */
+	/* New */
+	struct evcnt sc_ev_htdpmc;	/* Host Tx Discarded Pkts by MAC */
+
+	struct evcnt sc_ev_rlec;	/* Receive Length Error */
+	struct evcnt sc_ev_cbrdpc;	/* Circuit Breaker Rx Dropped Packet */
+	struct evcnt sc_ev_prc64;	/* Packets Rx (64 bytes) */
+	struct evcnt sc_ev_prc127;	/* Packets Rx (65-127 bytes) */
+	struct evcnt sc_ev_prc255;	/* Packets Rx (128-255 bytes) */
+	struct evcnt sc_ev_prc511;	/* Packets Rx (256-511 bytes) */
+	struct evcnt sc_ev_prc1023;	/* Packets Rx (512-1023 bytes) */
+	struct evcnt sc_ev_prc1522;	/* Packets Rx (1024-1522 bytes) */
 	struct evcnt sc_ev_gprc;	/* Good Packets Rx */
 	struct evcnt sc_ev_bprc;	/* Broadcast Packets Rx */
 	struct evcnt sc_ev_mprc;	/* Multicast Packets Rx */
@@ -629,44 +643,62 @@ struct wm_softc {
 	struct evcnt sc_ev_rfc;		/* Rx Fragment */
 	struct evcnt sc_ev_roc;		/* Rx 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-06-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 27 18:32:46 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Pull up the following revisions, requested by msaitoh in #1656:

sys/dev/pci/if_wm.c 1.768-1.782 via patch
sys/dev/pci/if_wmreg.h  1.129-1.130
sys/dev/pci/if_wmvar.h  1.49

wm(4):
- Rework for event counters:
  - Fix calculation of GORC, GOTC, TOR and TOT counters correctly.
  - Rearrange the order of the registers so that they are roughly
in ascending order.
  - Reorder evcnt_attach_dynamic(), WM_EVCNT_ADD() and evcnt_detach()
to match.
  - IC{TX,RX}*C registers are for older than 82575.
  - Fix a bug that the transmit underrun counter is incorrectly
counted.
  - Don't add "Count" for event counter's description.
  - Some statistics registers were replaced with new counters on newer
chips. Treat 0x403c(CEXTERR->HTDPMC), 0x40fc(TSCTFC->CBRMPC),
0x4124(ICRXOC->HTCBDPC) and from 0x4104 to 0x4124.
  - Add some new counters:
- Circuit Breaker TX Manageability Packet
- Circuit Breaker RX Dropped Packet
- Host Good Octets RX
- Host Good Octets TX
- Length Errors
- SerDes/SGMII Code Violation Packet
- Header Redirection Missed Packet
- EEE TX LPI
- EEE RX LPI
  - Fix prc511's comment and description.
- Add SOICZIFDATA (ifconfig -z) support for evcnt(9).
- Use WM_IS_ICHPCH(). No functional change.
- Fix typo. s/ictxact/ictxatc/. No functional change.
- Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.15 -r1.645.2.16 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.7 -r1.115.2.8 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.44.4.4 -r1.44.4.5 src/sys/dev/pci/if_wmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 22:21:57 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1654


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.15 -r1.1371.2.16 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.15 -r1.1370.2.16 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 22:20:31 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1654):

sys/dev/pci/pcidevs: revision 1.1478
sys/dev/pci/pcidevs: revision 1.1479
sys/dev/pci/pcidevs: revision 1.1480

Add Samsung SM990.

Add devices from PPR for AMD Family 19h Model 61h Revision B1 processors.

The SATA device ID for Apollo Lake is not 0x5ae0 but 0x5ae3.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.15 -r1.1383.2.16 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.15 src/sys/dev/pci/pcidevs:1.1383.2.16
--- src/sys/dev/pci/pcidevs:1.1383.2.15	Mon Jan 30 11:32:22 2023
+++ src/sys/dev/pci/pcidevs	Wed Jun 21 22:20:31 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.15 2023/01/30 11:32:22 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.16 2023/06/21 22:20:31 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1087,6 +1087,19 @@ product AMD F19_1X_PSP		0x14ca	19h/1xh P
 product AMD F19_1X_ACP		0x14cb	19h/1xh ACP
 product AMD F19_1X_HDA		0x14cc	19h/1xh HD Audio
 product AMD F19_6X_RC		0x14d8	19h/6xh Root Complex
+product AMD F19_6X_IOMMU	0x14d9	19h/6xh IOMMU
+product AMD F19_6X_PCIE_DUMMY_HB 0x14da	19h/6xh PCIe Dummy Host Bridge
+product AMD F19_6X_GPPB		0x14db	19h/6xh PCIe GPP Bridge
+product AMD F19_6X_INTNL_GPPB	0x14dd	19h/6xh Internal PCIe GPP Bridge
+product AMD F19_6X_PCIE_DUMMY	0x14de	19h/6xh PCIe Dummy Function
+product AMD F19_6X_DF_0		0x14e0	19h/6xh Data Fabric 0
+product AMD F19_6X_DF_1		0x14e1	19h/6xh Data Fabric 1
+product AMD F19_6X_DF_2		0x14e2	19h/6xh Data Fabric 2
+product AMD F19_6X_DF_3		0x14e3	19h/6xh Data Fabric 3
+product AMD F19_6X_DF_4		0x14e4	19h/6xh Data Fabric 4
+product AMD F19_6X_DF_5		0x14e5	19h/6xh Data Fabric 5
+product AMD F19_6X_DF_6		0x14e6	19h/6xh Data Fabric 6
+product AMD F19_6X_DF_7		0x14e7	19h/6xh Data Fabric 7
 product AMD F17_AX_XHCI_0	0x1503	17h/Axh USB 3.1 xHCI
 product AMD F17_AX_XHCI_1	0x1504	17h/Axh USB 3.1 xHCI
 product AMD F17_AX_USB_BIOM	0x1505	17h/Axh Secure USB BIOmetric
@@ -1135,6 +1148,9 @@ product AMD F15_7X_DRAM		0x15b2	15h/7xh 
 product AMD F15_7X_NB		0x15b3	15h/7xh North Bridge Configuration
 product AMD F15_7X_CSTATE	0x15b4	15h/7xh CPU C-state Configuration
 product AMD F15_7X_MISC		0x15b5	15h/7xh Miscellaneous Configuration
+product AMD F19_6X_XHCI_0	0x15b6	19h/6xh USB 3.1 xHCI
+product AMD F19_6X_XHCI_1	0x15b7	19h/6xh USB 3.1 xHCI
+product AMD F19_6X_USB_BIOM	0x15b8	19h/6xh Secure USB BIOmetric
 product AMD F17_1X_RC		0x15d0	Family17h/1xh Root Complex
 product AMD F17_1X_IOMMU	0x15d1	Family17h/1xh IOMMU
 product AMD F17_1X_PCIE_1	0x15d3	Family17h/1xh PCIe
@@ -1178,6 +1194,7 @@ product AMD F17_9X_HB		0x1645	17h/9xh Ho
 product AMD F17_9X_PCIE_1	0x1647	17h/9xh PCIE
 product AMD F17_9X_PCIE_2	0x1648	17h/9xh PCIE
 product AMD F17_9X_CCP		0x1649	17h/9xh Crypto
+product AMD F19_6X_GFX		0x164e	19h/6xh Internal GPU
 product AMD F17_9X_DF_0		0x1660	17h/9xh Data Fabric
 product AMD F17_9X_DF_1		0x1661	17h/9xh Data Fabric
 product AMD F17_9X_DF_2		0x1662	17h/9xh Data Fabric
@@ -6199,7 +6216,7 @@ product INTEL APL_PCIE_A0	0x5ad8	Apollo 
 product INTEL APL_PCIE_A1	0x5ad9	Apollo Lake PCIe A1
 product INTEL APL_PCIE_A2	0x5ada	Apollo Lake PCIe A2
 product INTEL APL_PCIE_A3	0x5adb	Apollo Lake PCIe A3
-product INTEL APL_SATA		0x5ae0	Apollo Lake SATA
+product INTEL APL_SATA		0x5ae3	Apollo Lake SATA
 product INTEL APL_LPC		0x5ae8	Apollo Lake LPC
 product INTEL APL_SSRAM		0x5aec	Apollo Lake Shared SRAM
 product INTEL APL_UART_3	0x5aee	Apollo Lake UART 3
@@ -9023,6 +9040,7 @@ product SAMSUNGELEC3	SM961		0xa804	SM961
 product SAMSUNGELEC3	SM981		0xa808	SM981 M.2 NVMe SSD
 product SAMSUNGELEC3	SM980		0xa809	SM980 M.2 NVMe SSD
 product SAMSUNGELEC3	PM9A1		0xa80a	PM9A1 M.2 NVMe SSD
+product SAMSUNGELEC3	SM990		0xa80c	SM990 M.2 NVMe SSD
 product SAMSUNGELEC3	171X		0xa820	NVMe SSD Controller 171X
 product SAMSUNGELEC3	172X		0xa821	NVMe SSD Controller 172X
 product SAMSUNGELEC3	172XAB		0xa822	NVMe SSD Controller 172Xa/172Xb



CVS commit: [netbsd-9] src/sys/dev/pci

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 22:20:31 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1654):

sys/dev/pci/pcidevs: revision 1.1478
sys/dev/pci/pcidevs: revision 1.1479
sys/dev/pci/pcidevs: revision 1.1480

Add Samsung SM990.

Add devices from PPR for AMD Family 19h Model 61h Revision B1 processors.

The SATA device ID for Apollo Lake is not 0x5ae0 but 0x5ae3.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.15 -r1.1383.2.16 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 19:20:51 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c ixgbe_common.c ixgbe_type.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1647:

sys/dev/pci/ixgbe/ixgbe.c   1.325-1.326 via patch
sys/dev/pci/ixgbe/ixgbe_common.c1.44
sys/dev/pci/ixgbe/ixgbe_type.h  1.56

- PCI device ID 0x15c8 also uses X557-AT PHY, so create the thermal
  sensor sysctl for it, too.
- Count the number of link down events in the MAC using with
  LINK_DN_CNT register.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.25 -r1.199.2.26 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.25.2.6 -r1.25.2.7 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.41.2.7 -r1.41.2.8 src/sys/dev/pci/ixgbe/ixgbe_type.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.25 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.26
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.25	Mon Jan 23 14:04:42 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jun 21 19:20:50 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.25 2023/01/23 14:04:42 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.26 2023/06/21 19:20:50 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.25 2023/01/23 14:04:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.26 2023/06/21 19:20:50 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1635,6 +1635,8 @@ ixgbe_update_stats_counters(struct adapt
 		IXGBE_EVC_REGADD(hw, stats, IXGBE_MLFC, mlfc);
 		IXGBE_EVC_REGADD(hw, stats, IXGBE_MRFC, mrfc);
 	}
+	if (hw->mac.type == ixgbe_mac_X550EM_a)
+		IXGBE_EVC_REGADD(hw, stats, IXGBE_LINK_DN_CNT, link_dn_cnt);
 	IXGBE_EVC_REGADD2(hw, stats, IXGBE_RLEC, rlec);
 
 	/* Hardware workaround, gprc counts missed packets */
@@ -1985,6 +1987,9 @@ ixgbe_add_hw_stats(struct adapter *adapt
 	stats->namebuf, "MAC Local Faults");
 	evcnt_attach_dynamic(>mrfc, EVCNT_TYPE_MISC, NULL,
 	stats->namebuf, "MAC Remote Faults");
+	if (hw->mac.type == ixgbe_mac_X550EM_a)
+		evcnt_attach_dynamic(>link_dn_cnt, EVCNT_TYPE_MISC,
+		NULL, stats->namebuf, "Link down event in the MAC");
 	evcnt_attach_dynamic(>rlec, EVCNT_TYPE_MISC, NULL,
 	stats->namebuf, "Receive Length Errors");
 	evcnt_attach_dynamic(>lxontxc, EVCNT_TYPE_MISC, NULL,
@@ -2153,6 +2158,8 @@ ixgbe_clear_evcnt(struct adapter *adapte
 	IXGBE_EVC_STORE(>mpctotal, 0);
 	IXGBE_EVC_STORE(>mlfc, 0);
 	IXGBE_EVC_STORE(>mrfc, 0);
+	if (hw->mac.type == ixgbe_mac_X550EM_a)
+		IXGBE_EVC_STORE(>link_dn_cnt, 0);
 	IXGBE_EVC_STORE(>rlec, 0);
 	IXGBE_EVC_STORE(>lxontxc, 0);
 	IXGBE_EVC_STORE(>lxonrxc, 0);
@@ -3471,7 +3478,8 @@ ixgbe_add_device_sysctls(struct adapter 
 	}
 
 	/* for X552/X557-AT devices */
-	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
+	if ((hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) ||
+	(hw->device_id == IXGBE_DEV_ID_X550EM_A_10G_T)) {
 		const struct sysctlnode *phy_node;
 
 		if (sysctl_createv(log, 0, , _node, 0, CTLTYPE_NODE,
@@ -3767,6 +3775,8 @@ ixgbe_detach(device_t dev, int flags)
 	evcnt_detach(>mpctotal);
 	evcnt_detach(>mlfc);
 	evcnt_detach(>mrfc);
+	if (hw->mac.type == ixgbe_mac_X550EM_a)
+		evcnt_detach(>link_dn_cnt);
 	evcnt_detach(>rlec);
 	evcnt_detach(>lxontxc);
 	evcnt_detach(>lxonrxc);
@@ -5813,7 +5823,8 @@ ixgbe_sysctl_phy_temp(SYSCTLFN_ARGS)
 	if (ixgbe_fw_recovery_mode_swflag(adapter))
 		return (EPERM);
 
-	if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) {
+	if ((hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) &&
+	(hw->device_id != IXGBE_DEV_ID_X550EM_A_10G_T)) {
 		device_printf(adapter->dev,
 		"Device has no supported external thermal sensor.\n");
 		return (ENODEV);
@@ -5856,7 +5867,8 @@ ixgbe_sysctl_phy_overtemp_occurred(SYSCT
 	if (ixgbe_fw_recovery_mode_swflag(adapter))
 		return (EPERM);
 
-	if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) {
+	if ((hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) &&
+	(hw->device_id != IXGBE_DEV_ID_X550EM_A_10G_T)) {
 		device_printf(adapter->dev,
 		"Device has no supported external thermal sensor.\n");
 		return (ENODEV);

Index: src/sys/dev/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.25.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.25.2.7
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.25.2.6	Mon Jan 23 14:04:42 2023
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Wed Jun 21 19:20:51 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 1.25.2.6 2023/01/23 14:04:42 martin Exp $ */
+/* $NetBSD: ixgbe_common.c,v 1.25.2.7 2023/06/21 19:20:51 martin Exp $ */
 
 /**
   

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 19:20:51 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c ixgbe_common.c ixgbe_type.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1647:

sys/dev/pci/ixgbe/ixgbe.c   1.325-1.326 via patch
sys/dev/pci/ixgbe/ixgbe_common.c1.44
sys/dev/pci/ixgbe/ixgbe_type.h  1.56

- PCI device ID 0x15c8 also uses X557-AT PHY, so create the thermal
  sensor sysctl for it, too.
- Count the number of link down events in the MAC using with
  LINK_DN_CNT register.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.25 -r1.199.2.26 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.25.2.6 -r1.25.2.7 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.41.2.7 -r1.41.2.8 src/sys/dev/pci/ixgbe/ixgbe_type.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-06-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  3 14:46:08 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_aq.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #1637):

sys/dev/pci/if_aq.c: revision 1.45

aq(4): if_transmit: Invoke softint_schedule(9) with kpreempt disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.3 -r1.17.2.4 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.17.2.3 src/sys/dev/pci/if_aq.c:1.17.2.4
--- src/sys/dev/pci/if_aq.c:1.17.2.3	Tue Jul  7 12:02:29 2020
+++ src/sys/dev/pci/if_aq.c	Sat Jun  3 14:46:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.17.2.3 2020/07/07 12:02:29 martin Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.17.2.4 2023/06/03 14:46:07 martin Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.17.2.3 2020/07/07 12:02:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.17.2.4 2023/06/03 14:46:07 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -4635,7 +4635,9 @@ aq_transmit(struct ifnet *ifp, struct mb
 		aq_send_common_locked(ifp, sc, txring, true);
 		mutex_exit(>txr_mutex);
 	} else {
+		kpreempt_disable();
 		softint_schedule(txring->txr_softint);
+		kpreempt_enable();
 	}
 	return 0;
 }



CVS commit: [netbsd-9] src/sys/dev/pci

2023-06-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  3 14:46:08 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_aq.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #1637):

sys/dev/pci/if_aq.c: revision 1.45

aq(4): if_transmit: Invoke softint_schedule(9) with kpreempt disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.3 -r1.17.2.4 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 30 11:34:21 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1580


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.14 -r1.1371.2.15 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.14 -r1.1370.2.15 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 30 11:34:21 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1580


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.14 -r1.1371.2.15 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.14 -r1.1370.2.15 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1371.2.14 src/sys/dev/pci/pcidevs.h:1.1371.2.15
--- src/sys/dev/pci/pcidevs.h:1.1371.2.14	Wed Jan 18 19:27:18 2023
+++ src/sys/dev/pci/pcidevs.h	Mon Jan 30 11:33:45 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1371.2.14 2023/01/18 19:27:18 martin Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1371.2.15 2023/01/30 11:33:45 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1383.2.14 2023/01/18 19:26:30 martin Exp
+ *	NetBSD: pcidevs,v 1.1383.2.15 2023/01/30 11:32:22 martin Exp
  */
 
 /*
@@ -3212,6 +3212,7 @@
 #define	PCI_PRODUCT_EXAR_XR17D152	0x0152		/* dual-channel Universal PCI UART */
 #define	PCI_PRODUCT_EXAR_XR17D154	0x0154		/* quad-channel Universal PCI UART */
 #define	PCI_PRODUCT_EXAR_XR17D158	0x0158		/* octal-channel Universal PCI UART */
+#define	PCI_PRODUCT_EXAR_XR17V354	0x0354		/* quad-channel Universal PCIe UART */
 
 /* FORE products */
 #define	PCI_PRODUCT_FORE_PCA200	0x0210		/* ATM PCA-200 */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1370.2.14 src/sys/dev/pci/pcidevs_data.h:1.1370.2.15
--- src/sys/dev/pci/pcidevs_data.h:1.1370.2.14	Wed Jan 18 19:27:18 2023
+++ src/sys/dev/pci/pcidevs_data.h	Mon Jan 30 11:33:45 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1370.2.14 2023/01/18 19:27:18 martin Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1370.2.15 2023/01/30 11:33:45 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1383.2.14 2023/01/18 19:26:30 martin Exp
+ *	NetBSD: pcidevs,v 1.1383.2.15 2023/01/30 11:32:22 martin Exp
  */
 
 /*
@@ -5243,6 +5243,8 @@ static const uint16_t pci_products[] = {
 	15140, 20295, 615, 7941, 0,
 	PCI_VENDOR_EXAR, PCI_PRODUCT_EXAR_XR17D158, 
 	15153, 20295, 615, 7941, 0,
+	PCI_VENDOR_EXAR, PCI_PRODUCT_EXAR_XR17V354, 
+	15140, 20295, 8154, 7941, 0,
 	PCI_VENDOR_FORE, PCI_PRODUCT_FORE_PCA200, 
 	7083, 20305, 0,
 	PCI_VENDOR_FORE, PCI_PRODUCT_FORE_PCA200E, 
@@ -18827,7 +18829,7 @@ static const char pci_words[] = { "." 
 	"NVMe\0" /* 24 refs @ 7915 */
 	"SSD\0" /* 27 refs @ 7920 */
 	"16650-compatible\0" /* 1 refs @ 7924 */
-	"UART\0" /* 96 refs @ 7941 */
+	"UART\0" /* 97 refs @ 7941 */
 	"Elastic\0" /* 1 refs @ 7946 */
 	"K8\0" /* 4 refs @ 7954 */
 	"AMD64\0" /* 14 refs @ 7957 */
@@ -18856,7 +18858,7 @@ static const char pci_words[] = { "." 
 	"Fabric\0" /* 64 refs @ 8129 */
 	"17h/6xh\0" /* 20 refs @ 8136 */
 	"Family17h\0" /* 21 refs @ 8144 */
-	"PCIe\0" /* 669 refs @ 8154 */
+	"PCIe\0" /* 670 refs @ 8154 */
 	"17h/Axh\0" /* 19 refs @ 8159 */
 	"Dummy\0" /* 6 refs @ 8167 */
 	"Crypto\0" /* 6 refs @ 8173 */
@@ -19902,7 +19904,7 @@ static const char pci_words[] = { "." 
 	"single-channel\0" /* 2 refs @ 15105 */
 	"RS-485\0" /* 8 refs @ 15120 */
 	"dual-channel\0" /* 3 refs @ 15127 */
-	"quad-channel\0" /* 3 refs @ 15140 */
+	"quad-channel\0" /* 4 refs @ 15140 */
 	"octal-channel\0" /* 3 refs @ 15153 */
 	"Isolated\0" /* 4 refs @ 15167 */
 	"PBlaze4\0" /* 1 refs @ 15176 */
@@ -20566,7 +20568,7 @@ static const char pci_words[] = { "." 
 	"OZ711E0\0" /* 1 refs @ 20270 */
 	"Freedom\0" /* 1 refs @ 20278 */
 	"PCI-GBus\0" /* 1 refs @ 20286 */
-	"Universal\0" /* 3 refs @ 20295 */
+	"Universal\0" /* 4 refs @ 20295 */
 	"PCA-200\0" /* 1 refs @ 20305 */
 	"PCA-200e\0" /* 1 refs @ 20313 */
 	"801\0" /* 1 refs @ 20322 */



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 30 11:32:22 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #1580):

sys/dev/pci/pcidevs: revision 1.1477

Add ID for the EXAR XR17V354 PCIe UART.
PR kern/57202


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.14 -r1.1383.2.15 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.14 src/sys/dev/pci/pcidevs:1.1383.2.15
--- src/sys/dev/pci/pcidevs:1.1383.2.14	Wed Jan 18 19:26:30 2023
+++ src/sys/dev/pci/pcidevs	Mon Jan 30 11:32:22 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.14 2023/01/18 19:26:30 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.15 2023/01/30 11:32:22 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3205,6 +3205,7 @@ product ES FREEDOM	0x0001	Freedom PCI-GB
 product EXAR XR17D152	0x0152	dual-channel Universal PCI UART
 product EXAR XR17D154	0x0154	quad-channel Universal PCI UART
 product EXAR XR17D158	0x0158	octal-channel Universal PCI UART
+product EXAR XR17V354	0x0354	quad-channel Universal PCIe UART
 
 /* FORE products */
 product FORE PCA200	0x0210	ATM PCA-200



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 30 11:32:22 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #1580):

sys/dev/pci/pcidevs: revision 1.1477

Add ID for the EXAR XR17V354 PCIe UART.
PR kern/57202


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.14 -r1.1383.2.15 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:04:42 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: files.pci
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_82598.c
ixgbe_api.c ixgbe_common.c ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1579:

sys/dev/pci/files.pci   1.442
sys/dev/pci/ixgbe/ix_txrx.c 1.99-1.100
sys/dev/pci/ixgbe/ixgbe.c   1.320-1.324 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c 1.19
sys/dev/pci/ixgbe/ixgbe_api.c   1.28
sys/dev/pci/ixgbe/ixgbe_common.c1.43
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.17
sys/dev/pci/ixgbe/ixv.c 1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.413.2.5 -r1.413.2.6 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.54.2.10 -r1.54.2.11 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.24 -r1.199.2.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12.8.5 -r1.12.8.6 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.23.2.3 -r1.23.2.4 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.25.2.5 -r1.25.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.11.4.3 -r1.11.4.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.125.2.20 -r1.125.2.21 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.413.2.5 src/sys/dev/pci/files.pci:1.413.2.6
--- src/sys/dev/pci/files.pci:1.413.2.5	Thu Oct 21 14:30:10 2021
+++ src/sys/dev/pci/files.pci	Mon Jan 23 14:04:41 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.413.2.5 2021/10/21 14:30:10 martin Exp $
+#	$NetBSD: files.pci,v 1.413.2.6 2023/01/23 14:04:41 martin Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -691,6 +691,7 @@ file	dev/pci/ixgbe/ixgbe_phy.c	ixg | ixv
 file	dev/pci/ixgbe/ixgbe_vf.c	ixg | ixv
 file	dev/pci/ixgbe/if_bypass.c	ixg | ixv
 file	dev/pci/ixgbe/if_fdir.c		ixg | ixv
+defflag	opt_if_ixg.h	IXGBE_ALWAYS_TXDEFER
 
 # This appears to be the driver for virtual instances of i82599.
 device	ixv: ether, ifnet, arp, mii, mii_phy

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.10 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.11
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.10	Mon May 30 17:01:06 2022
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -250,6 +250,11 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 		IXGBE_EVC_ADD(>pcq_drops, 1);
 		return ENOBUFS;
 	}
+#ifdef IXGBE_ALWAYS_TXDEFER
+	kpreempt_disable();
+	softint_schedule(txr->txr_si);
+	kpreempt_enable();
+#else
 	if (IXGBE_TX_TRYLOCK(txr)) {
 		ixgbe_mq_start_locked(ifp, txr);
 		IXGBE_TX_UNLOCK(txr);
@@ -279,6 +284,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 			kpreempt_enable();
 		}
 	}
+#endif
 
 	return (0);
 } /* ixgbe_mq_start */
@@ -316,7 +322,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
 #if __FreeBSD_version >= 1100036
 		/*
 		 * Since we're looking at the tx ring, we can check
-		 * to see if we're a VF by examing our tail register
+		 * to see if we're a VF by examining our tail register
 		 * address.
 		 */
 		if ((txr->adapter->feat_en & IXGBE_FEATURE_VF) &&
@@ -1977,7 +1983,7 @@ ixgbe_rxeof(struct ix_queue *que)
 		 * not be fragmented across sequential
 		 * descriptors, rather the next descriptor
 		 * is indicated in bits of the descriptor.
-		 * This also means that we might proceses
+		 * This also means that we might process
 		 * more than one packet at a time, something
 		 * that has never been true before, it
 		 * required eliminating global chain pointers

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.24 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.25
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.24	Fri Jun  3 04:00:49 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@

CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:04:42 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: files.pci
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_82598.c
ixgbe_api.c ixgbe_common.c ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1579:

sys/dev/pci/files.pci   1.442
sys/dev/pci/ixgbe/ix_txrx.c 1.99-1.100
sys/dev/pci/ixgbe/ixgbe.c   1.320-1.324 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c 1.19
sys/dev/pci/ixgbe/ixgbe_api.c   1.28
sys/dev/pci/ixgbe/ixgbe_common.c1.43
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.17
sys/dev/pci/ixgbe/ixv.c 1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.413.2.5 -r1.413.2.6 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.54.2.10 -r1.54.2.11 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.24 -r1.199.2.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12.8.5 -r1.12.8.6 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.23.2.3 -r1.23.2.4 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.25.2.5 -r1.25.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.11.4.3 -r1.11.4.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.125.2.20 -r1.125.2.21 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:59:04 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1578:

sys/dev/pci/if_wm.c 1.764-1.767 via patch
sys/dev/pci/if_wmreg.h  1.128

- Workaround for some hypervisor environments. The environments
  cannot stop e1000 interrupt immediately.
- Rename nq_txdesc' member "nqrx_ctx" to "nqtx_ctx". No functional
  change.
- Add comment. Modify comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.14 -r1.645.2.15 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.6 -r1.115.2.7 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:59:04 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1578:

sys/dev/pci/if_wm.c 1.764-1.767 via patch
sys/dev/pci/if_wmreg.h  1.128

- Workaround for some hypervisor environments. The environments
  cannot stop e1000 interrupt immediately.
- Rename nq_txdesc' member "nqrx_ctx" to "nqtx_ctx". No functional
  change.
- Add comment. Modify comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.14 -r1.645.2.15 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.6 -r1.115.2.7 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.14 src/sys/dev/pci/if_wm.c:1.645.2.15
--- src/sys/dev/pci/if_wm.c:1.645.2.14	Wed Sep  7 10:05:42 2022
+++ src/sys/dev/pci/if_wm.c	Mon Jan 23 13:59:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.14 2022/09/07 10:05:42 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.15 2023/01/23 13:59:04 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.14 2022/09/07 10:05:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.15 2023/01/23 13:59:04 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -490,6 +490,7 @@ struct wm_queue {
 	char sysctlname[32];		/* Name for sysctl */
 
 	bool wmq_txrx_use_workqueue;
+	bool wmq_wq_enqueued;
 	struct work wmq_cookie;
 	void *wmq_si;
 	krndsource_t rnd_source;	/* random source */
@@ -2289,7 +2290,7 @@ alloc_retry:
 aprint_error_dev(sc->sc_dev,
 "unable to find PCIX capability\n");
 			else if (sc->sc_type != WM_T_82545_3 &&
- sc->sc_type != WM_T_82546_3) {
+			sc->sc_type != WM_T_82546_3) {
 /*
  * Work around a problem caused by the BIOS
  * setting the max memory read byte count
@@ -3673,7 +3674,7 @@ wm_watchdog_txq_locked(struct ifnet *ifp
 		ifp->if_oerrors++;
 #ifdef WM_DEBUG
 		for (i = txq->txq_sdirty; i != txq->txq_snext;
-		i = WM_NEXTTXS(txq, i)) {
+		 i = WM_NEXTTXS(txq, i)) {
 			txs = >txq_soft[i];
 			printf("txs %d tx %d -> %d\n",
 			i, txs->txs_firstdesc, txs->txs_lastdesc);
@@ -3834,9 +3835,9 @@ wm_tick(void *arg)
 	crcerrs + algnerrc + symerrc + rxerrc + sec + cexterr + rlec;
 
 	/*
-	 * WMREG_RNBC is incremented when there are no available buffers in host
-	 * memory. It does not mean the number of dropped packets, because an
-	 * Ethernet controller can receive packets in such case if there is
+	 * WMREG_RNBC is incremented when there are no available buffers in
+	 * host memory. It does not mean the number of dropped packets, because
+	 * an Ethernet controller can receive packets in such case if there is
 	 * space in the phy's FIFO.
 	 *
 	 * If you want to know the nubmer of WMREG_RMBC, you should use such as
@@ -4153,7 +4154,7 @@ wm_read_mac_addr(struct wm_softc *sc, ui
 
 	return 0;
 
- bad:
+bad:
 	return -1;
 }
 
@@ -4442,10 +4443,10 @@ wm_set_filter(struct wm_softc *sc)
 
 	goto setit;
 
- allmulti:
+allmulti:
 	sc->sc_rctl |= RCTL_MPE;
 
- setit:
+setit:
 	if (sc->sc_type >= WM_T_PCH2) {
 		if (((ec->ec_capabilities & ETHERCAP_JUMBO_MTU) != 0)
 		&& (ifp->if_mtu > ETHERMTU))
@@ -4836,7 +4837,8 @@ wm_init_lcd_from_nvm(struct wm_softc *sc
 		 * LCD Write Enable bits are set in the NVM. When both NVM bits
 		 * are cleared, SW will configure them instead.
 		 */
-		DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s: Configure SMBus and LED\n",
+		DPRINTF(sc, WM_DEBUG_INIT,
+		("%s: %s: Configure SMBus and LED\n",
 			device_xname(sc->sc_dev), __func__));
 		if ((rv = wm_write_smbus_addr(sc)) != 0)
 			goto release;
@@ -5147,15 +5149,15 @@ wm_initialize_hardware_bits(struct wm_so
 		CSR_WRITE(sc, WMREG_TARC0, tarc0);
 
 		switch (sc->sc_type) {
-		/*
-		 * 8257[12] Errata No.52, 82573 Errata No.43 and some others.
-		 * Avoid RSS Hash Value bug.
-		 */
 		case WM_T_82571:
 		case WM_T_82572:
 		case WM_T_82573:
 		case WM_T_80003:
 		case WM_T_ICH8:
+			/*
+			 * 8257[12] Errata No.52, 82573 Errata No.43 and some
+			 * others to avoid RSS Hash Value bug.
+			 */
 			reg = CSR_READ(sc, WMREG_RFCTL);
 			reg |= WMREG_RFCTL_NEWIPV6EXDIS |WMREG_RFCTL_IPV6EXDIS;
 			CSR_WRITE(sc, WMREG_RFCTL, reg);
@@ -5560,6 +5562,11 @@ wm_reset(struct wm_softc *sc)
 		CSR_WRITE(sc, WMREG_CTRL, reg);
 		/* Don't insert a completion barrier when reset */
 		delay(20*1000);
+		/*
+		 * The EXTCNFCTR_MDIO_SW_OWNERSHIP bit is cleared by the reset,
+		 * so don't use sc->phy.release(sc). Release sc_ich_phymtx
+		 * only. See also wm_get_swflag_ich8lan().
+		 */
 		mutex_exit(sc->sc_ich_phymtx);
 		break;
 	case WM_T_82580:
@@ 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:43:36 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: piixpm.c piixpmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1573:

sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.2 -r1.54.2.3 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/dev/pci/piixpmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.54.2.2 src/sys/dev/pci/piixpm.c:1.54.2.3
--- src/sys/dev/pci/piixpm.c:1.54.2.2	Tue Nov 30 11:44:39 2021
+++ src/sys/dev/pci/piixpm.c	Mon Jan 23 12:43:35 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.54.2.2 2021/11/30 11:44:39 martin Exp $ */
+/* $NetBSD: piixpm.c,v 1.54.2.3 2023/01/23 12:43:35 martin Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.54.2.2 2021/11/30 11:44:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.54.2.3 2023/01/23 12:43:35 martin Exp $");
 
 #include 
 #include 
@@ -51,7 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 
 #define PIIXPM_IS_CSB5(sc)		  \
 	(PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_SERVERWORKS &&		  \
-	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
+	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
 #define PIIXPM_DELAY	200
 #define PIIXPM_TIMEOUT	1
 
@@ -75,20 +75,20 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 struct piixpm_smbus {
 	int			sda;
 	int			sda_save;
-	struct			piixpm_softc *softc;
+	struct piixpm_softc	*softc;
 };
 
 struct piixpm_softc {
 	device_t		sc_dev;
 
 	bus_space_tag_t		sc_iot;
-#define	sc_pm_iot sc_iot
-#define sc_smb_iot sc_iot
+	bus_space_tag_t		sc_sb800_bt;
 	bus_space_handle_t	sc_pm_ioh;
-	bus_space_handle_t	sc_sb800_ioh;
+	bus_space_handle_t	sc_sb800_bh;
 	bus_space_handle_t	sc_smb_ioh;
 	void *			sc_smb_ih;
 	int			sc_poll;
+	bool			sc_sb800_mmio;	/* Use MMIO access */
 	bool			sc_sb800_selen; /* Use SMBUS0SEL */
 
 	pci_chipset_tag_t	sc_pc;
@@ -121,6 +121,7 @@ static void	piixpm_chdet(device_t, devic
 static bool	piixpm_suspend(device_t, const pmf_qual_t *);
 static bool	piixpm_resume(device_t, const pmf_qual_t *);
 
+static uint8_t	piixpm_sb800_pmread(struct piixpm_softc *, bus_size_t);
 static int	piixpm_sb800_init(struct piixpm_softc *);
 static void	piixpm_csb5_reset(void *);
 static int	piixpm_i2c_sb600_acquire_bus(void *, int);
@@ -217,7 +218,7 @@ piixpm_attach(device_t parent, device_t 
 
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_PM_BASE);
-	if (base == 0 || bus_space_map(sc->sc_pm_iot, PCI_MAPREG_IO_ADDR(base),
+	if (base == 0 || bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_PM_SIZE, 0, >sc_pm_ioh)) {
 		aprint_error_dev(self,
 		"can't map power management I/O space\n");
@@ -229,13 +230,22 @@ piixpm_attach(device_t parent, device_t 
 	 * PIIX4 and PIIX4E have a bug in the timer latch, see Errata #20
 	 * in the "Specification update" (document #297738).
 	 */
-	acpipmtimer_attach(self, sc->sc_pm_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
+	acpipmtimer_attach(self, sc->sc_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
 	(PCI_REVISION(pa->pa_class) < 3) ? ACPIPMT_BADLATCH : 0);
 
 nopowermanagement:
 
 	/* SB800 rev 0x40+, AMD HUDSON and newer need special initialization */
 	if (PIIXPM_IS_FCHGRP(sc) || PIIXPM_IS_SB800GRP(sc)) {
+		/* Newer chips don't support I/O access */
+		if (PIIXPM_IS_KERNCZ(sc) && (sc->sc_rev >= 0x51)) {
+			sc->sc_sb800_mmio = true;
+			sc->sc_sb800_bt = pa->pa_memt;
+		} else {
+			sc->sc_sb800_mmio = false;
+			sc->sc_sb800_bt = pa->pa_iot;
+		}
+
 		if (piixpm_sb800_init(sc) == 0) {
 			/* Read configuration */
 			conf = bus_space_read_1(sc->sc_iot,
@@ -260,7 +270,7 @@ nopowermanagement:
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE) & 0x;
 	if (base == 0 ||
-	bus_space_map(sc->sc_smb_iot, PCI_MAPREG_IO_ADDR(base),
+	bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_SMB_SIZE, 0, >sc_smb_ioh)) {
 		aprint_error_dev(self, "can't map smbus I/O space\n");
 		return;
@@ -395,18 +405,37 @@ piixpm_resume(device_t dv, const pmf_qua
 	return true;
 }
 
+static uint8_t
+piixpm_sb800_pmread(struct piixpm_softc *sc, bus_size_t offset)
+{
+	bus_space_tag_t sbt = sc->sc_sb800_bt;
+	bus_space_handle_t sbh = sc->sc_sb800_bh;
+	uint8_t val;
+
+	if (sc->sc_sb800_mmio)
+		val = bus_space_read_1(sbt, sbh, offset);
+	else {
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX, offset);
+		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
+	}
+
+	return val;
+}
+
 

CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:43:36 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: piixpm.c piixpmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1573:

sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.2 -r1.54.2.3 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/dev/pci/piixpmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 18 19:27:51 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1566


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.13 -r1.1371.2.14 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.13 -r1.1370.2.14 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 18 19:27:51 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #1566


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.13 -r1.1371.2.14 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.13 -r1.1370.2.14 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 18 19:26:30 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1566):

sys/dev/pci/sdhc_pci.c: revision 1.20
sys/dev/pci/pcidevs: revision 1.1469
sys/dev/pci/pcidevs: revision 1.1470
sys/dev/pci/pcidevs: revision 1.1471
sys/dev/pci/pcidevs: revision 1.1472
sys/dev/pci/pcidevs: revision 1.1473
sys/dev/pci/pcidevs: revision 1.1474
sys/dev/pci/pcidevs: revision 1.1475
sys/dev/pci/pcidevs: revision 1.1476

Add some AMD 17h/9xh devices from OpenBSD.
Add AMD F17/Axh devices.
Add some Xeon Scalable devices from OpenBSD.
Update Intel Elkhart Lake devices.
Add Elkhart Lake Shared SRAM.
Fix typo. s/SSC/SCC/.
Fix typo. No functional change.
add Aquantia (Marvell) AQC113 ethernet devices and the variants
Add AMD Family 19h/1xh devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.13 -r1.1383.2.14 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.14.16.1 -r1.14.16.2 src/sys/dev/pci/sdhc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.13 src/sys/dev/pci/pcidevs:1.1383.2.14
--- src/sys/dev/pci/pcidevs:1.1383.2.13	Tue Oct 11 17:49:35 2022
+++ src/sys/dev/pci/pcidevs	Wed Jan 18 19:26:30 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.13 2022/10/11 17:49:35 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.14 2023/01/18 19:26:30 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1028,6 +1028,7 @@ product AMD F17_IOMMU		0x1451	Family17h 
 product AMD F17_PCIE_1		0x1452	Family17h PCIe
 product AMD F17_PCIE_2		0x1453	Family17h PCIe
 product AMD F17_PCIE_3		0x1454	Family17h PCIe
+product AMD F17_AX_PCIE_DUMMY	0x1455	17h/Axh PCIe Dummy Function
 product AMD F17_CCP_1		0x1456	Family17h Crypto
 product AMD F17_HDA		0x1457	Family17h HD Audio
 product AMD F17_PCIE_DUMMY	0x145a	Family17h PCIe Dummy Function
@@ -1053,7 +1054,43 @@ product AMD F17_7X_RESV_SPP	0x1485	Famil
 product AMD F17_7X_CCP		0x1486	Family17h/7xh Crypto
 product AMD F17_3X_HDA		0x1487	17h/7xh HD Audio
 product AMD F17_7X_USB3		0x149c	Family17h/7xh USB 3.0 Host Controller
+product AMD F19_1X_IOMMU	0x149e	19h/7xh IOMMU
+product AMD F19_1X_PCIE_DUMMY_HB 0x149f	19h/7xh PCIe Dummy Host Bridge
+product AMD F19_1X_RC		0x14a4	19h/1xh Root Complex
+product AMD F19_1X_GPPB_0	0x14a5	19h/1xh PCIe GPP Bridge
+product AMD F19_1X_RCEC		0x14a6	19h/1xh RCEC
+product AMD F19_1X_INTNL_GPPB	0x14a7	19h/1xh Internal PCIe GPP Bridge
+product AMD F19_1X_GPPB_1	0x14aa	19h/1xh PCIe GPP Bridge
+product AMD F19_1X_GPPB_2	0x14ab	19h/1xh PCIe GPP Bridge
+product AMD F19_1X_PCIE_DUMMY_0	0x14ac	19h/1xh PCIe Dummy Function
+product AMD F19_1X_DF_0		0x14ad	19h/1xh Data Fabric
+product AMD F19_1X_DF_1		0x14ae	19h/1xh Data Fabric
+product AMD F19_1X_DF_2		0x14af	19h/1xh Data Fabric
+product AMD F19_1X_DF_3		0x14b0	19h/1xh Data Fabric
+product AMD F19_1X_DF_4		0x14b1	19h/1xh Data Fabric
+product AMD F19_1X_DF_5		0x14b2	19h/1xh Data Fabric
+product AMD F19_1X_DF_6		0x14b3	19h/1xh Data Fabric
+product AMD F19_1X_DF_7		0x14b4	19h/1xh Data Fabric
+product AMD F17_AX_RC		0x14b5	17h/Axh Root Complex
+product AMD F17_AX_IOMMU	0x14b6	17h/Axh IOMMU
+product AMD F17_AX_PCIE_DUMMY_HB 0x14b7	17h/Axh PCIe Dummy Host Bridge
+product AMD F17_AX_INTNL_GPPB_0	0x14b9	17h/Axh Internal GPP Bridge 0
+product AMD F17_AX_GPPB		0x14ba	17h/Axh PCIe GPP Bridge
+product AMD F19_1X_NTB_0	0x14c0	19h/1xh Primary PCIe Non Transparent Bridge
+product AMD F19_1X_VNTB		0x14c1	19h/1xh Secondary vNTB
+product AMD F19_1X_PCIE_DUMMY_1	0x14c2	19h/1xh PCIe Dummy Function
+product AMD F19_1X_NTB_1	0x14c3	19h/1xh PCIe Non Transparent Bridge
+product AMD F19_1X_SWDS		0x14c4	19h/1xh Swith NBIF DS
+product AMD F19_1X_NVME		0x14c5	19h/1xh NVMe
+product AMD F19_1X_SWUS		0x14c6	19h/1xh Swith US in PCIe
+product AMD F19_1X_PSP		0x14ca	19h/1xh PSP
+product AMD F19_1X_ACP		0x14cb	19h/1xh ACP
+product AMD F19_1X_HDA		0x14cc	19h/1xh HD Audio
 product AMD F19_6X_RC		0x14d8	19h/6xh Root Complex
+product AMD F17_AX_XHCI_0	0x1503	17h/Axh USB 3.1 xHCI
+product AMD F17_AX_XHCI_1	0x1504	17h/Axh USB 3.1 xHCI
+product AMD F17_AX_USB_BIOM	0x1505	17h/Axh Secure USB BIOmetric
+product AMD F17_AX_GFX		0x1506	17h/Axh Internal GPU
 product AMD F14_RC		0x1510	Family14h Root Complex
 product AMD F14_PCIE_1		0x1512	Family14h PCIe
 product AMD F14_PCIE_2		0x1513	Family14h PCIe
@@ -1085,6 +1122,7 @@ product AMD F15_6X_HDA		0x157a	15h/6xh A
 product AMD F15_6X_HB		0x157b	15h/6xh Host Bridge
 product AMD F15_6X_RP		0x157c	15h/6xh Root Port
 product AMD F15_6X_HB_2		0x157d	15h/6xh Host Bridge
+product AMD F19_1X_XHCI		0x157f	19h/1xh USB 3.2
 product AMD F16_30_HT		0x1580	Family16h HyperTransport Configuration
 product AMD F16_30_ADDR		0x1581	

CVS commit: [netbsd-9] src/sys/dev/pci

2023-01-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 18 19:26:30 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs sdhc_pci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1566):

sys/dev/pci/sdhc_pci.c: revision 1.20
sys/dev/pci/pcidevs: revision 1.1469
sys/dev/pci/pcidevs: revision 1.1470
sys/dev/pci/pcidevs: revision 1.1471
sys/dev/pci/pcidevs: revision 1.1472
sys/dev/pci/pcidevs: revision 1.1473
sys/dev/pci/pcidevs: revision 1.1474
sys/dev/pci/pcidevs: revision 1.1475
sys/dev/pci/pcidevs: revision 1.1476

Add some AMD 17h/9xh devices from OpenBSD.
Add AMD F17/Axh devices.
Add some Xeon Scalable devices from OpenBSD.
Update Intel Elkhart Lake devices.
Add Elkhart Lake Shared SRAM.
Fix typo. s/SSC/SCC/.
Fix typo. No functional change.
add Aquantia (Marvell) AQC113 ethernet devices and the variants
Add AMD Family 19h/1xh devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.13 -r1.1383.2.14 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.14.16.1 -r1.14.16.2 src/sys/dev/pci/sdhc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:29:40 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1544:

sys/dev/pci/ichsmb.c1.76-1.77

Add Intel 600 Series PCH support.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.3 -r1.60.4.4 src/sys/dev/pci/ichsmb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:29:40 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1544:

sys/dev/pci/ichsmb.c1.76-1.77

Add Intel 600 Series PCH support.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.3 -r1.60.4.4 src/sys/dev/pci/ichsmb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.60.4.3 src/sys/dev/pci/ichsmb.c:1.60.4.4
--- src/sys/dev/pci/ichsmb.c:1.60.4.3	Fri Dec  3 17:49:41 2021
+++ src/sys/dev/pci/ichsmb.c	Sat Oct 15 10:29:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.60.4.3 2021/12/03 17:49:41 martin Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.60.4.4 2022/10/15 10:29:40 martin Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.3 2021/12/03 17:49:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.4 2022/10/15 10:29:40 martin Exp $");
 
 #include 
 #include 
@@ -152,6 +152,8 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_495_YU_SMB:
 		case PCI_PRODUCT_INTEL_5HS_H_SMB:
 		case PCI_PRODUCT_INTEL_5HS_LP_SMB:
+		case PCI_PRODUCT_INTEL_6HS_H_SMB:
+		case PCI_PRODUCT_INTEL_6HS_LP_SMB:
 			return 1;
 		}
 	}



CVS commit: [netbsd-9] src/sys/dev/pci

2022-10-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 11 17:51:46 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen (Ticket #1537)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.12 -r1.1371.2.13 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.12 -r1.1370.2.13 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/sys/dev/pci

2022-10-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 11 17:51:46 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen (Ticket #1537)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.12 -r1.1371.2.13 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.12 -r1.1370.2.13 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2022-09-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 29 18:26:42 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: mfii.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1534):

sys/dev/pci/mfii.c: revision 1.28

Convert from pci_intr_map() to pci_intr_alloc(); makes the driver use
MSI/MSI-x when available. Tested by Edgar Fu?.


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.2 -r1.4.4.3 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mfii.c
diff -u src/sys/dev/pci/mfii.c:1.4.4.2 src/sys/dev/pci/mfii.c:1.4.4.3
--- src/sys/dev/pci/mfii.c:1.4.4.2	Fri Sep 16 18:27:38 2022
+++ src/sys/dev/pci/mfii.c	Thu Sep 29 18:26:42 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: mfii.c,v 1.4.4.2 2022/09/16 18:27:38 martin Exp $ */
+/* $NetBSD: mfii.c,v 1.4.4.3 2022/09/29 18:26:42 martin Exp $ */
 /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.4.4.2 2022/09/16 18:27:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.4.4.3 2022/09/29 18:26:42 martin Exp $");
 
 #include "bio.h"
 
@@ -655,7 +655,7 @@ mfii_attach(device_t parent, device_t se
 	struct mfii_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
 	pcireg_t memtype;
-	pci_intr_handle_t ih;
+	pci_intr_handle_t *ihp;
 	char intrbuf[PCI_INTRSTR_LEN];
 	const char *intrstr;
 	u_int32_t status, scpad2, scpad3;
@@ -705,12 +705,12 @@ mfii_attach(device_t parent, device_t se
 	/* disable interrupts */
 	mfii_write(sc, MFI_OMSK, 0x);
 
-	if (pci_intr_map(pa, ) != 0) {
+	if (pci_intr_alloc(pa, , NULL, 0)) {
 		aprint_error(": unable to map interrupt\n");
 		goto pci_unmap;
 	}
-	intrstr = pci_intr_string(pa->pa_pc, ih, intrbuf, sizeof(intrbuf));
-	pci_intr_setattr(pa->pa_pc, , PCI_INTR_MPSAFE, true);
+	intrstr = pci_intr_string(pa->pa_pc, ihp[0], intrbuf, sizeof(intrbuf));
+	pci_intr_setattr(pa->pa_pc, [0], PCI_INTR_MPSAFE, true);
 
 	/* lets get started */
 	if (mfii_transition_firmware(sc))
@@ -819,7 +819,7 @@ mfii_attach(device_t parent, device_t se
 	aprint_normal("\n");
 	aprint_naive("\n");
 
-	sc->sc_ih = pci_intr_establish_xname(sc->sc_pc, ih, IPL_BIO,
+	sc->sc_ih = pci_intr_establish_xname(sc->sc_pc, ihp[0], IPL_BIO,
 	mfii_intr, sc, DEVNAME(sc));
 	if (sc->sc_ih == NULL) {
 		aprint_error_dev(self, "can't establish interrupt");



CVS commit: [netbsd-9] src/sys/dev/pci

2022-09-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 29 18:26:42 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: mfii.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1534):

sys/dev/pci/mfii.c: revision 1.28

Convert from pci_intr_map() to pci_intr_alloc(); makes the driver use
MSI/MSI-x when available. Tested by Edgar Fu?.


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.2 -r1.4.4.3 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2022-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep  7 10:05:42 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1515:

sys/dev/pci/if_wm.c 1.741-1.749,
1.753-1.757,
1.762 via patch
sys/dev/pci/if_wmreg.h  1.126-1.127

- Fix I219 workaround in wm_flush_desc_rings().
- Add more statistics counters.
- To avoid releasing mutex temporally, use new
  wm_set_mdio_slow_mode_hv_locked().
- No functional changes:
  - Turn a locking botch (shouldn't drop lock on error) into a KASSERT
in wm_deferred_start_locked().
  - Remove unneeded header inclusion.
  - Use __BIT() a little.
  - Modify comment and debug messages.
  - Consistency use -1 instead of 1 for some error code.
  - KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.13 -r1.645.2.14 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.5 -r1.115.2.6 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2022-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep  7 10:05:42 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1515:

sys/dev/pci/if_wm.c 1.741-1.749,
1.753-1.757,
1.762 via patch
sys/dev/pci/if_wmreg.h  1.126-1.127

- Fix I219 workaround in wm_flush_desc_rings().
- Add more statistics counters.
- To avoid releasing mutex temporally, use new
  wm_set_mdio_slow_mode_hv_locked().
- No functional changes:
  - Turn a locking botch (shouldn't drop lock on error) into a KASSERT
in wm_deferred_start_locked().
  - Remove unneeded header inclusion.
  - Use __BIT() a little.
  - Modify comment and debug messages.
  - Consistency use -1 instead of 1 for some error code.
  - KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.13 -r1.645.2.14 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.5 -r1.115.2.6 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.13 src/sys/dev/pci/if_wm.c:1.645.2.14
--- src/sys/dev/pci/if_wm.c:1.645.2.13	Mon Jul 11 14:10:18 2022
+++ src/sys/dev/pci/if_wm.c	Wed Sep  7 10:05:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.13 2022/07/11 14:10:18 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.14 2022/09/07 10:05:42 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.13 2022/07/11 14:10:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.14 2022/09/07 10:05:42 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -90,26 +90,25 @@ __KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.
 #endif
 
 #include 
-#include 
+
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
-#include 
-#include 
+#include 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
 #include 
-#include 
-
-#include 
 
 #include 
 #include 
@@ -497,7 +496,7 @@ struct wm_queue {
 };
 
 struct wm_phyop {
-	int (*acquire)(struct wm_softc *);
+	int (*acquire)(struct wm_softc *) __attribute__((warn_unused_result));
 	void (*release)(struct wm_softc *);
 	int (*readreg_locked)(device_t, int, int, uint16_t *);
 	int (*writereg_locked)(device_t, int, int, uint16_t);
@@ -506,7 +505,7 @@ struct wm_phyop {
 };
 
 struct wm_nvmop {
-	int (*acquire)(struct wm_softc *);
+	int (*acquire)(struct wm_softc *) __attribute__((warn_unused_result));
 	void (*release)(struct wm_softc *);
 	int (*read)(struct wm_softc *, int, int, uint16_t *);
 };
@@ -597,12 +596,76 @@ struct wm_softc {
 	/* Event counters. */
 	struct evcnt sc_ev_linkintr;	/* Link interrupts */
 
-	/* WM_T_82542_2_1 only */
+	/* >= WM_T_82542_2_1 */
 	struct evcnt sc_ev_tx_xoff;	/* Tx PAUSE(!0) frames */
 	struct evcnt sc_ev_tx_xon;	/* Tx PAUSE(0) frames */
 	struct evcnt sc_ev_rx_xoff;	/* Rx PAUSE(!0) frames */
 	struct evcnt sc_ev_rx_xon;	/* Rx PAUSE(0) frames */
 	struct evcnt sc_ev_rx_macctl;	/* Rx Unsupported */
+
+	struct evcnt sc_ev_crcerrs;	/* CRC Error */
+	struct evcnt sc_ev_algnerrc;	/* Alignment Error */
+	struct evcnt sc_ev_symerrc;	/* Symbol Error */
+	struct evcnt sc_ev_rxerrc;	/* Receive Error */
+	struct evcnt sc_ev_mpc;		/* Missed Packets */
+	struct evcnt sc_ev_colc;	/* Collision */
+	struct evcnt sc_ev_sec;		/* Sequence Error */
+	struct evcnt sc_ev_cexterr;	/* Carrier Extension Error */
+	struct evcnt sc_ev_rlec;	/* Receive Length Error */
+	struct evcnt sc_ev_scc;		/* Single Collision */
+	struct evcnt sc_ev_ecol;	/* Excessive Collision */
+	struct evcnt sc_ev_mcc;		/* Multiple Collision */
+	struct evcnt sc_ev_latecol;	/* Late Collision */
+	struct evcnt sc_ev_dc;		/* Defer */
+	struct evcnt sc_ev_gprc;	/* Good Packets Rx */
+	struct evcnt sc_ev_bprc;	/* Broadcast Packets Rx */
+	struct evcnt sc_ev_mprc;	/* Multicast Packets Rx */
+	struct evcnt sc_ev_gptc;	/* Good Packets Tx */
+	struct evcnt sc_ev_gorc;	/* Good Octets Rx */
+	struct evcnt sc_ev_gotc;	/* Good Octets Tx */
+	struct evcnt sc_ev_rnbc;	/* Rx No Buffers */
+	struct evcnt sc_ev_ruc;		/* Rx Undersize */
+	struct evcnt sc_ev_rfc;		/* Rx Fragment */
+	struct evcnt sc_ev_roc;		/* Rx Oversize */
+	struct evcnt sc_ev_rjc;		/* Rx Jabber */
+	struct evcnt sc_ev_tor;		/* Total Octets Rx */
+	struct evcnt sc_ev_tot;		/* Total Octets Tx */
+	struct evcnt sc_ev_tpr;		/* Total Packets Rx */
+	struct evcnt sc_ev_tpt;		/* Total Packets Tx */
+	struct evcnt sc_ev_mptc;	/* Multicast Packets Tx */
+	struct evcnt sc_ev_bptc;	/* 

CVS commit: [netbsd-9] src/sys/dev/pci

2022-07-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 27 14:41:43 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket #1482


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.11 -r1.1371.2.12 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.11 -r1.1370.2.12 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/sys/dev/pci

2022-07-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 27 14:41:43 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket #1482


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.11 -r1.1371.2.12 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.11 -r1.1370.2.12 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2022-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 11 14:10:18 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1477:

sys/dev/pci/if_wmreg.h  1.122-1.125
sys/dev/pci/if_wmvar.h  1.48
sys/dev/pci/if_wm.c 1.719-1.720,
1.722-1.725,
1.727-1.740 via patch

- wm_tick: Add missing splx(s) when not WM_MPSAFE.
- Print DMA range info if the system is booting in the verbose mode.
- Micro optimization:
  - Call m_freem(m) only if m0 == NULL.
  - Call wm_xxeof() only when limit > 0.
  - Don't set the more flag when there is no packet to process.
- No functional changes:
  - Call txeof first, then rxeof for the consistency.
  - Remove duplicated break.
  - Remove stray semicolons from struct declaration.
  - Fix value return from void function.
  - Use macros.
  - Modify comment.
  - KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.12 -r1.645.2.13 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.4 -r1.115.2.5 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.44.4.3 -r1.44.4.4 src/sys/dev/pci/if_wmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.12 src/sys/dev/pci/if_wm.c:1.645.2.13
--- src/sys/dev/pci/if_wm.c:1.645.2.12	Sat Nov 20 14:59:04 2021
+++ src/sys/dev/pci/if_wm.c	Mon Jul 11 14:10:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.12 2021/11/20 14:59:04 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.13 2022/07/11 14:10:18 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -39,21 +39,21 @@
 
   Copyright (c) 2001-2005, Intel Corporation
   All rights reserved.
- 
+
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
- 
+
1. Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.
- 
+
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
- 
+
3. Neither the name of the Intel Corporation nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.
- 
+
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.12 2021/11/20 14:59:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.13 2022/07/11 14:10:18 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -321,9 +321,9 @@ struct wm_softc;
 #endif
 
 #ifdef WM_EVENT_COUNTERS
-#define WM_Q_EVCNT_DEFINE(qname, evname)\
+#define WM_Q_EVCNT_DEFINE(qname, evname) \
 	char qname##_##evname##_evcnt_name[sizeof("qname##XX##evname")]; \
-	struct evcnt qname##_ev_##evname;
+	struct evcnt qname##_ev_##evname
 
 #define WM_Q_EVCNT_ATTACH(qname, evname, q, qnum, xname, evtype)	\
 	do {\
@@ -342,7 +342,7 @@ struct wm_softc;
 	WM_Q_EVCNT_ATTACH(qname, evname, q, qnum, xname, EVCNT_TYPE_INTR)
 
 #define WM_Q_EVCNT_DETACH(qname, evname, q, qnum)	\
-	evcnt_detach(&(q)->qname##_ev_##evname);
+	evcnt_detach(&(q)->qname##_ev_##evname)
 #endif /* WM_EVENT_COUNTERS */
 
 struct wm_txqueue {
@@ -409,27 +409,27 @@ struct wm_txqueue {
 	uint32_t txq_bytes;		/* for AIM */
 #ifdef WM_EVENT_COUNTERS
 	/* TX event counters */
-	WM_Q_EVCNT_DEFINE(txq, txsstall)/* Stalled due to no txs */
-	WM_Q_EVCNT_DEFINE(txq, txdstall)/* Stalled due to no txd */
-	WM_Q_EVCNT_DEFINE(txq, fifo_stall)  /* FIFO stalls (82547) */
-	WM_Q_EVCNT_DEFINE(txq, txdw)	/* Tx descriptor interrupts */
-	WM_Q_EVCNT_DEFINE(txq, txqe)	/* Tx queue empty interrupts */
+	WM_Q_EVCNT_DEFINE(txq, txsstall);   /* Stalled due to no txs */
+	WM_Q_EVCNT_DEFINE(txq, txdstall);   /* Stalled due to no txd */
+	WM_Q_EVCNT_DEFINE(txq, fifo_stall); /* FIFO stalls (82547) */
+	WM_Q_EVCNT_DEFINE(txq, txdw);	/* Tx descriptor interrupts */
+	WM_Q_EVCNT_DEFINE(txq, txqe);	/* Tx queue empty interrupts */
 	/* XXX not used? */
 
-	WM_Q_EVCNT_DEFINE(txq, ipsum)	/* IP checksums comp. */
-	WM_Q_EVCNT_DEFINE(txq, tusum)	/* TCP/UDP cksums comp. */
-	WM_Q_EVCNT_DEFINE(txq, tusum6)	/* TCP/UDP v6 cksums comp. */
-	

CVS commit: [netbsd-9] src/sys/dev/pci

2022-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 11 14:10:18 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1477:

sys/dev/pci/if_wmreg.h  1.122-1.125
sys/dev/pci/if_wmvar.h  1.48
sys/dev/pci/if_wm.c 1.719-1.720,
1.722-1.725,
1.727-1.740 via patch

- wm_tick: Add missing splx(s) when not WM_MPSAFE.
- Print DMA range info if the system is booting in the verbose mode.
- Micro optimization:
  - Call m_freem(m) only if m0 == NULL.
  - Call wm_xxeof() only when limit > 0.
  - Don't set the more flag when there is no packet to process.
- No functional changes:
  - Call txeof first, then rxeof for the consistency.
  - Remove duplicated break.
  - Remove stray semicolons from struct declaration.
  - Fix value return from void function.
  - Use macros.
  - Modify comment.
  - KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.12 -r1.645.2.13 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.4 -r1.115.2.5 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.44.4.3 -r1.44.4.4 src/sys/dev/pci/if_wmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun  3 04:00:49 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1460):
sys/dev/pci/ixgbe/ixgbe.c: patch
Fix previous to re-enable legacy interrupt correctly. It's a part of
ixgbe.c rev. 1.273.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.23 -r1.199.2.24 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.23 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.24
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.23	Thu Jun  2 10:45:12 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Jun  3 04:00:49 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.23 2022/06/02 10:45:12 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.24 2022/06/03 04:00:49 snj Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.23 2022/06/02 10:45:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.24 2022/06/03 04:00:49 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -6542,7 +6542,7 @@ ixgbe_handle_que(void *context)
 		ixgbe_enable_queue(adapter, que->msix);
 	} else {
 		/* INTx or MSI */
-		ixgbe_enable_intr(adapter);
+		ixgbe_enable_queue(adapter, 0);
 	}
 
 	return;



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-06-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun  3 04:00:49 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1460):
sys/dev/pci/ixgbe/ixgbe.c: patch
Fix previous to re-enable legacy interrupt correctly. It's a part of
ixgbe.c rev. 1.273.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.23 -r1.199.2.24 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-06-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun  2 10:45:12 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c ixgbe.h ixgbe_type.h
ixgbe_x550.c ixv.c

Log Message:
Pull up the following revisions, all via patch, requested by msaitoh
in ticket #1459:

sys/dev/pci/ixgbe/ixgbe.c   1.261,1.265-1.268,1.273,1.275-1.277,
1.312,1.316-1.319 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.85 via patch
sys/dev/pci/ixgbe/ixgbe_type.h  1.46-1.47
sys/dev/pci/ixgbe/ixgbe_x550.c  1.26
sys/dev/pci/ixgbe/ixv.c 1.182

- Reduce code duplication between ixgbe_msix_admin() and
  ixgbe_legacy_irq().
  - Add missing code which was not in ixgbe_msix_admin() from
ixgbe_legacy_irq() and vice versa.
  - Reorder code.
- Disable/enable the OTHER interrupts correctly.
- Don't return in the middle of ixgbe_msix_admin() when an flow
  director reinit failed. NetBSD currently doesn't support flow
  director, so this is not a real bug.
- Print ECC, PHY and temp error log using with ratecheck().
- Correctly re-enable queue interrupt in ixgbe_legacy_irq().
- Correctly enter the recovery mode.
- No functional change:
  - Add some debug printf()s.
  - Don't use "more" flag for simplify.
  - Fix typos in comment.
  - KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.22 -r1.199.2.23 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.8 -r1.56.2.9 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.41.2.6 -r1.41.2.7 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.15.2.5 -r1.15.2.6 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.125.2.19 -r1.125.2.20 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.22 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.23
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.22	Tue May 31 14:03:26 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Jun  2 10:45:12 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.22 2022/05/31 14:03:26 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.23 2022/06/02 10:45:12 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.22 2022/05/31 14:03:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.23 2022/06/02 10:45:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -262,12 +262,11 @@ static int	ixgbe_sysctl_wufc(SYSCTLFN_PR
 /* Support for pluggable optic modules */
 static bool	ixgbe_sfp_probe(struct adapter *);
 
-/* Legacy (single vector) interrupt handler */
-static int	ixgbe_legacy_irq(void *);
-
-/* The MSI/MSI-X Interrupt handlers */
+/* Interrupt functions */
 static int	ixgbe_msix_que(void *);
-static int	ixgbe_msix_link(void *);
+static int	ixgbe_msix_admin(void *);
+static void	ixgbe_intr_admin_common(struct adapter *, u32, u32 *);
+static int	ixgbe_legacy_irq(void *);
 
 /* Software interrupts for deferred work */
 static void	ixgbe_handle_que(void *);
@@ -422,6 +421,9 @@ static int (*ixgbe_ring_empty)(struct if
 #endif
 #define IXGBE_WORKQUEUE_PRI PRI_SOFTNET
 
+/* Interval between reports of errors */
+static const struct timeval ixgbe_errlog_intrvl = { 60, 0 };	/* 60s */
+
 /
  * ixgbe_initialize_rss_mapping
  /
@@ -624,12 +626,11 @@ ixgbe_initialize_receive_units(struct ad
 		 * so we do not need to clear the bit, but do it just in case
 		 * this code is moved elsewhere.
 		 */
-		if (adapter->num_queues > 1 &&
-		adapter->hw.fc.requested_mode == ixgbe_fc_none) {
+		if ((adapter->num_queues > 1) &&
+		(adapter->hw.fc.requested_mode == ixgbe_fc_none))
 			srrctl |= IXGBE_SRRCTL_DROP_EN;
-		} else {
+		else
 			srrctl &= ~IXGBE_SRRCTL_DROP_EN;
-		}
 
 		IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(j), srrctl);
 
@@ -847,7 +848,8 @@ ixgbe_attach(device_t parent, device_t d
 	 * Initialize the shared code
 	 */
 	if (ixgbe_init_shared_code(hw) != 0) {
-		aprint_error_dev(dev, "Unable to initialize the shared code\n");
+		aprint_error_dev(dev,
+		"Unable to initialize the shared code\n");
 		error = ENXIO;
 		goto err_out;
 	}
@@ -1153,7 +1155,8 @@ ixgbe_attach(device_t parent, device_t d
 	error = ixgbe_start_hw(hw);
 	switch (error) {
 	case IXGBE_ERR_EEPROM_VERSION:
-		aprint_error_dev(dev, "This device is a pre-production adapter/"
+		aprint_error_dev(dev,
+		"This device is a pre-production adapter/"
 		"LOM.  Please be aware there may be issues associated "
 		"with your hardware.\nIf you are experiencing problems "
 		"please contact your Intel or hardware representative "
@@ -1439,60 +1442,45 @@ ixgbe_add_media_types(struct 

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-06-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun  2 10:45:12 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c ixgbe.h ixgbe_type.h
ixgbe_x550.c ixv.c

Log Message:
Pull up the following revisions, all via patch, requested by msaitoh
in ticket #1459:

sys/dev/pci/ixgbe/ixgbe.c   1.261,1.265-1.268,1.273,1.275-1.277,
1.312,1.316-1.319 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.85 via patch
sys/dev/pci/ixgbe/ixgbe_type.h  1.46-1.47
sys/dev/pci/ixgbe/ixgbe_x550.c  1.26
sys/dev/pci/ixgbe/ixv.c 1.182

- Reduce code duplication between ixgbe_msix_admin() and
  ixgbe_legacy_irq().
  - Add missing code which was not in ixgbe_msix_admin() from
ixgbe_legacy_irq() and vice versa.
  - Reorder code.
- Disable/enable the OTHER interrupts correctly.
- Don't return in the middle of ixgbe_msix_admin() when an flow
  director reinit failed. NetBSD currently doesn't support flow
  director, so this is not a real bug.
- Print ECC, PHY and temp error log using with ratecheck().
- Correctly re-enable queue interrupt in ixgbe_legacy_irq().
- Correctly enter the recovery mode.
- No functional change:
  - Add some debug printf()s.
  - Don't use "more" flag for simplify.
  - Fix typos in comment.
  - KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.22 -r1.199.2.23 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.8 -r1.56.2.9 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.41.2.6 -r1.41.2.7 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.15.2.5 -r1.15.2.6 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.125.2.19 -r1.125.2.20 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-05-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 31 14:03:27 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c ixgbe.h ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1458):

sys/dev/pci/ixgbe/ixv.c: revision 1.181
sys/dev/pci/ixgbe/ixgbe.c: revision 1.315
sys/dev/pci/ixgbe/ixgbe.h: revision 1.86

Fix a bug that the legacy interrupt doesn't work when MSI-X allocation failed.
Fixes PR kern/56857.

Remove unused adapter->msix_mem.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.21 -r1.199.2.22 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.7 -r1.56.2.8 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.125.2.18 -r1.125.2.19 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.21 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.22
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.21	Mon May 30 17:01:06 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue May 31 14:03:26 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.21 2022/05/30 17:01:06 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.22 2022/05/31 14:03:26 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.21 2022/05/30 17:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.22 2022/05/31 14:03:26 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1096,7 +1096,6 @@ ixgbe_attach(device_t parent, device_t d
 			ixgbe_free_queues(adapter);
 
 			/* Fallback to legacy interrupt */
-			adapter->feat_en &= ~IXGBE_FEATURE_MSIX;
 			if (adapter->feat_cap & IXGBE_FEATURE_MSI)
 adapter->feat_en |= IXGBE_FEATURE_MSI;
 			adapter->num_queues = 1;
@@ -5054,7 +5053,7 @@ ixgbe_enable_intr(struct adapter *adapte
 	IXGBE_WRITE_REG(hw, IXGBE_EIMS, mask);
 
 	/* With MSI-X we use auto clear */
-	if (adapter->msix_mem) {
+	if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0) {
 		/*
 		 * We use auto clear for RTX_QUEUE only. Don't use other
 		 * interrupts (e.g. link interrupt). BTW, we don't use
@@ -5086,7 +5085,7 @@ ixgbe_disable_intr_internal(struct adapt
 	/* disable interrupts other than queues */
 	IXGBE_WRITE_REG(>hw, IXGBE_EIMC, ~IXGBE_EIMC_RTX_QUEUE);
 
-	if (adapter->msix_mem)
+	if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0)
 		IXGBE_WRITE_REG(>hw, IXGBE_EIAC, 0);
 
 	for (int i = 0; i < adapter->num_queues; i++, que++)
@@ -6743,6 +6742,7 @@ ixgbe_allocate_msix(struct adapter *adap
 	adapter->osdep.nintrs) != 0) {
 		aprint_error_dev(dev,
 		"failed to allocate MSI-X interrupt\n");
+		adapter->feat_en &= ~IXGBE_FEATURE_MSIX;
 		return (ENXIO);
 	}
 
@@ -6942,7 +6942,7 @@ ixgbe_configure_interrupts(struct adapte
 	if (msgs < 2)
 		goto msi;
 
-	adapter->msix_mem = (void *)1; /* XXX */
+	adapter->feat_en |= IXGBE_FEATURE_MSIX;
 
 	/* Figure out a reasonable auto config value */
 	queues = (ncpu > (msgs - 1)) ? (msgs - 1) : ncpu;
@@ -6996,7 +6996,7 @@ msi:
 	adapter->feat_en  &= ~IXGBE_FEATURE_SRIOV;
 
 	msgs = pci_msi_count(adapter->osdep.pc, adapter->osdep.tag);
-	adapter->msix_mem = NULL; /* XXX */
+	adapter->feat_en &= ~IXGBE_FEATURE_MSIX;
 	if (msgs > 1)
 		msgs = 1;
 	if (msgs != 0) {

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.56.2.7 src/sys/dev/pci/ixgbe/ixgbe.h:1.56.2.8
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.56.2.7	Sun Jan 30 15:58:28 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Tue May 31 14:03:27 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.56.2.7 2022/01/30 15:58:28 martin Exp $ */
+/* $NetBSD: ixgbe.h,v 1.56.2.8 2022/05/31 14:03:27 martin Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -479,7 +479,6 @@ struct adapter {
 	struct if_percpuq	*ipq;	/* softint-based input queues */
 
 	struct resource		*pci_mem;
-	struct resource		*msix_mem;
 
 	/* NetBSD: Interrupt resources are in osdep */
 

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.125.2.18 src/sys/dev/pci/ixgbe/ixv.c:1.125.2.19
--- src/sys/dev/pci/ixgbe/ixv.c:1.125.2.18	Mon May 30 17:01:06 2022
+++ src/sys/dev/pci/ixgbe/ixv.c	Tue May 31 14:03:26 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixv.c,v 1.125.2.18 2022/05/30 17:01:06 martin Exp $ */
+/* $NetBSD: ixv.c,v 1.125.2.19 2022/05/31 14:03:26 martin Exp $ */
 
 /**
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.125.2.18 2022/05/30 17:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.125.2.19 2022/05/31 14:03:26 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3487,7 +3487,6 

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-05-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 31 14:03:27 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c ixgbe.h ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1458):

sys/dev/pci/ixgbe/ixv.c: revision 1.181
sys/dev/pci/ixgbe/ixgbe.c: revision 1.315
sys/dev/pci/ixgbe/ixgbe.h: revision 1.86

Fix a bug that the legacy interrupt doesn't work when MSI-X allocation failed.
Fixes PR kern/56857.

Remove unused adapter->msix_mem.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.21 -r1.199.2.22 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.7 -r1.56.2.8 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.125.2.18 -r1.125.2.19 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-05-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 30 17:01:06 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh:

sys/dev/pci/ixgbe/ixgbe.c   1.270,1.280,1.307-1.311,
1.313-1.314 via patch
sys/dev/pci/ixgbe/ix_txrx.c 1.96-1.97
sys/dev/pci/ixgbe/ixv.c 1.158,1.179-1.180 via patch

- ixg(4): Print Printed Board Assembly (PBA) number.
- ixg(4): Add IFF_RUNNING check in ixgbe_legacy_irq() again. this might
  fix small race but it's not so dangerous.
- Add value check for {tx,rx}_process_limit sysctl to avoid setting
  wrong value.
- Add missing num_tx_desc sysctl.
- No functional change:
  - KNF a bit.
  - Simplify setting of EIAC register.
  - Move the definition of eicr_mask variable.
  - Enclose flow director stuff in ixgbe_intr_admin_common() with
IXGBE_FIR which is not defined in NetBSD.
  - Modify comment for consistency.
  - Use cached rx_copy_len in ixgbe_rxeof().


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.9 -r1.54.2.10 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.20 -r1.199.2.21 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.125.2.17 -r1.125.2.18 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.9 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.10
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.9	Fri May 13 11:18:40 2022
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Mon May 30 17:01:06 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.9 2022/05/13 11:18:40 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.9 2022/05/13 11:18:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1819,6 +1819,7 @@ ixgbe_rxeof(struct ix_queue *que)
 	u32			staterr = 0;
 	u32			loopcount = 0, numdesc;
 	u32			limit = adapter->rx_process_limit;
+	u32			rx_copy_len = adapter->rx_copy_len;
 	bool			discard_multidesc = rxr->discard_multidesc;
 	bool			wraparound = false;
 	unsigned int		syncremain;
@@ -1929,7 +1930,7 @@ ixgbe_rxeof(struct ix_queue *que)
 			/* Pre-alloc new mbuf. */
 
 			if ((rbuf->fmp == NULL) &&
-			eop && (len <= adapter->rx_copy_len)) {
+			eop && (len <= rx_copy_len)) {
 /* For short packet. See below. */
 sendmp = m_gethdr(M_NOWAIT, MT_DATA);
 if (__predict_false(sendmp == NULL)) {
@@ -2035,7 +2036,7 @@ ixgbe_rxeof(struct ix_queue *que)
 			 * packet.
 			 */
 
-			if (eop && (len <= adapter->rx_copy_len)) {
+			if (eop && (len <= rx_copy_len)) {
 /*
  * Optimize.  This might be a small packet, may
  * be just a TCP ACK. Copy into a new mbuf, and
@@ -2047,7 +2048,7 @@ ixgbe_rxeof(struct ix_queue *que)
 IXGBE_EVC_ADD(>rx_copies, 1);
 rbuf->flags |= IXGBE_RX_COPY;
 			} else {
-/* Non short packet */
+/* For long packet */
 
 /* Update new (used in future) mbuf */
 newmp->m_pkthdr.len = newmp->m_len

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.20 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.21
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.20	Wed Feb  2 14:25:49 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon May 30 17:01:06 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.20 2022/02/02 14:25:49 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.21 2022/05/30 17:01:06 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.20 2022/02/02 14:25:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.21 2022/05/30 17:01:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -235,8 +235,6 @@ static int	ixgbe_set_advertise(struct ad
 static int	ixgbe_get_default_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);
@@ -256,6 +254,8 @@ static int	ixgbe_sysctl_tdh_handler(SYSC
 static int	ixgbe_sysctl_eee_state(SYSCTLFN_PROTO);
 static int	ixgbe_sysctl_debug(SYSCTLFN_PROTO);
 static int	ixgbe_sysctl_rx_copy_len(SYSCTLFN_PROTO);
+static int	ixgbe_sysctl_tx_process_limit(SYSCTLFN_PROTO);
+static int	ixgbe_sysctl_rx_process_limit(SYSCTLFN_PROTO);
 static int	ixgbe_sysctl_wol_enable(SYSCTLFN_PROTO);
 static int	

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-05-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 30 17:01:06 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh:

sys/dev/pci/ixgbe/ixgbe.c   1.270,1.280,1.307-1.311,
1.313-1.314 via patch
sys/dev/pci/ixgbe/ix_txrx.c 1.96-1.97
sys/dev/pci/ixgbe/ixv.c 1.158,1.179-1.180 via patch

- ixg(4): Print Printed Board Assembly (PBA) number.
- ixg(4): Add IFF_RUNNING check in ixgbe_legacy_irq() again. this might
  fix small race but it's not so dangerous.
- Add value check for {tx,rx}_process_limit sysctl to avoid setting
  wrong value.
- Add missing num_tx_desc sysctl.
- No functional change:
  - KNF a bit.
  - Simplify setting of EIAC register.
  - Move the definition of eicr_mask variable.
  - Enclose flow director stuff in ixgbe_intr_admin_common() with
IXGBE_FIR which is not defined in NetBSD.
  - Modify comment for consistency.
  - Use cached rx_copy_len in ixgbe_rxeof().


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.9 -r1.54.2.10 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.20 -r1.199.2.21 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.125.2.17 -r1.125.2.18 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci

2022-05-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May 19 16:24:20 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: if_bge.c

Log Message:
Pull up following revision(s) (requested by buhrow in ticket #1456):

sys/dev/pci/if_bge.c: revision 1.353

For chips which contain an ASF/IPMI firmware, instruct the chip to shut
the host ASF firmware down when attaching the device so the IPMI BMC
can use the same physical port even when NetBSD doesn't have a
network configuration on the device.
By contrast, when the device gets a network configuration assigned to
it and bge_init() is called, the host ASF firmware is brought up so
both NetBSD and the IPMI BMc can use the same physical port.

This now matches FreeBSD behavior, as well as  behavior from NetBSD-5.2.

Tested on a Sunfire X2200-M2 system with the following chip:

bge1 at pci7 dev 4 function 1: Broadcom BCM5715 Gigabit Ethernet
bge1: interrupting at ioapic0 pin 11
bge1: HW config 00d4, 0014, ,  
bge1: ASIC BCM5715 A3 (0x9003), Ethernet address 00:1e:68:XX:XX:XX
bge1: setting short Tx thresholds
brgphy1 at bge1 phy 1: BCM5714 1000BASE-T/X media interface, rev. 0
brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto


To generate a diff of this commit:
cvs rdiff -u -r1.335.2.1 -r1.335.2.2 src/sys/dev/pci/if_bge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.335.2.1 src/sys/dev/pci/if_bge.c:1.335.2.2
--- src/sys/dev/pci/if_bge.c:1.335.2.1	Wed Nov 27 11:08:24 2019
+++ src/sys/dev/pci/if_bge.c	Thu May 19 16:24:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.335.2.1 2019/11/27 11:08:24 martin Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.335.2.2 2022/05/19 16:24:20 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.335.2.1 2019/11/27 11:08:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.335.2.2 2022/05/19 16:24:20 martin Exp $");
 
 #include 
 #include 
@@ -3646,7 +3646,7 @@ bge_attach(device_t parent, device_t sel
 	BGE_SETBIT_FLUSH(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_AUTO_EEPROM);
 
 	bge_stop_fw(sc);
-	bge_sig_pre_reset(sc, BGE_RESET_START);
+	bge_sig_pre_reset(sc, BGE_RESET_SHUTDOWN);
 	if (bge_reset(sc))
 		aprint_error_dev(sc->bge_dev, "chip reset failed\n");
 
@@ -3680,8 +3680,8 @@ bge_attach(device_t parent, device_t sel
 	"HW config %08x, %08x, %08x, %08x %08x\n",
 	hwcfg, hwcfg2, hwcfg3, hwcfg4, hwcfg5);
 
-	bge_sig_legacy(sc, BGE_RESET_START);
-	bge_sig_post_reset(sc, BGE_RESET_START);
+	bge_sig_legacy(sc, BGE_RESET_SHUTDOWN);
+	bge_sig_post_reset(sc, BGE_RESET_SHUTDOWN);
 
 	if (bge_chipinit(sc)) {
 		aprint_error_dev(sc->bge_dev, "chip initialization failed\n");



CVS commit: [netbsd-9] src/sys/dev/pci

2022-05-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May 19 16:24:20 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: if_bge.c

Log Message:
Pull up following revision(s) (requested by buhrow in ticket #1456):

sys/dev/pci/if_bge.c: revision 1.353

For chips which contain an ASF/IPMI firmware, instruct the chip to shut
the host ASF firmware down when attaching the device so the IPMI BMC
can use the same physical port even when NetBSD doesn't have a
network configuration on the device.
By contrast, when the device gets a network configuration assigned to
it and bge_init() is called, the host ASF firmware is brought up so
both NetBSD and the IPMI BMc can use the same physical port.

This now matches FreeBSD behavior, as well as  behavior from NetBSD-5.2.

Tested on a Sunfire X2200-M2 system with the following chip:

bge1 at pci7 dev 4 function 1: Broadcom BCM5715 Gigabit Ethernet
bge1: interrupting at ioapic0 pin 11
bge1: HW config 00d4, 0014, ,  
bge1: ASIC BCM5715 A3 (0x9003), Ethernet address 00:1e:68:XX:XX:XX
bge1: setting short Tx thresholds
brgphy1 at bge1 phy 1: BCM5714 1000BASE-T/X media interface, rev. 0
brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto


To generate a diff of this commit:
cvs rdiff -u -r1.335.2.1 -r1.335.2.2 src/sys/dev/pci/if_bge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-05-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 13 11:18:40 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1445):

sys/dev/pci/ixgbe/ix_txrx.c: revision 1.98

bus_dmamem_unmap() before bus_dmamem_free(), otherwise we may give back meomry
which is still (and will stay) mapped.

Fixes one instance of "panic: HYPERVISOR_mmu_update failed" on Xen.
There may be others.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.8 -r1.54.2.9 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.8 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.9
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.8	Wed Feb  2 14:25:49 2022
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri May 13 11:18:40 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.8 2022/02/02 14:25:49 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.9 2022/05/13 11:18:40 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.8 2022/02/02 14:25:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.9 2022/05/13 11:18:40 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -2321,6 +2321,7 @@ ixgbe_dma_free(struct adapter *adapter, 
 	bus_dmamap_sync(dma->dma_tag->dt_dmat, dma->dma_map, 0, dma->dma_size,
 	BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 	ixgbe_dmamap_unload(dma->dma_tag, dma->dma_map);
+	bus_dmamem_unmap(dma->dma_tag->dt_dmat, dma->dma_vaddr, dma->dma_size);
 	bus_dmamem_free(dma->dma_tag->dt_dmat, >dma_seg, 1);
 	ixgbe_dma_tag_destroy(dma->dma_tag);
 } /* ixgbe_dma_free */



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-05-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri May 13 11:18:40 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1445):

sys/dev/pci/ixgbe/ix_txrx.c: revision 1.98

bus_dmamem_unmap() before bus_dmamem_free(), otherwise we may give back meomry
which is still (and will stay) mapped.

Fixes one instance of "panic: HYPERVISOR_mmu_update failed" on Xen.
There may be others.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.8 -r1.54.2.9 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb  2 14:25:49 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_mbx.c
ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions (requested by msaitoh in ticket #1424):

sys/dev/pci/ixgbe/ix_txrx.c 1.95
sys/dev/pci/ixgbe/ixgbe.c   1.305 via patch
sys/dev/pci/ixgbe/ixgbe_mbx.c   1.19
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.15-1.16
sys/dev/pci/ixgbe/ixv.c 1.178 via patch

Use atomic_{load,store}_relaxed() for event counters.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.7 -r1.54.2.8 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.19 -r1.199.2.20 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.11.2.3 -r1.11.2.4 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.11.4.2 -r1.11.4.3 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.125.2.16 -r1.125.2.17 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.7 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.8
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.7	Sat Nov 20 15:16:53 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Feb  2 14:25:49 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.7 2021/11/20 15:16:53 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.8 2022/02/02 14:25:49 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.7 2021/11/20 15:16:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.8 2022/02/02 14:25:49 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -247,7 +247,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 
 	if (__predict_false(!pcq_put(txr->txr_interq, m))) {
 		m_freem(m);
-		txr->pcq_drops.ev_count++;
+		IXGBE_EVC_ADD(>pcq_drops, 1);
 		return ENOBUFS;
 	}
 	if (IXGBE_TX_TRYLOCK(txr)) {
@@ -475,7 +475,7 @@ retry:
 	/* Make certain there are enough descriptors */
 	if (txr->tx_avail < (map->dm_nsegs + 2)) {
 		txr->txr_no_space = true;
-		txr->no_desc_avail.ev_count++;
+		IXGBE_EVC_ADD(>no_desc_avail, 1);
 		ixgbe_dmamap_unload(txr->txtag, txbuf->map);
 		return EAGAIN;
 	}
@@ -546,7 +546,7 @@ retry:
 	 * Advance the Transmit Descriptor Tail (Tdt), this tells the
 	 * hardware that this frame is available to transmit.
 	 */
-	++txr->total_packets.ev_count;
+	IXGBE_EVC_ADD(>total_packets, 1);
 	IXGBE_WRITE_REG(>hw, txr->tail, i);
 
 	/*
@@ -583,7 +583,7 @@ ixgbe_drain(struct ifnet *ifp, struct tx
 
 	while ((m = pcq_get(txr->txr_interq)) != NULL) {
 		m_freem(m);
-		txr->pcq_drops.ev_count++;
+		IXGBE_EVC_ADD(>pcq_drops, 1);
 	}
 }
 
@@ -846,7 +846,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 		int rv = ixgbe_tso_setup(txr, mp, cmd_type_len, olinfo_status);
 
 		if (rv != 0)
-			++adapter->tso_err.ev_count;
+			IXGBE_EVC_ADD(>tso_err, 1);
 		return rv;
 	}
 
@@ -1088,7 +1088,7 @@ ixgbe_tso_setup(struct tx_ring *txr, str
 	*cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE;
 	*olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8;
 	*olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT;
-	++txr->tso_tx.ev_count;
+	IXGBE_EVC_ADD(>tso_tx, 1);
 
 	return (0);
 } /* ixgbe_tso_setup */
@@ -1360,7 +1360,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
 		if (__predict_false(rxbuf->buf == NULL)) {
 			mp = ixgbe_getcl();
 			if (mp == NULL) {
-rxr->no_mbuf.ev_count++;
+IXGBE_EVC_ADD(>no_mbuf, 1);
 goto update;
 			}
 			mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz;
@@ -1549,7 +1549,7 @@ ixgbe_setup_receive_ring(struct rx_ring 
 		rxbuf->flags = 0;
 		rxbuf->buf = ixgbe_getcl();
 		if (rxbuf->buf == NULL) {
-			rxr->no_mbuf.ev_count++;
+			IXGBE_EVC_ADD(>no_mbuf, 1);
 			error = ENOBUFS;
 			goto fail;
 		}
@@ -1582,11 +1582,11 @@ ixgbe_setup_receive_ring(struct rx_ring 
 	rxr->next_to_refresh = adapter->num_rx_desc - 1; /* Fully allocated */
 	rxr->lro_enabled = FALSE;
 	rxr->discard_multidesc = false;
-	rxr->rx_copies.ev_count = 0;
+	IXGBE_EVC_STORE(>rx_copies, 0);
 #if 0 /* NetBSD */
-	rxr->rx_bytes.ev_count = 0;
+	IXGBE_EVC_STORE(>rx_bytes, 0);
 #if 1	/* Fix inconsistency */
-	rxr->rx_packets.ev_count = 0;
+	IXGBE_EVC_STORE(>rx_packets, 0);
 #endif
 #endif
 	rxr->vtag_strip = FALSE;
@@ -1917,7 +1917,7 @@ ixgbe_rxeof(struct ix_queue *que)
 			if (adapter->feat_en & IXGBE_FEATURE_VF)
 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
 #endif
-			rxr->rx_discarded.ev_count++;
+			IXGBE_EVC_ADD(>rx_discarded, 1);
 			ixgbe_rx_discard(rxr, i);
 			discard_multidesc = false;
 			goto next_desc;
@@ -1933,14 +1933,14 @@ ixgbe_rxeof(struct ix_queue *que)
 /* For short packet. See below. */
 sendmp = m_gethdr(M_NOWAIT, MT_DATA);
 if 

CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-02-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb  2 14:25:49 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_mbx.c
ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions (requested by msaitoh in ticket #1424):

sys/dev/pci/ixgbe/ix_txrx.c 1.95
sys/dev/pci/ixgbe/ixgbe.c   1.305 via patch
sys/dev/pci/ixgbe/ixgbe_mbx.c   1.19
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.15-1.16
sys/dev/pci/ixgbe/ixv.c 1.178 via patch

Use atomic_{load,store}_relaxed() for event counters.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.7 -r1.54.2.8 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.19 -r1.199.2.20 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.11.2.3 -r1.11.2.4 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.11.4.2 -r1.11.4.3 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.125.2.16 -r1.125.2.17 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-02-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb  1 11:35:46 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1420:

sys/dev/pci/ixgbe/ixgbe.c   1.264,1.269,1.272,
1.306 via patch

Four INTx related fixes:
- Fix a bug that the all interrupt sources are enabled when the
  interface is UP and the INTx line is shared with other devices.
- Fix a bug that it might incorrectly enable interrupt when
  IFF_RUNNING is not set.
- Don't process TX/RX if a queue interrupt isn't occurred.
- Increment legacy interrupt counter after checking INTx sharing.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.18 -r1.199.2.19 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.18 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.19
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.18	Mon Jan 31 17:36:25 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Feb  1 11:35:45 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.18 2022/01/31 17:36:25 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.19 2022/02/01 11:35:45 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.18 2022/01/31 17:36:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.19 2022/02/01 11:35:45 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -5115,28 +5115,34 @@ ixgbe_legacy_irq(void *arg)
 	struct ix_queue *que = arg;
 	struct adapter	*adapter = que->adapter;
 	struct ixgbe_hw	*hw = >hw;
-	struct ifnet	*ifp = adapter->ifp;
 	struct		tx_ring *txr = adapter->tx_rings;
 	bool		more = false;
 	u32		eicr, eicr_mask;
+	u32		eims_orig;
 
-	/* Silicon errata #26 on 82598 */
+	eims_orig = IXGBE_READ_REG(hw, IXGBE_EIMS);
+	/*
+	 * Silicon errata #26 on 82598. Disable all interrupts before reading
+	 * EICR.
+	 */
 	IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK);
 
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 
-	adapter->stats.pf.legint.ev_count++;
-	++que->irqs.ev_count;
 	if (eicr == 0) {
 		adapter->stats.pf.intzero.ev_count++;
-		if ((ifp->if_flags & IFF_UP) != 0)
-			ixgbe_enable_intr(adapter);
+		IXGBE_WRITE_REG(hw, IXGBE_EIMS, eims_orig);
 		return 0;
 	}
+	adapter->stats.pf.legint.ev_count++;
+
+	/* Queue (0) intr */
+	if ((eicr & IXGBE_EIMC_RTX_QUEUE) != 0) {
+		++que->irqs.ev_count;
 
-	if ((ifp->if_flags & IFF_RUNNING) != 0) {
 		/*
-		 * The same as ixgbe_msix_que() about "que->txrx_use_workqueue".
+		 * The same as ixgbe_msix_que() about
+		 * "que->txrx_use_workqueue".
 		 */
 		que->txrx_use_workqueue = adapter->txrx_use_workqueue;
 



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-02-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb  1 11:35:46 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ixgbe.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1420:

sys/dev/pci/ixgbe/ixgbe.c   1.264,1.269,1.272,
1.306 via patch

Four INTx related fixes:
- Fix a bug that the all interrupt sources are enabled when the
  interface is UP and the INTx line is shared with other devices.
- Fix a bug that it might incorrectly enable interrupt when
  IFF_RUNNING is not set.
- Don't process TX/RX if a queue interrupt isn't occurred.
- Increment legacy interrupt counter after checking INTx sharing.


To generate a diff of this commit:
cvs rdiff -u -r1.199.2.18 -r1.199.2.19 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/dev/pci/ixgbe

2022-01-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 31 17:36:25 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: if_sriov.c ixgbe.c ixgbe_82599.c
ixgbe_mbx.c ixgbe_mbx.h ixgbe_type.h ixgbe_vf.c ixgbe_x540.c ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1416):

sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.19
sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.31
sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.23
sys/dev/pci/ixgbe/if_sriov.c: revision 1.17
sys/dev/pci/ixgbe/ixv.c: revision 1.172
sys/dev/pci/ixgbe/ixv.c: revision 1.173
sys/dev/pci/ixgbe/ixgbe.c: revision 1.301
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.55
sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.29
sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.16
sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.17
sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.18

Add code to support API version 1.5. No functional change.
   - This change adds almost all code to support API 1.5 except real negotiation
 and upgrade mailbox functions.
   - From ix-3.3.18, ix-3.3.22 and ixv-1.5.24.

Enable mailbox API 1.5 support. Tested on ESXi with ixgben 1.10.3.0.

Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_vf().
Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_pf().


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/dev/pci/ixgbe/if_sriov.c
cvs rdiff -u -r1.199.2.17 -r1.199.2.18 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.21.4.3 -r1.21.4.4 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.11.2.2 -r1.11.2.3 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.14.2.1 -r1.14.2.2 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.41.2.5 -r1.41.2.6 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.18.2.5 -r1.18.2.6 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.16.8.3 -r1.16.8.4 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.125.2.15 -r1.125.2.16 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/if_sriov.c
diff -u src/sys/dev/pci/ixgbe/if_sriov.c:1.6.2.2 src/sys/dev/pci/ixgbe/if_sriov.c:1.6.2.3
--- src/sys/dev/pci/ixgbe/if_sriov.c:1.6.2.2	Sun Jan 30 15:58:28 2022
+++ src/sys/dev/pci/ixgbe/if_sriov.c	Mon Jan 31 17:36:25 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: if_sriov.c,v 1.6.2.2 2022/01/30 15:58:28 martin Exp $ */
+/* $NetBSD: if_sriov.c,v 1.6.2.3 2022/01/31 17:36:25 martin Exp $ */
 /**
 
   Copyright (c) 2001-2017, Intel Corporation
@@ -34,7 +34,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.6.2.2 2022/01/30 15:58:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.6.2.3 2022/01/31 17:36:25 martin Exp $");
 
 #include "ixgbe.h"
 #include "ixgbe_sriov.h"
@@ -99,7 +99,7 @@ ixgbe_send_vf_msg(struct ixgbe_hw *hw, s
 	if (vf->flags & IXGBE_VF_CTS)
 		msg |= IXGBE_VT_MSGTYPE_CTS;
 
-	hw->mbx.ops.write(hw, , 1, vf->pool);
+	hw->mbx.ops[vf->pool].write(hw, , 1, vf->pool);
 }
 
 static inline void
@@ -594,7 +594,8 @@ ixgbe_process_vf_msg(struct adapter *ada
 
 	hw = >hw;
 
-	error = hw->mbx.ops.read(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool);
+	error = hw->mbx.ops[vf->pool].read(hw, msg, IXGBE_VFMAILBOX_SIZE,
+	vf->pool);
 
 	if (error != 0)
 		return;
@@ -654,16 +655,17 @@ ixgbe_handle_mbx(void *context)
 	for (i = 0; i < adapter->num_vfs; i++) {
 		vf = >vfs[i];
 
-		if (vf->flags & IXGBE_VF_ACTIVE) {
-			if (hw->mbx.ops.check_for_rst(hw, vf->pool) == 0)
-ixgbe_process_vf_reset(adapter, vf);
-
-			if (hw->mbx.ops.check_for_msg(hw, vf->pool) == 0)
-ixgbe_process_vf_msg(adapter, vf);
-
-			if (hw->mbx.ops.check_for_ack(hw, vf->pool) == 0)
-ixgbe_process_vf_ack(adapter, vf);
-		}
+		if ((vf->flags & IXGBE_VF_ACTIVE) == 0)
+			continue;
+
+		if (hw->mbx.ops[vf->pool].check_for_rst(hw, vf->pool) == 0)
+			ixgbe_process_vf_reset(adapter, vf);
+
+		if (hw->mbx.ops[vf->pool].check_for_msg(hw, vf->pool) == 0)
+			ixgbe_process_vf_msg(adapter, vf);
+
+		if (hw->mbx.ops[vf->pool].check_for_ack(hw, vf->pool) == 0)
+			ixgbe_process_vf_ack(adapter, vf);
 	}
 	IXGBE_CORE_UNLOCK(adapter);
 } /* ixgbe_handle_mbx */

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.17 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.18
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.17	Sun Jan 30 15:58:28 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Jan 31 17:36:25 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.17 2022/01/30 15:58:28 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.18 2022/01/31 17:36:25 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 

  1   2   >