@@ -757,8 +757,8 @@ static int pm_stats_show(struct seq_file *seq, void *v)
757757 };
758758
759759 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 ];
762762 struct adapter * adap = seq -> private ;
763763
764764 t4_pmtx_get_stats (adap , tx_cnt , tx_cyc );
@@ -773,6 +773,32 @@ static int pm_stats_show(struct seq_file *seq, void *v)
773773 for (i = 0 ; i < PM_NSTATS - 1 ; i ++ )
774774 seq_printf (seq , "%-13s %10u %20llu\n" ,
775775 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+ }
776802 return 0 ;
777803}
778804
@@ -1559,25 +1585,35 @@ static int mps_tcam_show(struct seq_file *seq, void *v)
15591585{
15601586 struct adapter * adap = seq -> private ;
15611587 unsigned int chip_ver = CHELSIO_CHIP_VERSION (adap -> params .chip );
1562-
15631588 if (v == SEQ_START_TOKEN ) {
1564- if (adap -> params . arch . mps_rplc_size > 128 )
1589+ if (chip_ver > CHELSIO_T5 ) {
15651590 seq_puts (seq , "Idx Ethernet address Mask "
1591+ " VNI Mask IVLAN Vld "
1592+ "DIP_Hit Lookup Port "
15661593 "Vld Ports PF VF "
15671594 "Replication "
15681595 " 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+ }
15731607 } else {
15741608 u64 mask ;
15751609 u8 addr [ETH_ALEN ];
1576- bool replicate ;
1610+ bool replicate , dip_hit = false, vlan_vld = false ;
15771611 unsigned int idx = (uintptr_t )v - 2 ;
15781612 u64 tcamy , tcamx , val ;
1579- u32 cls_lo , cls_hi , ctl ;
1613+ u32 cls_lo , cls_hi , ctl , data2 , vnix = 0 , vniy = 0 ;
15801614 u32 rplc [8 ] = {0 };
1615+ u8 lookup_type = 0 , port_num = 0 ;
1616+ u16 ivlan = 0 ;
15811617
15821618 if (chip_ver > CHELSIO_T5 ) {
15831619 /* CtlCmdType - 0: Read, 1: Write
@@ -1596,13 +1632,35 @@ static int mps_tcam_show(struct seq_file *seq, void *v)
15961632 val = t4_read_reg (adap , MPS_CLS_TCAM_DATA1_A );
15971633 tcamy = DMACH_G (val ) << 32 ;
15981634 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 );
15991651
16001652 /* Read tcamx. Change the control param */
16011653 ctl |= CTLXYBITSEL_V (1 );
16021654 t4_write_reg (adap , MPS_CLS_TCAM_DATA2_CTL_A , ctl );
16031655 val = t4_read_reg (adap , MPS_CLS_TCAM_DATA1_A );
16041656 tcamx = DMACH_G (val ) << 32 ;
16051657 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+ }
16061664 } else {
16071665 tcamy = t4_read_reg64 (adap , MPS_CLS_TCAM_Y_L (idx ));
16081666 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)
16621720 }
16631721
16641722 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
16761764 seq_printf (seq , "%3u %02x:%02x:%02x:%02x:%02x:%02x "
16771765 "%012llx%3c %#x%4u%4d" ,
16781766 idx , addr [0 ], addr [1 ], addr [2 ], addr [3 ],
0 commit comments