Module Name: src
Committed By: msaitoh
Date: Wed Sep 13 08:05:23 UTC 2023
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c
Log Message:
ixg(4): Count Queue Bytes {Transmit, Receive} counter.
To generate a diff of this commit:
cvs rdiff -u -r1.328 -r1.329 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.328 src/sys/dev/pci/ixgbe/ixgbe.c:1.329
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.328 Wed Sep 13 07:38:31 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c Wed Sep 13 08:05:23 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.328 2023/09/13 07:38:31 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.329 2023/09/13 08:05:23 msaitoh Exp $ */
/******************************************************************************
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.328 2023/09/13 07:38:31 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.329 2023/09/13 08:05:23 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1638,8 +1638,19 @@ ixgbe_update_stats_counters(struct adapt
for (i = 0; i < queue_counters; i++) {
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)
+ if (hw->mac.type >= ixgbe_mac_82599EB) {
+ IXGBE_EVC_ADD(&stats->qbrc[i],
+ IXGBE_READ_REG(hw, IXGBE_QBRC_L(i)) +
+ ((u64)IXGBE_READ_REG(hw, IXGBE_QBRC_H(i)) << 32));
+ IXGBE_EVC_ADD(&stats->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]);
+ } else {
+ /* 82598 */
+ IXGBE_EVC_REGADD(hw, stats, IXGBE_QBRC(i), qbrc[i]);
+ IXGBE_EVC_REGADD(hw, stats, IXGBE_QBTC(i), qbtc[i]);
+ }
}
/* 8 registers exist */