Skip to content

Commit

Permalink
[vslib] add missing port attributes for virtual switch (#419)
Browse files Browse the repository at this point in the history
- add default port admin state attribute
 - add default port mtu attribute

Signed-off-by: Stepan Blyschak <[email protected]>
  • Loading branch information
stepanblyschak authored and lguohan committed Feb 15, 2019
1 parent dcc8688 commit 2b91013
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ mlnx
mpls
mutex
mutexes
MTU
namespace
namespaces
NHG
Expand Down
10 changes: 10 additions & 0 deletions vslib/src/sai_vs_switch_BCM56850.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ static sai_status_t create_ports()

sai_attribute_t attr;

attr.id = SAI_PORT_ATTR_ADMIN_STATE;
attr.value.booldata = false; /* default admin state is down as defined in SAI */

CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));

attr.id = SAI_PORT_ATTR_MTU;
attr.value.u32 = 1514; /* default MTU is 1514 as defined in SAI */

CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));

attr.id = SAI_PORT_ATTR_SPEED;
attr.value.u32 = 10 * 1000;

Expand Down
10 changes: 10 additions & 0 deletions vslib/src/sai_vs_switch_MLNX2700.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ static sai_status_t create_ports()

sai_attribute_t attr;

attr.id = SAI_PORT_ATTR_ADMIN_STATE;
attr.value.booldata = false; /* default admin state is down as defined in SAI */

CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));

attr.id = SAI_PORT_ATTR_MTU;
attr.value.u32 = 1514; /* default MTU is 1514 as defined in SAI */

CHECK_STATUS(vs_generic_set(SAI_OBJECT_TYPE_PORT, port_id, &attr));

attr.id = SAI_PORT_ATTR_SPEED;
attr.value.u32 = 40 * 1000; /* TODO from config */

Expand Down

0 comments on commit 2b91013

Please sign in to comment.