Skip to content

Commit

Permalink
[switchorch] Implement VXLAN src port range feature configuring (Fixes)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Yurkiv <[email protected]>
  • Loading branch information
ayurkiv-nvda committed Nov 4, 2021
1 parent f33878f commit 7b2a885
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions orchagent/switchorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SwitchOrch::SwitchOrch(DBConnector *db, vector<TableConnector>& connectors, Tabl
attr.value.s32 = SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_EPHEMERAL;
attrs.push_back(attr);

status = sai_switch_api->create_switch_tunnel(&switch_tunnel_id, gSwitchId, static_cast<uint32_t>(attrs.size()), attrs.data());
status = sai_switch_api->create_switch_tunnel(&m_switchTunnelId, gSwitchId, static_cast<uint32_t>(attrs.size()), attrs.data());

if (status != SAI_STATUS_SUCCESS)
{
Expand Down Expand Up @@ -169,7 +169,7 @@ sai_status_t SwitchOrch::setSwitchTunnelVxlanParams(swss::FieldValueTuple &val)
// Enable Vxlan src port range feauture
attr.id = SAI_SWITCH_TUNNEL_ATTR_TUNNEL_VXLAN_UDP_SPORT_MODE;
attr.value.s32 = SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_USER_DEFINED;
status = sai_switch_api->set_switch_tunnel_attribute(switch_tunnel_id, &attr);
status = sai_switch_api->set_switch_tunnel_attribute(m_switchTunnelId, &attr);

if (status != SAI_STATUS_SUCCESS)
{
Expand All @@ -194,7 +194,7 @@ sai_status_t SwitchOrch::setSwitchTunnelVxlanParams(swss::FieldValueTuple &val)
return SAI_STATUS_SUCCESS;
}

status = sai_switch_api->set_switch_tunnel_attribute(switch_tunnel_id, &attr);
status = sai_switch_api->set_switch_tunnel_attribute(m_switchTunnelId, &attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to set tunnnel switch attribute %s to %s, rv:%d", attribute.c_str(), value.c_str(), status);
Expand Down
2 changes: 1 addition & 1 deletion orchagent/switchorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SwitchOrch : public Orch
void doTask(swss::NotificationConsumer& consumer);
swss::DBConnector *m_db;
swss::Table m_switchTable;
sai_object_id_t switch_tunnel_id;
sai_object_id_t m_switchTunnelId;

// ASIC temperature sensors
std::shared_ptr<swss::DBConnector> m_stateDb = nullptr;
Expand Down

0 comments on commit 7b2a885

Please sign in to comment.