Implement hardware MAC statistics for BCM5705 or newer Broadcom
controllers. bge(4) exported MAC statistics on controllers that maintain the statistics in the NIC's internal memory. Newer controllers require register access to fetch these values. These counters provide useful information to diagnose driver issues.
This commit is contained in:
parent
11129fcf49
commit
1560327157
@ -371,6 +371,7 @@ static int bge_rxeof(struct bge_softc *, uint16_t, int);
|
||||
|
||||
static void bge_asf_driver_up (struct bge_softc *);
|
||||
static void bge_tick(void *);
|
||||
static void bge_stats_clear_regs(struct bge_softc *);
|
||||
static void bge_stats_update(struct bge_softc *);
|
||||
static void bge_stats_update_regs(struct bge_softc *);
|
||||
static struct mbuf *bge_setup_tso(struct bge_softc *, struct mbuf *,
|
||||
@ -453,6 +454,10 @@ static int bge_sysctl_reg_read(SYSCTL_HANDLER_ARGS);
|
||||
static int bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS);
|
||||
#endif
|
||||
static void bge_add_sysctls(struct bge_softc *);
|
||||
static void bge_add_sysctl_stats_regs(struct bge_softc *,
|
||||
struct sysctl_ctx_list *, struct sysctl_oid_list *);
|
||||
static void bge_add_sysctl_stats(struct bge_softc *, struct sysctl_ctx_list *,
|
||||
struct sysctl_oid_list *);
|
||||
static int bge_sysctl_stats(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
static device_method_t bge_methods[] = {
|
||||
@ -3730,15 +3735,127 @@ static void
|
||||
bge_stats_update_regs(struct bge_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct bge_mac_stats *stats;
|
||||
|
||||
ifp = sc->bge_ifp;
|
||||
stats = &sc->bge_mac_stats;
|
||||
|
||||
ifp->if_collisions += CSR_READ_4(sc, BGE_MAC_STATS +
|
||||
offsetof(struct bge_mac_stats_regs, etherStatsCollisions));
|
||||
stats->ifHCOutOctets +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_OCTETS);
|
||||
stats->etherStatsCollisions +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_COLLS);
|
||||
stats->outXonSent +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_XON_SENT);
|
||||
stats->outXoffSent +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_XOFF_SENT);
|
||||
stats->dot3StatsInternalMacTransmitErrors +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_ERRORS);
|
||||
stats->dot3StatsSingleCollisionFrames +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_SINGLE_COLL);
|
||||
stats->dot3StatsMultipleCollisionFrames +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_MULTI_COLL);
|
||||
stats->dot3StatsDeferredTransmissions +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_DEFERRED);
|
||||
stats->dot3StatsExcessiveCollisions +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_EXCESS_COLL);
|
||||
stats->dot3StatsLateCollisions +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_LATE_COLL);
|
||||
stats->ifHCOutUcastPkts +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_UCAST);
|
||||
stats->ifHCOutMulticastPkts +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_MCAST);
|
||||
stats->ifHCOutBroadcastPkts +=
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_BCAST);
|
||||
|
||||
ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_OUT_OF_BDS);
|
||||
ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS);
|
||||
ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_ERRORS);
|
||||
stats->ifHCInOctets +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_OCTESTS);
|
||||
stats->etherStatsFragments +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_FRAGMENTS);
|
||||
stats->ifHCInUcastPkts +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_UCAST);
|
||||
stats->ifHCInMulticastPkts +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_MCAST);
|
||||
stats->ifHCInBroadcastPkts +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_BCAST);
|
||||
stats->dot3StatsFCSErrors +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_FCS_ERRORS);
|
||||
stats->dot3StatsAlignmentErrors +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_ALGIN_ERRORS);
|
||||
stats->xonPauseFramesReceived +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_XON_RCVD);
|
||||
stats->xoffPauseFramesReceived +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_XOFF_RCVD);
|
||||
stats->macControlFramesReceived +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_CTRL_RCVD);
|
||||
stats->xoffStateEntered +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_XOFF_ENTERED);
|
||||
stats->dot3StatsFramesTooLong +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_FRAME_TOO_LONG);
|
||||
stats->etherStatsJabbers +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_JABBERS);
|
||||
stats->etherStatsUndersizePkts +=
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_UNDERSIZE);
|
||||
|
||||
stats->FramesDroppedDueToFilters +=
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_FILTDROP);
|
||||
stats->DmaWriteQueueFull +=
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_DMA_WRQ_FULL);
|
||||
stats->DmaWriteHighPriQueueFull +=
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_DMA_HPWRQ_FULL);
|
||||
stats->NoMoreRxBDs +=
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_OUT_OF_BDS);
|
||||
stats->InputDiscards +=
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS);
|
||||
stats->InputErrors +=
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_ERRORS);
|
||||
stats->RecvThresholdHit +=
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_RXTHRESH_HIT);
|
||||
|
||||
ifp->if_collisions = (u_long)stats->etherStatsCollisions;
|
||||
ifp->if_ierrors = (u_long)(stats->NoMoreRxBDs + stats->InputDiscards +
|
||||
stats->InputErrors);
|
||||
}
|
||||
|
||||
static void
|
||||
bge_stats_clear_regs(struct bge_softc *sc)
|
||||
{
|
||||
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_OCTETS);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_COLLS);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_XON_SENT);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_XOFF_SENT);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_ERRORS);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_SINGLE_COLL);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_MULTI_COLL);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_DEFERRED);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_EXCESS_COLL);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_LATE_COLL);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_UCAST);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_MCAST);
|
||||
CSR_READ_4(sc, BGE_TX_MAC_STATS_BCAST);
|
||||
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_OCTESTS);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_FRAGMENTS);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_UCAST);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_MCAST);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_BCAST);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_FCS_ERRORS);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_ALGIN_ERRORS);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_XON_RCVD);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_XOFF_RCVD);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_CTRL_RCVD);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_XOFF_ENTERED);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_FRAME_TOO_LONG);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_JABBERS);
|
||||
CSR_READ_4(sc, BGE_RX_MAC_STATS_UNDERSIZE);
|
||||
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_FILTDROP);
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_DMA_WRQ_FULL);
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_DMA_HPWRQ_FULL);
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_OUT_OF_BDS);
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS);
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_ERRORS);
|
||||
CSR_READ_4(sc, BGE_RXLP_LOCSTAT_RXTHRESH_HIT);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -4239,6 +4356,10 @@ bge_init_locked(struct bge_softc *sc)
|
||||
*/
|
||||
CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 2);
|
||||
|
||||
/* Clear MAC statistics. */
|
||||
if (BGE_IS_5705_PLUS(sc))
|
||||
bge_stats_clear_regs(sc);
|
||||
|
||||
/* Tell firmware we're alive. */
|
||||
BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
|
||||
|
||||
@ -4640,6 +4761,9 @@ bge_stop(struct bge_softc *sc)
|
||||
BGE_CLRBIT(sc, BGE_BMAN_MODE, BGE_BMANMODE_ENABLE);
|
||||
BGE_CLRBIT(sc, BGE_MARB_MODE, BGE_MARBMODE_ENABLE);
|
||||
}
|
||||
/* Update MAC statistics. */
|
||||
if (BGE_IS_5705_PLUS(sc))
|
||||
bge_stats_update_regs(sc);
|
||||
|
||||
bge_reset(sc);
|
||||
bge_sig_legacy(sc, BGE_RESET_STOP);
|
||||
@ -4838,17 +4962,11 @@ bge_link_upd(struct bge_softc *sc)
|
||||
BGE_MACSTAT_LINK_CHANGED);
|
||||
}
|
||||
|
||||
#define BGE_SYSCTL_STAT(sc, ctx, desc, parent, node, oid) \
|
||||
SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, oid, CTLTYPE_UINT|CTLFLAG_RD, \
|
||||
sc, offsetof(struct bge_stats, node), bge_sysctl_stats, "IU", \
|
||||
desc)
|
||||
|
||||
static void
|
||||
bge_add_sysctls(struct bge_softc *sc)
|
||||
{
|
||||
struct sysctl_ctx_list *ctx;
|
||||
struct sysctl_oid_list *children, *schildren;
|
||||
struct sysctl_oid *tree;
|
||||
struct sysctl_oid_list *children;
|
||||
char tn[32];
|
||||
int unit;
|
||||
|
||||
@ -4910,9 +5028,24 @@ bge_add_sysctls(struct bge_softc *sc)
|
||||
"generate UDP checksum value 0");
|
||||
|
||||
if (BGE_IS_5705_PLUS(sc))
|
||||
return;
|
||||
bge_add_sysctl_stats_regs(sc, ctx, children);
|
||||
else
|
||||
bge_add_sysctl_stats(sc, ctx, children);
|
||||
}
|
||||
|
||||
tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD,
|
||||
#define BGE_SYSCTL_STAT(sc, ctx, desc, parent, node, oid) \
|
||||
SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, oid, CTLTYPE_UINT|CTLFLAG_RD, \
|
||||
sc, offsetof(struct bge_stats, node), bge_sysctl_stats, "IU", \
|
||||
desc)
|
||||
|
||||
static void
|
||||
bge_add_sysctl_stats(struct bge_softc *sc, struct sysctl_ctx_list *ctx,
|
||||
struct sysctl_oid_list *parent)
|
||||
{
|
||||
struct sysctl_oid *tree;
|
||||
struct sysctl_oid_list *children, *schildren;
|
||||
|
||||
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "stats", CTLFLAG_RD,
|
||||
NULL, "BGE Statistics");
|
||||
schildren = children = SYSCTL_CHILDREN(tree);
|
||||
BGE_SYSCTL_STAT(sc, ctx, "Frames Dropped Due To Filters",
|
||||
@ -5029,6 +5162,106 @@ bge_add_sysctls(struct bge_softc *sc)
|
||||
children, txstats.ifOutErrors, "Errors");
|
||||
}
|
||||
|
||||
#undef BGE_SYSCTL_STAT
|
||||
|
||||
#define BGE_SYSCTL_STAT_ADD64(c, h, n, p, d) \
|
||||
SYSCTL_ADD_QUAD(c, h, OID_AUTO, n, CTLFLAG_RD, p, d)
|
||||
|
||||
static void
|
||||
bge_add_sysctl_stats_regs(struct bge_softc *sc, struct sysctl_ctx_list *ctx,
|
||||
struct sysctl_oid_list *parent)
|
||||
{
|
||||
struct sysctl_oid *tree;
|
||||
struct sysctl_oid_list *child, *schild;
|
||||
struct bge_mac_stats *stats;
|
||||
|
||||
stats = &sc->bge_mac_stats;
|
||||
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "stats", CTLFLAG_RD,
|
||||
NULL, "BGE Statistics");
|
||||
schild = child = SYSCTL_CHILDREN(tree);
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "FramesDroppedDueToFilters",
|
||||
&stats->FramesDroppedDueToFilters, "Frames Dropped Due to Filters");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "DmaWriteQueueFull",
|
||||
&stats->DmaWriteQueueFull, "NIC DMA Write Queue Full");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "DmaWriteHighPriQueueFull",
|
||||
&stats->DmaWriteHighPriQueueFull,
|
||||
"NIC DMA Write High Priority Queue Full");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "NoMoreRxBDs",
|
||||
&stats->NoMoreRxBDs, "NIC No More RX Buffer Descriptors");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "InputDiscards",
|
||||
&stats->InputDiscards, "Discarded Input Frames");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "InputErrors",
|
||||
&stats->InputErrors, "Input Errors");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "RecvThresholdHit",
|
||||
&stats->RecvThresholdHit, "NIC Recv Threshold Hit");
|
||||
|
||||
tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", CTLFLAG_RD,
|
||||
NULL, "BGE RX Statistics");
|
||||
child = SYSCTL_CHILDREN(tree);
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "ifHCInOctets",
|
||||
&stats->ifHCInOctets, "Inbound Octets");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "Fragments",
|
||||
&stats->etherStatsFragments, "Fragments");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "UcastPkts",
|
||||
&stats->ifHCInUcastPkts, "Inbound Unicast Packets");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "MulticastPkts",
|
||||
&stats->ifHCInMulticastPkts, "Inbound Multicast Packets");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "BroadcastPkts",
|
||||
&stats->ifHCInBroadcastPkts, "Inbound Broadcast Packets");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "FCSErrors",
|
||||
&stats->dot3StatsFCSErrors, "FCS Errors");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "AlignmentErrors",
|
||||
&stats->dot3StatsAlignmentErrors, "Alignment Errors");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "xonPauseFramesReceived",
|
||||
&stats->xonPauseFramesReceived, "XON Pause Frames Received");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "xoffPauseFramesReceived",
|
||||
&stats->xoffPauseFramesReceived, "XOFF Pause Frames Received");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "ControlFramesReceived",
|
||||
&stats->macControlFramesReceived, "MAC Control Frames Received");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "xoffStateEntered",
|
||||
&stats->xoffStateEntered, "XOFF State Entered");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "FramesTooLong",
|
||||
&stats->dot3StatsFramesTooLong, "Frames Too Long");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "Jabbers",
|
||||
&stats->etherStatsJabbers, "Jabbers");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "UndersizePkts",
|
||||
&stats->etherStatsUndersizePkts, "Undersized Packets");
|
||||
|
||||
tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD,
|
||||
NULL, "BGE TX Statistics");
|
||||
child = SYSCTL_CHILDREN(tree);
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "Octets",
|
||||
&stats->ifHCOutOctets, "Outbound Octets");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "Collisions",
|
||||
&stats->etherStatsCollisions, "TX Collisions");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "XonSent",
|
||||
&stats->outXonSent, "XON Sent");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "XoffSent",
|
||||
&stats->outXoffSent, "XOFF Sent");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "InternalMacTransmitErrors",
|
||||
&stats->dot3StatsInternalMacTransmitErrors,
|
||||
"Internal MAC TX Errors");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "SingleCollisionFrames",
|
||||
&stats->dot3StatsSingleCollisionFrames, "Single Collision Frames");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "MultipleCollisionFrames",
|
||||
&stats->dot3StatsMultipleCollisionFrames,
|
||||
"Multiple Collision Frames");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "DeferredTransmissions",
|
||||
&stats->dot3StatsDeferredTransmissions, "Deferred Transmissions");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "ExcessiveCollisions",
|
||||
&stats->dot3StatsExcessiveCollisions, "Excessive Collisions");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "LateCollisions",
|
||||
&stats->dot3StatsLateCollisions, "Late Collisions");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "UcastPkts",
|
||||
&stats->ifHCOutUcastPkts, "Outbound Unicast Packets");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "McastPkts",
|
||||
&stats->ifHCOutMulticastPkts, "Outbound Multicast Packets");
|
||||
BGE_SYSCTL_STAT_ADD64(ctx, child, "BcastPkts",
|
||||
&stats->ifHCOutBroadcastPkts, "Outbound Broadcast Packets");
|
||||
}
|
||||
|
||||
#undef BGE_SYSCTL_STAT_ADD64
|
||||
|
||||
static int
|
||||
bge_sysctl_stats(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
@ -637,7 +637,53 @@
|
||||
#define BGE_SERDES_STS 0x0594
|
||||
#define BGE_SGDIG_CFG 0x05B0
|
||||
#define BGE_SGDIG_STS 0x05B4
|
||||
#define BGE_MAC_STATS 0x0800
|
||||
#define BGE_TX_MAC_STATS_OCTETS 0x0800
|
||||
#define BGE_TX_MAC_STATS_RESERVE_0 0x0804
|
||||
#define BGE_TX_MAC_STATS_COLLS 0x0808
|
||||
#define BGE_TX_MAC_STATS_XON_SENT 0x080C
|
||||
#define BGE_TX_MAC_STATS_XOFF_SENT 0x0810
|
||||
#define BGE_TX_MAC_STATS_RESERVE_1 0x0814
|
||||
#define BGE_TX_MAC_STATS_ERRORS 0x0818
|
||||
#define BGE_TX_MAC_STATS_SINGLE_COLL 0x081C
|
||||
#define BGE_TX_MAC_STATS_MULTI_COLL 0x0820
|
||||
#define BGE_TX_MAC_STATS_DEFERRED 0x0824
|
||||
#define BGE_TX_MAC_STATS_RESERVE_2 0x0828
|
||||
#define BGE_TX_MAC_STATS_EXCESS_COLL 0x082C
|
||||
#define BGE_TX_MAC_STATS_LATE_COLL 0x0830
|
||||
#define BGE_TX_MAC_STATS_RESERVE_3 0x0834
|
||||
#define BGE_TX_MAC_STATS_RESERVE_4 0x0838
|
||||
#define BGE_TX_MAC_STATS_RESERVE_5 0x083C
|
||||
#define BGE_TX_MAC_STATS_RESERVE_6 0x0840
|
||||
#define BGE_TX_MAC_STATS_RESERVE_7 0x0844
|
||||
#define BGE_TX_MAC_STATS_RESERVE_8 0x0848
|
||||
#define BGE_TX_MAC_STATS_RESERVE_9 0x084C
|
||||
#define BGE_TX_MAC_STATS_RESERVE_10 0x0850
|
||||
#define BGE_TX_MAC_STATS_RESERVE_11 0x0854
|
||||
#define BGE_TX_MAC_STATS_RESERVE_12 0x0858
|
||||
#define BGE_TX_MAC_STATS_RESERVE_13 0x085C
|
||||
#define BGE_TX_MAC_STATS_RESERVE_14 0x0860
|
||||
#define BGE_TX_MAC_STATS_RESERVE_15 0x0864
|
||||
#define BGE_TX_MAC_STATS_RESERVE_16 0x0868
|
||||
#define BGE_TX_MAC_STATS_UCAST 0x086C
|
||||
#define BGE_TX_MAC_STATS_MCAST 0x0870
|
||||
#define BGE_TX_MAC_STATS_BCAST 0x0874
|
||||
#define BGE_TX_MAC_STATS_RESERVE_17 0x0878
|
||||
#define BGE_TX_MAC_STATS_RESERVE_18 0x087C
|
||||
#define BGE_RX_MAC_STATS_OCTESTS 0x0880
|
||||
#define BGE_RX_MAC_STATS_RESERVE_0 0x0884
|
||||
#define BGE_RX_MAC_STATS_FRAGMENTS 0x0888
|
||||
#define BGE_RX_MAC_STATS_UCAST 0x088C
|
||||
#define BGE_RX_MAC_STATS_MCAST 0x0890
|
||||
#define BGE_RX_MAC_STATS_BCAST 0x0894
|
||||
#define BGE_RX_MAC_STATS_FCS_ERRORS 0x0898
|
||||
#define BGE_RX_MAC_STATS_ALGIN_ERRORS 0x089C
|
||||
#define BGE_RX_MAC_STATS_XON_RCVD 0x08A0
|
||||
#define BGE_RX_MAC_STATS_XOFF_RCVD 0x08A4
|
||||
#define BGE_RX_MAC_STATS_CTRL_RCVD 0x08A8
|
||||
#define BGE_RX_MAC_STATS_XOFF_ENTERED 0x08AC
|
||||
#define BGE_RX_MAC_STATS_FRAME_TOO_LONG 0x08B0
|
||||
#define BGE_RX_MAC_STATS_JABBERS 0x08B4
|
||||
#define BGE_RX_MAC_STATS_UNDERSIZE 0x08B8
|
||||
|
||||
/* Ethernet MAC Mode register */
|
||||
#define BGE_MACMODE_RESET 0x00000001
|
||||
@ -2349,40 +2395,50 @@ struct bge_tx_mac_stats {
|
||||
};
|
||||
|
||||
/* Stats counters access through registers */
|
||||
struct bge_mac_stats_regs {
|
||||
uint32_t ifHCOutOctets;
|
||||
uint32_t Reserved0;
|
||||
uint32_t etherStatsCollisions;
|
||||
uint32_t outXonSent;
|
||||
uint32_t outXoffSent;
|
||||
uint32_t Reserved1;
|
||||
uint32_t dot3StatsInternalMacTransmitErrors;
|
||||
uint32_t dot3StatsSingleCollisionFrames;
|
||||
uint32_t dot3StatsMultipleCollisionFrames;
|
||||
uint32_t dot3StatsDeferredTransmissions;
|
||||
uint32_t Reserved2;
|
||||
uint32_t dot3StatsExcessiveCollisions;
|
||||
uint32_t dot3StatsLateCollisions;
|
||||
uint32_t Reserved3[14];
|
||||
uint32_t ifHCOutUcastPkts;
|
||||
uint32_t ifHCOutMulticastPkts;
|
||||
uint32_t ifHCOutBroadcastPkts;
|
||||
uint32_t Reserved4[2];
|
||||
uint32_t ifHCInOctets;
|
||||
uint32_t Reserved5;
|
||||
uint32_t etherStatsFragments;
|
||||
uint32_t ifHCInUcastPkts;
|
||||
uint32_t ifHCInMulticastPkts;
|
||||
uint32_t ifHCInBroadcastPkts;
|
||||
uint32_t dot3StatsFCSErrors;
|
||||
uint32_t dot3StatsAlignmentErrors;
|
||||
uint32_t xonPauseFramesReceived;
|
||||
uint32_t xoffPauseFramesReceived;
|
||||
uint32_t macControlFramesReceived;
|
||||
uint32_t xoffStateEntered;
|
||||
uint32_t dot3StatsFramesTooLong;
|
||||
uint32_t etherStatsJabbers;
|
||||
uint32_t etherStatsUndersizePkts;
|
||||
struct bge_mac_stats {
|
||||
/* TX MAC statistics */
|
||||
uint64_t ifHCOutOctets;
|
||||
uint64_t Reserved0;
|
||||
uint64_t etherStatsCollisions;
|
||||
uint64_t outXonSent;
|
||||
uint64_t outXoffSent;
|
||||
uint64_t Reserved1;
|
||||
uint64_t dot3StatsInternalMacTransmitErrors;
|
||||
uint64_t dot3StatsSingleCollisionFrames;
|
||||
uint64_t dot3StatsMultipleCollisionFrames;
|
||||
uint64_t dot3StatsDeferredTransmissions;
|
||||
uint64_t Reserved2;
|
||||
uint64_t dot3StatsExcessiveCollisions;
|
||||
uint64_t dot3StatsLateCollisions;
|
||||
uint64_t Reserved3[14];
|
||||
uint64_t ifHCOutUcastPkts;
|
||||
uint64_t ifHCOutMulticastPkts;
|
||||
uint64_t ifHCOutBroadcastPkts;
|
||||
uint64_t Reserved4[2];
|
||||
/* RX MAC statistics */
|
||||
uint64_t ifHCInOctets;
|
||||
uint64_t Reserved5;
|
||||
uint64_t etherStatsFragments;
|
||||
uint64_t ifHCInUcastPkts;
|
||||
uint64_t ifHCInMulticastPkts;
|
||||
uint64_t ifHCInBroadcastPkts;
|
||||
uint64_t dot3StatsFCSErrors;
|
||||
uint64_t dot3StatsAlignmentErrors;
|
||||
uint64_t xonPauseFramesReceived;
|
||||
uint64_t xoffPauseFramesReceived;
|
||||
uint64_t macControlFramesReceived;
|
||||
uint64_t xoffStateEntered;
|
||||
uint64_t dot3StatsFramesTooLong;
|
||||
uint64_t etherStatsJabbers;
|
||||
uint64_t etherStatsUndersizePkts;
|
||||
/* Receive List Placement control */
|
||||
uint64_t FramesDroppedDueToFilters;
|
||||
uint64_t DmaWriteQueueFull;
|
||||
uint64_t DmaWriteHighPriQueueFull;
|
||||
uint64_t NoMoreRxBDs;
|
||||
uint64_t InputDiscards;
|
||||
uint64_t InputErrors;
|
||||
uint64_t RecvThresholdHit;
|
||||
};
|
||||
|
||||
struct bge_stats {
|
||||
@ -2660,6 +2716,7 @@ struct bge_softc {
|
||||
#ifdef DEVICE_POLLING
|
||||
int rxcycles;
|
||||
#endif /* DEVICE_POLLING */
|
||||
struct bge_mac_stats bge_mac_stats;
|
||||
struct task bge_intr_task;
|
||||
struct taskqueue *bge_tq;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user