Преглед на файлове

[intel] Add intelxvf_stats() to dump packet statistics registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown преди 9 години
родител
ревизия
51b6a1c835
променени са 2 файла, в които са добавени 46 реда и са изтрити 0 реда
  1. 25
    0
      src/drivers/net/intelxvf.c
  2. 21
    0
      src/drivers/net/intelxvf.h

+ 25
- 0
src/drivers/net/intelxvf.c Целия файл

@@ -38,6 +38,31 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
38 38
  *
39 39
  */
40 40
 
41
+/******************************************************************************
42
+ *
43
+ * Diagnostics
44
+ *
45
+ ******************************************************************************
46
+ */
47
+
48
+/**
49
+ * Dump statistics
50
+ *
51
+ * @v intel		Intel device
52
+ */
53
+static __attribute__ (( unused )) void
54
+intelxvf_stats ( struct intel_nic *intel ) {
55
+
56
+	DBGC ( intel, "INTEL %p TX %d (%#x%08x) RX %d (%#x%08x) multi %d\n",
57
+	       intel, readl ( intel->regs + INTELXVF_GPTC ),
58
+	       readl ( intel->regs + INTELXVF_GOTCH ),
59
+	       readl ( intel->regs + INTELXVF_GOTCL ),
60
+	       readl ( intel->regs + INTELXVF_GPRC ),
61
+	       readl ( intel->regs + INTELXVF_GORCH ),
62
+	       readl ( intel->regs + INTELXVF_GORCL ),
63
+	       readl ( intel->regs + INTELXVF_MPRC ) );
64
+}
65
+
41 66
 /******************************************************************************
42 67
  *
43 68
  * Device reset

+ 21
- 0
src/drivers/net/intelxvf.h Целия файл

@@ -71,7 +71,28 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
71 71
 #define INTELXVF_SRRCTL_DESCTYPE_DEFAULT INTELXVF_SRRCTL_DESCTYPE ( 0x00 )
72 72
 #define INTELXVF_SRRCTL_DESCTYPE_MASK INTELXVF_SRRCTL_DESCTYPE ( 0x07 )
73 73
 
74
+/** Good Packets Received Count */
75
+#define INTELXVF_GPRC 0x101c
76
+
77
+/** Good Packets Received Count Low */
78
+#define INTELXVF_GORCL 0x1020
79
+
80
+/** Good Packets Received Count High */
81
+#define INTELXVF_GORCH 0x1024
82
+
83
+/* Multicast Packets Received Count */
84
+#define INTELXVF_MPRC 0x1034
85
+
74 86
 /** Transmit Descriptor register block */
75 87
 #define INTELXVF_TD 0x2000UL
76 88
 
89
+/** Good Packets Transmitted Count */
90
+#define INTELXVF_GPTC 0x201c
91
+
92
+/** Good Packets Transmitted Count Low */
93
+#define INTELXVF_GOTCL 0x2020
94
+
95
+/** Good Packets Transmitted Count High */
96
+#define INTELXVF_GOTCH 0x2024
97
+
77 98
 #endif /* _INTELXVF_H */

Loading…
Отказ
Запис