@@ -757,8 +757,8 @@ static int pm_stats_show(struct seq_file *seq, void *v)
757
757
};
758
758
759
759
int i ;
760
- u32 tx_cnt [PM_NSTATS ], rx_cnt [PM_NSTATS ];
761
- u64 tx_cyc [PM_NSTATS ], rx_cyc [PM_NSTATS ];
760
+ u32 tx_cnt [T6_PM_NSTATS ], rx_cnt [T6_PM_NSTATS ];
761
+ u64 tx_cyc [T6_PM_NSTATS ], rx_cyc [T6_PM_NSTATS ];
762
762
struct adapter * adap = seq -> private ;
763
763
764
764
t4_pmtx_get_stats (adap , tx_cnt , tx_cyc );
@@ -773,6 +773,32 @@ static int pm_stats_show(struct seq_file *seq, void *v)
773
773
for (i = 0 ; i < PM_NSTATS - 1 ; i ++ )
774
774
seq_printf (seq , "%-13s %10u %20llu\n" ,
775
775
rx_pm_stats [i ], rx_cnt [i ], rx_cyc [i ]);
776
+
777
+ if (CHELSIO_CHIP_VERSION (adap -> params .chip ) > CHELSIO_T5 ) {
778
+ /* In T5 the granularity of the total wait is too fine.
779
+ * It is not useful as it reaches the max value too fast.
780
+ * Hence display this Input FIFO wait for T6 onwards.
781
+ */
782
+ seq_printf (seq , "%13s %10s %20s\n" ,
783
+ " " , "Total wait" , "Total Occupancy" );
784
+ seq_printf (seq , "Tx FIFO wait %10u %20llu\n" ,
785
+ tx_cnt [i ], tx_cyc [i ]);
786
+ seq_printf (seq , "Rx FIFO wait %10u %20llu\n" ,
787
+ rx_cnt [i ], rx_cyc [i ]);
788
+
789
+ /* Skip index 6 as there is nothing useful ihere */
790
+ i += 2 ;
791
+
792
+ /* At index 7, a new stat for read latency (count, total wait)
793
+ * is added.
794
+ */
795
+ seq_printf (seq , "%13s %10s %20s\n" ,
796
+ " " , "Reads" , "Total wait" );
797
+ seq_printf (seq , "Tx latency %10u %20llu\n" ,
798
+ tx_cnt [i ], tx_cyc [i ]);
799
+ seq_printf (seq , "Rx latency %10u %20llu\n" ,
800
+ rx_cnt [i ], rx_cyc [i ]);
801
+ }
776
802
return 0 ;
777
803
}
778
804
@@ -1559,25 +1585,35 @@ static int mps_tcam_show(struct seq_file *seq, void *v)
1559
1585
{
1560
1586
struct adapter * adap = seq -> private ;
1561
1587
unsigned int chip_ver = CHELSIO_CHIP_VERSION (adap -> params .chip );
1562
-
1563
1588
if (v == SEQ_START_TOKEN ) {
1564
- if (adap -> params . arch . mps_rplc_size > 128 )
1589
+ if (chip_ver > CHELSIO_T5 ) {
1565
1590
seq_puts (seq , "Idx Ethernet address Mask "
1591
+ " VNI Mask IVLAN Vld "
1592
+ "DIP_Hit Lookup Port "
1566
1593
"Vld Ports PF VF "
1567
1594
"Replication "
1568
1595
" P0 P1 P2 P3 ML\n" );
1569
- else
1570
- seq_puts (seq , "Idx Ethernet address Mask "
1571
- "Vld Ports PF VF Replication"
1572
- " P0 P1 P2 P3 ML\n" );
1596
+ } else {
1597
+ if (adap -> params .arch .mps_rplc_size > 128 )
1598
+ seq_puts (seq , "Idx Ethernet address Mask "
1599
+ "Vld Ports PF VF "
1600
+ "Replication "
1601
+ " P0 P1 P2 P3 ML\n" );
1602
+ else
1603
+ seq_puts (seq , "Idx Ethernet address Mask "
1604
+ "Vld Ports PF VF Replication"
1605
+ " P0 P1 P2 P3 ML\n" );
1606
+ }
1573
1607
} else {
1574
1608
u64 mask ;
1575
1609
u8 addr [ETH_ALEN ];
1576
- bool replicate ;
1610
+ bool replicate , dip_hit = false, vlan_vld = false ;
1577
1611
unsigned int idx = (uintptr_t )v - 2 ;
1578
1612
u64 tcamy , tcamx , val ;
1579
- u32 cls_lo , cls_hi , ctl ;
1613
+ u32 cls_lo , cls_hi , ctl , data2 , vnix = 0 , vniy = 0 ;
1580
1614
u32 rplc [8 ] = {0 };
1615
+ u8 lookup_type = 0 , port_num = 0 ;
1616
+ u16 ivlan = 0 ;
1581
1617
1582
1618
if (chip_ver > CHELSIO_T5 ) {
1583
1619
/* CtlCmdType - 0: Read, 1: Write
@@ -1596,13 +1632,35 @@ static int mps_tcam_show(struct seq_file *seq, void *v)
1596
1632
val = t4_read_reg (adap , MPS_CLS_TCAM_DATA1_A );
1597
1633
tcamy = DMACH_G (val ) << 32 ;
1598
1634
tcamy |= t4_read_reg (adap , MPS_CLS_TCAM_DATA0_A );
1635
+ data2 = t4_read_reg (adap , MPS_CLS_TCAM_DATA2_CTL_A );
1636
+ lookup_type = DATALKPTYPE_G (data2 );
1637
+ /* 0 - Outer header, 1 - Inner header
1638
+ * [71:48] bit locations are overloaded for
1639
+ * outer vs. inner lookup types.
1640
+ */
1641
+ if (lookup_type && (lookup_type != DATALKPTYPE_M )) {
1642
+ /* Inner header VNI */
1643
+ vniy = ((data2 & DATAVIDH2_F ) << 23 ) |
1644
+ (DATAVIDH1_G (data2 ) << 16 ) | VIDL_G (val );
1645
+ dip_hit = data2 & DATADIPHIT_F ;
1646
+ } else {
1647
+ vlan_vld = data2 & DATAVIDH2_F ;
1648
+ ivlan = VIDL_G (val );
1649
+ }
1650
+ port_num = DATAPORTNUM_G (data2 );
1599
1651
1600
1652
/* Read tcamx. Change the control param */
1601
1653
ctl |= CTLXYBITSEL_V (1 );
1602
1654
t4_write_reg (adap , MPS_CLS_TCAM_DATA2_CTL_A , ctl );
1603
1655
val = t4_read_reg (adap , MPS_CLS_TCAM_DATA1_A );
1604
1656
tcamx = DMACH_G (val ) << 32 ;
1605
1657
tcamx |= t4_read_reg (adap , MPS_CLS_TCAM_DATA0_A );
1658
+ data2 = t4_read_reg (adap , MPS_CLS_TCAM_DATA2_CTL_A );
1659
+ if (lookup_type && (lookup_type != DATALKPTYPE_M )) {
1660
+ /* Inner header VNI mask */
1661
+ vnix = ((data2 & DATAVIDH2_F ) << 23 ) |
1662
+ (DATAVIDH1_G (data2 ) << 16 ) | VIDL_G (val );
1663
+ }
1606
1664
} else {
1607
1665
tcamy = t4_read_reg64 (adap , MPS_CLS_TCAM_Y_L (idx ));
1608
1666
tcamx = t4_read_reg64 (adap , MPS_CLS_TCAM_X_L (idx ));
@@ -1662,17 +1720,47 @@ static int mps_tcam_show(struct seq_file *seq, void *v)
1662
1720
}
1663
1721
1664
1722
tcamxy2valmask (tcamx , tcamy , addr , & mask );
1665
- if (chip_ver > CHELSIO_T5 )
1666
- seq_printf (seq , "%3u %02x:%02x:%02x:%02x:%02x:%02x "
1667
- "%012llx%3c %#x%4u%4d" ,
1668
- idx , addr [0 ], addr [1 ], addr [2 ], addr [3 ],
1669
- addr [4 ], addr [5 ], (unsigned long long )mask ,
1670
- (cls_lo & T6_SRAM_VLD_F ) ? 'Y' : 'N' ,
1671
- PORTMAP_G (cls_hi ),
1672
- T6_PF_G (cls_lo ),
1673
- (cls_lo & T6_VF_VALID_F ) ?
1674
- T6_VF_G (cls_lo ) : -1 );
1675
- else
1723
+ if (chip_ver > CHELSIO_T5 ) {
1724
+ /* Inner header lookup */
1725
+ if (lookup_type && (lookup_type != DATALKPTYPE_M )) {
1726
+ seq_printf (seq ,
1727
+ "%3u %02x:%02x:%02x:%02x:%02x:%02x "
1728
+ "%012llx %06x %06x - - %3c"
1729
+ " %3c %4x "
1730
+ "%3c %#x%4u%4d" , idx , addr [0 ],
1731
+ addr [1 ], addr [2 ], addr [3 ],
1732
+ addr [4 ], addr [5 ],
1733
+ (unsigned long long )mask ,
1734
+ vniy , vnix , dip_hit ? 'Y' : 'N' ,
1735
+ lookup_type ? 'I' : 'O' , port_num ,
1736
+ (cls_lo & T6_SRAM_VLD_F ) ? 'Y' : 'N' ,
1737
+ PORTMAP_G (cls_hi ),
1738
+ T6_PF_G (cls_lo ),
1739
+ (cls_lo & T6_VF_VALID_F ) ?
1740
+ T6_VF_G (cls_lo ) : -1 );
1741
+ } else {
1742
+ seq_printf (seq ,
1743
+ "%3u %02x:%02x:%02x:%02x:%02x:%02x "
1744
+ "%012llx - - " ,
1745
+ idx , addr [0 ], addr [1 ], addr [2 ],
1746
+ addr [3 ], addr [4 ], addr [5 ],
1747
+ (unsigned long long )mask );
1748
+
1749
+ if (vlan_vld )
1750
+ seq_printf (seq , "%4u Y " , ivlan );
1751
+ else
1752
+ seq_puts (seq , " - N " );
1753
+
1754
+ seq_printf (seq ,
1755
+ "- %3c %4x %3c %#x%4u%4d" ,
1756
+ lookup_type ? 'I' : 'O' , port_num ,
1757
+ (cls_lo & T6_SRAM_VLD_F ) ? 'Y' : 'N' ,
1758
+ PORTMAP_G (cls_hi ),
1759
+ T6_PF_G (cls_lo ),
1760
+ (cls_lo & T6_VF_VALID_F ) ?
1761
+ T6_VF_G (cls_lo ) : -1 );
1762
+ }
1763
+ } else
1676
1764
seq_printf (seq , "%3u %02x:%02x:%02x:%02x:%02x:%02x "
1677
1765
"%012llx%3c %#x%4u%4d" ,
1678
1766
idx , addr [0 ], addr [1 ], addr [2 ], addr [3 ],
0 commit comments