Page MenuHomeFreeBSD

D61004.1794681944.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61004.1794681944.diff

diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h
--- a/sys/dev/igc/if_igc.h
+++ b/sys/dev/igc/if_igc.h
@@ -333,6 +333,7 @@
u32 eitr_setting;
struct rx_ring rxr;
u64 irqs;
+ u64 rx_drops;
struct if_irq que_irq;
};
diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c
--- a/sys/dev/igc/if_igc.c
+++ b/sys/dev/igc/if_igc.c
@@ -3142,6 +3142,19 @@
sc->stats.htdpmc += IGC_READ_REG(&sc->hw, IGC_HTDPMC);
sc->stats.tsctc += IGC_READ_REG(&sc->hw, IGC_TSCTC);
+ /*
+ * Packets dropped because a queue's descriptor ring was full. The
+ * register does not clear on read.
+ */
+ for (int i = 0; i < sc->rx_num_queues; i++) {
+ u32 rqdpc = IGC_READ_REG(&sc->hw, IGC_RQDPC(i));
+
+ if (rqdpc != 0) {
+ IGC_WRITE_REG(&sc->hw, IGC_RQDPC(i), 0);
+ sc->rx_queues[i].rx_drops += rqdpc;
+ }
+ }
+
igc_update_ecc_stats(sc);
}
@@ -3166,6 +3179,13 @@
case IFCOUNTER_OERRORS:
return (if_get_counter_default(ifp, cnt) +
sc->stats.ecol + sc->stats.latecol);
+ case IFCOUNTER_IQDROPS: {
+ uint64_t drops = if_get_counter_default(ifp, cnt);
+
+ for (int i = 0; i < sc->rx_num_queues; i++)
+ drops += sc->rx_queues[i].rx_drops;
+ return (drops);
+ }
default:
return (if_get_counter_default(ifp, cnt));
}
@@ -3367,6 +3387,9 @@
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq",
CTLFLAG_RD, &rxr->rx_irq,
"Queue MSI-X Receive Interrupts");
+ SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_drops",
+ CTLFLAG_RD, &rx_que->rx_drops,
+ "Packets dropped for want of a receive descriptor");
}
/* MAC stats get their own sub node */

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 14, 6:45 PM (14 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41251942
Default Alt Text
D61004.1794681944.diff (1 KB)

Event Timeline