Professional Documents
Culture Documents
Debug PFE
Debug PFE
27-Sept-2011
PACKET FORWARDING QUICK REVIEW
Idx#12 ucast:
[pfe-0]: 0x1003a0b900d09167
Idx#8 redirect-check:
[pfe-0]: 0x27fffff80000000c
........
TAZ-TBB-0(cheese vty)#
Topology Neighbors:
[none]-> ifl(341)-> flist-master(oif)
Feature List: oif
[pfe-0]: 0x08d1052800020000;
f_mask:0x00204400; c_mask:0xe0000000; f_num:23; c_num:3, inst:0
Idx#10 ptype-mux:
[pfe-0]: 0x02000c16fb000804
Idx#17 sample:
[pfe-0]: 0x1400000000004000
Idx#21 wan-output:
11 [pfe-0]: 0x240030d000000000
Copyright © 2010 Juniper Networks, Inc. www.juniper.net
2. HOW THE IPV4 FRAGMENTATION IS DONE ?
We can only see that by capturing the parcel directly from the PPE
thread via. packet-via-dmem dump function
Dispatch: Size 14e Copy 0000 M2L_PKT_HEAD (1) TailEntry 0015 Stream Wan (f) Off 0
IxPreClass 2 IxPort 01 IxMyMac 0
Data: 80711fc266788071
Data: 1fc266610800(4500
Data: 05dc000020003f3d
^^^^
Data: b1e0c0010102c800
Data: 1b01000000000000
.......
Dispatch: Size 14e Copy 0000 M2L_PKT_HEAD (1) TailEntry 0018 Stream Wan (f) Off 0
IxPreClass 2 IxPort 01 IxMyMac 0
Data: 80711fc266788071
Data: 1fc266610800(4500
Data: 0208000000b93f3d
^^^^
Data: d4fbc0010102c800
Data: 1b01000000000000
.......
0x02 2 0
0x03 2 0
3. HOW DOES QOS WORK IN TRINITY (BA) ?
TAZ-TBB-0(cheese vty)# show jnh 0 vread 0xd09a38 8
Addr:0xd09a38, Data = 0x0808080808080808
Addr:0xd09a39, Data = 0x0808080808080808
Addr:0xd09a3a, Data = 0x0808080808080808
Addr:0xd09a3b, Data = 0x0808080808080808
Addr:0xd09a3c, Data = 0x0404040404040404
Addr:0xd09a3d, Data = 0x0404040404040404
Addr:0xd09a3e, Data = 0x0404040404040404
Addr:0xd09a3f, Data = 0x0404040404040404
TAZ-TBB-0(cheese vty)#
16 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
3. HOW DOES QOS WORK IN TRINITY (BA) ?
COS debug message is available
TAZ-TBB-0(cheese vty)# show ukern_trace handles
Ukernel Trace Info:
ID Name Level Printf Logging Size Wrap
----- --------------- --------- ----- ----- ----- -----
29 COS-HALP terse Off On 65536 0
30 COS terse Off On 65536 14
76 classify_layer3_ip @ 0x0434
Prev_PC 0x038c -> 0x0434
77 use_dscp_with_main_tbl @ 0x0438
Cond SYNC XTXN DMEM_RD(VA 0xd09a38 -> PA 0xc0009a38)
Reply64 is 0x0808080808080808
Prev_PC 0x0434 -> 0x0438
xrs: 0x268107803a13470f -> 0x0808080808080808
IR1 0x1a1e2c01 -> 0x00000000
78 extract_result_byte @ 0x0431
GPR29 0x000000000000003f -> 0x000000100000003f
Prev_PC 0x0438 -> 0x0431
LMEM[0x3f] 0x000000000000003f -> 0x000000100000003f
.........
// 32 bit boundary
exp1 : 3;
exp2 : 3;
tos_t tos; // 8
20 tos2 : 8; Copyright © 2010 Juniper Networks, Inc. www.juniper.net
// TTL and control word related fields are placed here to conserve
// context space.
3. HOW DOES QOS WORK IN TRINITY (BA) ?
Tool is provided by Engineering to break the 64 bits.
~swong/bin/bits
svl-junos-pool72% bits 3 3 1 3 1 1 3 8 6 2 1 3 3 8 8 1 1 8
0x000000100000003f
Wid 3 3 1 3 1 1 3 8 6 2 1 3 3 8 8 1 1 8
Bin 000 000 0 000 0 0 000 00000000 000010 00 0 000 000 00000000 00000000 0 0 00111111
Hex 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 3f
Dec 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 63
^^^^^^ fwd_class = 2
--------------------------------------------------------------------------------
IFD name: ge-1/1/1 (Index 153)
MQ chip id: 0
MQ chip Scheduler: 1
MQ chip L1 index: 13
MQ chip dummy L2 index: 13
MQ chip base Q index: 104
Queue State Max Guaranteed Burst Weight Priorities Drop-Rules
Index rate rate size G E Wred Tail
------ ----------- ------------ ------------ ------ ------ ---------- ----------
104 Configured 1000000000 50000000 32767 6 GL EL 4 33
105 Configured 1000000000 450000000 32767 56 GL EL 4 112
106 Configured 1000000000 450000000 32767 56 GL EL 4 112
107 Configured 1000000000 50000000 32767 6 GL EL 4 33
108 Configured 1000000000 0 32767 1 GL EL 0 255
109 Configured 1000000000 0 32767 1 GL EL 0 255
110 Configured 1000000000 0 32767 1 GL EL 0 255
111 Configured 1000000000 0 32767 1 GL EL 0 255
24 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
TAZ-TBB-0(cheese vty)#
3. HOW DOES QOS WORK IN TRINITY (STATS) ?
To check the queue statistics, first, need to identify the queue
number using the egress stream number
TAZ-TBB-0(cheese vty)# show mqchip 0 ifd
......
Output IFD IFD Base
Stream Index Name Qsys Qnum
------ ------ ---------- ------ ------
181 143 ge-1/0/1 MQ1 8
TAZ-TBB-0(cheese vty)#
3. HOW DOES QOS WORK IN TRINITY (REWRITE) ?
Similar method to check the rewrite function
TAZ-TBB-0(cheese vty)# show ukern_trace 29
[7048213] cos_trinity_rewrite_bind: HALP-cos_trinity_rewrite_bind rewrite_mask 2
[7048214] cos_trinity_rewrite_bind_per_pfe: HALP-cos_trinity_rewrite_bind_per_pfe:
[7048215] trinity_get_rewrite_table_index: HALP-trinity_get_rewrite_table_index fe_id
[7048216] cos_trinity_rewrite_bind_per_pfe: HALP-creating cos rewrite nh for the first tim
[7048217] cos_trinity_rewrite_bind_per_pfe: HALP-cos_rewrite_nh 0x9010000000000000
TAZ-TBB-0(cheese vty)#
Packet Exceptions
----------------------
IP options PUNT( 2) 6372 1496928
Routing
----------------------
discard route DISC(66) 324 288636
hold route DISC(70) 6 504
resolve route PUNT(33) 11 700
control pkt punt via nh PUNT(34) 169411 18575370
host route PUNT(32) 151056 29012267
reject route PUNT(40) 7969480 20364386
34 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
4. WHERE IS THE PACKET GOT DROPPED (LU) ?
All drops are classified into certain category with a REASON code
src/pfe/ucode/lu/ucode_public.h
#define DROP_CODE_BASE 128
#define DROP_ETH_FRAME_ERROR (DROP_CODE_BASE + 0)
#define DROP_UNKNOWN_IIF (DROP_CODE_BASE + 1)
#define DROP_CSUM_ERR (DROP_CODE_BASE + 2)
#define DROP_INPUT_STP_BLOCKED (DROP_CODE_BASE + 3)
#define DROP_NON_V4_TUNNEL (DROP_CODE_BASE + 4)
#define DROP_GRE_UNSUPPORTED_FLAGS (DROP_CODE_BASE + 5)
#define DROP_TUNNEL_PKT_TOO_SHORT (DROP_CODE_BASE + 6)
#define DROP_TUNNEL_HDR_TOO_LONG (DROP_CODE_BASE + 7)
#define DROP_ENUM_CHK_MISMATCH (DROP_CODE_BASE + 8)
#define DROP_V6_OPTS_TOO_LONG (DROP_CODE_BASE + 9)
#define DROP_UNUSED_CODE_10 (DROP_CODE_BASE + 10)
#define DROP_IP_HDR_ERR (DROP_CODE_BASE + 11)
#define DROP_IP_LEN_ERR (DROP_CODE_BASE + 12)
#define DROP_L4_LEN_ERR (DROP_CODE_BASE + 13)
#define DROP_TCP_FRAG_OFF_ERR (DROP_CODE_BASE + 14)
#define DROP_DMAC_MISS (DROP_CODE_BASE + 15)
#define DROP_TCAM_MISS (DROP_CODE_BASE + 16)
#define DROP_LEARN_LIMIT_EXCEEDED (DROP_CODE_BASE + 17)
#define DROP_STATIC_MAC_MOVE (DROP_CODE_BASE + 18)
#define DROP_PFE_MASK_ZERO (DROP_CODE_BASE + 19)
35 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
#define DROP_NO_LOCAL_SWITCHING (DROP_CODE_BASE + 20)
......
4. WHERE IS THE PACKET GOT DROPPED (LU) ?
......
#define DROP_MTU_EXCEEDED (DROP_CODE_BASE + 21)
#define DROP_FRAG_NEEDED_DF_SET (DROP_CODE_BASE + 22)
#define DROP_IP_OPTIONS_ERR (DROP_CODE_BASE + 23)
#define DROP_MCAST_SMAC (DROP_CODE_BASE + 24)
#define DROP_FLOW_DISCARD (DROP_CODE_BASE + 25)
#define DROP_UCAST_SPLIT_HORIZON (DROP_CODE_BASE + 26)
#define DROP_MCAST_PFE_CHECK (DROP_CODE_BASE + 27)
#define DROP_UNKNOWN_DMAC (DROP_CODE_BASE + 28)
#define DROP_PPPOE_HEADER (DROP_CODE_BASE + 29)
#define DROP_PPPOE_LENGTH (DROP_CODE_BASE + 30)
#define DROP_OUTPUT_STP_BLOCKED (DROP_CODE_BASE + 31)
#define DROP_VLAN_RANGE_CHECK (DROP_CODE_BASE + 32)
#define DROP_MC_STK_OVERFLOW (DROP_CODE_BASE + 33)
#define DROP_NH_STK_ERROR (DROP_CODE_BASE + 34)
#define DROP_SAMPLING_STK_ERROR (DROP_CODE_BASE + 35)
#define DROP_NH_CHAIN_ERROR (DROP_CODE_BASE + 36)
#define DROP_UCODE_ERROR (DROP_CODE_BASE + 37)
#define DROP_L2TP_HEADER_ERROR (DROP_CODE_BASE + 39)
#define DROP_L2TP_CONTROL_PACKET (DROP_CODE_BASE + 40)
#define DROP_DISCARD_SWERR (DROP_CODE_BASE + 64 + 0)
#define DROP_DISCARD_DEBUG (DROP_CODE_BASE + 64 + 1)
#define DROP_DISCARD_PROTOCOL (DROP_CODE_BASE + 64 + 2)
#define DROP_DISCARD_FW (DROP_CODE_BASE + 64 + 3)
......
36 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
4. WHERE IS THE PACKET GOT DROPPED (LU) ?
......
#define DROP_DISCARD_IIF (DROP_CODE_BASE + 64 + 4)
#define DROP_NOT_USED_69 (DROP_CODE_BASE + 64 + 5)
#define DROP_DISCARD_HOLD (DROP_CODE_BASE + 64 + 6)
#define DROP_URPF (DROP_CODE_BASE + 64 + 7)
#define DROP_UNINIT_STREAM (DROP_CODE_BASE + 64 + 8)
#define DROP_UNKNOWN_IFF (DROP_CODE_BASE + 64 + 9)
#define DROP_DISCARD_SWERR_IIF_NOMEM (DROP_CODE_BASE + 64 + 10)
#define DROP_DISCARD_FABRIC (DROP_CODE_BASE + 64 + 11)
#define DROP_DISCARD_GREKEY_MISMATCH (DROP_CODE_BASE + 64 + 12)
#define DROP_UNKNOWN_VRF (DROP_CODE_BASE + 64 + 13)
#define DROP_DISCARD_MAC_FW (DROP_CODE_BASE + 64 + 14)
#define DROP_PPPOE_NO_SESSION (DROP_CODE_BASE + 64 + 15)
#define DROP_PPPOE_SESSION_DOWN (DROP_CODE_BASE + 64 + 16)
#define DROP_PPPOE_SESSION_UNKNOWN_MAC (DROP_CODE_BASE + 64 + 17)
#define DROP_PPP_PROTO_UNCONFIGURED (DROP_CODE_BASE + 64 + 18)
#define DROP_PPP_PROTO_DOWN (DROP_CODE_BASE + 64 + 19)
#define DROP_DISCARD_LT (DROP_CODE_BASE + 64 + 20)
#define DROP_AGG_MCAST (DROP_CODE_BASE + 64 + 21)
#define DROP_DISCARD_L2_TOKEN (DROP_CODE_BASE + 64 + 22)
#define DROP_DISCARD_IIF_DOWN (DROP_CODE_BASE + 64 + 23)
{
.e_category = CAT_BRIDGING,
.e_code = PACKET_ERR_UCAST_SPLIT_HORIZON,
.e_name = "bridge ucast split horizon",
.e_type = DISCARD,
.e_nh = CNT,
.e_help =
"Internal counter. Number of L2 packets failing split-horizon check."
},
{
.e_category = CAT_ROUTING,
.e_code = PACKET_ERR_DISCARD_PROTOCOL,
.e_name = "discard route",
.e_type = DISCARD,
.e_nh = CNT,
.e_help =
"RNH_DISCARD nexthops explicitly installed by routing protocols."
},
41
TAZ-TBB-0(cheese vty)# Copyright © 2010 Juniper Networks, Inc. www.juniper.net
4. WHERE IS THE PACKET GOT DROPPED (IX) ?
How about drops in other places like IX and MQ ?
IX
TAZ-TBB-0(cheese vty)# show ixchip ifd
TAZ-TBB-0(cheese vty)#
TAZ-TBB-0(cheese vty)#
48 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
4. WHERE IS THE PACKET GOT DROPPED (MQ) ?
The same applies on fabric side
TAZ-TBB-0(cheese vty)# show mqchip 0 fi stats
FI Counters:
TAZ-TBB-0(cheese vty)#
Topology Neighbors:
[none]-> stream-(225)-> flist-master(stream)
Feature List: stream
[pfe-0]: 0x0240684f23000303;
f_mask:0x02000000; c_mask:0x80000000; f_num:7; c_num:1, inst:0
Idx#6 iif-lookup:
[pfe-0]: 0x0240684f23000303
TAZ-TBB-0(cheese
51 vty)# Copyright © 2010 Juniper Networks, Inc. www.juniper.net
5. HOW DOES TRINITY IMPLEMENT LOAD SHARING ?
5. HOW DOES TRINITY IMPLEMENT LOAD SHARING ?
Trinity uses the same polynomials as in Ichip to calculate the hash
value
http://cvs.juniper.net/cgi-bin/viewcvs.cgi/sw-
projects/platform/trinity/pfe/core/load_balance_whitepaper.doc?rev
=1.1&view=log
[edit]
lab@cheese#
54 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
5. HOW DOES TRINITY IMPLEMENT LOAD SHARING ?
[edit]
lab@cheese# set forwarding-options enhanced-hash-key family inet6 ?
Possible completions:
+ apply-groups Groups from which to inherit configuration data
+ apply-groups-except Don't inherit configuration data from these groups
incoming-interface-index Include incoming interface index in the hash key
no-destination-port Omit IP destination port in the hash key
no-source-port Omit IP source port in the hash key
traffic-class Include Traffic Class byte in the hash key
[edit]
lab@cheese# set forwarding-options enhanced-hash-key family mpls ?
Possible completions:
+ apply-groups Groups from which to inherit configuration data
+ apply-groups-except Don't inherit configuration data from these groups
incoming-interface-index Include incoming interface index in the hash key
label-1-exp Include EXP of first MPLS label from the hash key
no-payload Omit MPLS payload data from the hash key
[edit]
lab@cheese# set forwarding-options enhanced-hash-key family multiservice ?
Possible completions:
+ apply-groups Groups from which to inherit configuration data
+ apply-groups-except Don't inherit configuration data from these groups
incoming-interface-index Include incoming interface index in hash key
no-payload Omit payload data from the hash key
55
outer-priority Include Outer 802.1 Priority bits in the hash key
Copyright © 2010 Juniper Networks, Inc. www.juniper.net
[edit]
lab@cheese#
5. HOW DOES TRINITY IMPLEMENT LOAD SHARING ?
Here is the default hash key configuration
Some of them can be changed only under PFE
TAZ-TBB-0(cheese vty)# show jnh lb
Unilist Seed Configured 0x8bce4c39 System Mac address 00:00:00:00:00:00
Hash Key Configuration: 0x0000000000e00000 0xffffffffffffffff
IIF-V4: No
SPORT-V4: Yes
DPORT-V4: Yes
TOS: No
IIF-V6: No
SPORT-V6: Yes
DPORT-V6: Yes
TRAFFIC_CLASS: No
IIF-MPLS: No
MPLS_PAYLOAD: Yes
MPLS_EXP: No
IIF-BRIDGED: No
MAC ADDRESSES: Yes
ETHER_PAYLOAD: Yes
56 802.1P OUTER: No Copyright © 2010 Juniper Networks, Inc. www.juniper.net
NH #0 NH #1 NH #2
Ichip
0x0000 Hash Value Range 0xFFFF
Hash Distribution
NH NH NH NH NH NH NH NH NH NH NH NH NH NH
#0 #1 #2 #0 #1 #2 #0 #0 #1 #2 #0 #1 #2 #0
Trinity
0x0000 Hash Value Range 0xFFFF
All intermediate nexthop uses the legacy way to select the nexthop.
Selector table only appears on final nexthop.
0 0002 0002 0003 0002 0003 0003 0003 0003 0001 0000 0003 0003 0003 0002 0001 0003
1 0003 0001 0003 0002 0003 0000 0002 0002 0002 0002 0003 0002 0002 0003 0002 0003
2 0003 0002 0000 0001 0002 0002 0003 0002 0001 0000 0002 0001 0002 0001 0003 0001
3 0001 0003 0000 0001 0003 0002 0003 0003 0001 0002 0000 0003 0003 0001 0002 0002
4 0003 0002 0003 0002 0001 0003 0003 0003 0001 0003 0002 0003 0002 0003 0003 0002
5 0002 0003 0001 0002 0000 0003 0001 0001 0003 0002 0003 0003 0001 0002 0003 0003
6 0002 0001 0003 0003 0001 0001 0002 0001 0001 0001 0001 0003 0003 0003 0001 0003
7 0002 0003 0002 0002 0003 0001 0003 0003 0002 0001 0003 0002 0003 0002 0002 0002
8 0002 0000 0002 0003 0000 0002 0003 0003 0002 0003 0003 0002 0003 0002 0001 0001
9 0003 0003 0002 0003 0000 0001 0002 0002 0003 0003 0001 0001 0003 0002 0002 0002
10 0003 0002 0002 0002 0001 0003 0003 0001 0002 0003 0000 0001 0003 0003 0001 0001
11 0003 0003 0002 0002 0002 0000 0003 0002 0002 0002 0002 0001 0002 0002 0001 0003
12 0000 0001 0003 0002 0001 0002 0002 0003 0001 0002 0003 0003 0001 0003 0001 0003
13 0002 0001 0002 0003 0001 0001 0000 0001 0003 0003 0003 0003 0002 0002 0003 0002
14 0002 0002 0002 0000 0003 0003 0002 0003 0002 0001 0001 0003 0002 0001 0002 0003
15 0002 0003 0003 0002 0003 0002 0000 0001 0001 0003 0002 0003 0002 0001 0001 0002
16 0000 0002 0001 0001 0002 0003 0002 0003 0002 0002 0003 0003 0003 0002 0003 0001
17 0001 0002 0002 0003 0002 0003 0002 0003 0002 0003 0001 0003 0000 0002 0001 0001
65 18 0000 0002 0003 0003Copyright
0000© 2010
0002 0001
Juniper 0003
Networks, Inc. 0003 0001
www.juniper.net 0000 0003 0000 0002 0003 0000
......
5. HOW DOES TRINITY IMPLEMENT LOAD SHARING ?
......
19 0001 0003 0003 0002 0003 0003 0000 0001 0003 0003 0003 0000 0002 0003 0003 0001
20 0001 0003 0003 0002 0003 0002 0003 0003 0003 0002 0003 0001 0003 0002 0003 0001
21 0003 0003 0002 0003 0003 0003 0003 0002 0001 0003 0003 0001 0003 0002 0000 0002
22 0002 0002 0000 0003 0000 0001 0001 0001 0002 0001 0001 0002 0003 0003 0002 0002
23 0003 0000 0003 0003 0002 0001 0001 0003 0003 0002 0002 0002 0001 0002 0000 0003
24 0000 0003 0003 0003 0001 0002 0002 0000 0003 0002 0002 0003 0002 0003 0003 0002
25 0003 0000 0000 0003 0003 0000 0003 0003 0003 0003 0003 0003 0001 0002 0003 0003
26 0002 0001 0003 0001 0003 0003 0003 0003 0001 0002 0003 0000 0001 0001 0002 0001
27 0002 0003 0003 0003 0000 0003 0003 0003 0003 0002 0002 0001 0001 0002 0003 0002
28 0002 0002 0003 0003 0003 0001 0000 0000 0002 0000 0003 0003 0003 0003 0003 0003
29 0002 0003 0002 0000 0000 0000 0001 0001 0002 0003 0002 0001 0000 0000 0002 0001
30 0003 0000 0003 0003 0003 0000 0003 0001 0003 0003 0002 0000 0000 0003 0003 0001
31 0002 0003 0001 0002 0000 0001 0002 0003 0003 0002 0001 0002 0001 0000 0000 0001
Topology: UnilistSelector(22-0)
Flavor: Unilist-Selector (50), Refcount 0, Flags 0x1
Addr: 0x43b51bf8, Next: 0x49a61968, Context 0x4c703e90
Link 0: 00000000:00000000, Offset 0, Next: 08ba6620:00020000
Link 1: 00000000:00000000, Offset 0, Next: 00000000:00000000
Link 2: 00000000:00000000, Offset 0, Next: 00000000:00000000
Link 3: 00000000:00000000, Offset 0, Next: 00000000:00000000
......
Topology Neighbors:
[none]-> UnilistSelector(22-1)-> ifl(337)-> flist-master(iif)
Topology: UnilistSelector(22-2)
Flavor: Unilist-Selector (50), Refcount 0, Flags 0x1
Addr: 0x43b51b68, Next: 0x49a61968, Context 0x4c703e90
Link 0: 00000000:00000000, Offset 0, Next: 08ba6620:00020000
Link 1: 00000000:00000000, Offset 0, Next: 00000000:00000000
Link 2: 00000000:00000000, Offset 0, Next: 00000000:00000000
Link 3: 00000000:00000000, Offset 0, Next: 00000000:00000000
......
Topology Neighbors:
[none]-> UnilistSelector(22-3)-> ifl(337)-> flist-master(iif)
TAZ-TBB-0(cheese vty)#
TAZ-TBB-0(cheese vty)#
FI Counters:
StreamMask Match
0x3ff 0x00f Packets Pkt Rate Cells Cell Rate
-------------------- ---------------- ------------ ---------------- ------------
Received 147300 48170 2357424 770914
Dropped 0 0 0 0
Pkts to PT 147300 48169
Errored Pkts to PT 0 0
TAZ-TBB-0(cheese vty)#
Topology Neighbors:
7. HOW TO CHECK ASIC STUCK ?
7. HOW TO CHECK ASIC STUCK ?
There are a few places that we can see “stuck” in Trinity – LU, MQ and
TOE
https://gnats.juniper.net/web/default/669131
– LU wedge detection
– https://matrix.juniper.net/docs/DOC-84959
https://gnats.juniper.net/web/default/680609
– MQ wedge detection
https://gnats.juniper.net/web/default/680604
– Host path wedge detection
The zone timer was set to 0 at zone load time, when the dispatch prescaler
reaches 0, this counter is incremented. Given that dispatch does not care
about the prescaler value at the time of the load, the zone_state_timeout
transition 0->1 is ignored. When the dispatch prescaler hits 0 the second
time, the zone_state_timeout transitions 1->2 and the dispatch block
notifies the PPE of the thread_timeout event.
When the dispatch prescaler hits 0 the third time, the zone_state_timeout
transitions 2->3 and the dispatch block notifies the control plane that a
secondary timeout has occurred. The PPE is expected to process the
thread timeout by cleaning up the context state and dropping the parcel..
Jun 13 15:04:01 mx960-2-re0 fpc1 MQCHIP(1) PT Errors in tail length/offset in CPT scan
Jun 13 15:04:01 mx960-2-re0 fpc1 MQCHIP(1) LI Packet length error, pt entry 24
Jun 13 15:04:01 mx960-2-re0 fpc1 MQCHIP(1) MALLOC Pre-Q Reference Count underflow -
Jun 13 15:04:01 mx960-2-re0 fpc1 MQCHIP(1) PT Errors in tail length/offset in CPT scan
Jun 13 15:04:01 mx960-2-re0 fpc1 MQCHIP(1) LI Packet length error, pt entry 2
Jun 13 15:04:01 mx960-2-re0 fpc1 MQCHIP(1) PT Errors in tail length/offset in CPT scan
Jun 13 15:04:01 mx960-2-re0 fpc1 MQCHIP(1) LI Packet length error, pt entry 24
Jun 13 15:04:02 mx960-2-re0 fpc1 MQCHIP(1) LI Packet length error, pt entry 0
CPT UM Status:
FI drop bits : 0xf
WI drop bits : 0x3
LI drop bits : 0x3
FI region : 3
WI region : 0
LI region : 0
TOT region : 3
FO PGRP 0:
port rq_en gr_en rcsel
---- ----- ----- -----
0 1 1 4
1 0 0 0
2 1 1 5
3 0 0 0
4 1 1 0
5 0 0 0
6 1 1 1
7 0 0 0 ......
8 1 1 2 Request Outstanding counters:
9 0 0 0 rcnt 0: 14
10 1 1 3 rcnt 1: 8
11 0 0 0 rcnt 2: 7
12 0 0 0 rcnt 3: 7
13 0 0 0 rcnt 4: 8
14 0 0 0 rcnt 5: 4
15 0 0 0 rcnt 6: 0
...... rcnt 7: 0
FO phy_stream 36:
Port Group : 0
Req Enable : 1
Grant Enable : 1
Drop Enable : 0
TX descriptors
tx accepted: 0000000000823737
tx completed: 0000000000823737
RX packets
rx accepted: 0000000001269326
......
RX Rates:
RX packets per second: 9
RX descriptors per second: 12
RX bytes per second: 4565
RX completed since last count: 1811580
TX errors:
FIFO not initialized: 0000000000000000
head descriptor invalid: 0000000007636926
init descriptor idx invalid: 0000000000000000
packet null: 0000000000000000
packet buffer out of range: 0000000000000000
packet length out of range: 0000000000000000
......
Other errors:
Chip start fail: 0000000000000000
TOE chip:
Current TOE status: TOE thread 0 status:
TX descriptors
tx accepted: 0000000000824886
tx completed: 0000000000824886
RX packets
rx accepted: 0000000001270356
......
RX Rates:
RX packets per second: 5
RX descriptors per second: 5
RX bytes per second: 678
RX completed since last count: 1030
TX errors:
FIFO not initialized: 0000000000000000
head descriptor invalid: 0000000007637373
init descriptor idx invalid: 0000000000000000
packet null: 0000000000000000
packet buffer out of range: 0000000000000000
packet length out of range: 0000000000000000
.....
Other errors:
Chip start fail: 0000000000000000
TOE chip:
Current TOE status: TOE thread 0 status:
TAZ-TBB-0(cheese vty)#
Send failures: 11
Send ack timeout: 329
Packet get failures: 0
Current time is 3669 seconds
Sent Wedge test packets: 3608.
Test packet 3600 sent at 3661
Test packet 3601 sent at 3662
Test packet 3602 sent at 3663
Test packet 3603 sent at 3664
Test packet 3604 sent at 3665
Test packet 3605 sent at 3666
Test packet 3606 sent at 3667
Test packet 3607 sent at 3668
104 ..... Copyright © 2010 Juniper Networks, Inc. www.juniper.net
7. HOW TO CHECK ASIC STUCK (TOE) ?
......
TAZ-TBB-0(cheese vty)#
Receives: 0000000001272472
Options: 0000000000041767
MLP: 0000000000000000
Probes: 0000000000000000
Skip services: 0000000000000000
TAZ-TBB-0(cheese vty)#
TAZ-TBB-0(cheese vty)#
plct_p0_xtxn – Policer
Worst Case
– 1 Policer in LU
– Performance 800/14 = 57M Policer XTXN/sec
Best Case
– 200M Policer XTXN/sec (Number of Policers in LU < 24)
plct_p1_xtxn – Counters
Worst Case
– 1 Counter in LU
– Performance 800/5 = 160M Counter XTXN/sec
Best Case
– 400M Counter XTXT/sec (Number of Counters in LU < 32)
......
119 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
9. WHAT IS TRAP MESSAGE ?
9. WHAT IS TRAP MESSAGE ?
When the PPE encounters a lookup error, a trap message will be
generated for offline analysis
The trap information can be collected from the MPC
– “show jnh <lu_instance> trap-info
Watch out PR660002 !
fpc11 PPE Thread Timeout Trap: Count 42, PC 2a4, 0x02a4: fw_op_eq
fpc11 PPE Thread Timeout Trap: Count 43, PC 36, 0x0036: entry_fw_stop
fpc11 PPE Thread Timeout Trap: Count 108, PC 181, 0x0181: call_table_launch_nh
fpc11 PPE Thread Timeout Trap: Count 44, PC 181, 0x0181: call_table_launch_nh
fpc11 PPE Thread Timeout Trap: Count 45, PC 196, 0x0196: counter_nh_read_next_nh
fpc11 PPE Thread Timeout Trap: Count 113, PC 19a, 0x019a: compute_pkt_len
fpc11 PPE Thread Timeout Trap: Count 46, PC 2ac, 0x02ac: fw_rd_value_mask
fpc11 PPE Thread Timeout Trap: Count 117, PC 23, 0x0023: entry_index_nh
fpc11 PPE Thread Timeout Trap: Count 47, PC 36, 0x0036: entry_fw_stop
fpc11 PPE Thread Timeout Trap: Count 119, PC 23, 0x0023: entry_index_nh
fpc11 PPE Thread Timeout Trap: Count 49, PC 1c0, 0x01c0: wr_ctx_info_ret_or_read_nh
fpc5 PPE PPE HW Fault Trap: Count 13540176663, PC 26, 0x0026: fw_set_layer3_length 0x0026:
fw_set_layer3_length
fpc4 PPE PPE HW Fault Trap: Count 73615, PC 6109, 0x6109: mac_age_entry
fpc7 PPE PPE HW Fault Trap: Count 1391192282, PC 315, 0x0315: fab_out_apply_pfe_alive_mask
fpc4 PPE PPE HW Fault Trap: Count 61298, PC 2b1, 0x02b1: set_iif_compute_hash
LMEM Dump:
LMEM 0x0000: 0x80c5c000e0000005 5045606659020100 30000005fe800000 000000008a43e1ff
LMEM 0x0004: 0xfe37fc2459100200 0000000000000000 0000000000000000 0074000000000000
LMEM 0x0008: 0x000680e041080100 5e00000500171003 63438100080c0800 45c000547a8b0000
LMEM 0x000c: 0x0159ad5550456066 e000000502010030 504565fb63000000 0000000200000b10
LMEM 0x0010: 0x4e5c4250fffffffc 0001020000000004 5045606500000000 5045685e175cdfb6
LMEM 0x0014: 0x82bef1f35d4a92b4 39bb3ab600000003 0008050100007530 000808010000000a
LMEM 0x0018: 0x0024090200000007 050000067f000005 0000000000000000 7f80000000000014
LMEM 0x001c: 0x000005dc000c0a07 504568630000003b 000810010005afd4 0034150101085045
LMEM 0x0020: 0x68c5200001085045 6b06200001085045 6bcd200001085045 6b0a200001085045
123 ...... Copyright © 2010 Juniper Networks, Inc. www.juniper.net
9. WHAT IS TRAP MESSAGE ?
......
LMEM 0x004c: 0x0000000220000000 c000ffff00460066 0000001902c00230 0f400e3801571e64
LMEM 0x0050: 0x000c0000000f094b 529a728100000000 0000000000040000 0000000000000000
LMEM 0x0054: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000000
LMEM 0x0058: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000000
LMEM 0x005c: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000000
LMEM 0x0060: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000000
LMEM 0x0064: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000000
LMEM 0x0068: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000000
LMEM 0x006c: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000000
LMEM 0x0070: 0x0000000000000000 0000000000000000 0000000000000000 0000000000000f08
LMEM 0x0074: 0x3e3c1fb87c780000 ffffff0000000000 0000000000000000 0000000000000000
LMEM 0x0078: 0x0f62bc0100010000 0e31280100010000 166ba60100010000 d0149e0100010000
LMEM 0x007c: 0xffff010200000000 ffffff0000000000 0000000000000000 6737a8d600000000
XRS XRA IR64 WP64 BASE_0
0x27fffff800000002 20000000c000ffff 0046006600000019 02c002300f400e38 0000
Dispatch size is 116
000680e041080100
5e00000500171003
63438100080c0800
45c000547a8b0000
0159ad5550456066
e000000502010030
504565fb63000000
0000000200000b10
4e5c4250fffffffc
0001020000000004
5045606500000000
5045685e175cdfb6
82bef1f35d4a92b4
39bb3ab6
124 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
9. WHAT IS TRAP MESSAGE ?
To decode the coredump, we need a parcel_decode script
Need to use the correct version !
It’s under /src/pfe/ucode/lu/scripts/
% ~swong/code/10.4/release/10.4R6.5/src/pfe/ucode/lu/scripts/decode_parcels
./trap_fpc0_pfe0.core.0
Dispatch: Size 000 Copy 0000 M2L_PKT (0)
Register Context:
Info PType IPV4 (2) subtype 0 score 20 reason 20 AddInfo 0001f IIF 00066
Pkt Proto_TcpF 59 SrcPort 0201 DstPort 0030 EncLen 12 PktLen 0066
Qos NTags 1 cos2 0 dei2 0 cos1 0 dei1 0 ExpV 0 Exp 0 RwFlg 00
FC 06 DP 0 Qv 1 Exp1 0 Exp2 0 Tos c0 Tos2 00 InsCW 0 NoPropTTL 0 TTL 01
Fwd HcopyIFfwd 0 Token 00000 VRF 0000 Egr64BitMC 0 PfeHi 00 PfeLo 82
FwdEgr Queue 003f8 OIF 20008 EID 00000 Media 0 RestrictedQ 0
Vars ImpLen 00 OPtype 2 OEncLen 12 OL2off 06 IRB 0 Bridge 0
OLabel 0 LabelCnt 0 PolRes 0 NHStkIdx 0 XConn 0
ChkEth 0 InsNative 0 NatTPID 0 NatVid 000
Bridge MGid 00 BDid 0000 Lvlan 0000 LrnEna 1 LSwEna 0 DMissDrp 0 Age 3ffff
Bridge2 STPid 182a BDdata_addr 930000 Epoch 00 L2Token 01000
......
125 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
9. WHAT IS TRAP MESSAGE ?
......
BDdata StatsEna 0 V4MC_IRB 1 V6MC_IRB 0 CollStat 0 FTF 1
LrnEna 1 LSwEna 1 IRBnh_L2iif 000a32 IgmpSnoop 0 MGarr 166cd0
Vlan 8100080c08004800
Hash ReorderQueue 0f08 LB Hash 3e3c1fb87c78
PostProc Mlist 000000 Count 0000 Flags 0000
Services 0000000000000000
SampleClass 0000000000000000
PfeMask 0000000000000000
FW 00010600013df982
Trap DumpBase 10000a40 TrapOff 03 TrapPC 8395
LMEM Context:
Info PType IPV4 (2) subtype 0 score 20 reason 20 AddInfo 0001f IIF 00066
Pkt Proto_TcpF 59 SrcPort 0201 DstPort 0030 EncLen 12 PktLen 0054
Qos NTags 1 cos2 0 dei2 0 cos1 0 dei1 0 ExpV 0 Exp 0 RwFlg 00
FC 01 DP 0 Qv 0 Exp1 0 Exp2 0 Tos c0 Tos2 00 InsCW 0 NoPropTTL 0 TTL 01
Fwd HcopyIFfwd 1 Token fffe0 VRF 0000 Egr64BitMC 0 PfeHi 00 PfeLo 82
Opt OptionMap 00 GRE Key 00000000 CP Hash 0000
L2 Uvlan 0000 Lvlan 0000 Etype 0000 BUM 0
https://wintermute.juniper.net/projects/trinity/trinity-software/trinity-
debugging/copy3_of_gen_ttrace
NPC0(MX960-DUT2 vty)#
128 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
9. WHAT IS TRAP MESSAGE ?
OK. What should I do with that then ?
We can use ttrace to see what’s wrong
– https://gnats.juniper.net/web/default/611029
Apr 26 17:44:11 tkmrt2 tfeb0 PPE PPE HW Fault Trap: Count 22, PC 6c, 0x006c:
l2tp_hdlc_hdr_size
Apr 26 17:45:39 tkmrt2 tfeb0 LUCHIP(0) PPE_2 Errors lmem addr error
Apr 26 17:45:39 tkmrt2 tfeb0 LUCHIP(0) PPE_3 Errors lmem addr error
svl-junos-pool72% ~/code/10.4/release/10.4R1.4/src/pfe/ucode/lu/scripts/decode_parcels
~nfujita/q1
Dispatch: Size 052 Copy 0000 M2L_PKT (0) TailEntry 0004 Stream Wan (406) Off 0
IxPreClass 1 IxPort 01 IxMyMac 1
Data: 80711fc3de000012
Data: f2f5890081000065
Data: 0800450000325aa0
Data: 00b178111b4b7889
Data: e24f7d18f42de4ab
Data: 06a5cded575413c2
Data: c6e363a9651cd7c2
Data: df9ee1cfebaf1218
Data: 074c67e8
l2tp_hdr_too_long @ 0x0070
GPR31 0x2000000000000000 -> 0x2000870000000000
Prev_PC 0x006f -> 0x0070
PCSD: 2 -> 1, dropped 0x005d
l2tp_check_pkt_size @ 0x005d
Prev_PC 0x0070 -> 0x005d
......
130 Copyright © 2010 Juniper Networks, Inc. www.juniper.net
9. WHAT IS TRAP MESSAGE ?
What that ucode instruction does ?
/src/pfe/ucode/lu/layer3_input.t
l2tp_hdr_size_offset_check:
begin
// In the above instructions ir_l2tp_encap_len is set to the length
// of the L2 encapsulation header and here we check to insure it fits
// in the available parcel space before attempting the next access.
if (ir_l2tp_encap_len > r_l2tpsz.rem_off) {
goto l2tp_hdr_too_long;
}
end
l2tp_hdlc_hdr_size:
begin
// HDLC header may or may not be included. If included, the HDLC frame
// will have the value = 0xff03 (All stations, unnumbered).
const :16 hdlc_frame_field = *cast<:16 *>(layer3_ptr + ir_l2tp_encap_len);
struct CtxInfo_t {
PType : 4; // Packet type, see PTYPE_TAG
subtype : 4;
scorecard_t scorecard;
reason : 8; // punt/drop reason (see PUNT_REASON_TAG)
add_info : 20; // additional info, usage depends on punt/drop reason
iif : 20;
};
svl-junos-pool72% bits 4 4 8 8 20 20
0x2000870000000000
0010 0x2 0000 0x0 00000000 0x0 10000111 0x87 00000000000000000000 0x0
00000000000000000000 0x0
l2tp_input @ 0x0057
GPR05 0x0060004270000e0c -> 0x13c2004270000e0c
GPR12 0x0000000000000000 -> 0x0000000000000004
Prev_PC 0x0054 -> 0x0057
WP0 0x0360 -> 0x03a0
.....
if (csh_reg.csum != 0) {
goto ipv4_csum_error;
}
// The RE will NEVER use a src_port other than 0x1701 for L2TP.
// The ucode today was simplified to use this fact to determine if
// the header following the UDP header is L2TP or not.
// This could be changed by adding 17 bits to the tunnel decaps NH
// to specify L2TP=true and the actual dest port to check (16 bits).
Here comes to the problem. Since the PPE will treat this as a real
packet, we need to inject a *valid* packet – you even need to make
sure the IP packet header is with correct checksum byte !
If you inject a bad packet to run ttrace, the error will be logged as an
error from a real packet !