Skip to content

Commit

Permalink
Account for GLOBAL key in PFC_WD (sonic-net#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbud-msft authored and mssonicbld committed Mar 7, 2024
1 parent e1af33f commit b431273
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions sonic_data_client/virtual_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ func getPfcwdMap() (map[string]map[string]string, error) {
}

for _, key := range resp {
name := key[7:]
pfcwdName_map[name] = make(map[string]string)
if strings.Contains(key, "Ethernet") { // Account for non interface ports in PFC_WD such as GLOBAL
name := key[7:]
pfcwdName_map[name] = make(map[string]string)
}
}

// Get Queue indexes that are enabled with PFC-WD
Expand Down
5 changes: 4 additions & 1 deletion testdata/CONFIG_PFCWD_PORTS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@
"PFC_WD|Ethernet9": {
"action": "drop"
},
"PORT_QOS_MAP|Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68": {
"PFC_WD|GLOBAL": {
"action": "drop"
},
"PORT_QOS_MAP|Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,global": {
"pfc_enable": "3,4"
}
}

0 comments on commit b431273

Please sign in to comment.