Skip to content

Commit 2b91013

Browse files
stepanblyschaklguohan
authored andcommitted
[vslib] add missing port attributes for virtual switch (sonic-net#419)
- add default port admin state attribute - add default port mtu attribute Signed-off-by: Stepan Blyschak <[email protected]>
1 parent dcc8688 commit 2b91013

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

tests/aspell.en.pws

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ mlnx
107107
mpls
108108
mutex
109109
mutexes
110+
MTU
110111
namespace
111112
namespaces
112113
NHG

vslib/src/sai_vs_switch_BCM56850.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ static sai_status_t create_ports()
169169

170170
sai_attribute_t attr;
171171

172+
attr.id = SAI_PORT_ATTR_ADMIN_STATE;
173+
attr.value.booldata = false; /* default admin state is down as defined in SAI */
174+
175+
CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));
176+
177+
attr.id = SAI_PORT_ATTR_MTU;
178+
attr.value.u32 = 1514; /* default MTU is 1514 as defined in SAI */
179+
180+
CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));
181+
172182
attr.id = SAI_PORT_ATTR_SPEED;
173183
attr.value.u32 = 10 * 1000;
174184

vslib/src/sai_vs_switch_MLNX2700.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ static sai_status_t create_ports()
166166

167167
sai_attribute_t attr;
168168

169+
attr.id = SAI_PORT_ATTR_ADMIN_STATE;
170+
attr.value.booldata = false; /* default admin state is down as defined in SAI */
171+
172+
CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));
173+
174+
attr.id = SAI_PORT_ATTR_MTU;
175+
attr.value.u32 = 1514; /* default MTU is 1514 as defined in SAI */
176+
177+
CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));
178+
169179
attr.id = SAI_PORT_ATTR_SPEED;
170180
attr.value.u32 = 40 * 1000; /* TODO from config */
171181

0 commit comments

Comments
 (0)