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

2024-02-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 23 18:36:00 UTC 2024

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

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

sys/dev/pci/ixgbe/ixgbe.c: revision 1.349

ixgbe: Add QPRDC into iqdrops.

 A receive packet might drop at two different locations.

One is the packet buffer that packets are received into the chip first.
If the packet buffer is overflowed, the MPC register is incremented.
It's currently added to iqdrops. It's no problem.

Another is descriptor ring(s). A packet from the packet buffer is DMA'ed
into main memory base on the descriptor ring. If the ring is full, the packet
is dropped and the QPRDC register is incremented. It should be added to
iqdrops but it was not done. Fix it.

Reported by ozaki-r@.


To generate a diff of this commit:
cvs rdiff -u -r1.324.2.7 -r1.324.2.8 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.324.2.7 src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.8
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.7	Sat Feb  3 11:58:53 2024
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Feb 23 18:35:59 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.324.2.7 2024/02/03 11:58:53 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.324.2.8 2024/02/23 18:35:59 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324.2.7 2024/02/03 11:58:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324.2.8 2024/02/23 18:35:59 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1637,7 +1637,7 @@ ixgbe_update_stats_counters(struct ixgbe
 	struct ixgbe_hw	  *hw = >hw;
 	struct ixgbe_hw_stats *stats = >stats.pf;
 	u32		  missed_rx = 0, bprc, lxontxc, lxofftxc;
-	u64		  total, total_missed_rx = 0;
+	u64		  total, total_missed_rx = 0, total_qprdc = 0;
 	uint64_t	  crcerrs, illerrc, rlec, ruc, rfc, roc, rjc;
 	unsigned int	  queue_counters;
 	int		  i;
@@ -1656,13 +1656,18 @@ ixgbe_update_stats_counters(struct ixgbe
 		IXGBE_EVC_REGADD(hw, stats, IXGBE_QPRC(i), qprc[i]);
 		IXGBE_EVC_REGADD(hw, stats, IXGBE_QPTC(i), qptc[i]);
 		if (hw->mac.type >= ixgbe_mac_82599EB) {
+			uint32_t qprdc;
+
 			IXGBE_EVC_ADD(>qbrc[i],
 			IXGBE_READ_REG(hw, IXGBE_QBRC_L(i)) +
 			((u64)IXGBE_READ_REG(hw, IXGBE_QBRC_H(i)) << 32));
 			IXGBE_EVC_ADD(>qbtc[i],
 			IXGBE_READ_REG(hw, IXGBE_QBTC_L(i)) +
 			((u64)IXGBE_READ_REG(hw, IXGBE_QBTC_H(i)) << 32));
-			IXGBE_EVC_REGADD(hw, stats, IXGBE_QPRDC(i), qprdc[i]);
+			/* QPRDC will be added to iqdrops. */
+			qprdc = IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
+			IXGBE_EVC_ADD(>qprdc[i], qprdc);
+			total_qprdc += qprdc;
 		} else {
 			/* 82598 */
 			IXGBE_EVC_REGADD(hw, stats, IXGBE_QBRC(i), qbrc[i]);
@@ -1793,7 +1798,7 @@ ixgbe_update_stats_counters(struct ixgbe
 	 * normal RX counters are prepared in ether_input().
 	 */
 	net_stat_ref_t nsr = IF_STAT_GETREF(ifp);
-	if_statadd_ref(nsr, if_iqdrops, total_missed_rx);
+	if_statadd_ref(nsr, if_iqdrops, total_missed_rx + total_qprdc);
 
 	/*
 	 * Aggregate following types of errors as RX errors:



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

2024-02-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 23 18:36:00 UTC 2024

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

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

sys/dev/pci/ixgbe/ixgbe.c: revision 1.349

ixgbe: Add QPRDC into iqdrops.

 A receive packet might drop at two different locations.

One is the packet buffer that packets are received into the chip first.
If the packet buffer is overflowed, the MPC register is incremented.
It's currently added to iqdrops. It's no problem.

Another is descriptor ring(s). A packet from the packet buffer is DMA'ed
into main memory base on the descriptor ring. If the ring is full, the packet
is dropped and the QPRDC register is incremented. It should be added to
iqdrops but it was not done. Fix it.

Reported by ozaki-r@.


To generate a diff of this commit:
cvs rdiff -u -r1.324.2.7 -r1.324.2.8 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-10] src/sys/dev/pci/ixgbe

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

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

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

sys/dev/pci/ixgbe/ix_txrx.c: revision 1.110
sys/dev/pci/ixgbe/ixgbe.c: revision 1.345
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.111
sys/dev/pci/ixgbe/ixgbe.c: revision 1.346
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.112
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.62
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.113
sys/dev/pci/ixgbe/ixgbe.c: revision 1.348
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.114
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.115
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.116
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.105
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.106
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.107
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.108
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.109
sys/dev/pci/ixgbe/ixv.c: revision 1.193
sys/dev/pci/ixgbe/ixv.c: revision 1.195
sys/dev/pci/ixgbe/ixv.c: revision 1.196
sys/dev/pci/ixgbe/ixgbe.h: revision 1.94
sys/dev/pci/ixgbe/ixgbe.h: revision 1.95
sys/dev/pci/ixgbe/ixgbe.h: revision 1.96
sys/dev/pci/ixgbe/ixgbe.h: revision 1.97
sys/dev/pci/ixgbe/ixgbe.h: revision 1.98

ixgbe: Fix comment. No functional change.
ixgbe: Whitespace. No functional change.
ixgbe(4): Move assignment of TXD. NFCI.
ixgbe(4): Modify comment. No functional change.
 ixgbe_tx_ctx_setup() may or may not consume one TX descriptor.
ixv(4): Remove unused IFF_OACTIVE. No functional change.
ixgbe: Clear the WTHRESH bit field before writing it.
ixgbe: Modify for the readability. No functional change.
ixgbe: micro-optimize ixgbe_txeof()
 Update txr->tx_avail and txr->txr_no_space outside the loop in ixgbe_txeof().
ixgbe: Update if_opackets outside the loop in ixgbe_txeof().
ixgbe: micro-optimize ixgbe_txeof()
 Update txr->packets outside the loop in ixgbe_txeof().
ixgbe: Use #ifdef IXGBE_FDIR more
 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.
ixgbe: Simplify. No functional change.
 The descriptor ring size and the alignment are tested in the attach
function, so it's not required to use roundup2(size, DBA_ALIGN).
ixgbe: Use kmem_zalloc() instead of malloc(,M_ZERO).
ixgbe: Remove unused to reduce the size of struct rx_ring.
ixgbe: Use #ifdef LRO more to reduce the size of struct rx_ring.
ixgbe: 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.
ixgbe: Use #ifdef RSC
 This feature (hardware receive side coalescing) has been disabled all along,
so enclose the code with #ifdef RSC.


To generate a diff of this commit:
cvs rdiff -u -r1.100.4.4 -r1.100.4.5 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.6 -r1.324.2.7 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86.4.4 -r1.86.4.5 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.55.4.5 -r1.55.4.6 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.183.4.5 -r1.183.4.6 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.100.4.4 src/sys/dev/pci/ixgbe/ix_txrx.c:1.100.4.5
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.100.4.4	Wed Oct 18 11:53:22 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Sat Feb  3 11:58:53 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.100.4.4 2023/10/18 11:53:22 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.100.4.5 2024/02/03 11:58:53 martin Exp $ */
 
 /**
 
@@ -64,13 +64,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.100.4.4 2023/10/18 11:53:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.100.4.5 2024/02/03 11:58:53 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,
 

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

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

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

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

sys/dev/pci/ixgbe/ix_txrx.c: revision 1.110
sys/dev/pci/ixgbe/ixgbe.c: revision 1.345
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.111
sys/dev/pci/ixgbe/ixgbe.c: revision 1.346
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.112
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.62
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.113
sys/dev/pci/ixgbe/ixgbe.c: revision 1.348
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.114
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.115
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.116
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.105
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.106
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.107
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.108
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.109
sys/dev/pci/ixgbe/ixv.c: revision 1.193
sys/dev/pci/ixgbe/ixv.c: revision 1.195
sys/dev/pci/ixgbe/ixv.c: revision 1.196
sys/dev/pci/ixgbe/ixgbe.h: revision 1.94
sys/dev/pci/ixgbe/ixgbe.h: revision 1.95
sys/dev/pci/ixgbe/ixgbe.h: revision 1.96
sys/dev/pci/ixgbe/ixgbe.h: revision 1.97
sys/dev/pci/ixgbe/ixgbe.h: revision 1.98

ixgbe: Fix comment. No functional change.
ixgbe: Whitespace. No functional change.
ixgbe(4): Move assignment of TXD. NFCI.
ixgbe(4): Modify comment. No functional change.
 ixgbe_tx_ctx_setup() may or may not consume one TX descriptor.
ixv(4): Remove unused IFF_OACTIVE. No functional change.
ixgbe: Clear the WTHRESH bit field before writing it.
ixgbe: Modify for the readability. No functional change.
ixgbe: micro-optimize ixgbe_txeof()
 Update txr->tx_avail and txr->txr_no_space outside the loop in ixgbe_txeof().
ixgbe: Update if_opackets outside the loop in ixgbe_txeof().
ixgbe: micro-optimize ixgbe_txeof()
 Update txr->packets outside the loop in ixgbe_txeof().
ixgbe: Use #ifdef IXGBE_FDIR more
 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.
ixgbe: Simplify. No functional change.
 The descriptor ring size and the alignment are tested in the attach
function, so it's not required to use roundup2(size, DBA_ALIGN).
ixgbe: Use kmem_zalloc() instead of malloc(,M_ZERO).
ixgbe: Remove unused to reduce the size of struct rx_ring.
ixgbe: Use #ifdef LRO more to reduce the size of struct rx_ring.
ixgbe: 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.
ixgbe: Use #ifdef RSC
 This feature (hardware receive side coalescing) has been disabled all along,
so enclose the code with #ifdef RSC.


To generate a diff of this commit:
cvs rdiff -u -r1.100.4.4 -r1.100.4.5 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.6 -r1.324.2.7 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86.4.4 -r1.86.4.5 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.55.4.5 -r1.55.4.6 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.183.4.5 -r1.183.4.6 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-10] src/sys/dev/pci/ixgbe

2023-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 18 11:53:22 UTC 2023

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

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

sys/dev/pci/ixgbe/ixgbe.c: revision 1.340
sys/dev/pci/ixgbe/ixgbe.c: revision 1.341
sys/dev/pci/ixgbe/ixgbe.c: revision 1.342
sys/dev/pci/ixgbe/ixgbe.c: revision 1.343
sys/dev/pci/ixgbe/ixgbe.c: revision 1.344
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.61
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.104
sys/dev/pci/ixgbe/ixv.c: revision 1.190
sys/dev/pci/ixgbe/ixv.c: revision 1.191
sys/dev/pci/ixgbe/ixv.c: revision 1.192
sys/dev/pci/ixgbe/ixgbe.h: revision 1.93

ixg(4): Print DEVICE_CAPS register.

ixgbe: Whitespace. No functional change.

ixg(4): Don't print wrong error message about ixgbe_num_queues.
 Don't override the ixgbe_num_queues global variable. It's the default
value of the number of queues and should not override it because it
will be referenced by later device attach. For example, the number of
MSI-X vector is 64 on X540 and 18 on 82599. When both cards are inserted
to a machine that the number of CPU is 24 and X540 is probed earlier,
ixgbe_num_queues is overridden to 24 and the following error message is
printed when attaching 82599:
ixg2: autoconfiguration error: ixgbe_num_queues (24) is too large,
using reduced amount (17).

Note that the number of queues is in sc->num_queuss and referenced
by hw.ixgN.num_queues sysctl.

ixgbe: Don't override the {ixgbe,ixv}_max_interrupt_rate global variable.

 Fix a bug that changing hw.ix[gv]X.qY.interrupt_rate would change all
devices all queues default interrupt rate.

ixgbe: Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.100.4.3 -r1.100.4.4 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.4 -r1.324.2.5 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86.4.3 -r1.86.4.4 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.55.4.4 -r1.55.4.5 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.183.4.3 -r1.183.4.4 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.100.4.3 src/sys/dev/pci/ixgbe/ix_txrx.c:1.100.4.4
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.100.4.3	Fri Oct 13 18:55:12 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Oct 18 11:53:22 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.100.4.3 2023/10/13 18:55:12 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.100.4.4 2023/10/18 11:53:22 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.100.4.3 2023/10/13 18:55:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.100.4.4 2023/10/18 11:53:22 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1274,9 +1274,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) {

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.4 src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.5
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.4	Fri Oct 13 18:55:12 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Oct 18 11:53:21 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.324.2.4 2023/10/13 18:55:12 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.324.2.5 2023/10/18 11:53:21 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324.2.4 2023/10/13 18:55:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324.2.5 2023/10/18 11:53:21 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -809,7 +809,7 @@ ixgbe_attach(device_t parent, device_t d
 	struct ixgbe_hw *hw;
 	int		error = -1;
 	u32		ctrl_ext;
-	u16		high, low, nvmreg;
+	u16		high, low, nvmreg, dev_caps;
 	pcireg_t	id, subid;
 	const ixgbe_vendor_info_t *ent;
 	struct pci_attach_args *pa = aux;
@@ -1277,10 +1277,15 @@ ixgbe_attach(device_t parent, device_t d
 	if (sc->feat_en & IXGBE_FEATURE_NETMAP)
 		ixgbe_netmap_attach(sc);
 
+	/* Print some flags */
 	snprintb(buf, sizeof(buf), IXGBE_FEATURE_FLAGS, sc->feat_cap);
 	aprint_verbose_dev(dev, "feature cap %s\n", buf);
 	snprintb(buf, sizeof(buf), IXGBE_FEATURE_FLAGS, sc->feat_en);
 	aprint_verbose_dev(dev, "feature ena %s\n", buf);
+	if 

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

2023-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 18 11:53:22 UTC 2023

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

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

sys/dev/pci/ixgbe/ixgbe.c: revision 1.340
sys/dev/pci/ixgbe/ixgbe.c: revision 1.341
sys/dev/pci/ixgbe/ixgbe.c: revision 1.342
sys/dev/pci/ixgbe/ixgbe.c: revision 1.343
sys/dev/pci/ixgbe/ixgbe.c: revision 1.344
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.61
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.104
sys/dev/pci/ixgbe/ixv.c: revision 1.190
sys/dev/pci/ixgbe/ixv.c: revision 1.191
sys/dev/pci/ixgbe/ixv.c: revision 1.192
sys/dev/pci/ixgbe/ixgbe.h: revision 1.93

ixg(4): Print DEVICE_CAPS register.

ixgbe: Whitespace. No functional change.

ixg(4): Don't print wrong error message about ixgbe_num_queues.
 Don't override the ixgbe_num_queues global variable. It's the default
value of the number of queues and should not override it because it
will be referenced by later device attach. For example, the number of
MSI-X vector is 64 on X540 and 18 on 82599. When both cards are inserted
to a machine that the number of CPU is 24 and X540 is probed earlier,
ixgbe_num_queues is overridden to 24 and the following error message is
printed when attaching 82599:
ixg2: autoconfiguration error: ixgbe_num_queues (24) is too large,
using reduced amount (17).

Note that the number of queues is in sc->num_queuss and referenced
by hw.ixgN.num_queues sysctl.

ixgbe: Don't override the {ixgbe,ixv}_max_interrupt_rate global variable.

 Fix a bug that changing hw.ix[gv]X.qY.interrupt_rate would change all
devices all queues default interrupt rate.

ixgbe: Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.100.4.3 -r1.100.4.4 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.4 -r1.324.2.5 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86.4.3 -r1.86.4.4 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.55.4.4 -r1.55.4.5 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.183.4.3 -r1.183.4.4 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-10] src/sys/dev/pci/ixgbe

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

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-10]: 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 following revision(s) (requested by msaitoh in ticket #407):

sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.47
sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.28
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.60
sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.31
sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.32
sys/dev/pci/ixgbe/ixv.c: revision 1.187
sys/dev/pci/ixgbe/ixv.c: revision 1.188
sys/dev/pci/ixgbe/ixv.c: revision 1.189
sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.18
sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.24
sys/dev/pci/ixgbe/ixgbe.c: revision 1.334
sys/dev/pci/ixgbe/ixgbe.c: revision 1.335
sys/dev/pci/ixgbe/ixgbe.c: revision 1.336
sys/dev/pci/ixgbe/ixgbe.c: revision 1.337
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.103
sys/dev/pci/ixgbe/ixgbe.c: revision 1.338
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.59
sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.13
sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.14
sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.15
sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.29
sys/dev/pci/ixgbe/ixgbe_bypass.h: revision 1.5
sys/dev/pci/ixgbe/ixgbe.h: revision 1.90
sys/dev/pci/ixgbe/ixgbe.h: revision 1.91
sys/dev/pci/ixgbe/ixgbe.h: revision 1.92
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.46

ixg(4): Remove unused and old function. No functional change.
 - From FreeBSD's ix-3.3.32.

ixg(4): Add 82599 LS once again.
 - From:
FreeBSD: 9228ac3a69c4c7401a743e6465e118101a2beeb0
DPDK:549ccd3dc01539e060597b503f2b65b272de3347
 - This was removed 5 years ago. From the commit message:
   > Remove IXGBE_DEV_ID_82599_LS(0x154f) support again. I don't know why. This
   > was added in ix-3.2.18.tar.gz(NetBSD: ixgbe_82599.c rev. 1.20) and
   > removed in ix-3.3.6.tar.gz.

ixg(4): Filter out spurious link up indication
 - Extend SFP+ cage crosstalk fix by re-checking link state after 5ms delay
   to filter out spurious link up indication by transceiver with no fiber
   cable connected.
 - From FreeBSD:
 In-tree: 04a5e6d7cadd06b10169c3c3a560649e7dc7444c
 Out of tree: ix-3.3.33.

ixgbe: Simplify definitions. No functional change.
 Both DEFAULT_{TX,RX}D and PERFORM_{TX,RX}D are 2048. Use DEFAULT_{TX,RX}D.
Same as FreeBSD.

ixgbe: Modify error message of wrong TX/RX descriptor size.
  - Based from FreeBSD ix-3.3.35. I think ix-3.3.35's RING_INCREMENT(== 32)
is wrong. It should be 8(DBA_ALIGN / sizeof(union ixgbe_adv_[tr]x_desc)).
Linux also uses 8.

ixgbe: Remove NO_82599_SUPPORT and NO_X540_SUPPORT support. NFCI.
 From FreeBSD ix-3.3.35. Note that this file is not used in NetBSD.

ixgbe: Enable interrupt after setting IFF_RUNNING. Same as FreeBSD x-3.3.35.

ixgbe: Cleanup. No fucntional change.

 Remove unused code, fix whitespace and modify comment to reduce against
FreeBSD(mainly from ix-3.3.35).


To generate a diff of this commit:
cvs rdiff -u -r1.100.4.2 -r1.100.4.3 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.3 -r1.324.2.4 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86.4.2 -r1.86.4.3 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.29.4.1 -r1.29.4.2 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.28 -r1.28.4.1 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.3.4.1 -r1.3.4.2 src/sys/dev/pci/ixgbe/ixgbe_bypass.h
cvs rdiff -u -r1.43.4.2 -r1.43.4.3 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.16.4.1 -r1.16.4.2 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r1.12 -r1.12.4.1 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c
cvs rdiff -u -r1.55.4.3 -r1.55.4.4 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.26.4.1 -r1.26.4.2 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.183.4.2 -r1.183.4.3 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.100.4.2 src/sys/dev/pci/ixgbe/ix_txrx.c:1.100.4.3
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.100.4.2	Fri Oct 13 18:16:51 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Oct 13 18:55:12 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.100.4.2 2023/10/13 18:16:51 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.100.4.3 2023/10/13 18:55:12 martin Exp $ */
 
 /**
 
@@ -64,7 

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

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

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-10]: 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 following revision(s) (requested by msaitoh in ticket #407):

sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.47
sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.28
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.60
sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.31
sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.32
sys/dev/pci/ixgbe/ixv.c: revision 1.187
sys/dev/pci/ixgbe/ixv.c: revision 1.188
sys/dev/pci/ixgbe/ixv.c: revision 1.189
sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.18
sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.24
sys/dev/pci/ixgbe/ixgbe.c: revision 1.334
sys/dev/pci/ixgbe/ixgbe.c: revision 1.335
sys/dev/pci/ixgbe/ixgbe.c: revision 1.336
sys/dev/pci/ixgbe/ixgbe.c: revision 1.337
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.103
sys/dev/pci/ixgbe/ixgbe.c: revision 1.338
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.59
sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.13
sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.14
sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.15
sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.29
sys/dev/pci/ixgbe/ixgbe_bypass.h: revision 1.5
sys/dev/pci/ixgbe/ixgbe.h: revision 1.90
sys/dev/pci/ixgbe/ixgbe.h: revision 1.91
sys/dev/pci/ixgbe/ixgbe.h: revision 1.92
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.46

ixg(4): Remove unused and old function. No functional change.
 - From FreeBSD's ix-3.3.32.

ixg(4): Add 82599 LS once again.
 - From:
FreeBSD: 9228ac3a69c4c7401a743e6465e118101a2beeb0
DPDK:549ccd3dc01539e060597b503f2b65b272de3347
 - This was removed 5 years ago. From the commit message:
   > Remove IXGBE_DEV_ID_82599_LS(0x154f) support again. I don't know why. This
   > was added in ix-3.2.18.tar.gz(NetBSD: ixgbe_82599.c rev. 1.20) and
   > removed in ix-3.3.6.tar.gz.

ixg(4): Filter out spurious link up indication
 - Extend SFP+ cage crosstalk fix by re-checking link state after 5ms delay
   to filter out spurious link up indication by transceiver with no fiber
   cable connected.
 - From FreeBSD:
 In-tree: 04a5e6d7cadd06b10169c3c3a560649e7dc7444c
 Out of tree: ix-3.3.33.

ixgbe: Simplify definitions. No functional change.
 Both DEFAULT_{TX,RX}D and PERFORM_{TX,RX}D are 2048. Use DEFAULT_{TX,RX}D.
Same as FreeBSD.

ixgbe: Modify error message of wrong TX/RX descriptor size.
  - Based from FreeBSD ix-3.3.35. I think ix-3.3.35's RING_INCREMENT(== 32)
is wrong. It should be 8(DBA_ALIGN / sizeof(union ixgbe_adv_[tr]x_desc)).
Linux also uses 8.

ixgbe: Remove NO_82599_SUPPORT and NO_X540_SUPPORT support. NFCI.
 From FreeBSD ix-3.3.35. Note that this file is not used in NetBSD.

ixgbe: Enable interrupt after setting IFF_RUNNING. Same as FreeBSD x-3.3.35.

ixgbe: Cleanup. No fucntional change.

 Remove unused code, fix whitespace and modify comment to reduce against
FreeBSD(mainly from ix-3.3.35).


To generate a diff of this commit:
cvs rdiff -u -r1.100.4.2 -r1.100.4.3 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.3 -r1.324.2.4 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86.4.2 -r1.86.4.3 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.29.4.1 -r1.29.4.2 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.28 -r1.28.4.1 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.3.4.1 -r1.3.4.2 src/sys/dev/pci/ixgbe/ixgbe_bypass.h
cvs rdiff -u -r1.43.4.2 -r1.43.4.3 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.16.4.1 -r1.16.4.2 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r1.12 -r1.12.4.1 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c
cvs rdiff -u -r1.55.4.3 -r1.55.4.4 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.26.4.1 -r1.26.4.2 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.183.4.2 -r1.183.4.3 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-10] src/sys/dev/pci/ixgbe

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

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-10]: 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 #405):

sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.27
sys/dev/pci/ixgbe/ixgbe_fdir.h: revision 1.5
sys/dev/pci/ixgbe/ixv.c: revision 1.186
sys/dev/pci/ixgbe/ixgbe_osdep.c: revision 1.9
sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.17
sys/dev/pci/ixgbe/ixgbe_api.h: revision 1.17
sys/dev/pci/ixgbe/ixgbe.h: revision 1.89
sys/dev/pci/ixgbe/if_fdir.c: revision 1.6
sys/dev/pci/ixgbe/if_sriov.c: revision 1.18
sys/dev/pci/ixgbe/ixgbe.c: revision 1.333
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.102
sys/dev/pci/ixgbe/ixgbe.c: revision 1.339
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.58
sys/dev/pci/ixgbe/ixgbe_sriov.h: revision 1.6
sys/dev/pci/ixgbe/if_bypass.c: revision 1.10
sys/dev/pci/ixgbe/ixgbe_bypass.h: revision 1.4
sys/dev/pci/ixgbe/ixgbe_netmap.h: revision 1.3
sys/dev/pci/ixgbe/ixgbe_netmap.c: revision 1.6
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.45

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.9 -r1.9.4.1 src/sys/dev/pci/ixgbe/if_bypass.c
cvs rdiff -u -r1.5 -r1.5.14.1 src/sys/dev/pci/ixgbe/if_fdir.c
cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/dev/pci/ixgbe/if_sriov.c
cvs rdiff -u -r1.100.4.1 -r1.100.4.2 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.2 -r1.324.2.3 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86.4.1 -r1.86.4.2 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/dev/pci/ixgbe/ixgbe_api.h \
src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.3 -r1.3.4.1 src/sys/dev/pci/ixgbe/ixgbe_bypass.h
cvs rdiff -u -r1.43.4.1 -r1.43.4.2 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/dev/pci/ixgbe/ixgbe_fdir.h
cvs rdiff -u -r1.5 -r1.5.4.1 src/sys/dev/pci/ixgbe/ixgbe_netmap.c \
src/sys/dev/pci/ixgbe/ixgbe_sriov.h
cvs rdiff -u -r1.2 -r1.2.14.1 src/sys/dev/pci/ixgbe/ixgbe_netmap.h
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/dev/pci/ixgbe/ixgbe_osdep.c
cvs rdiff -u -r1.55.4.2 -r1.55.4.3 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.183.4.1 -r1.183.4.2 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-10] src/sys/dev/pci/ixgbe

2023-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  8 14:57:54 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-10]: 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 #395):

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.100 -r1.100.4.1 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.1 -r1.324.2.2 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86 -r1.86.4.1 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.29 -r1.29.4.1 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.19 -r1.19.4.1 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.55.4.1 -r1.55.4.2 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.31 -r1.31.4.1 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.183 -r1.183.4.1 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.100 src/sys/dev/pci/ixgbe/ix_txrx.c:1.100.4.1
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.100	Fri Sep 16 03:05:51 2022
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Sun Oct  8 14:57:53 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.100 2022/09/16 03:05:51 knakahara Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.100.4.1 2023/10/08 14:57:53 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.100 2022/09/16 03:05:51 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.100.4.1 2023/10/08 14:57:53 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1334,11 +1334,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.324.2.1 src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.2
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.1	Wed Jun 21 19:16:12 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sun Oct  8 14:57:53 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.324.2.1 2023/06/21 19:16:12 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.324.2.2 2023/10/08 14:57:53 martin Exp $ */
 
 

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

2023-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Oct  8 14:57:54 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-10]: 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 #395):

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.100 -r1.100.4.1 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.324.2.1 -r1.324.2.2 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.86 -r1.86.4.1 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.29 -r1.29.4.1 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.19 -r1.19.4.1 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.55.4.1 -r1.55.4.2 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.31 -r1.31.4.1 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.183 -r1.183.4.1 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-10] src/sys/dev/pci/ixgbe

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

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

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

sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.56
sys/dev/pci/ixgbe/ixgbe.c: revision 1.325
sys/dev/pci/ixgbe/ixgbe.c: revision 1.326
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.44

Use thermal sensor code for IXGBE_DEV_ID_X550EM_A_10G_T, too.
 PCI device ID 0x15c8 also use 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.
 - Add new event counter "link_dn_cnt" to count the number of link down
   events in the MAC.
 - The LINK_DN_CNT register (at 0x0403c) is described only in the
   Denverton's datasheet, so use it only on ixgbe_mac_X550EM_a.


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.324.2.1 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.43 -r1.43.4.1 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.55 -r1.55.4.1 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.324 src/sys/dev/pci/ixgbe/ixgbe.c:1.324.2.1
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.324	Fri Oct 28 01:10:41 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jun 21 19:16:12 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.324.2.1 2023/06/21 19:16:12 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324.2.1 2023/06/21 19:16:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1680,6 +1680,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 */
@@ -2029,6 +2031,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,
@@ -2197,6 +2202,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);
@@ -3515,7 +3522,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,
@@ -3801,6 +3809,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);
@@ -5954,7 +5964,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);
@@ -5997,7 +6008,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.43 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.43.4.1
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.43	Mon Jun  6 02:16:37 2022
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Wed Jun 21 19:16:12 2023
@@ -1,4 +1,4 

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

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

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

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

sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.56
sys/dev/pci/ixgbe/ixgbe.c: revision 1.325
sys/dev/pci/ixgbe/ixgbe.c: revision 1.326
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.44

Use thermal sensor code for IXGBE_DEV_ID_X550EM_A_10G_T, too.
 PCI device ID 0x15c8 also use 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.
 - Add new event counter "link_dn_cnt" to count the number of link down
   events in the MAC.
 - The LINK_DN_CNT register (at 0x0403c) is described only in the
   Denverton's datasheet, so use it only on ixgbe_mac_X550EM_a.


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.324.2.1 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.43 -r1.43.4.1 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.55 -r1.55.4.1 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.