Skip to content

Commit

Permalink
Add fabric ports related calls for vs tests. (#1301)
Browse files Browse the repository at this point in the history
Add fabric ports related calls for vs tests.

This is the preparation for adding vs test for fabric daemon ( sonic-net/sonic-swss#2920 )
  • Loading branch information
jfeng-arista authored Oct 8, 2023
1 parent 9263397 commit 5450811
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion vslib/SwitchStateBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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));

Expand All @@ -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;
Expand Down

0 comments on commit 5450811

Please sign in to comment.