@@ -59,41 +59,6 @@ static const struct hns3_stats hns3_rxq_stats[] = {
59
59
60
60
#define HNS3_TQP_STATS_COUNT (HNS3_TXQ_STATS_COUNT + HNS3_RXQ_STATS_COUNT)
61
61
62
- /* netdev stats */
63
- #define HNS3_NETDEV_STAT (_string , _member ) { \
64
- .stats_string = _string, \
65
- .stats_offset = offsetof(struct rtnl_link_stats64, _member) \
66
- }
67
-
68
- static const struct hns3_stats hns3_netdev_stats [] = {
69
- /* Rx per-queue statistics */
70
- HNS3_NETDEV_STAT ("rx_packets" , rx_packets ),
71
- HNS3_NETDEV_STAT ("tx_packets" , tx_packets ),
72
- HNS3_NETDEV_STAT ("rx_bytes" , rx_bytes ),
73
- HNS3_NETDEV_STAT ("tx_bytes" , tx_bytes ),
74
- HNS3_NETDEV_STAT ("rx_errors" , rx_errors ),
75
- HNS3_NETDEV_STAT ("tx_errors" , tx_errors ),
76
- HNS3_NETDEV_STAT ("rx_dropped" , rx_dropped ),
77
- HNS3_NETDEV_STAT ("tx_dropped" , tx_dropped ),
78
- HNS3_NETDEV_STAT ("multicast" , multicast ),
79
- HNS3_NETDEV_STAT ("collisions" , collisions ),
80
- HNS3_NETDEV_STAT ("rx_length_errors" , rx_length_errors ),
81
- HNS3_NETDEV_STAT ("rx_over_errors" , rx_over_errors ),
82
- HNS3_NETDEV_STAT ("rx_crc_errors" , rx_crc_errors ),
83
- HNS3_NETDEV_STAT ("rx_frame_errors" , rx_frame_errors ),
84
- HNS3_NETDEV_STAT ("rx_fifo_errors" , rx_fifo_errors ),
85
- HNS3_NETDEV_STAT ("rx_missed_errors" , rx_missed_errors ),
86
- HNS3_NETDEV_STAT ("tx_aborted_errors" , tx_aborted_errors ),
87
- HNS3_NETDEV_STAT ("tx_carrier_errors" , tx_carrier_errors ),
88
- HNS3_NETDEV_STAT ("tx_fifo_errors" , tx_fifo_errors ),
89
- HNS3_NETDEV_STAT ("tx_heartbeat_errors" , tx_heartbeat_errors ),
90
- HNS3_NETDEV_STAT ("tx_window_errors" , tx_window_errors ),
91
- HNS3_NETDEV_STAT ("rx_compressed" , rx_compressed ),
92
- HNS3_NETDEV_STAT ("tx_compressed" , tx_compressed ),
93
- };
94
-
95
- #define HNS3_NETDEV_STATS_COUNT ARRAY_SIZE(hns3_netdev_stats)
96
-
97
62
#define HNS3_SELF_TEST_TPYE_NUM 1
98
63
#define HNS3_NIC_LB_TEST_PKT_NUM 1
99
64
#define HNS3_NIC_LB_TEST_RING_ID 0
@@ -466,27 +431,6 @@ static u8 *hns3_get_strings_tqps(struct hnae3_handle *handle, u8 *data)
466
431
return data ;
467
432
}
468
433
469
- static u8 * hns3_netdev_stats_get_strings (u8 * data )
470
- {
471
- int i ;
472
-
473
- /* get strings for netdev */
474
- for (i = 0 ; i < HNS3_NETDEV_STATS_COUNT ; i ++ ) {
475
- snprintf (data , ETH_GSTRING_LEN ,
476
- hns3_netdev_stats [i ].stats_string );
477
- data += ETH_GSTRING_LEN ;
478
- }
479
-
480
- snprintf (data , ETH_GSTRING_LEN , "netdev_rx_dropped" );
481
- data += ETH_GSTRING_LEN ;
482
- snprintf (data , ETH_GSTRING_LEN , "netdev_tx_dropped" );
483
- data += ETH_GSTRING_LEN ;
484
- snprintf (data , ETH_GSTRING_LEN , "netdev_tx_timeout" );
485
- data += ETH_GSTRING_LEN ;
486
-
487
- return data ;
488
- }
489
-
490
434
static void hns3_get_strings (struct net_device * netdev , u32 stringset , u8 * data )
491
435
{
492
436
struct hnae3_handle * h = hns3_get_handle (netdev );
@@ -498,7 +442,6 @@ static void hns3_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
498
442
499
443
switch (stringset ) {
500
444
case ETH_SS_STATS :
501
- buff = hns3_netdev_stats_get_strings (buff );
502
445
buff = hns3_get_strings_tqps (h , buff );
503
446
h -> ae_algo -> ops -> get_strings (h , stringset , (u8 * )buff );
504
447
break ;
@@ -537,27 +480,6 @@ static u64 *hns3_get_stats_tqps(struct hnae3_handle *handle, u64 *data)
537
480
return data ;
538
481
}
539
482
540
- static u64 * hns3_get_netdev_stats (struct net_device * netdev , u64 * data )
541
- {
542
- struct hns3_nic_priv * priv = netdev_priv (netdev );
543
- const struct rtnl_link_stats64 * net_stats ;
544
- struct rtnl_link_stats64 temp ;
545
- u8 * stat ;
546
- int i ;
547
-
548
- net_stats = dev_get_stats (netdev , & temp );
549
- for (i = 0 ; i < HNS3_NETDEV_STATS_COUNT ; i ++ ) {
550
- stat = (u8 * )net_stats + hns3_netdev_stats [i ].stats_offset ;
551
- * data ++ = * (u64 * )stat ;
552
- }
553
-
554
- * data ++ = netdev -> rx_dropped .counter ;
555
- * data ++ = netdev -> tx_dropped .counter ;
556
- * data ++ = priv -> tx_timeout_count ;
557
-
558
- return data ;
559
- }
560
-
561
483
/* hns3_get_stats - get detail statistics.
562
484
* @netdev: net device
563
485
* @stats: statistics info.
@@ -574,7 +496,7 @@ static void hns3_get_stats(struct net_device *netdev,
574
496
return ;
575
497
}
576
498
577
- p = hns3_get_netdev_stats ( netdev , p );
499
+ h -> ae_algo -> ops -> update_stats ( h , & netdev -> stats );
578
500
579
501
/* get per-queue stats */
580
502
p = hns3_get_stats_tqps (h , p );
0 commit comments