Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[subintf] Fix kernel mtu inheritance from parent #1874

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

wendani
Copy link
Contributor

@wendani wendani commented Aug 13, 2021

Why I did it

Sub port interface inherits mtu from parent port. This should hold for both kernel and SAI/ASIC.

At kernel side, decreasing parent port mtu, sub port interface mtu will decrease accordingly. However, this is not true in the reverse direction: Increasing parent port mtu, sub port interface mtu will not increase automatically. Treatment from user software, specifically, intfmgrd, is therefore needed to fill the gap for mtu inheritance from parent port.

The SAI/ASIC side mtu of sub port interface is not affected by this PR.

What I did
Have IntfMgr subscribe to CONFIG PORT and LAG table to listen to parent port mtu change, and set the corresponding mtu value to sub port interface in kernel.

Because the operation of parent port mtu change is issued from portmgrd or teammgrd, which is a separate process from intfmgrd, sub port interface mtu increase may occur before its parent port mtu increase is processed by the corresponding process. In such a case, ip link command will fail (as sub port interface mtu cannot be larger than that of its parent), and we leverage doTask retry logic to ensure that the sub port interface mtu increase will succeed ultimately.

How I verified it
vs test

Parent port mtu change: 9100 -> 8888 -> 6666 -> 7777 -> 9100. For every mtu change, check sub port interface mtu at both kernel and SAI/ASIC.

Details if related

Contains #1873, which lays the common foundation.

vs test failure message without the fix in this PR. Failure on line 1229:

========================================================================= FAILURES ==========================================================================
__________________________________________________________ TestSubPortIntf.test_sub_port_intf_mtu ___________________________________________________________

self = <test_sub_port_intf.TestSubPortIntf object at 0x7f3d0f5c20b8>, dvs = <conftest.DockerVirtualSwitch object at 0x7f3d0f76ae80>

    def test_sub_port_intf_mtu(self, dvs):
        self.connect_dbs(dvs)
    
>       self._test_sub_port_intf_mtu(dvs, self.SUB_PORT_INTERFACE_UNDER_TEST)

test_sub_port_intf.py:1268: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_sub_port_intf.py:1229: in _test_sub_port_intf_mtu
    self.check_sub_port_intf_mtu_kernel(dvs, sub_port_intf_name, mtu)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <test_sub_port_intf.TestSubPortIntf object at 0x7f3d0f5c20b8>, dvs = <conftest.DockerVirtualSwitch object at 0x7f3d0f76ae80>
port_name = 'Ethernet64.10', mtu = '7777'

    def check_sub_port_intf_mtu_kernel(self, dvs, port_name, mtu):
        (ec, out) = dvs.runcmd(['bash', '-c', "ip link show {} | grep 'mtu {}'".format(port_name, mtu)])
>       assert ec == 0
E       assert 1 == 0
E         +1
E         -0

test_sub_port_intf.py:328: AssertionError
================================================================== short test summary info ==================================================================
FAILED test_sub_port_intf.py::TestSubPortIntf::test_sub_port_intf_mtu - assert 1 == 0
=============================================================== 1 failed in 67.38s (0:01:07) ================================================================

wendani added 12 commits August 11, 2021 08:10
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
up

Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
@wendani wendani requested a review from prsunny as a code owner August 13, 2021 09:13
@wendani wendani changed the title [subinf] Fix kernel mtu inheritance from parent [subintf] Fix kernel mtu inheritance from parent Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant