diff options
author | Kuo Zhao <kuozhao@google.com> | 2020-09-11 10:38:45 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-11 14:31:53 -0700 |
commit | 433e274b8f7b0360169694b00eab05bbfa0921f5 (patch) | |
tree | af280d8ef74a956f0b294244432a118ed2a3d356 /drivers/net/ethernet/google/gve/gve.h | |
parent | d5f7543c86e0a889403abd42e27e911cc33144c3 (diff) |
gve: Add stats for gve.
Sample output of "ethtool -S <interface-name>" with 1 RX queue and 1 TX
queue:
NIC statistics:
rx_packets: 1039
tx_packets: 37
rx_bytes: 822071
tx_bytes: 4100
rx_dropped: 0
tx_dropped: 0
tx_timeouts: 0
rx_skb_alloc_fail: 0
rx_buf_alloc_fail: 0
rx_desc_err_dropped_pkt: 0
interface_up_cnt: 1
interface_down_cnt: 0
reset_cnt: 0
page_alloc_fail: 0
dma_mapping_error: 0
rx_posted_desc[0]: 1365
rx_completed_desc[0]: 341
rx_bytes[0]: 215094
rx_dropped_pkt[0]: 0
rx_copybreak_pkt[0]: 3
rx_copied_pkt[0]: 3
tx_posted_desc[0]: 6
tx_completed_desc[0]: 6
tx_bytes[0]: 420
tx_wake[0]: 0
tx_stop[0]: 0
tx_event_counter[0]: 6
adminq_prod_cnt: 34
adminq_cmd_fail: 0
adminq_timeouts: 0
adminq_describe_device_cnt: 1
adminq_cfg_device_resources_cnt: 1
adminq_register_page_list_cnt: 16
adminq_unregister_page_list_cnt: 0
adminq_create_tx_queue_cnt: 8
adminq_create_rx_queue_cnt: 8
adminq_destroy_tx_queue_cnt: 0
adminq_destroy_rx_queue_cnt: 0
adminq_dcfg_device_resources_cnt: 0
adminq_set_driver_parameter_cnt: 0
Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Kuo Zhao <kuozhao@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/google/gve/gve.h')
-rw-r--r-- | drivers/net/ethernet/google/gve/gve.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h index ebc37e256922..55b34b437764 100644 --- a/drivers/net/ethernet/google/gve/gve.h +++ b/drivers/net/ethernet/google/gve/gve.h @@ -71,6 +71,11 @@ struct gve_rx_ring { u32 cnt; /* free-running total number of completed packets */ u32 fill_cnt; /* free-running total number of descs and buffs posted */ u32 mask; /* masks the cnt and fill_cnt to the size of the ring */ + u64 rx_copybreak_pkt; /* free-running count of copybreak packets */ + u64 rx_copied_pkt; /* free-running total number of copied packets */ + u64 rx_skb_alloc_fail; /* free-running count of skb alloc fails */ + u64 rx_buf_alloc_fail; /* free-running count of buffer alloc fails */ + u64 rx_desc_err_dropped_pkt; /* free-running count of packets dropped by descriptor error */ u32 q_num; /* queue index */ u32 ntfy_id; /* notification block index */ struct gve_queue_resources *q_resources; /* head and tail pointer idx */ @@ -202,6 +207,26 @@ struct gve_priv { dma_addr_t adminq_bus_addr; u32 adminq_mask; /* masks prod_cnt to adminq size */ u32 adminq_prod_cnt; /* free-running count of AQ cmds executed */ + u32 adminq_cmd_fail; /* free-running count of AQ cmds failed */ + u32 adminq_timeouts; /* free-running count of AQ cmds timeouts */ + /* free-running count of per AQ cmd executed */ + u32 adminq_describe_device_cnt; + u32 adminq_cfg_device_resources_cnt; + u32 adminq_register_page_list_cnt; + u32 adminq_unregister_page_list_cnt; + u32 adminq_create_tx_queue_cnt; + u32 adminq_create_rx_queue_cnt; + u32 adminq_destroy_tx_queue_cnt; + u32 adminq_destroy_rx_queue_cnt; + u32 adminq_dcfg_device_resources_cnt; + u32 adminq_set_driver_parameter_cnt; + + /* Global stats */ + u32 interface_up_cnt; /* count of times interface turned up since last reset */ + u32 interface_down_cnt; /* count of times interface turned down since last reset */ + u32 reset_cnt; /* count of reset */ + u32 page_alloc_fail; /* count of page alloc fails */ + u32 dma_mapping_error; /* count of dma mapping errors */ struct workqueue_struct *gve_wq; struct work_struct service_task; @@ -426,7 +451,8 @@ static inline bool gve_can_recycle_pages(struct net_device *dev) } /* buffers */ -int gve_alloc_page(struct device *dev, struct page **page, dma_addr_t *dma, +int gve_alloc_page(struct gve_priv *priv, struct device *dev, + struct page **page, dma_addr_t *dma, enum dma_data_direction); void gve_free_page(struct device *dev, struct page *page, dma_addr_t dma, enum dma_data_direction); |