Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F158202203
D52091.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52091.diff
View Options
Index: sys/dev/bnxt/bnxt_en/if_bnxt.c
===================================================================
--- sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -3731,12 +3731,38 @@
static uint64_t
bnxt_get_counter(if_ctx_t ctx, ift_counter cnt)
{
+ struct bnxt_softc *softc = iflib_get_softc(ctx);
if_t ifp = iflib_get_ifp(ctx);
- if (cnt < IFCOUNTERS)
- return if_get_counter_default(ifp, cnt);
+ if (cnt >= IFCOUNTERS)
+ return 0;
- return 0;
+ switch (cnt) {
+ case IFCOUNTER_IPACKETS:
+ return (softc->rx_port_stats->rx_total_frames);
+ case IFCOUNTER_OPACKETS:
+ return (softc->tx_port_stats->tx_total_frames);
+ case IFCOUNTER_IBYTES:
+ return (softc->rx_port_stats->rx_bytes);
+ case IFCOUNTER_OBYTES:
+ return (softc->tx_port_stats->tx_bytes);
+ case IFCOUNTER_IMCASTS:
+ return (softc->rx_port_stats->rx_mcast_frames);
+ case IFCOUNTER_OMCASTS:
+ return (softc->tx_port_stats->tx_mcast_frames);
+ case IFCOUNTER_COLLISIONS:
+ return (softc->tx_port_stats->tx_total_collisions);
+ case IFCOUNTER_IQDROPS:
+ return (softc->rx_port_stats->rx_stat_discard);
+ case IFCOUNTER_OQDROPS:
+ return (softc->tx_port_stats->tx_stat_discard);
+ case IFCOUNTER_IERRORS:
+ return (softc->rx_port_stats->rx_stat_err);
+ case IFCOUNTER_OERRORS:
+ return (softc->tx_port_stats->tx_stat_error);
+ default:
+ return (if_get_counter_default(ifp, cnt));
+ }
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 30, 6:07 PM (1 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33637692
Default Alt Text
D52091.diff (1 KB)
Attached To
Mode
D52091: bnxt_en: Use hardware statistics for IFCOUNTERS
Attached
Detach File
Event Timeline
Log In to Comment