From 5450811372aba75e2b01b673144dcc4c983e13e5 Mon Sep 17 00:00:00 2001 From: jfeng-arista <98421150+jfeng-arista@users.noreply.github.com> Date: Sun, 8 Oct 2023 15:12:20 -0700 Subject: [PATCH] Add fabric ports related calls for vs tests. (#1301) Add fabric ports related calls for vs tests. This is the preparation for adding vs test for fabric daemon ( sonic-net/sonic-swss#2920 ) --- vslib/SwitchStateBase.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vslib/SwitchStateBase.cpp b/vslib/SwitchStateBase.cpp index c4fa76cf0..3e19b45a6 100644 --- a/vslib/SwitchStateBase.cpp +++ b/vslib/SwitchStateBase.cpp @@ -2382,6 +2382,9 @@ sai_status_t SwitchStateBase::refresh_read_only( return SAI_STATUS_SUCCESS; case SAI_PORT_ATTR_FABRIC_ATTACHED: + case SAI_PORT_ATTR_FABRIC_ATTACHED_SWITCH_ID: + case SAI_PORT_ATTR_FABRIC_ATTACHED_PORT_INDEX: + case SAI_PORT_ATTR_HW_LANE_LIST: return SAI_STATUS_SUCCESS; case SAI_PORT_ATTR_PORT_SERDES_ID: @@ -3429,7 +3432,7 @@ sai_status_t SwitchStateBase::create_fabric_ports() sai_attribute_t attr; attr.id = SAI_PORT_ATTR_FABRIC_ATTACHED; - attr.value.booldata = false; + attr.value.booldata = true; CHECK_STATUS(set(SAI_OBJECT_TYPE_PORT, fabric_port_id, &attr)); @@ -3445,6 +3448,14 @@ sai_status_t SwitchStateBase::create_fabric_ports() attr.value.s32 = SAI_PORT_TYPE_FABRIC; CHECK_STATUS(set(SAI_OBJECT_TYPE_PORT, fabric_port_id, &attr)); + + attr.id = SAI_PORT_ATTR_FABRIC_ATTACHED_SWITCH_ID; + attr.value.s32 = i; + CHECK_STATUS(set(SAI_OBJECT_TYPE_PORT, fabric_port_id, &attr)); + + attr.id = SAI_PORT_ATTR_FABRIC_ATTACHED_PORT_INDEX; + attr.value.s32 = i; + CHECK_STATUS(set(SAI_OBJECT_TYPE_PORT, fabric_port_id, &attr)); } return SAI_STATUS_SUCCESS;