Skip to content

Commit 339101c

Browse files
[cbf] Add class-based forwarding support (sonic-net#1963)
* [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>
1 parent 24a615b commit 339101c

23 files changed

+3497
-599
lines changed

doc/Configuration.md

+2
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,8 @@ name as object key and member list as attribute.
11291129
"pfc_enable": "3,4",
11301130
"pfc_to_queue_map": "AZURE",
11311131
"dscp_to_tc_map": "AZURE",
1132+
"dscp_to_fc_map": "AZURE",
1133+
"exp_to_fc_map": "AZURE",
11321134
"scheduler": "scheduler.port"
11331135
}
11341136
}

doc/swss-schema.md

+57
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,28 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
194194
mpls_nh = STRING ; Comma-separated list of MPLS NH info.
195195
weight = weight_list ; List of weights.
196196

197+
---------------------------------------------
198+
### CLASS_BASED_NEXT_HOP_GROUP_TABLE
199+
;Stores a list of groups of one or more next hop groups used for class based forwarding
200+
;Status: Mandatory
201+
key = CLASS_BASED_NEXT_HOP_GROUP_TABLE:string ; arbitrary index for the next hop group
202+
members = NEXT_HOP_GROUP_TABLE.key ; one or more separated by ","
203+
selection_map = FC_TO_NHG_INDEX_MAP_TABLE.key ; the NHG map to use for this CBF NHG
204+
205+
---------------------------------------------
206+
### FC_TO_NHG_INDEX_MAP_TABLE
207+
; FC to Next hop group index map
208+
key = "FC_TO_NHG_INDEX_MAP_TABLE:"name
209+
fc_num = 1*DIGIT ;value
210+
nh_index = 1*DIGIT; index of NH inside NH group
211+
212+
Example:
213+
127.0.0.1:6379> hgetall "FC_TO_NHG_INDEX_MAP_TABLE:AZURE"
214+
1) "0" ;fc_num
215+
2) "0" ;nhg_index
216+
3) "1"
217+
4) "0"
218+
197219
---------------------------------------------
198220
### NEIGH_TABLE
199221
; Stores the neighbors or next hop IP address and output port or
@@ -321,6 +343,41 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
321343
9) "4"
322344
10) "8"
323345

346+
### DSCP_TO_FC_TABLE_NAME
347+
; dscp to FC map
348+
;SAI mapping - qos_map object with SAI_QOS_MAP_ATTR_TYPE == sai_qos_map_type_t::SAI_QOS_MAP_TYPE_DSCP_TO_FORWARDING_CLASS
349+
key = "DSCP_TO_FC_MAP_TABLE:"name
350+
;field value
351+
dscp_value = 1*DIGIT
352+
fc_value = 1*DIGIT
353+
354+
Example:
355+
127.0.0.1:6379> hgetall "DSCP_TO_FC_MAP_TABLE:AZURE"
356+
1) "0" ;dscp
357+
2) "1" ;fc
358+
3) "1"
359+
4) "1"
360+
5) "2"
361+
6) "3"
362+
7)
363+
---------------------------------------------
364+
### EXP_TO_FC_MAP_TABLE
365+
; dscp to FC map
366+
;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
367+
key = "EXP_TO_FC_MAP_TABLE:"name
368+
;field value
369+
mpls_exp_value = 1*DIGIT
370+
fc_value = 1*DIGIT
371+
372+
Example:
373+
127.0.0.1:6379> hgetall "EXP_TO_FC_MAP_TABLE:AZURE"
374+
1) "0" ;mpls_exp
375+
2) "1" ;fc
376+
3) "1"
377+
4) "1"
378+
5) "2"
379+
6) "3"
380+
324381
---------------------------------------------
325382
### SCHEDULER_TABLE
326383
; Scheduler table

orchagent/Makefile.am

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ INCLUDES = -I $(top_srcdir)/lib \
33
-I $(top_srcdir)/warmrestart \
44
-I flex_counter \
55
-I debug_counter \
6-
-I pbh
6+
-I pbh \
7+
-I nhg
78

89
CFLAGS_SAI = -I /usr/include/sai
910

@@ -40,7 +41,10 @@ orchagent_SOURCES = \
4041
orchdaemon.cpp \
4142
orch.cpp \
4243
notifications.cpp \
43-
nhgorch.cpp \
44+
nhgorch.cpp \
45+
nhgbase.cpp \
46+
cbf/cbfnhgorch.cpp \
47+
cbf/nhgmaporch.cpp \
4448
routeorch.cpp \
4549
mplsrouteorch.cpp \
4650
neighorch.cpp \

0 commit comments

Comments
 (0)