Skip to content

Commit f972073

Browse files
authored
[vs]: set mtu only on the physical port (#601)
Signed-off-by: Guohan Lu <[email protected]>
1 parent e566f7a commit f972073

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

vslib/src/SwitchStateBase.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,9 @@ sai_status_t SwitchStateBase::setPort(
403403
{
404404
SWSS_LOG_INFO("setting new MTU: %d on %s", mtu, name.c_str());
405405

406-
if (vs_set_dev_mtu(name.c_str(), mtu) < 0)
406+
std::string vname = vs_get_veth_name(name, portId);
407+
408+
if (vs_set_dev_mtu(vname.c_str(), mtu) < 0)
407409
{
408410
SWSS_LOG_ERROR("failed to set MTU on portId %s",
409411
sai_serialize_object_id(portId).c_str());

vslib/src/SwitchStateBaseHostif.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ sai_status_t SwitchStateBase::vs_create_hostif_tap_interface(
656656
SWSS_LOG_INFO("setting new MTU: %d on %s", mtu, vname.c_str());
657657
}
658658

659-
vs_set_dev_mtu(name.c_str(), mtu);
659+
vs_set_dev_mtu(vname.c_str(), mtu);
660660

661661
if (!hostif_create_tap_veth_forwarding(name, tapfd, obj_id))
662662
{

0 commit comments

Comments
 (0)