Skip to content

Commit e0ac130

Browse files
Sangita MaityPraveen Chaudhary
authored andcommitted
[DPB|master] Update Dynamic Port Breakout Logic for flexible alias support a… (sonic-net#6831)
To fix [DPB| wrong aliases for interfaces](sonic-net#6024) issue, implimented flexible alias support [design doc](sonic-net/SONiC#749) > [[dpb|config] Fix the validation logic of breakout mode](sonic-net/sonic-utilities#1440) depends on this 1. Removed `"alias_at_lanes"` from port-configuration file(i.e. platfrom.json) 2. Added dictionary to "breakout_modes" values. This defines the breakout modes available on the platform for this parent port, and it maps to the alias list. The alias list presents the alias names for individual ports in order under this breakout mode. ``` { "interfaces": { "Ethernet0": { "index": "1,1,1,1", "lanes": "0,1,2,3", "breakout_modes": { "1x100G[40G]": ["Eth1"], "2x50G": ["Eth1/1", "Eth1/2"], "4x25G[10G]": ["Eth1/1", "Eth1/2", "Eth1/3", "Eth1/4"], "2x25G(2)+1x50G(2)": ["Eth1/1", "Eth1/2", "Eth1/3"], "1x50G(2)+2x25G(2)": ["Eth1/1", "Eth1/2", "Eth1/3"] } } } ``` `config interface breakout` Signed-off-by: Sangita Maity <[email protected]> device/mellanox/x86_64-mlnx_msn2700-r0/platform.json
1 parent cf143b5 commit e0ac130

File tree

21 files changed

+4851
-517
lines changed

21 files changed

+4851
-517
lines changed

device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json

Lines changed: 160 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,194 +3,290 @@
33
"Ethernet0": {
44
"index": "1,1,1,1",
55
"lanes": "0,1,2,3",
6-
"alias_at_lanes": "Ethernet0,Ethernet1,Ethernet2,Ethernet3",
7-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
6+
"breakout_modes": {
7+
"1x100G[40G]": ["Ethernet0"],
8+
"2x50G": ["Ethernet0", "Ethernet2"],
9+
"4x25G[10G]": ["Ethernet0", "Ethernet1", "Ethernet2", "Ethernet3"]
10+
}
811
},
912
"Ethernet4": {
1013
"index": "2,2,2,2",
1114
"lanes": "4,5,6,7",
12-
"alias_at_lanes": "Ethernet4,Ethernet5,Ethernet6,Ethernet7",
13-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
15+
"breakout_modes": {
16+
"1x100G[40G]": ["Ethernet4"],
17+
"2x50G": ["Ethernet4", "Ethernet6"],
18+
"4x25G[10G]": ["Ethernet4", "Ethernet5", "Ethernet6", "Ethernet7"]
19+
}
1420
},
1521
"Ethernet8": {
1622
"index": "3,3,3,3",
1723
"lanes": "8,9,10,11",
18-
"alias_at_lanes": "Ethernet8,Ethernet9,Ethernet10,Ethernet11",
19-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
24+
"breakout_modes": {
25+
"1x100G[40G]": ["Ethernet8"],
26+
"2x50G": ["Ethernet8", "Ethernet10"],
27+
"4x25G[10G]": ["Ethernet8", "Ethernet9", "Ethernet10", "Ethernet11"]
28+
}
2029
},
2130
"Ethernet12": {
2231
"index": "4,4,4,4",
2332
"lanes": "12,13,14,15",
24-
"alias_at_lanes": "Ethernet12,Ethernet13,Ethernet14,Ethernet15",
25-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
33+
"breakout_modes": {
34+
"1x100G[40G]": ["Ethernet12"],
35+
"2x50G": ["Ethernet12", "Ethernet14"],
36+
"4x25G[10G]": ["Ethernet12", "Ethernet13", "Ethernet14", "Ethernet15"]
37+
}
2638
},
2739
"Ethernet16": {
2840
"index": "5,5,5,5",
2941
"lanes": "16,17,18,19",
30-
"alias_at_lanes": "Ethernet16,Ethernet17,Ethernet18,Ethernet19",
31-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
42+
"breakout_modes": {
43+
"1x100G[40G]": ["Ethernet16"],
44+
"2x50G": ["Ethernet16", "Ethernet18"],
45+
"4x25G[10G]": ["Ethernet16", "Ethernet17", "Ethernet18", "Ethernet19"]
46+
}
3247
},
3348
"Ethernet20": {
3449
"index": "6,6,6,6",
3550
"lanes": "20,21,22,23",
36-
"alias_at_lanes": "Ethernet20,Ethernet21,Ethernet22,Ethernet23",
37-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
51+
"breakout_modes": {
52+
"1x100G[40G]": ["Ethernet20"],
53+
"2x50G": ["Ethernet20", "Ethernet22"],
54+
"4x25G[10G]": ["Ethernet20", "Ethernet21", "Ethernet22", "Ethernet23"]
55+
}
3856
},
3957
"Ethernet24": {
4058
"index": "7,7,7,7",
4159
"lanes": "24,25,26,27",
42-
"alias_at_lanes": "Ethernet24,Ethernet25,Ethernet26,Ethernet27",
43-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
60+
"breakout_modes": {
61+
"1x100G[40G]": ["Ethernet24"],
62+
"2x50G": ["Ethernet24", "Ethernet26"],
63+
"4x25G[10G]": ["Ethernet24", "Ethernet25", "Ethernet26", "Ethernet27"]
64+
}
4465
},
4566
"Ethernet28": {
4667
"index": "8,8,8,8",
4768
"lanes": "28,29,30,31",
48-
"alias_at_lanes": "Ethernet28,Ethernet29,Ethernet30,Ethernet31",
49-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
69+
"breakout_modes": {
70+
"1x100G[40G]": ["Ethernet28"],
71+
"2x50G": ["Ethernet28", "Ethernet30"],
72+
"4x25G[10G]": ["Ethernet28", "Ethernet29", "Ethernet30", "Ethernet31"]
73+
}
5074
},
5175
"Ethernet32": {
5276
"index": "9,9,9,9",
5377
"lanes": "32,33,34,35",
54-
"alias_at_lanes": "Ethernet32,Ethernet33,Ethernet34,Ethernet35",
55-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
78+
"breakout_modes": {
79+
"1x100G[40G]": ["Ethernet32"],
80+
"2x50G": ["Ethernet32", "Ethernet34"],
81+
"4x25G[10G]": ["Ethernet32", "Ethernet33", "Ethernet34", "Ethernet35"]
82+
}
5683
},
5784
"Ethernet36": {
5885
"index": "10,10,10,10",
5986
"lanes": "36,37,38,39",
60-
"alias_at_lanes": "Ethernet36,Ethernet37,Ethernet38,Ethernet39",
61-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
87+
"breakout_modes": {
88+
"1x100G[40G]": ["Ethernet36"],
89+
"2x50G": ["Ethernet36", "Ethernet38"],
90+
"4x25G[10G]": ["Ethernet36", "Ethernet37", "Ethernet38", "Ethernet39"]
91+
}
6292
},
6393
"Ethernet40": {
6494
"index": "11,11,11,11",
6595
"lanes": "40,41,42,43",
66-
"alias_at_lanes": "Ethernet40,Ethernet41,Ethernet42,Ethernet43",
67-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
96+
"breakout_modes": {
97+
"1x100G[40G]": ["Ethernet40"],
98+
"2x50G": ["Ethernet40", "Ethernet42"],
99+
"4x25G[10G]": ["Ethernet40", "Ethernet41", "Ethernet42", "Ethernet43"]
100+
}
68101
},
69102
"Ethernet44": {
70103
"index": "12,12,12,12",
71104
"lanes": "44,45,46,47",
72-
"alias_at_lanes": "Ethernet44,Ethernet45,Ethernet46,Ethernet47",
73-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
105+
"breakout_modes": {
106+
"1x100G[40G]": ["Ethernet44"],
107+
"2x50G": ["Ethernet44", "Ethernet46"],
108+
"4x25G[10G]": ["Ethernet44", "Ethernet45", "Ethernet46", "Ethernet47"]
109+
}
74110
},
75111
"Ethernet48": {
76112
"index": "13,13,13,13",
77113
"lanes": "48,49,50,51",
78-
"alias_at_lanes": "Ethernet48,Ethernet49,Ethernet50,Ethernet51",
79-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
114+
"breakout_modes": {
115+
"1x100G[40G]": ["Ethernet48"],
116+
"2x50G": ["Ethernet48", "Ethernet50"],
117+
"4x25G[10G]": ["Ethernet48", "Ethernet49", "Ethernet50", "Ethernet51"]
118+
}
80119
},
81120
"Ethernet52": {
82121
"index": "14,14,14,14",
83122
"lanes": "52,53,54,55",
84-
"alias_at_lanes": "Ethernet52,Ethernet53,Ethernet54,Ethernet55",
85-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
123+
"breakout_modes": {
124+
"1x100G[40G]": ["Ethernet52"],
125+
"2x50G": ["Ethernet52", "Ethernet54"],
126+
"4x25G[10G]": ["Ethernet52", "Ethernet53", "Ethernet54", "Ethernet55"]
127+
}
86128
},
87129
"Ethernet56": {
88130
"index": "15,15,15,15",
89131
"lanes": "56,57,58,59",
90-
"alias_at_lanes": "Ethernet56,Ethernet57,Ethernet58,Ethernet59",
91-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
132+
"breakout_modes": {
133+
"1x100G[40G]": ["Ethernet56"],
134+
"2x50G": ["Ethernet56", "Ethernet58"],
135+
"4x25G[10G]": ["Ethernet56", "Ethernet57", "Ethernet58", "Ethernet59"]
136+
}
92137
},
93138
"Ethernet60": {
94139
"index": "16,16,16,16",
95140
"lanes": "60,61,62,63",
96-
"alias_at_lanes": "Ethernet60,Ethernet61,Ethernet62,Ethernet63",
97-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
141+
"breakout_modes": {
142+
"1x100G[40G]": ["Ethernet60"],
143+
"2x50G": ["Ethernet60", "Ethernet62"],
144+
"4x25G[10G]": ["Ethernet60", "Ethernet61", "Ethernet62", "Ethernet63"]
145+
}
98146
},
99147
"Ethernet64": {
100148
"index": "17,17,17,17",
101149
"lanes": "64,65,66,67",
102-
"alias_at_lanes": "Ethernet64,Ethernet65,Ethernet66,Ethernet67",
103-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
150+
"breakout_modes": {
151+
"1x100G[40G]": ["Ethernet64"],
152+
"2x50G": ["Ethernet64", "Ethernet66"],
153+
"4x25G[10G]": ["Ethernet64", "Ethernet65", "Ethernet66", "Ethernet67"]
154+
}
104155
},
105156
"Ethernet68": {
106157
"index": "18,18,18,18",
107158
"lanes": "68,69,70,71",
108-
"alias_at_lanes": "Ethernet68,Ethernet69,Ethernet70,Ethernet71",
109-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
159+
"breakout_modes": {
160+
"1x100G[40G]": ["Ethernet68"],
161+
"2x50G": ["Ethernet68", "Ethernet70"],
162+
"4x25G[10G]": ["Ethernet68", "Ethernet69", "Ethernet70", "Ethernet71"]
163+
}
110164
},
111165
"Ethernet72": {
112166
"index": "19,19,19,19",
113167
"lanes": "72,73,74,75",
114-
"alias_at_lanes": "Ethernet72,Ethernet73,Ethernet74,Ethernet75",
115-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
168+
"breakout_modes": {
169+
"1x100G[40G]": ["Ethernet72"],
170+
"2x50G": ["Ethernet72", "Ethernet74"],
171+
"4x25G[10G]": ["Ethernet72", "Ethernet73", "Ethernet74", "Ethernet75"]
172+
}
116173
},
117174
"Ethernet76": {
118175
"index": "20,20,20,20",
119176
"lanes": "76,77,78,79",
120-
"alias_at_lanes": "Ethernet76,Ethernet77,Ethernet78,Ethernet79",
121-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
177+
"breakout_modes": {
178+
"1x100G[40G]": ["Ethernet76"],
179+
"2x50G": ["Ethernet76", "Ethernet78"],
180+
"4x25G[10G]": ["Ethernet76", "Ethernet77", "Ethernet78", "Ethernet79"]
181+
}
122182
},
123183
"Ethernet80": {
124184
"index": "21,21,21,21",
125185
"lanes": "80,81,82,83",
126-
"alias_at_lanes": "Ethernet80,Ethernet81,Ethernet82,Ethernet83",
127-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
186+
"breakout_modes": {
187+
"1x100G[40G]": ["Ethernet80"],
188+
"2x50G": ["Ethernet80", "Ethernet82"],
189+
"4x25G[10G]": ["Ethernet80", "Ethernet81", "Ethernet82", "Ethernet83"]
190+
}
128191
},
129192
"Ethernet84": {
130193
"index": "22,22,22,22",
131194
"lanes": "84,85,86,87",
132-
"alias_at_lanes": "Ethernet84,Ethernet85,Ethernet86,Ethernet87",
133-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
195+
"breakout_modes": {
196+
"1x100G[40G]": ["Ethernet84"],
197+
"2x50G": ["Ethernet84", "Ethernet86"],
198+
"4x25G[10G]": ["Ethernet84", "Ethernet85", "Ethernet86", "Ethernet87"]
199+
}
134200
},
135201
"Ethernet88": {
136202
"index": "23,23,23,23",
137203
"lanes": "88,89,90,91",
138-
"alias_at_lanes": "Ethernet88,Ethernet89,Ethernet90,Ethernet91",
139-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
204+
"breakout_modes": {
205+
"1x100G[40G]": ["Ethernet88"],
206+
"2x50G": ["Ethernet88", "Ethernet90"],
207+
"4x25G[10G]": ["Ethernet88", "Ethernet89", "Ethernet90", "Ethernet91"]
208+
}
140209
},
141210
"Ethernet92": {
142211
"index": "24,24,24,24",
143212
"lanes": "92,93,94,95",
144-
"alias_at_lanes": "Ethernet92,Ethernet93,Ethernet94,Ethernet95",
145-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
213+
"breakout_modes": {
214+
"1x100G[40G]": ["Ethernet92"],
215+
"2x50G": ["Ethernet92", "Ethernet94"],
216+
"4x25G[10G]": ["Ethernet92", "Ethernet93", "Ethernet94", "Ethernet95"]
217+
}
146218
},
147219
"Ethernet96": {
148220
"index": "25,25,25,25",
149221
"lanes": "96,97,98,99",
150-
"alias_at_lanes": "Ethernet96,Ethernet97,Ethernet98,Ethernet99",
151-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
222+
"breakout_modes": {
223+
"1x100G[40G]": ["Ethernet96"],
224+
"2x50G": ["Ethernet96", "Ethernet98"],
225+
"4x25G[10G]": ["Ethernet96", "Ethernet97", "Ethernet98", "Ethernet99"]
226+
}
152227
},
153228
"Ethernet100": {
154229
"index": "26,26,26,26",
155230
"lanes": "100,101,102,103",
156-
"alias_at_lanes": "Ethernet100,Ethernet101,Ethernet102,Ethernet103",
157-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
231+
"breakout_modes": {
232+
"1x100G[40G]": ["Ethernet100"],
233+
"2x50G": ["Ethernet100", "Ethernet102"],
234+
"4x25G[10G]": ["Ethernet100", "Ethernet101", "Ethernet102", "Ethernet103"]
235+
}
158236
},
159237
"Ethernet104": {
160238
"index": "27,27,27,27",
161239
"lanes": "104,105,106,107",
162-
"alias_at_lanes": "Ethernet104,Ethernet105,Ethernet106,Ethernet107",
163-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
240+
"breakout_modes": {
241+
"1x100G[40G]": ["Ethernet104"],
242+
"2x50G": ["Ethernet104", "Ethernet106"],
243+
"4x25G[10G]": ["Ethernet104", "Ethernet105", "Ethernet106", "Ethernet107"]
244+
}
164245
},
165246
"Ethernet108": {
166247
"index": "28,28,28,28",
167248
"lanes": "108,109,110,111",
168-
"alias_at_lanes": "Ethernet108,Ethernet109,Ethernet110,Ethernet111",
169-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
249+
"breakout_modes": {
250+
"1x100G[40G]": ["Ethernet108"],
251+
"2x50G": ["Ethernet108", "Ethernet110"],
252+
"4x25G[10G]": ["Ethernet108", "Ethernet109", "Ethernet110", "Ethernet111"]
253+
}
170254
},
171255
"Ethernet112": {
172256
"index": "29,29,29,29",
173257
"lanes": "112,113,114,115",
174-
"alias_at_lanes": "Ethernet112,Ethernet113,Ethernet114,Ethernet115",
175-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
258+
"breakout_modes": {
259+
"1x100G[40G]": ["Ethernet112"],
260+
"2x50G": ["Ethernet112", "Ethernet114"],
261+
"4x25G[10G]": ["Ethernet112", "Ethernet113", "Ethernet112", "Ethernet113"]
262+
}
176263
},
177264
"Ethernet116": {
178265
"index": "30,30,30,30",
179266
"lanes": "116,117,118,119",
180-
"alias_at_lanes": "Ethernet116,Ethernet117,Ethernet118,Ethernet119",
181-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
267+
"breakout_modes": {
268+
"1x100G[40G]": ["Ethernet116"],
269+
"2x50G": ["Ethernet116", "Ethernet118"],
270+
"4x25G[10G]": ["Ethernet116", "Ethernet117", "Ethernet118", "Ethernet119"]
271+
}
182272
},
183273
"Ethernet120": {
184274
"index": "31,31,31,31",
185275
"lanes": "120,121,122,123",
186-
"alias_at_lanes": "Ethernet120,Ethernet121,Ethernet122,Ethernet123",
187-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
276+
"breakout_modes": {
277+
"1x100G[40G]": ["Ethernet120"],
278+
"2x50G": ["Ethernet120", "Ethernet122"],
279+
"4x25G[10G]": ["Ethernet120", "Ethernet121", "Ethernet122", "Ethernet123"]
280+
}
188281
},
189282
"Ethernet124": {
190283
"index": "32,32,32,32",
191284
"lanes": "124,125,126,127",
192-
"alias_at_lanes": "Ethernet124,Ethernet125,Ethernet126,Ethernet127",
193-
"breakout_modes": "1x100G[40G],2x50G,4x25G[10G]"
285+
"breakout_modes": {
286+
"1x100G[40G]": ["Ethernet124"],
287+
"2x50G": ["Ethernet124", "Ethernet126"],
288+
"4x25G[10G]": ["Ethernet124", "Ethernet125", "Ethernet126", "Ethernet127"]
289+
}
194290
}
195291
}
196292
}

0 commit comments

Comments
 (0)