bcm cli 命令
查看端口当前芯片配置:
Sundray-SW /var #bcmsh port ge3 =
excute : ovs-appctl plugin/bcmsh port ge3 =
Enable[True]
AutoNeg[True]
ADVert[1000full,100,10]
SPeed[0]
FullDuplex[False]
LinkScan[HW]
LeaRN[5]
DISCard[None]
VlanFilter[3]
PRIOrity[0]
PortFilterMode[2]
PHymaster[Auto]
InterFace[GMII]
LoopBack[NONE]
SpanningTreeProtocol[Block]
STationADdress[90:3c:15:2b:c0:34]
TxPAUse[True]
RxPAUse[True]
ENCapsulation[IEEE]
FrameMax[1518]
MDIX[ForcedAuto]
Medium[Copper]
配置强制全双工:
Sundray-SW[1-LC] / #bcmsh port ge2,ge3 sp=100 fd=false an=0
excute : ovs-appctl plugin/bcmsh port ge2,ge3 sp=100 fd=false an=0
PORT: port ge2 does not support 100 mbps half duplex
PORT: port ge3 does not support 100 mbps half duplex
端口的速率不需要协商,但是双工模式需要协商
port1(100M FD) 和 port2(10/100/1000M) auto 协商,速率为100M(不需要协商),双工模式协商失败,port1为FD,port2为HD(非协商而来,乃是默认模式,默认为半双工)
56340关闭流控:
bcmsh s XMAC_PAUSE_CTRL.ge TX_PAUSE_EN=0 RX_PAUSE_EN=0
bcmsh s XMAC_PAUSE_CTRL.xe TX_PAUSE_EN=0 RX_PAUSE_EN=0
查看当前端口是光还是电
Sundray-SW /var #bcmsh combo ge12
excute : ovs-appctl plugin/bcmsh combo ge12
Port ge12:
ge12: Copper medium (active)
enable=1 preferred=1 force_speed=1000 force_duplex=1 master=Auto
autoneg_enable=1 autoneg_advert=(0x0)
MDIX=ForcedAuto
ge12: Fiber medium
enable=1 preferred=1 force_speed=1000 force_duplex=1 master=Auto
autoneg_enable=1 autoneg_advert=(0x0)
MDIX=ForcedAuto
preferred
字段表示是否支持此种媒介
关闭光口的使能和preferred
Sundray-SW /var #bcmsh combo ge12 fiber enable=0 preferred=0
excute : ovs-appctl plugin/bcmsh combo ge12 fiber enable=0 preferred=0
查看数据包统计情况
Sundray-SW /var #bcmsh pw log 5 report +dec +dma start
Sundray-SW /var #bcmsh pw
excute : ovs-appctl plugin/bcmsh pw
bcmPW.0: Status: Running. Mode RX. Buffering up to 5 packets.
Rate limit is 30000 (soc intvl 0).
Reporting is enabled for: DECode DMA # 命令`bcmsh pw report +dma`添加
Reporting is disabled for: Count Raw CHannel
Dump options are enabled for:
Dump options are disabled for: Count DECode Raw DMA CHannel
RX on for channel(s): -- using default --
RX Info @ time=2741844389: started. Last fill 2741661729. Thread is running.
+verbose for more info
Pkt Size 16384. Pkts/Chain 8. All COS PPS 30000. Burst 0. Flags 0.
Sys PPS 0. Sys tokens 0. Sys fill 2128172618.
Cntrs: Pkts 0. Last start 0. Tunnel 0. Owned 0.
Bad Hndlr 0. No Hndlr 0. Not Running 0.
Thrd Not Running 0. DCB Errs 0.
Registered callbacks:
RX CMD Priority=100. Argument=0x0. COS 0x0000000ff.
Packets handled 0, owned 0.
Discard Priority= 0. Argument=0x0. COS 0x0000000ff.
Packets handled 0, owned 0.
Channel Info
Chan 1 is running: Chains 8. COS 0xff. DCB/pkt 1
rpkt 0. rbyte 0. dpkt 0. dbyte 0. mem fail 0 flags 1.
Queue Info
Queue 0: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
Queue 1: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
Queue 2: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
Queue 3: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
Queue 4: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
Queue 5: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
Queue 6: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
Queue 7: PPS 0. CurPkts 0. TotPkts 0. Disc rate 0, qlen 0.
查看眼图,存在眼图即说明光模块有光,眼图形状良好说明光信号质量良好
Sundray-SW[Undefine-0/32|LC] / #bcmsh phy diag xe1 eyescan
excute : ovs-appctl plugin/bcmsh phy diag xe1 eyescan
for u=0 p=2 lane_mask=2:
+--------------------------------------------------------------------+
| EYESCAN Phy: 0x081 lane_mask: 0x02 |
+--------------------------------------------------------------------+
Each character N represents approximate error rate 1e-N at that location
UI/64 : -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30
: -|----|----|----|----|----|----|----|----|----|----|----|----|-
203mV : 111111111111111111111111111111111111111111111111111111111111111
196mV : 111111111111111111111111111111111111111111111111111111111111111
190mV : 111111111111111111111111111111111111111111111111111111111111111
183mV : 111111111111111111111111111111111111111111111111111111111111111
176mV : 111111111111111111111111111222222211111111111111111111111111111
170mV : 111111111111111111111111222222222222211111111111111111111111111
163mV : 111111111111111111111112222222222222222111111111111111111111111
157mV : 111111111111111111111222222233333333322211111111111111111111111
150mV : 111111111111111111112222233333344443333222111111111111111111111
144mV : 111111111111111111122223334444455554443322211111111111111111111
137mV : 111111111111111111222333445555666666654432221111111111111111111
131mV : 11111111111111111222334455667777--77766543322111111111111111111
124mV : 11111111111111112223345577: : : 7654332211111111111111111
117mV : 1111111111111112223345677 : : : 65432211111111111111111
111mV : 11111111111111122334567 : : : 6543221111111111111111
104mV : 111111111111112233456: : : : 7653322111111111111111
98mV : 111111111111122334567+----+----+----+----+754332211111111111111
91mV : 1111111111111223456 : : : : : 75432221111111111111
85mV : 111111111111223456 : : : : : 6543222111111111111
78mV : 111111111112233567 : : : : : 7654322111111111111
72mV : 11111111112223467 : : : : : 764332211111111111
65mV : 1111111112223457+----+----+----+----+----+----76433221111111111
58mV : 111111111223457 : : : : : : :7643222111111111
52mV : 11111111223456 : : : : : : : 754322111111111
45mV : 1111111223346 : : : : : : : 65432211111111
39mV : 111111223346 : : : : : : : 6533221111111
32mV : 11111223346+----+----+----+----+----+----+----+---7643221111111
26mV : 11112223457: : : : : : : : 754322211111
19mV : 1111223457 : : : : : : : : :65332211111
13mV : 111223457 : : : : : : : : : 6433221111
6mV : 11223456 : : : : : : : : : 7543322111
0mV : 11123346---+----+----+----+----+----+----+----+----+-7654322111
-6mV : 111223456 : : : : : : : : :76443222111
-13mV : 1111223456 : : : : : : : : :75432221111
-19mV : 11112223456: : : : : : : : 754322211111
-26mV : 111112223457 : : : : : : : 7643222111111
-32mV : 1111112233457---+----+----+----+----+----+----+---6543221111111
-39mV : 11111112233467 : : : : : : : 75432211111111
-45mV : 111111122234567 : : : : : : : 754322111111111
-52mV : 111111112223456 : : : : : : :7543221111111111
-58mV : 1111111112223457: : : : : : 76433221111111111
-65mV : 11111111112223467----+----+----+----+----+---764332211111111111
-72mV : 111111111112233567 : : : : : 653322111111111111
-78mV : 1111111111112234567 : : : : : 6543221111111111111
-85mV : 11111111111122234567 : : : : : 75432211111111111111
-91mV : 111111111111122234567: : : : :754322111111111111111
-98mV : 1111111111111122234567----+----+----+----7643322111111111111111
-104mV : 11111111111111122234567 : : : 76433221111111111111111
-111mV : 11111111111111112223345677: : : 7765432211111111111111111
-117mV : 1111111111111111122233445666777777 7766543322111111111111111111
-124mV : 111111111111111111222333444555566555554433221111111111111111111
-131mV : 111111111111111111122223333444444444443322211111111111111111111
-137mV : 111111111111111111112222333333333333333222111111111111111111111
-144mV : 111111111111111111111222222223333333222221111111111111111111111
-150mV : 111111111111111111111122222222222222222111111111111111111111111
-157mV : 111111111111111111111111222222222222211111111111111111111111111
-163mV : 111111111111111111111111111222222211111111111111111111111111111
-170mV : 111111111111111111111111111111111111111111111111111111111111111
-176mV : 111111111111111111111111111111111111111111111111111111111111111
-183mV : 111111111111111111111111111111111111111111111111111111111111111
-190mV : 111111111111111111111111111111111111111111111111111111111111111
-196mV : 111111111111111111111111111111111111111111111111111111111111111
-203mV : 111111111111111111111111111111111111111111111111111111111111111
: -|----|----|----|----|----|----|----|----|----|----|----|----|-
UI/64 : -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30
光信号锁定,关注SD、LCK字段
Sundray-SW[Undefine-0/7|LC] / #bcmsh phy diag hg0 dsc
excute : ovs-appctl plugin/bcmsh phy diag hg0 dsc
tscf16_phy_pmd_info_dump:539 type = 16384 laneMask = 0x3, Address = 0xC1
SerDes type = falcon16_tsc
CORE RST_ST PLL_PWDN UC_ATV COM_CLK UCODE_VER API_VER AFE_VER LIVE_TEMP AVG_TMON RESCAL VCO_RATE ANA_VCO_RANGE REFCLK_2x PLL_DIV PLL_LOCK PLL_COMP_THRESH
00 0,00 0 1 156.25MHz D103_13 A10720 0xd1 68C (11) 68C 0x08 27.375GHz 184 0 175 1 -150mV
**************************************************************************************************************
**** Legend of Entries in display_core_state() ****
**************************************************************************************************************
* RST_ST : Core DP Reset State{reset_active, reset_occured, reset_held}, Core uC Status byte(hex) *
* PLL_PWDN : PLL Powerdown Control Bit (active high) *
* UC_ATV : UC Active bit *
* COM_CLK : COM Clock frequency in MHz *
* UCODE_VER : Microcode Version [majorversion_minorversion] *
* API_VER : API Version *
* AFE_VER : AFE Hardware Vesrion *
* LIVE_TEMP : Live Die temperature in Celsius *
* AVG_TMON : uC Temp_idx, Average temperature in Celsius *
* RESCAL : Analog Resistor Calibration value *
* VCO_RATE : uC VCO Rate in GHz (approximate) *
* ANA_VCO_RANGE : Analog VCO Range *
* REFCLK_2x : Refclk doubler enabler *
* PLL_DIV : (Register Value) Actual PLL Divider Value *
* PLL_Lock : PLL Lock *
**************************************************************************************************************
LN (CDRxN , UC_CFG,UC_STS, RST, STP) SD LCK RXPPM CLK90 CLKP1 PF(M,L) VGA DCO P1mV M1mV DFE(1,2,3,4,5,6) TXPPM TXEQ(n1,m,p1,2,3,rpara) EYE(L,R,U,D) LINK_TIME BER
0 (OSx1:x1, 0x0404, 0x00 , 0,0, 00 ) 0 0 0 32 0 (10,0) 37 0 0 0 ( 0, 0, 0, 0, 0, 0) 0 (10, 65,20, 0, 0, 5) ( 0, 0, 0, 0) 0.0
1 (OSx1:x1, 0x0404, 0x00 , 0,0, 00 ) 0 0 0 32 0 (10,0) 37 0 0 0 ( 0, 0, 0, 0, 0, 0) 0 (10, 65,20, 0, 0, 5) ( 0, 0, 0, 0) 0.0
2 (OSx1:x1, 0x0404, 0x00 , 0,0, 00 ) 1* 1* 23 47 -1 ( 0,2) 24 -1 176 0 ( 45,-11, 0, 3, 2, 2) 0 (10, 65,20, 0, 0, 5) (281,328,107,115) 65.8
3 (OSx1:x1, 0x0404, 0x00 , 0,0, 00 ) 1* 1* 23 47 0 ( 0,2) 24 1 169 0 ( 44,-12, 1, 2, 1, 3) 0 (10, 65,20, 0, 0, 5) (296,312,101,109) 65.5
**********************************************************************************************
**** Legend of Entries in display_lane_state() ****
**********************************************************************************************
LN : Lane index within IP core
CDRxN : CDR type x OSR ratio [xH-OSx16p5; xK-OSx20p6;]
UC_CFG : Micro lane configuration variable
UC_STS : Micro lane status variable
RST : Reset State{reset_active, reset_occured, reset_held}
STP : uC Stopped State
SD : Signal Detect
LCK : pmd_rx_lock
RXPPM : Frequency offset of local reference clock with respect to RX data in ppm
CLK90 : Delay of zero crossing slicer, m1, wrt to data in PI codes
CLKP1 : Delay of diagnostic/lms slicer, p1, wrt to data in PI codes
PF(M,L) : Peaking Filter Main (0..15) and Low Frequency (0..7) settings
VGA : Variable Gain Amplifier settings (0..37)
DCO : DC offset DAC control value
P1mV : Vertical threshold voltage of p1 slicer
M1mV : Vertical threshold voltage of m1 slicer
DFE taps : ISI correction taps in units of 2.35mV
TXPPM : Frequency offset of local reference clock with respect to TX data in ppm
TXEQ(n1,m,p1,p2,p3) : TX equalization FIR tap weights in units of 1Vpp/160 units
EYE(L,R,U,D) : Eye margin @ 1e-5 as seen by internal diagnostic slicer in mUI and mV
LINK_TIME : Link time in milliseconds
BER : Bit Error Rate calculated based on 100ms test time; displayed only if prbs_chk_en=1.
**********************************************************************************************
Sundray-SW[Undefine-0/7|LC] / #
查看vlan表
Sundray-SW /var #bcmsh d vlan # 查看已配置的vlan
excute : ovs-appctl plugin/bcmsh d vlan
VLAN.ipipe0[1]: <VLAN_PROFILE_PTR=0,VLAN_CLASS_ID=0,VALID=1,UUC_IDX=0,UMC_IDX=0,STG=1,RESERVED_95=0,RESERVED_71=0,RESERVED_48=0,RESERVED_33=0,RESERVED_119=0,RESERVED_107=0,PORT_BITMAP_LO=0x3fffe7fc,PORT_BITMAP=0x3fffe7fc,L3_IIF=0,L2_ENTRY_KEY_TYPE=0,HIGIG_TRUNK_OVERRIDE=0,FID_ID=0,EVEN_PARITY=0,BC_IDX=0>
Sundray-SW /var #
Sundray-SW /var #bcmsh d chg vlan # 查看已配置vlan中有修改的字段
excute : ovs-appctl plugin/bcmsh d chg vlan
VLAN.ipipe0[1]: <VALID=1,STG=1,PORT_BITMAP_LO=0x3fffe7fc,PORT_BITMAP=0x3fffe7fc,>
查找l2x表中L2MC_PTR字段为0xf的表项:
Sundray-SW /var #bcmsh sea l2x L2MC_PTR=0xf
excute : ovs-appctl plugin/bcmsh sea l2x L2MC_PTR=0xf
Searching L2_ENTRY table indexes 0x0 through 0x3fff...
L2_ENTRY.ipipe0[11848]: <VPG=0xf,VLAN_ID=1,VIF:L2MC_PTR=0xf,VALID=1,T_1=1,TGID_1=6,TGID=7,T=0,STATIC_BIT=0,SRC_DISCARD=0,SCP=0,RPE=0,REMOTE_TRUNK_1=0,REMOTE_TRUNK=0,REMOTE=0,PRI=0,PORT_NUM_1=0x1e,PORT_NUM=0xf,PE_VID:L2MC_PTR=0xf,PENDING=0,OVID=1,MODULE_ID_1=0x20,MODULE_ID=0,MIRROR0=0,MIRROR=0,MAC_BLOCK_INDEX=0,MAC_ADDR=0x903c152bc038,LOCAL_SA=1,LIMIT_COUNTED=1,L3=0,L2MC_PTR=0xf,L2:VLAN_ID=1,L2:TGID=7,L2:T=0,L2:STATIC_BIT=0,L2:SRC_DISCARD=0,L2:SCP=0,L2:RPE=0,L2:RESVEVED_63=0,L2:REMOTE_TRUNK=0,L2:REMOTE=0,L2:PRI=0,L2:PORT_NUM=0xf,L2:PENDING=0,L2:MODULE_ID=0,L2:MIRROR0=0,L2:MIRROR=0,L2:MAC_BLOCK_INDEX=0,L2:MAC_ADDR=0x903c152bc038,L2:LIMIT_COUNTED=1,L2:L3=0,L2:L2MC_PTR=0xf,L2:DUMMY_INDEX=0,L2:DST_DISCARD=0,L2:DEST_TYPE=0,L2:DESTINATION=0xf,L2:CPU=0,L2:CLASS_ID=0,L2:ASSOCIATED_DATA=0x040000000f,KEY_TYPE=0,IVID=0x38,HITSA=1,HITDA=0,EVEN_PARITY=1,DUMMY_INDEX=0,DST_DISCARD=0,DEST_TYPE=0,DESTINATION_1=0x81e,DESTINATION=0xf,CPU=0,CLASS_ID=0,ASSOCIATED_DATA=0x040000000f>
查看芯片详情
Sundray-SW /var #bcmsh show params
excute : ovs-appctl plugin/bcmsh show params
driver BCM53540_A0 (wolfhound2)
regsfile Id: //depot/wolfhound2/regsfile/chip_top.regs#1
pci identifier vendor 0x14e4 device 0x8540 rev 0x01
classes of service 8
maximums block 20 ports 38 mem_bytes 64
blk 0 avs0 schan 17 cmic 17
blk 1 cmic0 schan 14 cmic 14
blk 2 epipe0 schan 11 cmic 11
blk 3 gport0 schan 33 cmic 33
blk 4 gport1 schan 34 cmic 34
blk 5 gport2 schan 37 cmic 37
blk 6 gport3 schan 38 cmic 38
blk 7 gport4 schan 41 cmic 41
blk 8 ipipe0 schan 10 cmic 10
blk 9 iproc0 schan 15 cmic 15
blk 10 mmu0 schan 12 cmic 12
blk 11 otpc0 schan 13 cmic 13
blk 12 pgw_ge0 schan 32 cmic 32
blk 13 pgw_ge1 schan 36 cmic 36
blk 14 pgw_ge2 schan 40 cmic 40
blk 15 pmq0 schan 35 cmic 35
blk 16 pmq1 schan 39 cmic 39
blk 17 pmq2 schan 42 cmic 42
blk 18 ser0 schan 19 cmic 19
blk 19 top0 schan 16 cmic 16
port 0 cpu blk 1 cmic0.0
port 2 ge blk 3 gport0.0
pgw_ge blk 12 pgw_ge0.0
port 3 ge blk 3 gport0.1
pgw_ge blk 12 pgw_ge0.1
port 4 ge blk 3 gport0.2
pgw_ge blk 12 pgw_ge0.2
port 5 ge blk 3 gport0.3
pgw_ge blk 12 pgw_ge0.3
port 6 ge blk 3 gport0.4
pgw_ge blk 12 pgw_ge0.4
port 7 ge blk 3 gport0.5
pgw_ge blk 12 pgw_ge0.5
port 8 ge blk 3 gport0.6
pgw_ge blk 12 pgw_ge0.6
port 9 ge blk 3 gport0.7
pgw_ge blk 12 pgw_ge0.7
port 10 ge blk 4 gport1.0
pgw_ge blk 12 pgw_ge0.8
port 11 ge blk 4 gport1.1
pgw_ge blk 12 pgw_ge0.9
port 12 ge blk 4 gport1.2
pgw_ge blk 12 pgw_ge0.10
port 13 ge blk 4 gport1.3
pgw_ge blk 12 pgw_ge0.11
port -1 ge blk 4 gport1.4
pgw_ge blk 12 pgw_ge0.12
port -1 ge blk 4 gport1.5
pgw_ge blk 12 pgw_ge0.13
port -1 ge blk 4 gport1.6
pgw_ge blk 12 pgw_ge0.14
port -1 ge blk 4 gport1.7
pgw_ge blk 12 pgw_ge0.15
port 14 ge blk 5 gport2.0
pgw_ge blk 13 pgw_ge1.0
port 15 ge blk 5 gport2.1
pgw_ge blk 13 pgw_ge1.1
port 16 ge blk 5 gport2.2
pgw_ge blk 13 pgw_ge1.2
port 17 ge blk 5 gport2.3
pgw_ge blk 13 pgw_ge1.3
port 18 ge blk 5 gport2.4
pgw_ge blk 13 pgw_ge1.4
port 19 ge blk 5 gport2.5
pgw_ge blk 13 pgw_ge1.5
port 20 ge blk 5 gport2.6
pgw_ge blk 13 pgw_ge1.6
port 21 ge blk 5 gport2.7
pgw_ge blk 13 pgw_ge1.7
port 22 ge blk 6 gport3.0
pgw_ge blk 13 pgw_ge1.8
port 23 ge blk 6 gport3.1
pgw_ge blk 13 pgw_ge1.9
port 24 ge blk 6 gport3.2
pgw_ge blk 13 pgw_ge1.10
port 25 ge blk 6 gport3.3
pgw_ge blk 13 pgw_ge1.11
port -1 ge blk 6 gport3.4
pgw_ge blk 13 pgw_ge1.12
port -1 ge blk 6 gport3.5
pgw_ge blk 13 pgw_ge1.13
port -1 ge blk 6 gport3.6
pgw_ge blk 13 pgw_ge1.14
port -1 ge blk 6 gport3.7
pgw_ge blk 13 pgw_ge1.15
port 26 ge blk 7 gport4.0
pgw_ge blk 14 pgw_ge2.0
port 27 ge blk 7 gport4.1
pgw_ge blk 14 pgw_ge2.1
port 28 ge blk 7 gport4.2
pgw_ge blk 14 pgw_ge2.2
port 29 ge blk 7 gport4.3
pgw_ge blk 14 pgw_ge2.3
unit 0:
pci device 8547 rev 01
cmc used by pci CMC0
driver type 165 (BCM53540_A0) group 111 (BCM53540)
chip xgs xgs3_switch xgs_switch
SOC_IS_FBX
SOC_IS_HURRICANEX
SOC_IS_TR_VL
SOC_IS_TRX
SOC_IS_XGS
SOC_IS_XGS_SWITCH
SOC_IS_XGS3_SWITCH
max modid 63
num ports 30
num modids 1
num blocks 20
num pipes 1
FE ports 0 0x0000000000000000000000000000000000000000000000000000000000000000 (-1:-1)
GE ports 28 0x000000000000000000000000000000000000000000000000000000003ffffffc (2:29)
XE ports 0 0x0000000000000000000000000000000000000000000000000000000000000000 (-1:-1)
CE ports 0 0x0000000000000000000000000000000000000000000000000000000000000000 (-1:-1)
HG ports 0 0x0000000000000000000000000000000000000000000000000000000000000000 (-1:-1)
ST ports 0 0x0000000000000000000000000000000000000000000000000000000000000000 (-1:-1)
ETHER ports 28 0x000000000000000000000000000000000000000000000000000000003ffffffc (2:29)
PORT ports 28 0x000000000000000000000000000000000000000000000000000000003ffffffc (2:29)
ALL ports 29 0x000000000000000000000000000000000000000000000000000000003ffffffd (0:29)
IPIC port -1 block -1
CMIC port 0 0x0000000000000000000000000000000000000000000000000000000000000001 block 1
other blocks ARL -1 MMU 10 MCU -1
IPIPE 8 IPIPE_HI -1 EPIPE 2 EPIPE_HI -1 BSAFE -1 ESM -1 OTPC 11
has blocks 20 avs cmic epipe gport gport gport gport
gport ipipe iproc mmu otpc pgw_ge
pgw_ge pgw_ge pmq pmq pmq ser
top
port names 0=cpu0 1= 2=ge11 3=ge10 4=ge9
5=ge8 6=ge7 7=ge6 8=ge5 9=ge4
10=ge3 11=ge2 12=ge1 13=ge0 14=ge12
15=ge13 16=ge14 17=ge15 18=ge16 19=ge17
20=ge18 21=ge19 22=ge20 23=ge21 24=ge22
25=ge23 26=ge24 27=ge25 28=ge26 29=ge27
block bitmap 1 cmic0 0x0000000000000000000000000000000000000000000000000000000000000001 (1 ports)
3 gport0 0x00000000000000000000000000000000000000000000000000000000000003fc (8 ports)
4 gport1 0x0000000000000000000000000000000000000000000000000000000000003c00 (4 ports)
5 gport2 0x00000000000000000000000000000000000000000000000000000000003fc000 (8 ports)
6 gport3 0x0000000000000000000000000000000000000000000000000000000003c00000 (4 ports)
7 gport4 0x000000000000000000000000000000000000000000000000000000003c000000 (4 ports)
12 pgw_ge_0 0x0000000000000000000000000000000000000000000000000000000000003ffc (13 ports)
13 pgw_ge_1 0x0000000000000000000000000000000000000000000000000000000003ffc000 (13 ports)
14 pgw_ge_1 0x000000000000000000000000000000000000000000000000000000003c000000 (5 ports)
features arl_hashed arl_insert_ovr cfap_pool
cos_rx_dma dcb_type34 ingress_metering
egress_metering l3 l3_ip6
l3_lookup_cmd ip_mcast ip_mcast_repl
led_proc led_data_offset_a0 schmsg_alias
stack_my_modid stat_dma cpuport_stat_dma
table_dma tslam_dma stg
stg_xgs remap_ut_prio xgxs_v7
phy_cl45 aging_extended modmap
l3_sgv l2_hashed l2_lookup_cmd
l2_lookup_retry l2_user_table schan_hw_timeout
lpm_tcam mdio_enhanced rxdma_cleanup
fe_maxframe l2x_parity l3x_parity
l2_modfifo l2_overflow l2_overflow_bucket
vlan_mc_flood_ctrl vlan_translation parity_err_tocpu
nip_l3_err_tocpu l3mtu_fail_tocpu meter_adjust
xgxs_power src_modid_blk src_modid_blk_ucast_override
src_modid_blk_opcode_override egress_blk_ucast_override stat_jumbo_adj
stat_xgs3 port_trunk_index port_flow_hash
cpuport_switched cpuport_mirror higig2
color color_inner_cfi color_prio_map
untagged_vt_miss module_loopback dscp_map_per_port
egr_dscp_map_per_port dscp_map_mode_all egr_mirror_path
trunk_extended hg_trunking hg_trunk_override
egr_vlan_check cpu_proto_prio hg_trunk_failover
trunk_egress force_forward port_egr_block_ctl
bucket_support remote_learn_trust src_mac_group
storm_control hw_stats_calc mac_learn_limit
linear_drr_weight igmp_mld_support basic_dos_ctrl
enhanced_dos_ctrl proto_pkt_ctrl vlan_ctrl
big_icmpv6_ping_check trunk_group_overlay xport_convertible
dual_hash dscp rcpu_1
unimac generic_table_ops vlan_translation_range
static_pfm sgmii_autoneg rcpu_tc_mapping
mem_push_pop dcb_reason_hi multi_sbus_cmds
new_sbus_format new_sbus_old_resp sbus_format_v4
fifo_dma fifo_dma_active l3_entry_key_type
l2_pending internal_loopback vlan_action
packet_rate_limit system_mac_learn_limit field
field_slices8 field_meter_pools8 field_mirror_ovr
field_udf_higig field_udf_ethertype field_comb_read
field_wide field_slice_enable field_cos
field_color_indep field_qual_drop field_qual_IpType
field_qual_Ip6High field_ingress_global_meter_pools field_ingress_ipbm
field_egress_flexible_v6_key field_egress_global_counters field_egress_metering
field_ing_egr_separate_packet_byte_counters field_intraslice_double_wide field_virtual_slice_group
field_action_timestamp field_action_l2_change field_virtual_queue
field_action_redirect_nexthop field_slice_dest_entity_select field_packet_based_metering
field_oam_actions lport_tab_profile oam
ignore_cmic_xgxs_pll_status use_double_freq_for_ddr_pll counter_parity
time_support time_v3 time_v3_no_bs
timesync_support timesync_v3 extended_pci_error
priority_flow_control qos_profile urpf
rx_timestamp rx_timestamp_upper logical_port_num
timestamp_counter l3_ingress_interface generic_counters
niv modport_map_profile eee
ser_parity ser_engine ser_system_scrub
mem_cache mem_wb_cache_reload regs_as_mem
xy_tcam xy_tcam_direct xy_tcam_28nm
vlan_egr_it_inner_replace src_modid_base_index cmicm
iproc iproc_7 cmicm_extended_interrupts
unified_port sbusdma iproc_ddr
mirror_encap_profile higig_misc_speed_support vpd_profile
color_prio_map_profile l3_iif_zero_invalid port_extension
gphy ipmc_unicast system_reserved_vlan
memory_2bit_ecc_ser mem_parity_eccmask l2_no_vfi
l3mc_use_egress_next_hop field_action_pfc_class fifo_dma_hu2
eee_bb_mode cmicd_v2 int_common_init
inner_tpid_enable l3_no_ecmp no_tunnel
ipmc_use_configured_dest_mac hg_no_speed_change mac_based_vlan
ip_subnet_based_vlan tsce hr2_dual_hash
timesync_timestampingmode avs l3_iif_under_4k
flowcnt custom_header ing_capwap_parser
gh_style_pfc_config field_qual_vlanformat_reverse cpureg_dump
hr3_switch_encap_index_shift2_war ignore_mem_write_nak unimac_reset_wo_clock
internal_phy_link_check field_udf_offset_hg_114B field_udf_offset_hg2_110B
hg_trunk_group_members_max_4 eee_stat_clear_directly pktpri_as_dot1p
cosq_hol_drop_packet_count vlan_egress_membership_l3_only hg2_light_in_portmacro
switch_match l2_learn_stats sync_port_lport_tab
no_qt_gport modport_map_dest_is_hg_port_bitmap ifg_wb_include_unimac
serdes_firmware_pos_by_host_endian dport_update_hl wh2
hr3_egphy28_phyrev_override
查看PHY信息
Sundray-SW[1] ~ #bcmsh phy int ge18 # 中间PHY
excute : ovs-appctl plugin/bcmsh phy int ge18
Port ge18 (intermediate PHY addr 0xb1):
0x00: 0x0000 0x01: 0x0000 0x02: 0x0000 0x03: 0x0000
0x04: 0x0000 0x05: 0x0000 0x06: 0x0000 0x07: 0x0000
0x08: 0x0000 0x09: 0x0000 0x0a: 0x0000 0x0b: 0x0000
0x0c: 0x0000 0x0d: 0x0000 0x0e: 0x0140 0x0f: 0x0000
0x10: 0x0140 0x11: 0x0129 0x12: 0x0143 0x13: 0xbff0
0x14: 0x01e0 0x15: 0x4001 0x16: 0x0004 0x17: 0x2001
0x18: 0x0000 0x19: 0x0000 0x1a: 0x0000 0x1b: 0x0000
0x1c: 0x0000 0x1d: 0x0000 0x1e: 0x0000 0x1f: 0xffe0
Sundray-SW[1] ~ #bcmsh phy ge18
excute : ovs-appctl plugin/bcmsh phy ge18
Port ge18 (PHY addr 0x16): BCM54282 (542XX Gigabit PHY Driver)
0x00: 0x1140 0x01: 0x79c9 0x02: 0x600d 0x03: 0x845b
0x04: 0x01e1 0x05: 0x0000 0x06: 0x0064 0x07: 0x2001
0x08: 0x0000 0x09: 0x0600 0x0a: 0x0000 0x0b: 0x0000
0x0c: 0x0000 0x0d: 0x4007 0x0e: 0x0006 0x0f: 0x3000
0x10: 0x0021 0x11: 0x2000 0x12: 0x0000 0x13: 0x0000
0x14: 0x0000 0x15: 0x1000 0x16: 0x000c 0x17: 0xffff
0x18: 0x8000 0x19: 0x0000 0x1a: 0x0000 0x1b: 0x0000
0x1c: 0x0000 0x1d: 0x0000 0x1e: 0x0001 0x1f: 0x2000
读取clause 45寄存器:
Sundray-SW[Undefine-0/32|LC] / #bcmsh phy info
excute : ovs-appctl plugin/bcmsh phy info
Phy mapping dump:
port id0 id1 addr iaddr name timeout
ce0( 41) 600d 8770 d1 d1 TSCF-16/14/4 250000
ce1( 42) 600d 8770 e1 e1 TSCF-16/15/4 250000
ce2( 43) 600d 8770 e5 e5 TSCF-16/16/4 250000
ce3( 44) 600d 8770 e9 e9 TSCF-16/17/4 250000
ce4( 45) 600d 8770 ed ed TSCF-16/18/4 250000
ce5( 46) 600d 8770 f1 f1 TSCF-16/19/4 250000
ce6( 1) 600d 8770 81 81 TSCF-16/00/4 250000
ce7( 2) 600d 8770 85 85 TSCF-16/01/4 250000
ce8( 3) 600d 8770 89 89 TSCF-16/02/4 250000
ce9( 4) 600d 8770 8d 8d TSCF-16/03/4 250000
ce10( 5) 600d 8770 91 91 TSCF-16/04/4 250000
ce11( 6) 600d 8770 a1 a1 TSCF-16/05/4 250000
Sundray-SW[Undefine-0/32|LC] / #bcmsh phy ce0
excute : ovs-appctl plugin/bcmsh phy ce0
Port ce0 (PHY addr 0xd1): TSCF-16/14/4 (Tscf)
0x00: 0x0000 0x01: 0x0000 0x02: 0x600d 0x03: 0x8770
0x04: 0x0000 0x05: 0x0000 0x06: 0x0000 0x07: 0x0000
0x08: 0x0000 0x09: 0x0000 0x0a: 0x0000 0x0b: 0x0000
0x0c: 0x0000 0x0d: 0x0000 0x0e: 0x0000 0x0f: 0x0000
0x10: 0x0000 0x11: 0x0000 0x12: 0x0000 0x13: 0x0000
0x14: 0x0000 0x15: 0x0000 0x16: 0x0000 0x17: 0x0000
0x18: 0x0000 0x19: 0x0000 0x1a: 0x0000 0x1b: 0x0000
0x1c: 0x0000 0x1d: 0x0000 0x1e: 0x0000 0x1f: 0x0000
Sundray-SW[Undefine-0/32|LC] / #bcmsh phy raw c45 0xd1 0x0 0x2
excute : ovs-appctl plugin/bcmsh phy raw c45 0xd1(phy addr) 0x0(block) 0x2(reg)
0x02: 0x600d
Sundray-SW[Undefine-0/32|LC] / #bcmsh phy raw c45 0xd1(phy addr) 0x0(block) 0x3
excute : ovs-appctl plugin/bcmsh phy raw c45 0xd1 0x0 0x3
0x03: 0x8770
查看pci配置寄存器空间
Sundray-SW[Undefine-0/32|LC] / #bcmsh dump pcic
excute : ovs-appctl plugin/bcmsh dump pcic
0000: b77014e4 DeviceID=b770 VendorID=14e4 # 设备ID,厂商ID
0004: 00100406 Status=0010 Command=0406
0008: 02000001 ClassCode=020000 RevisionID=01 # 版本号
000c: 00000008 BIST=00 HeaderType=00 LatencyTimer=00 CacheLineSize=08 # 系统cache line(cache基本大小)大小
0010: f780000c BaseAddress0=f780000c
0014: 00000000 BaseAddress1=00000000
0018: f700000c BaseAddress2=f700000c
001c: 00000000 BaseAddress3=00000000
0020: 00000000 BaseAddress4=00000000
0024: 00000000 BaseAddress5=00000000
0028: 00000000 CardbusCISPointer=00000000
002c: b77014e4 SubsystemID=b770 SubsystemVendorID=14e4
0030: 00000000 ExpansionROMBaseAddress=00000000
0034: 00000048 Reserved=000000 CapabilitiesPointer=48
0038: 00000000 Reserved=00000000
003c: 0000012a Max_Lat=00 Min_Gnt=00 InterruptPin=01 InterruptLine=2a # 所占系统中断号
0040: 00000000 Reserved=00 RetryTimeoutValue=00 TRDYTimeoutValue=00
0044: 00000000 PLLConf=0
0048: c8035801 -
0048: c8035801 CapabilityID=01 CapabilitiesPointer=58 PWR-MGMT
004c: 00002008 -
0058: 018ba005 CapabilityID=05 CapabilitiesPointer=a0 MSI
005c: f0280040 -
0060: 00000000 -
0064: 000000a0 -
0068: fffffffe -
006c: 00000000 -
00a0: 003fac11 CapabilityID=11 CapabilitiesPointer=ac MSI-X
00a4: 00300002 -
00a8: 00301002 -
00ac: 00020010 CapabilityID=10 CapabilitiesPointer=00 PCIE
00b0: 00008d80 -
00b4: 001b0c00 -
switchcontrol 控制交换行为
Sundray-SW[Undefine-0/32|LC] / #bcmsh sc ?
excute : ovs-appctl plugin/bcmsh sc ?
Usage (SwitchControl):
SwitchControl [PortBitMap=<pbmp>] [<name> | <name>=<value>]
# 后面接的 <name> 需要参考 bcm_switch_control_e 中的枚举,去掉"bcmSwitch"前缀
Sundray-SW[Undefine-0/32|LC] / #bcmsh sc IgmpPktToCpu # 读取
excute : ovs-appctl plugin/bcmsh sc IgmpPktToCpu
0x0
Sundray-SW[Undefine-0/32|LC] / #bcmsh sc IgmpPktToCpu=1 # 写值
excute : ovs-appctl plugin/bcmsh sc IgmpPktToCpu=1
Sundray-SW[Undefine-0/32|LC] / #bcmsh sc IgmpPktToCpu
excute : ovs-appctl plugin/bcmsh sc IgmpPktToCpu
0x1
查看中断状态
Sundray-SW[Undefine-0/32|LC] / #bcmsh show int
excute : ovs-appctl plugin/bcmsh show int
SHOW: Interrupts: Total(613) Schan-total(0),error(0) Link(0)
SHOW: GBP-full(0) PCI-fatal(0),parity(0)
SHOW: Table-DMA(0),TSlam-DMA(163)
SHOW: Ch0-fifo-DMA(2),Ch1-fifo-DMA(1)
SHOW: Ch2-fifo-DMA(0),Ch3-fifo-DMA(0)
SHOW: I2C(0),MII(0),Stats(0),Desc(0),Chain(0)
Sundray-SW[Undefine-0/32|LC] / #bcmsh intr ?
excute : ovs-appctl plugin/bcmsh intr ?
Usage (INTR): Usage:
intr enable [cmc <cmcId> stat <statId>] [<mask>/<irq_name> ...] - Enable interrupts
intr disable [cmc <cmcId> stat <statId>] [<mask>/<irq_name> ...] - Disable interrupts
intr mask [cmc <cmcId> stat <statId>] - Show current mask reg
intr pending [cmc <cmcId> stat <statId>] - Show current state
intr names [cmc <cmcId> stat <statId>] - List interrupt names
Note:
Valid cmcId range : 0-2
Valid statId range : 0-2
查看端口映射关系
Sundray-SW / #bcmsh pbmp 0x3f0000
excute : ovs-appctl plugin/bcmsh pbmp 0x3f0000
0x00000000000000000000000000000000000000000000000000000000003f0000 ==> ge14-ge19
Sundray-SW / #bcmsh pbmp 0x3f000
excute : ovs-appctl plugin/bcmsh pbmp 0x3f000
0x000000000000000000000000000000000000000000000000000000000003f000 ==> ge0-ge1,ge12-ge15
Sundray-SW / #bcmsh pbmp ge14-ge19
excute : ovs-appctl plugin/bcmsh pbmp ge14-ge19
0x00000000000000000000000000000000000000000000000000000000003f0000 ==> ge14-ge19
Sundray-SW / #bcmsh pbmp cpu
excute : ovs-appctl plugin/bcmsh pbmp cpu
0x0000000000000000000000000000000000000000000000000000000000000001 ==> cpu
Sundray-SW / #