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

Add sub port interface to config interface ip add/del #651

Merged
merged 9 commits into from
Oct 3, 2019

Conversation

wendani
Copy link
Contributor

@wendani wendani commented Sep 18, 2019

- What I did
Implement HLD sonic-net/SONiC#420

- How I did it

- How to verify it
On mlnx dut

default mode:

    "VLAN_SUB_INTERFACE": {
        "Ethernet64.10": {
            "admin_status": "up"
        },
        "Ethernet64.10|10.0.0.32/31": {},
        "Ethernet64.10|FC00::41/126": {}
    },
sudo config interface ip remove Ethernet64.10 10.0.0.32/31
    "VLAN_SUB_INTERFACE": {
        "Ethernet64.10": {
            "admin_status": "up"
        },
        "Ethernet64.10|FC00::41/126": {}
    },
sudo config interface ip remove Ethernet64.10 FC00::41/126

VLAN_SUB_INTERFACE table is removed from CONFIG_DB

sudo config interface ip add Ethernet64.10 10.0.0.32/31
    "VLAN_SUB_INTERFACE": {
        "Ethernet64.10": {
            "admin_status": "up"
        },
        "Ethernet64.10|10.0.0.32/31": {}
    },
sudo config interface ip add Ethernet64.10 FC00::41/126
    "VLAN_SUB_INTERFACE": {
        "Ethernet64.10": {
            "admin_status": "up"
        },
        "Ethernet64.10|10.0.0.32/31": {},
        "Ethernet64.10|FC00::41/126": {}
    },

alias mode:

sudo config interface ip remove etp17.10 10.0.0.32/31 
    "VLAN_SUB_INTERFACE": {
            "Ethernet64.10": {
            "admin_status": "up"
        },
        "Ethernet64.10|FC00::41/126": {}
    },
sudo config interface ip remove etp17.10 FC00::41/126

VLAN_SUB_INTERFACE table is removed from CONFIG_DB

sudo config interface ip add etp17.10 10.0.0.32/31  
    "VLAN_SUB_INTERFACE": {
        "Ethernet64.10": {
            "admin_status": "up"
        },
        "Ethernet64.10|10.0.0.32/31": {}
    },
sudo config interface ip add etp17.10 FC00::41/126
    "VLAN_SUB_INTERFACE": {
        "Ethernet64.10": {
            "admin_status": "up"
        },
        "Ethernet64.10|10.0.0.32/31": {},
        "Ethernet64.10|FC00::41/126": {}
    },

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

-->

config_db.set_entry("INTERFACE", (interface_name, ip_addr), {"NULL": "NULL"})
config_db.set_entry("INTERFACE", interface_name, {"NULL": "NULL"})
if VLAN_SUB_INTERFACE_SEPARATOR in interface_name:
config_db.set_entry("VLAN_SUB_INTERFACE", interface_name, {"admin_status": "up"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be it is good now to just set a table_name here and use config_db.set_entry once instead of repeated lines of same code.

@wendani
Copy link
Contributor Author

wendani commented Oct 2, 2019

retest this please

@wendani wendani merged commit 7a68558 into sonic-net:master Oct 3, 2019
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.

3 participants