Skip to content

Commit

Permalink
[cbf] Added initial CBF support (#2)
Browse files Browse the repository at this point in the history
* Added CBF NHG support to NhgOrch
* Added NhgMapOrch to handle DSCP_TO_FC and EXP_TO_FC tables
* Added UT for the new NhgOrch function and NhgMapOrch

Signed-off-by: Alexandru Banu <Alexandru.Banu@metaswitch.com>
  • Loading branch information
TACappleman committed Oct 27, 2021
1 parent ac09bde commit 6edf848
Show file tree
Hide file tree
Showing 22 changed files with 3,500 additions and 677 deletions.
2 changes: 2 additions & 0 deletions doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ name as object key and member list as attribute.
"pfc_enable": "3,4",
"pfc_to_queue_map": "AZURE",
"dscp_to_tc_map": "AZURE",
"dscp_to_fc_map": "AZURE",
"exp_to_fc_map": "AZURE",
"scheduler": "scheduler.port"
}
}
Expand Down
58 changes: 58 additions & 0 deletions doc/swss-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,28 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
mpls_nh = STRING ; Comma-separated list of MPLS NH info.
weight = weight_list ; List of weights.

---------------------------------------------
### CLASS_BASED_NEXT_HOP_GROUP_TABLE
;Stores a list of groups of one or more next hop groups used for class based forwarding
;Status: Mandatory
key = CLASS_BASED_NEXT_HOP_GROUP_TABLE:string ; arbitrary index for the next hop group
members = NEXT_HOP_GROUP_TABLE.key ; one or more separated by ","
selection_map = FC_TO_NHG_INDEX_MAP_TABLE.key ; the NHG map to use for this CBF NHG

---------------------------------------------
### FC_TO_NHG_INDEX_MAP_TABLE
; FC to Next hop group index map
key = "FC_TO_NHG_INDEX_MAP_TABLE:"name
fc_num = 1*DIGIT ;value
nh_index = 1*DIGIT; index of NH inside NH group

Example:
127.0.0.1:6379> hgetall "FC_TO_NHG_INDEX_MAP_TABLE:AZURE"
1) "0" ;fc_num
2) "0" ;nhg_index
3) "1"
4) "0"

---------------------------------------------
### NEIGH_TABLE
; Stores the neighbors or next hop IP address and output port or
Expand Down Expand Up @@ -279,6 +301,42 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
9) "9"
10) "8"

---------------------------------------------
### DSCP_TO_FC_TABLE_NAME
; dscp to FC map
;SAI mapping - qos_map object with SAI_QOS_MAP_ATTR_TYPE == sai_qos_map_type_t::SAI_QOS_MAP_TYPE_DSCP_TO_FORWARDING_CLASS
key = "DSCP_TO_FC_MAP_TABLE:"name
;field value
dscp_value = 1*DIGIT
fc_value = 1*DIGIT

Example:
127.0.0.1:6379> hgetall "DSCP_TO_FC_MAP_TABLE:AZURE"
1) "0" ;dscp
2) "1" ;fc
3) "1"
4) "1"
5) "2"
6) "3"
7)
---------------------------------------------
### EXP_TO_FC_MAP_TABLE
; dscp to FC map
;SAI mapping - qos_map object with SAI_QOS_MAP_ATTR_TYPE == sai_qos_map_type_t::SAI_QOS_MAP_TYPE_MPLS_EXP_TO_FORWARDING_CLASS
key = "EXP_TO_FC_MAP_TABLE:"name
;field value
mpls_exp_value = 1*DIGIT
fc_value = 1*DIGIT

Example:
127.0.0.1:6379> hgetall "EXP_TO_FC_MAP_TABLE:AZURE"
1) "0" ;mpls_exp
2) "1" ;fc
3) "1"
4) "1"
5) "2"
6) "3"

---------------------------------------------
### SCHEDULER_TABLE
; Scheduler table
Expand Down
7 changes: 5 additions & 2 deletions orchagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ orchagent_SOURCES = \
orchdaemon.cpp \
orch.cpp \
notifications.cpp \
nhgorch.cpp \
nhgbase.cpp \
nhghandler.cpp \
cbfnhghandler.cpp \
routeorch.cpp \
mplsrouteorch.cpp \
neighorch.cpp \
Expand Down Expand Up @@ -80,7 +82,8 @@ orchagent_SOURCES = \
isolationgrouporch.cpp \
muxorch.cpp \
macsecorch.cpp \
lagid.cpp
lagid.cpp \
nhgmaporch.cpp

orchagent_SOURCES += flex_counter/flex_counter_manager.cpp flex_counter/flex_counter_stat_manager.cpp
orchagent_SOURCES += debug_counter/debug_counter.cpp debug_counter/drop_counter.cpp
Expand Down
Loading

0 comments on commit 6edf848

Please sign in to comment.