Skip to content

Commit

Permalink
[cbf] Add class-based forwarding support (sonic-net#1963)
Browse files Browse the repository at this point in the history
* [cbf] Added initial CBF support (#2)

* 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

Support sonic-net/SONiC#796

Co-authored-by: Alexandru Banu <v-albanu@microsoft.com>
  • Loading branch information
TACappleman and abanu-ms authored Nov 16, 2021
1 parent 24a615b commit 339101c
Show file tree
Hide file tree
Showing 23 changed files with 3,497 additions and 599 deletions.
2 changes: 2 additions & 0 deletions doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,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
57 changes: 57 additions & 0 deletions doc/swss-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,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 @@ -321,6 +343,41 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
9) "4"
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
8 changes: 6 additions & 2 deletions orchagent/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ INCLUDES = -I $(top_srcdir)/lib \
-I $(top_srcdir)/warmrestart \
-I flex_counter \
-I debug_counter \
-I pbh
-I pbh \
-I nhg

CFLAGS_SAI = -I /usr/include/sai

Expand Down Expand Up @@ -40,7 +41,10 @@ orchagent_SOURCES = \
orchdaemon.cpp \
orch.cpp \
notifications.cpp \
nhgorch.cpp \
nhgorch.cpp \
nhgbase.cpp \
cbf/cbfnhgorch.cpp \
cbf/nhgmaporch.cpp \
routeorch.cpp \
mplsrouteorch.cpp \
neighorch.cpp \
Expand Down
Loading

0 comments on commit 339101c

Please sign in to comment.