Skip to content

Commit

Permalink
Revert "Align default MTU value as SAI default (#705)" (#710)
Browse files Browse the repository at this point in the history
This reverts commit 836a58c.
  • Loading branch information
lguohan authored and prsunny committed Nov 28, 2018
1 parent 836a58c commit 2d7ab0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
7 changes: 1 addition & 6 deletions orchagent/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ extern "C" {
#include <map>

#define DEFAULT_PORT_VLAN_ID 1
/*
* Default MTU is derived from SAI_PORT_ATTR_MTU (1514)
* Orchagent adds extra 22 bytes for Ethernet header and FCS,
* hence setting to 1492 (1514 - 22)
*/
#define DEFAULT_MTU 1492
#define DEFAULT_MTU 9100

namespace swss {

Expand Down
8 changes: 4 additions & 4 deletions tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_InterfaceAddRemoveIpv6Address(self, dvs, testlog):
for fv in fvs:
if fv[0] == "SAI_ROUTER_INTERFACE_ATTR_TYPE":
assert fv[1] == "SAI_ROUTER_INTERFACE_TYPE_PORT"
# the default MTU without any configuration is 9100, set by portmgr
# the default MTU without any configuration is 9100
if fv[0] == "SAI_ROUTER_INTERFACE_ATTR_MTU":
assert fv[1] == "9100"

Expand Down Expand Up @@ -146,7 +146,7 @@ def test_InterfaceAddRemoveIpv4Address(self, dvs, testlog):
for fv in fvs:
if fv[0] == "SAI_ROUTER_INTERFACE_ATTR_TYPE":
assert fv[1] == "SAI_ROUTER_INTERFACE_TYPE_PORT"
# the default MTU without any configuration is 9100, set by portmgr
# the default MTU without any configuration is 9100
if fv[0] == "SAI_ROUTER_INTERFACE_ATTR_MTU":
assert fv[1] == "9100"

Expand Down Expand Up @@ -296,9 +296,9 @@ def test_InterfaceAddRemoveIpv4Address(self, dvs, testlog):
for fv in fvs:
if fv[0] == "SAI_ROUTER_INTERFACE_ATTR_TYPE":
assert fv[1] == "SAI_ROUTER_INTERFACE_TYPE_PORT"
# the default MTU without any configuration is 1492
# the default MTU without any configuration is 9100
if fv[0] == "SAI_ROUTER_INTERFACE_ATTR_MTU":
assert fv[1] == "1492"
assert fv[1] == "9100"

# check ASIC route database
tbl = swsscommon.Table(self.adb, "ASIC_STATE:SAI_OBJECT_TYPE_ROUTE_ENTRY")
Expand Down
3 changes: 1 addition & 2 deletions tests/test_vnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,15 +477,14 @@ def check_router_interface(self, dvs, name, vlan_oid=0):
expected_attr = {
"SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID": self.vr_map[name].get('ing'),
"SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS": switch_mac,
"SAI_ROUTER_INTERFACE_ATTR_MTU": "1492",
"SAI_ROUTER_INTERFACE_ATTR_MTU": "9100",
}

if vlan_oid:
expected_attr.update({'SAI_ROUTER_INTERFACE_ATTR_TYPE': 'SAI_ROUTER_INTERFACE_TYPE_VLAN'})
expected_attr.update({'SAI_ROUTER_INTERFACE_ATTR_VLAN_ID': vlan_oid})
else:
expected_attr.update({'SAI_ROUTER_INTERFACE_ATTR_TYPE': 'SAI_ROUTER_INTERFACE_TYPE_PORT'})
expected_attr.update({'SAI_ROUTER_INTERFACE_ATTR_MTU': '9100'})

new_rif = get_created_entry(asic_db, self.ASIC_RIF_TABLE, self.rifs)
check_object(asic_db, self.ASIC_RIF_TABLE, new_rif, expected_attr)
Expand Down

0 comments on commit 2d7ab0c

Please sign in to comment.