int size; int offset; }; enum {DRVSTAT_TX, DRVSTAT_RX, DRVSTAT}; #define FIELDINFO(_struct, field) FIELD_SIZEOF(_struct, field), \ offsetof(_struct, field) #define DRVSTAT_TX_INFO(field) #field, DRVSTAT_TX,\ FIELDINFO(struct be_tx_stats, field) #define DRVSTAT_RX_INFO(field) #field, DRVSTAT_RX,\ FIELDINFO(struct be_rx_stats, field) #define DRVSTAT_INFO(field) #field, DRVSTAT,\ FIELDINFO(struct be_drv_stats, field) static const struct be_ethtool_stat et_stats[] = { {DRVSTAT_INFO(rx_crc_errors)}, {DRVSTAT_INFO(rx_alignment_symbol_errors)}, {DRVSTAT_INFO(rx_pause_frames)}, {DRVSTAT_INFO(rx_control_frames)}, /* Received packets dropped when the Ethernet length field * is not equal to the actual Ethernet data length. */ {DRVSTAT_INFO(rx_in_range_errors)}, /* Received packets dropped when their length field is >= 1501 bytes * and <= 1535 bytes. */ {DRVSTAT_INFO(rx_out_range_errors)}, /* Received packets dropped when they are longer than 9216 bytes */ {DRVSTAT_INFO(rx_frame_too_long)}, /* Received packets dropped when they don't pass the unicast or * multicast address filtering.
{PORTSTAT_INFO(tx_multicastframes)}, {PORTSTAT_INFO(tx_broadcastframes)}, {PORTSTAT_INFO(tx_pauseframes)}, {PORTSTAT_INFO(tx_controlframes)}, {MISCSTAT_INFO(rx_drops_no_pbuf)}, {MISCSTAT_INFO(rx_drops_no_txpb)}, {MISCSTAT_INFO(rx_drops_no_erx_descr)}, {MISCSTAT_INFO(rx_drops_no_tpre_descr)}, {MISCSTAT_INFO(rx_drops_too_many_frags)}, {MISCSTAT_INFO(rx_drops_invalid_ring)}, {MISCSTAT_INFO(forwarded_packets)}, {MISCSTAT_INFO(rx_drops_mtu)}, {MISCSTAT_INFO(port0_jabber_events)}, {MISCSTAT_INFO(port1_jabber_events)}, {PMEMSTAT_INFO(eth_red_drops)}, {DRVSTAT_INFO(be_on_die_temperature)} }; #define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats) /* Stats related to multi RX queues */ static const struct be_ethtool_stat et_rx_stats[] = { {DRVSTAT_RX_INFO(rx_bytes)}, {DRVSTAT_RX_INFO(rx_pkts)}, {DRVSTAT_RX_INFO(rx_rate)}, {DRVSTAT_RX_INFO(rx_polls)}, {DRVSTAT_RX_INFO(rx_events)}, {DRVSTAT_RX_INFO(rx_compl)}, {DRVSTAT_RX_INFO(rx_mcast_pkts)}, {DRVSTAT_RX_INFO(rx_post_fail)}, {ERXSTAT_INFO(rx_drops_no_fragments)} };
#define PORTSTAT_INFO(field) #field, PORTSTAT,\ FIELDINFO(struct be_port_rxf_stats, \ field) #define ERXSTAT_INFO(field) #field, ERXSTAT,\ FIELDINFO(struct be_erx_stats, field) static const struct be_ethtool_stat et_stats[] = { {NETSTAT_INFO(rx_packets)}, {NETSTAT_INFO(tx_packets)}, {NETSTAT_INFO(rx_bytes)}, {NETSTAT_INFO(tx_bytes)}, {NETSTAT_INFO(rx_errors)}, {NETSTAT_INFO(tx_errors)}, {NETSTAT_INFO(rx_dropped)}, {NETSTAT_INFO(tx_dropped)}, {DRVSTAT_INFO(be_tx_reqs)}, {DRVSTAT_INFO(be_tx_stops)}, {DRVSTAT_INFO(be_fwd_reqs)}, {DRVSTAT_INFO(be_tx_wrbs)}, {DRVSTAT_INFO(be_rx_polls)}, {DRVSTAT_INFO(be_tx_events)}, {DRVSTAT_INFO(be_rx_events)}, {DRVSTAT_INFO(be_tx_compl)}, {DRVSTAT_INFO(be_rx_compl)}, {DRVSTAT_INFO(be_rx_mcast_pkt)}, {DRVSTAT_INFO(be_ethrx_post_fail)}, {DRVSTAT_INFO(be_802_3_dropped_frames)}, {DRVSTAT_INFO(be_802_3_malformed_frames)}, {DRVSTAT_INFO(be_tx_rate)}, {DRVSTAT_INFO(be_rx_rate)}, {PORTSTAT_INFO(rx_unicast_frames)},