From 2b91013985755e5bcdc6dd9322fbdd497652a097 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Fri, 15 Feb 2019 03:28:41 +0200 Subject: [PATCH] [vslib] add missing port attributes for virtual switch (#419) - add default port admin state attribute - add default port mtu attribute Signed-off-by: Stepan Blyschak --- tests/aspell.en.pws | 1 + vslib/src/sai_vs_switch_BCM56850.cpp | 10 ++++++++++ vslib/src/sai_vs_switch_MLNX2700.cpp | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/tests/aspell.en.pws b/tests/aspell.en.pws index 4f7206f73161..7a09c518ed70 100644 --- a/tests/aspell.en.pws +++ b/tests/aspell.en.pws @@ -107,6 +107,7 @@ mlnx mpls mutex mutexes +MTU namespace namespaces NHG diff --git a/vslib/src/sai_vs_switch_BCM56850.cpp b/vslib/src/sai_vs_switch_BCM56850.cpp index 1cdc1361115d..2be407505689 100644 --- a/vslib/src/sai_vs_switch_BCM56850.cpp +++ b/vslib/src/sai_vs_switch_BCM56850.cpp @@ -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; diff --git a/vslib/src/sai_vs_switch_MLNX2700.cpp b/vslib/src/sai_vs_switch_MLNX2700.cpp index 47a9692469ad..6f3aef294d5d 100644 --- a/vslib/src/sai_vs_switch_MLNX2700.cpp +++ b/vslib/src/sai_vs_switch_MLNX2700.cpp @@ -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 */