|
|
Line 98: |
Line 98: |
| Free (A, N) as a local end of a UDP tunnel | | Free (A, N) as a local end of a UDP tunnel |
| </ul> | | </ul> |
− | client --cmd alloc_fastpath --copt C --firm K --soft 0 --fltrs N1 --qs N2 --stats N3 --buffs N4 --sram 4096 --dram 0 | + | client --cmd alloc_fastpath --copt C --firm K --soft 0 |
| + | --fltrs N1 --qs N2 --stats N3 --buffs N4 --sram 4096 --dram 0 |
| <ul style="padding-left: 0.5in;"> | | <ul style="padding-left: 0.5in;"> |
| Allocate fastpath resources for code option C: | | Allocate fastpath resources for code option C: |
Line 131: |
Line 132: |
| </ul> | | </ul> |
| | | |
− | <ul>
| + | === Filter Management === |
− | ifList ← get_ifaces(ifList)
| |
− | <ul>
| |
− | Return a list of all physical interfaces of the SPP.
| |
− | Slices configure MIs using the information from this list.
| |
− | The returned list indicates for each physical interface the
| |
− | attributes of the interface; i.e., interface number,
| |
− | the interface type (Internet or peering), the IP address,
| |
− | the total bandwidth and the available bandwidth.
| |
− | </ul>
| |
− | ifNum ← get_ifn(EPaddr)
| |
− | <ul>
| |
− | Return the physical interface number of the EP.
| |
− | </ul>
| |
− | ifAttributes ← get_ifattrs(ifNum,ifAttributes)
| |
− | <ul>
| |
− | Return the attributes of the physical interface.
| |
− | </ul>
| |
− | IPaddr ← get_ifpeer(ifNum)
| |
− | <ul>
| |
− | Return the IP address of the physical interface.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === GPE Interface Bandwidth === | |
− | | |
− | <ul>
| |
− | rmpCode ← resrv_pl_ifbw(ifNum,BWkbps)
| |
− | <ul>
| |
− | Reserve bandwidth (Kbps) on the physical interface.
| |
− | </ul>
| |
− | rmpCode ← free_pl_ifbw(ifNum,BWkbps)
| |
− | <ul>
| |
− | Release bandwidth (Kbps) from the physical interface.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === GPE Endpoints ===
| |
− | | |
− | <ul>
| |
− | EPdescr ← alloc_endpoint(EPdescr)
| |
− | <ul>
| |
− | Given an EP description, allocate a new EP, and return
| |
− | a reference to the EP.
| |
− | A filter is installed in the LC to direct matching traffic to the GPE.
| |
− | For TCP or UDP, you can select the port number or have the
| |
− | system give you one.
| |
− | </ul>
| |
− | RMPcode ← free_endpoint(EPdescr)
| |
− | <ul>
| |
− | Free the endpoint, de-install the LC filter for the EP,
| |
− | and return the status.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === FastPaths ===
| |
− | | |
− | <ul>
| |
− | FPdescr ← alloc_fastpath(codeOpt,bwSpec,resSpec,memSpec,FPdescr)
| |
− | <ul>
| |
− | Given specifications for the aggregate bandwidth,
| |
− | other resource (filters, queues, buffers and stats) and
| |
− | memory, allocate a new FP for the code option, and
| |
− | return a reference to the FP description.
| |
− | </ul>
| |
− | free_fastpath(FPid)
| |
− | <ul>
| |
− | Free the resources of the FP.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === FastPath Bandwidth ===
| |
− | | |
− | <ul>
| |
− | RMPcode ← resrv_fpath_ifbw(FPid,ifNum,BWkbps)
| |
− | <ul>
| |
− | Reserve bandwidth (Kbps) on a physical interface for a FP.
| |
− | </ul>
| |
− | RMPcode ← free_fpath_ifbw(FPid,ifNum,BWkbps)
| |
− | <ul>
| |
− | Free the bandwidth (Kbps) of a FP from a physical interface,
| |
− | and return the status.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === FastPath MetaInterfaces ===
| |
− | | |
− | <ul>
| |
− | MIid ← alloc_udp_tunnel(FPid,EPdescr )
| |
− | <ul>
| |
− | Given a UDP tunnel EP description allocate the EP for the FP,
| |
− | and return the MI identifier.
| |
− | </ul>
| |
− | RMPcode ← free_udp_tunnel(FPid,MIid)
| |
− | <ul>
| |
− | Free the MI of a FP, and return the status.
| |
− | </ul>
| |
− | EPdescr ← get_endpoint(FPid,MIid,EPdescr)
| |
− | <ul>
| |
− | Return the UDP tunnel EP description for a given MI of a FP.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === FastPath Queue Management ===
| |
− | | |
− | <ul>
| |
− | RMPcode ← bind_queue(FPid,MIid,qidListType,qidList)
| |
− | <ul>
| |
− | Associate the listed queues to the MI of the FP, and
| |
− | return the status.
| |
− | </ul>
| |
− | Qdescr ← get_queue_params(FPid,Qid,Qdescr)
| |
− | <ul>
| |
− | Return the parameters (threshold, bandwidth) for the FP queue,
| |
− | and return a description of the queue.
| |
− | </ul>
| |
− | BWkbps ← set_queue_params(FPid,Qid,Qdescr)
| |
− | <ul>
| |
− | Set the queue parameters (threshold, bandwidth) for the FP queue,
| |
− | and return the bandwidth of the queue.
| |
− | </ul>
| |
− | Qlen ← get_queue_len(FPid,Qid,Qlen)
| |
− | <ul>
| |
− | Return the length of the FP queue.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === Fastpath Filter Management ===
| |
− | | |
− | <ul>
| |
− | rmpCode ← write_fltr(FPid,Fid,Fltr)
| |
− | <ul>
| |
− | Install a FP filter, and return the status.
| |
− | </ul>
| |
− | rmpCode ← update_result(FPid,Fid,Fltr)
| |
− | <ul>
| |
− | Modify the FP filter, and return the status.
| |
− | </ul>
| |
− | Fltr ← get_fltr_byfid(FPid,Fid,Fltr)
| |
− | <ul>
| |
− | Return the FP filter given the filter ID.
| |
− | </ul>
| |
− | Fltr ← get_fltr_bykey(FPid,key,Fltr)
| |
− | <ul>
| |
− | Return the FP filter that matches the key.
| |
− | </ul>
| |
− | fltrResult ← lookup_fltr(FPid,key,Fltr)
| |
− | <ul>
| |
− | Return the result part of the FP filter that matches the key.
| |
− | </ul>
| |
− | rmpCode ← rem_fltr_byfid(FPid,Fid)
| |
− | <ul>
| |
− | Remove the FP filter given the filter ID, and return the status.
| |
− | </ul>
| |
− | rmpCode ← rem_fltr_bykey(FPid,key)
| |
− | <ul>
| |
− | Remove the highest priority FP filter that matches the key, and
| |
− | return the status.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === FastPath Stats Management ===
| |
− | | |
− | <ul>
| |
− | statsRecord ← read_stats(FPid,statsId,flags,statsRecord)
| |
− | <ul>
| |
− | Return the FP stats record (counter group) for the stats ID.
| |
− | The flags argument selects which counters to return.
| |
− | You can select the byte or packet counter and
| |
− | whether the preQ or postQ counter
| |
− | </ul>
| |
− | rmpCode ← clear_stats(FPid,statsId,flags)
| |
− | <ul>
| |
− | Reset the FP stats counters for the stats ID.
| |
− | The flags argument selects which counters to return.
| |
− | </ul>
| |
− | statsHandle ← create_periodic(FPid,statsId,period, historySize,flags)
| |
− | <ul>
| |
− | Create a periodic stats read event for the stats ID with
| |
− | the given period and history size, and
| |
− | return a handle for the operation.
| |
− | The flags argument indicates the retrieval method:
| |
− | either push the stats data to a registered port, or
| |
− | have the VM pull the data using the get_periodic command.
| |
− | </ul>
| |
− | rmpCode ← delete_periodic(FPid,statsHandle)
| |
− | <ul>
| |
− | Remove the periodic event, remove the callback state, and
| |
− | return the status.
| |
− | </ul>
| |
− | rmpCode ← set_callback( FPid,statsHandle,ipPortNum)
| |
− | <ul>
| |
− | Setup the callback for a periodic stats push model that
| |
− | sends stats records to the IP port number, and return the status.
| |
− | </ul>
| |
− | statsRecord ← get_periodic(FPid,statsHandle,statsRecord)
| |
− | <ul>
| |
− | Return the stats record associated with the stats handle.
| |
− | </ul>
| |
− | </ul>
| |
− | === FastPath Memory ===
| |
− | | |
− | Each code option is provided with a block of SRAM.
| |
− | A slice can read/write to any location in this block.
| |
− | A code option may elect to provide library functions to manipulate control structures within this block.
| |
− | The valBuf argument to the read/write functions is a structure that includes the number of bytes in the buffer and the buffer itself.
| |
− | | |
− | <ul>
| |
− | rmpCode ← mem_write(FPid,offset,valBuf)
| |
− | <ul>
| |
− | Write data to the SRAM starting at offset within the FP block, and
| |
− | return the status.
| |
− | The valBuf argument is a structure that includes the
| |
− | number of bytes and the data.
| |
− | </ul>
| |
− | valBuf ← mem_read(FPid,offset,nbytes,valBuf)
| |
− | <ul>
| |
− | Read bytes into the value buffer, and return a reference to
| |
− | the value buffer.
| |
− | </ul>
| |
− | </ul>
| |
− | === Reservation Management ===
| |
− | | |
− | <ul>
| |
− | rmpCode ← make_reservation(rsvRecord)
| |
− | <ul>
| |
− | Make a reservation, and return the status.
| |
− | </ul>
| |
− | rmpCode ← update_reservation(rsvRecord)
| |
− | <ul>
| |
− | Update a reservation.
| |
− | </ul>
| |
− | rmpCode ← cancel_reservation(date)
| |
− | <ul>
| |
− | Cancel the reservation that includes the specified date and time.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | == Substrate Control Daemons (SCD) ==
| |
− | | |
− | The SCDs run on the xScale processors of the Line Card and NPE.
| |
− | They provide a messaging interface, through which other control software components can exercise control.
| |
− | These include messages to access traffic counters, add/remove TCAM packet filters, configure queue parameters (including WDRR weights and discard thresholds), read/write specific memory locations used for control and status registers, etc.
| |
− | These are described in more detail below.
| |
− | All functions have a context ID (''contextID'') as an argument. A context ID of 0 indicates a privileged operation performed by the substrate.
| |
− | Any other context ID indicates a user context and is either a fastpath ID or internal slice ID.
| |
− | Many of the functions (e.g. ''write_fltr'') appear to be similar to ones in the RMP.
| |
− | This is expected because the evaluation of an RMP operation must often be relayed to an SCD for evaluation but with one important difference.
| |
− | The SCD has a substrate view of objects whereas the RMP provides a higher-level of abstraction.
| |
− | The Line Card SCD allows the SRM to control various elements of the Line Card data path.
| |
− | This includes the TCAM-resident packet filters (on both input and output), interface addressing and bandwidth, NAT filter table configuration and queueing parameters.
| |
− | The NPE SCD allows the SRM and the RMP to control various elements of the NPE data path.
| |
− | This includes fast path configuration data, per-slice packet filters resident in the TCAM and queueing parameters.
| |
− | | |
− | === Control Table Initialization ===
| |
− | | |
− | There are several tables and control blocks used by the control software.
| |
− | | |
− | <ul>
| |
− | set_sched_params(contextId,Sid,ifNum,BWkbpsMax,BWkbpsMin,valBuf)
| |
− | <ul>
| |
− | Set the interface number and bandwidth characteristics
| |
− | for a Scheduler in the Per Scheduler Parameters table.
| |
− | </ul>
| |
− | set_encap_cb(contextId,Sid,srcIPaddr,dstMACaddr,valBuf)
| |
− | <ul>
| |
− | On the NPE, set the source IP Address and destination
| |
− | MAC Address associated with the specified scheduler.
| |
− | </ul>
| |
− | set_sched_mac(contextId,Sid,dstMACaddr,srcMACaddr,valBuf)
| |
− | <ul>
| |
− | On the LC, set the destination and source MAC Addresses for
| |
− | the specified scheduler.
| |
− | </ul>
| |
− | set_encap_gpe(contextId,FPid,GPEipAddr,NPEipAddr,valBuf)
| |
− | <ul>
| |
− | On the NPE, for a fast path, set the GPE IP Address and
| |
− | NPE IP Address to be used for communication between
| |
− | the GPE and NPE for local delivery and exceptions.
| |
− | </ul>
| |
− | set_fpmi_bw(contextId,FPid,Sid,MIid,BWkbps,valBuf)
| |
− | <ul>
| |
− | On the NPE, for a particular fast path, set the bandwidth
| |
− | for a MI using a particular scheduler.
| |
− | </ul>
| |
− | SCDcode ← set_src_hwaddr(contextId,MACaddr)
| |
− | <ul>
| |
− | On the NPE, set the NPE’s source MAC Address.
| |
− | </ul>
| |
− | SCDcode ← set_iface_table(contextId,ifTable)
| |
− | <ul>
| |
− | On the NPE, initialize the RX Interface ID table.
| |
− | This table translates the receive destination address
| |
− | on a packet to a 4 bit index which will be used in the Lookup key.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === FastPath (NPE SCD Only) ===
| |
− | | |
− | set_fast_path(contextId,FPid,codeOpt,vlanID, num_queues,num_filters,num_buffers,num_stats, SRAM_offset,SRAM_size,DRAM_offset,DRAM_size,valBuf)
| |
− | <ul>
| |
− | On the NPE, create a new fast path.
| |
− | </ul>
| |
− | rem_fast_path(contextId,FPid,valBuf)
| |
− | <ul>
| |
− | On the NPE, remove a fast path.
| |
− | </ul>
| |
− | SCDcode ← set_gpe_info(contextId,EXport,LDport,EXqid,LDqid)
| |
− | <ul>
| |
− | On the NPE, for a particular fast path, set the
| |
− | Local Delivery and Exception traffic port numbers and QIDs.
| |
− | </ul>
| |
− | | |
− | === Memory ===
| |
− | | |
− | <ul>
| |
− | write_sram(contextId,offset,valBuf)
| |
− | <ul>
| |
− | On the NPE, write to the SRAM block for a particular fast path.
| |
− | </ul>
| |
− | read_sram(contextId,offset,valBuf,count)
| |
− | <ul>
| |
− | On the NPE, read from the SRAM block for a particular fast path.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === Queue Management ===
| |
− | | |
− | <ul>
| |
− | SCDcode ← bind_queue(contextId,MIid,qidListType,qidVector)
| |
− | <ul>
| |
− | Associate the listed queues to the context’s MI, and return the status.
| |
− | </ul>
| |
− | BWkbps ← set_queue_params(contextId,Qid,threshhold,BWkbps)
| |
− | <ul>
| |
− | Set the context’s queue parameters (threshold, bandwidth)
| |
− | for the queue, and return the bandwidth of the queue.
| |
− | </ul>
| |
− | get_queue_params(contextId,Qid,threshhold,BWkbps)
| |
− | <ul>
| |
− | Return the context’s parameters (threshold, bandwidth)
| |
− | for the queue through the threshold and BWkbps parameters,
| |
− | and return a description of the queue.
| |
− | </ul>
| |
− | get_queue_len(contextId,Qid,pktCnt,byteCnt)
| |
− | <ul>
| |
− | Return the length of the context’s queue through the pktCnt
| |
− | and byteCnt parameters.
| |
− | </ul>
| |
− | set_queue_sched(contextId,Qid,Sid,valBuf)
| |
− | <ul>
| |
− | Associate a specified queue with the specified scheduler.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === NPE Filter Management ===
| |
− | | |
− | <ul>
| |
− | SCDcode ← npe_write_fltr(contextId,Fid,substrateFltr)
| |
− | <ul>
| |
− | Install a context’s substrate (generic) filter with filter ID.
| |
− | </ul>
| |
− | SCDcode ← npe_update_result(contextId,Fid,result)
| |
− | <ul>
| |
− | Modify the result part of a context’s substrate (generic)
| |
− | filter with filter ID.
| |
− | </ul>
| |
− | substrateFltr ← npe_get_fltr_by_key(contextId,key,substrateFltr)
| |
− | <ul>
| |
− | Return the context’s substrate (generic) filter that matches the key.
| |
− | </ul>
| |
− | substrateFltr ← npe_get_fltr_by_fid(contextId,Fid,substrateFltr)
| |
− | <ul>
| |
− | Return the context’s substrate filter given the filter ID.
| |
− | </ul>
| |
− | substrateResult ← npe_lookup_fltr(contextId,key,substrateResult)
| |
− | <ul>
| |
− | Return the result part of the context’s substrate (generic) filter
| |
− | that matches the key.
| |
− | </ul>
| |
− | SCDcode ← npe_rem_fltr_by_key(contextId,substrateKey)
| |
− | <ul>
| |
− | Remove the context’s highest priority substrate filter
| |
− | that matches the key, and return the status.
| |
− | </ul>
| |
− | SCDcode ← npe_rem_fltr_by_fid(contextId,Fid)
| |
− | <ul>
| |
− | Remove the context’s substrate filter given the filter ID,
| |
− | and return the status.
| |
− | </ul>
| |
− | </ul>
| |
− | === Line Card Filter Management ===
| |
− | | |
− | There are two Line Card filter databases: ingress and egress.
| |
− | Ingress filters are used to determine which SPP component (e.g., NPE, GPE) should handle incoming packets.
| |
− | Egress filters are used to determine which output interface to send outgoing packets.
| |
− | The database ID (DBid) indicates the database to be used.
| |
− | | |
− | <ul>
| |
− | write_fltr( contextId,DBid,Fid,key,mask,result,valBuf)
| |
− | <ul>
| |
− | Install a context’s LC filter (key, mask, result) in the given database.
| |
− | </ul>
| |
− | update_result(contextId,DBid,Fid,result)
| |
− | <ul>
| |
− | Update a context’s LC filter result in the specified database.
| |
− | </ul>
| |
− | get_fltr_by_key(contextId,DBid,key,mask,result,keyLen,resultLen)
| |
− | <ul>
| |
− | Given the key, retrieve a filter from the specified database.
| |
− | </ul>
| |
− | get_fltr_by_fid(contextId,DBid,Fid,key,mask,result,keyLen, resultLen)
| |
− | <ul>
| |
− | Given the filter id, retrieve a filter from the specified database.
| |
− | </ul>
| |
− | lookup_fltr(contextId,DBid,key,result,resultLen)
| |
− | <ul>
| |
− | Given the key, retrieve the filter result from the specified database.
| |
− | </ul>
| |
− | rem_fltr_by_key(contextId,DBid,key,valBuf)
| |
− | <ul>
| |
− | Given the key, remove the filter from the specified database.
| |
− | </ul>
| |
− | rem_fltr_by_fid(contextId,DBid,Fid,valBuf)
| |
− | <ul>
| |
− | Given the filter id, remove the filter from a specified database.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === Statistics Management ===
| |
| | | |
− | <ul>
| + | === Reservations === |
− | statsRecord ← read_stats(contextId,statsId,flags,statsRecord)
| |
− | <ul>
| |
− | Return the context’s stats record (counter group) for the stats ID.
| |
− | The flags argument selects which counters to return.
| |
− | You can select the byte or packet counter and
| |
− | whether the preQ or postQ counter.
| |
− | </ul>
| |
− | SCDcode ← clear_stats(contextId,statsId,flags)
| |
− | <ul>
| |
− | Reset the context’s stats counters for the stats ID, and
| |
− | return the status.
| |
− | The flags argument selects which counters to return.
| |
− | </ul>
| |
− | statsHandle ← create_periodic(contextId,statsId,period,count, flags)
| |
− | <ul>
| |
− | Create a periodic stats read event for the stats ID of
| |
− | the context with the given period and history size, and
| |
− | return a handle for the operation.
| |
− | The flags argument indicates the retrieval method:
| |
− | either push the stats data to a registered port, or have
| |
− | the VM pull the data using the get_periodic command.
| |
− | </ul>
| |
− | SCDcode ← del_periodic(contextId,statsHandle)
| |
− | <ul>
| |
− | Remove the context’s periodic event, remove the callback state,
| |
− | and return the status.
| |
− | </ul>
| |
− | SCDcode ← set_callback(contextId,statsHandle,UDPport)
| |
− | <ul>
| |
− | Setup the context’s callback for a periodic stats push
| |
− | model that sends stats records to the UDP port number, and
| |
− | return the status.
| |
− | </ul>
| |
− | statsRecordVector ← get_periodic(contextId,statsHandle, statsRecordVector)
| |
− | <ul>
| |
− | Return the context’s stats record associated with the stats handle.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === MicroEngine Management === | |
− | | |
− | <ul>
| |
− | start_mes(contextId,valBuf)
| |
− | <ul>
| |
− | Start the MicroEngines on an NPU.
| |
− | </ul>
| |
− | stop_mes(contextId,valBuf)
| |
− | <ul>
| |
− | Stop the MicroEngines on an NPU.
| |
− | </ul>
| |
− | </ul>
| |
− | | |
− | === NAT ===
| |
− | | |
− | <ul>
| |
− | nat_filters(contextId,ingressStartFid,ingressEndFid, egressStartFid, egressEndFid)
| |
− | <ul>
| |
− | On the LC, initialize the NAT filter tables.
| |
− | This sets aside a block of the TCAM for the Ingress NAT filters
| |
− | and a block of the TCAM for the Egress NAT filters.
| |
− | </ul>
| |
− | </ul>
| |
− | === MetaInterface Management ===
| |
− | | |
− | <ul>
| |
− | SCDcode ← create_mi(contextId,FPid,MIid,Sid)
| |
− | <ul>
| |
− | On the NPE,cCreate a new meta-interface for a fast path.
| |
− | </ul>
| |
− | SCDcode ← delete_mi(contextId,FPid,MIid)
| |
− | <ul>
| |
− | On the NPE, delete the specified meta-interface for
| |
− | the specified fast path.
| |
− | </ul>
| |
− | SCDcode ← set_mi_bw(contextId,FPid,MIid,BWkbps)
| |
− | <ul>
| |
− | On the NPE, for the specified fast path, set the bandwidth
| |
− | for a meta-interface.
| |
− | </ul>
| |
− | SCDcode ← bind_queue_sched(contextId,Qid,Sid)
| |
− | <ul>
| |
− | On the NPE, bind a queue to a scheduler.
| |
− | </ul>
| |
− | SCDcode ← unbind_queue_sched(contextId,Qid)
| |
− | <ul>
| |
− | On the NPE, unbind a queue from a scheduler and
| |
− | release its bandwidth on that scheduler.
| |
− | </ul>
| |
− | SCDcode ← unbind_queue(contextId,Qid)
| |
− | <ul>
| |
− | On the NPE, unbind a queue from a meta-interface and
| |
− | release its bandwidth on that meta-interface.
| |
− | </ul>
| |
− | </ul>
| |