@@ -365,6 +365,14 @@ static const char lan743x_set1_sw_cnt_strings[][ETH_GSTRING_LEN] = {
365
365
"RX Queue 3 Frames" ,
366
366
};
367
367
368
+ static const char lan743x_tx_queue_cnt_strings [][ETH_GSTRING_LEN ] = {
369
+ "TX Queue 0 Frames" ,
370
+ "TX Queue 1 Frames" ,
371
+ "TX Queue 2 Frames" ,
372
+ "TX Queue 3 Frames" ,
373
+ "TX Total Queue Frames" ,
374
+ };
375
+
368
376
static const char lan743x_set2_hw_cnt_strings [][ETH_GSTRING_LEN ] = {
369
377
"RX Total Frames" ,
370
378
"EEE RX LPI Transitions" ,
@@ -462,6 +470,8 @@ static const char lan743x_priv_flags_strings[][ETH_GSTRING_LEN] = {
462
470
static void lan743x_ethtool_get_strings (struct net_device * netdev ,
463
471
u32 stringset , u8 * data )
464
472
{
473
+ struct lan743x_adapter * adapter = netdev_priv (netdev );
474
+
465
475
switch (stringset ) {
466
476
case ETH_SS_STATS :
467
477
memcpy (data , lan743x_set0_hw_cnt_strings ,
@@ -473,6 +483,13 @@ static void lan743x_ethtool_get_strings(struct net_device *netdev,
473
483
sizeof (lan743x_set1_sw_cnt_strings )],
474
484
lan743x_set2_hw_cnt_strings ,
475
485
sizeof (lan743x_set2_hw_cnt_strings ));
486
+ if (adapter -> is_pci11x1x ) {
487
+ memcpy (& data [sizeof (lan743x_set0_hw_cnt_strings ) +
488
+ sizeof (lan743x_set1_sw_cnt_strings ) +
489
+ sizeof (lan743x_set2_hw_cnt_strings )],
490
+ lan743x_tx_queue_cnt_strings ,
491
+ sizeof (lan743x_tx_queue_cnt_strings ));
492
+ }
476
493
break ;
477
494
case ETH_SS_PRIV_FLAGS :
478
495
memcpy (data , lan743x_priv_flags_strings ,
@@ -486,7 +503,9 @@ static void lan743x_ethtool_get_ethtool_stats(struct net_device *netdev,
486
503
u64 * data )
487
504
{
488
505
struct lan743x_adapter * adapter = netdev_priv (netdev );
506
+ u64 total_queue_count = 0 ;
489
507
int data_index = 0 ;
508
+ u64 pkt_cnt ;
490
509
u32 buf ;
491
510
int i ;
492
511
@@ -500,6 +519,14 @@ static void lan743x_ethtool_get_ethtool_stats(struct net_device *netdev,
500
519
buf = lan743x_csr_read (adapter , lan743x_set2_hw_cnt_addr [i ]);
501
520
data [data_index ++ ] = (u64 )buf ;
502
521
}
522
+ if (adapter -> is_pci11x1x ) {
523
+ for (i = 0 ; i < ARRAY_SIZE (adapter -> tx ); i ++ ) {
524
+ pkt_cnt = (u64 )(adapter -> tx [i ].frame_count );
525
+ data [data_index ++ ] = pkt_cnt ;
526
+ total_queue_count += pkt_cnt ;
527
+ }
528
+ data [data_index ++ ] = total_queue_count ;
529
+ }
503
530
}
504
531
505
532
static u32 lan743x_ethtool_get_priv_flags (struct net_device * netdev )
@@ -520,6 +547,8 @@ static int lan743x_ethtool_set_priv_flags(struct net_device *netdev, u32 flags)
520
547
521
548
static int lan743x_ethtool_get_sset_count (struct net_device * netdev , int sset )
522
549
{
550
+ struct lan743x_adapter * adapter = netdev_priv (netdev );
551
+
523
552
switch (sset ) {
524
553
case ETH_SS_STATS :
525
554
{
@@ -528,6 +557,8 @@ static int lan743x_ethtool_get_sset_count(struct net_device *netdev, int sset)
528
557
ret = ARRAY_SIZE (lan743x_set0_hw_cnt_strings );
529
558
ret += ARRAY_SIZE (lan743x_set1_sw_cnt_strings );
530
559
ret += ARRAY_SIZE (lan743x_set2_hw_cnt_strings );
560
+ if (adapter -> is_pci11x1x )
561
+ ret += ARRAY_SIZE (lan743x_tx_queue_cnt_strings );
531
562
return ret ;
532
563
}
533
564
case ETH_SS_PRIV_FLAGS :
0 commit comments