Skip to content

Commit

Permalink
[vs]: set mtu only on the physical port (#601)
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan committed Apr 12, 2020
1 parent e566f7a commit f972073
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion vslib/src/SwitchStateBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,9 @@ sai_status_t SwitchStateBase::setPort(
{
SWSS_LOG_INFO("setting new MTU: %d on %s", mtu, name.c_str());

if (vs_set_dev_mtu(name.c_str(), mtu) < 0)
std::string vname = vs_get_veth_name(name, portId);

if (vs_set_dev_mtu(vname.c_str(), mtu) < 0)
{
SWSS_LOG_ERROR("failed to set MTU on portId %s",
sai_serialize_object_id(portId).c_str());
Expand Down
2 changes: 1 addition & 1 deletion vslib/src/SwitchStateBaseHostif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ sai_status_t SwitchStateBase::vs_create_hostif_tap_interface(
SWSS_LOG_INFO("setting new MTU: %d on %s", mtu, vname.c_str());
}

vs_set_dev_mtu(name.c_str(), mtu);
vs_set_dev_mtu(vname.c_str(), mtu);

if (!hostif_create_tap_veth_forwarding(name, tapfd, obj_id))
{
Expand Down

0 comments on commit f972073

Please sign in to comment.