1 - charlie wiseman, shakir james - 05/11/07 design review: plugin framework charlie wiseman and...
DESCRIPTION
3 - Charlie Wiseman, Shakir James - 05/11/07 Plugins (control path) XScale SRAM Ring Plugin 0 Plugin 1 Plugin 2 Plugin 3 Plugin 4 Control Messages from RLI Control Responses to RLI and Configuration Updates to XScaleTRANSCRIPT
1 - Charlie Wiseman, Shakir James - 05/11/07
Design Review:Plugin Framework
Charlie Wiseman and Shakir James [email protected], [email protected]
ONL NP Router
2 - Charlie Wiseman, Shakir James - 05/11/07
ONL NP Router
SRAM
Rx(2 ME)
HdrFmt(1 ME)
Parse, Lookup,
Copy(3 MEs)
TCAM SRAM
Mux(1 ME)
Tx(1 ME)
QM(1 ME)
xScale xScale Assoc. DataZBT-SRAM
Plug
in0
Plug
in1
Plug
in2
Plug
in3
Plug
in4NN NN NN NN
FreeList Mgr(1 ME)
Tx, QMParsePluginXScale
Stats(1 ME)
RxMuxHFCopyPluginsTx
SRAM
NN
Large SRAMRingScratchRingNNRingNN
SRAM
64KW
64KW 64KW
New
NeedsA Lot
Of Mod.
NeedsSomeMod.
64KW 64KW 64KW 64KW
512W
512W
512W
512W
512W
Small SRAMRing
xScale51
2WPer-Plugin
CtrlMsgs
LDEx
cept
Erro
rs
MostlyUnchanged
64KW
3 - Charlie Wiseman, Shakir James - 05/11/07
Plugins (control path)
XScale
SRAMRing
Plugin0Plugin1Plugin2Plugin3Plugin4
Control Messagesfrom RLI
Control Responsesto RLI and
Configuration Updatesto XScale
4 - Charlie Wiseman, Shakir James - 05/11/07
Plugins (data path)
SRAMRingScratchRing
PLC
MuxPlugin0Plugin1Plugin2Plugin3Plugin4
QM
5 - Charlie Wiseman, Shakir James - 05/11/07
XScale -> Plugins
XScale
Plugin0Plugin1Plugin2Plugin3Plugin4
Current Types: From RLI Control Msg (0)
#words (8b)MsgID (16b)
Value 2 (32b)...
Control Messagesfrom RLI Type (8b)
Value 1 (32b)
6 - Charlie Wiseman, Shakir James - 05/11/07
Plugins -> XScalePlugin0Plugin1Plugin2Plugin3Plugin4
XScale
Control Responsesto RLI and
Configuration Updatesto XScale
Current Types: To RLI Control Message Resp (0) Debug Message* (1) To XScale Add Route ( 2) Remove Route ( 3) Add Primary Filter ( 4) Remove Primary Filter ( 5) Add Aux Filter ( 6) Remove Aux Filter ( 7) Update Queue Quantum ( 8) Update Queue Threshold ( 9) Update Port Rate (10) Update Mux Quanta (11) Update Aux Sampling Rates (12) Update Exception Destinations (13)
#words (8b)MsgID (16b)
Value 2 (32b)...
Type (8b)
Value 1 (32b)
7 - Charlie Wiseman, Shakir James - 05/11/07
PLC -> Plugins
PLC
Flags(8b): Why pkt is being sent to Plugin TTL(1b): TTL expired Options(1b): IP Options present NoRoute(1b): No matching route or filter NonIP(1b): Non IP Packet received ARP_Needed(1b): NH_IP valid, but no MAC NH_Invalid(1b): NH_IP AND NH_MAC both invalid Reserved(2b): currently unused
xScale
SRAML3 (IP, ARP, …)Pkt Length (16b)
Buffer Handle(24b)
Stats Index (16b)
QID(16b)In
Port(3b)
Flags(8b)
PluginTag(5b)
NH MAC DA[47:16] (32b)NH MAC DA[15:0]
(16b)Unicast/MCast bits
(16b)
Rsv(8b)
Reserved (16b)
EtherType (16b)
01237Reserved
(2b)NR
(1b)TTL(1b)
Opt(1b)
NI(1b)
ARP(1b)
NHINV(1b)
456
Plugin0Plugin1Plugin2Plugin3Plugin4
8 - Charlie Wiseman, Shakir James - 05/11/07
Plugins -> Mux
Mux
Flags: PT(1b): PassThrough(1)/Classify(0) Reserved (7b)
L3 (IP, ARP, …)Pkt Length (16b)
Buffer Handle(24b)
Stats Index (16b)
QID(16b)
InPort(3b)
PluginTag(5b)
Flags(8b)
Rsv(4b)
OutPort(4b)
Reserved (7b) PT(1b)
01237
Plugin0Plugin1Plugin2Plugin3Plugin4
9 - Charlie Wiseman, Shakir James - 05/11/07
Plugins -> QM
QM
Plugin0Plugin1Plugin2Plugin3Plugin4
Buffer Handle(24b)
QID(16b)Rsv(4b)
OutPort(4b)
L3 (IP, ARP, …)Pkt Length (16b)Reserved(16b)
Rsv(8b)
Rsv(8b)
10 - Charlie Wiseman, Shakir James - 05/11/07
Framework Components▪ Basic plugin structures
»1 thread: only handling data»8 threads: all handling data»8 threads: 7 handling data, 1 handling control»8 threads: 6 handling data, 1 handling control, 1
handling time-outs▪ Macros for common processing
11 - Charlie Wiseman, Shakir James - 05/11/07
Plugin Structuremain(){ plugin_init() switch(ctx()) { case 0: callback_loop() case 1: handle_msg_loop() case 2,3,4,5,6,7: handle_packet_loop() }}
12 - Charlie Wiseman, Shakir James - 05/11/07
handle_packet_loop()handle_packet_loop(){ while(1) { dl_source() handle_packet() // change required for ordered threads // also need to add BID_NULL to not sink anywhere dl_sink() }}
13 - Charlie Wiseman, Shakir James - 05/11/07
handle_msg_loop()handle_msg_loop(){ while(1) { // special control dl_source call dl_source_control() handle_msg() // only one thread handles control messages at a time // also need to add BID_NULL to not sink anywhere dl_sink() }}
14 - Charlie Wiseman, Shakir James - 05/11/07
callback_loop()callback_loop(){ while(1) { // timeout initialized in plugin_init() sleep(timeout) callback() }}
15 - Charlie Wiseman, Shakir James - 05/11/07
Macros▪ Packet Allocation
»SRAM dequeue from free list▪ Packet forwarding or dropping
»Set dlNextBlock▪ Packet access/modification
»Read/write buffer descriptor and packet buffer▪ Packet copying
»Allocation, buffer descriptor updates, data copying▪ Queues of packets with-in the plugin
»Use packet_next field in (header) buffer descriptor»Keep head buf handle in local memory
16 - Charlie Wiseman, Shakir James - 05/11/07
Macros, continued▪ Read configuration
»SRAM, scratch reads▪ Configuration updates
»write data to local mem and have control thread send?▪ Read stats
»SRAM reads▪ Write stats
»Write to stats ring▪ Clock, CRC, local CAM access
»Wrap intrinsic functions