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

[Show | Command Reference] Add Port breakout Show Command #859

Merged
merged 5 commits into from
Jun 25, 2020

Conversation

samaity
Copy link
Contributor

@samaity samaity commented Mar 26, 2020

Signed-off-by: Sangita Maity sangitamaity0211@gmail.com

- What I did
Implemented show interface breakout sub-command to show the port capability and the current breakout mode.

Available commands are mentioned below.

show interfaces breakout --help
show interfaces breakout current-mode

- How I did it
using platform.json, hwsku.json and config-db BREAKOUT_CFG table.

- How to verify it

admin@lnos-x1-a-fab01:~$ show interfaces breakout --help
Usage: show interfaces breakout [OPTIONS] COMMAND [ARGS]...

  Show interface breakout

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  current-mode  Show interface breakout current-mode
admin@lnos-x1-a-fab01:~$ show interfaces breakout
{
    "Ethernet0": {
        "index": "1,1,1,1",
        "default_brkout_mode": "1x100G[40G]",
        "child ports": "Ethernet0",
        "child port speed": "100G",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "Current Breakout Mode": "1x100G[40G]",
        "lanes": "65,66,67,68",
        "alias_at_lanes": "Eth1/1, Eth1/2, Eth1/3, Eth1/4"
    },
    "Ethernet4": {
        "index": "2,2,2,2",
        "default_brkout_mode": "1x100G[40G]",
        "child ports": "Ethernet4,Ethernet5,Ethernet6,Ethernet7",
        "child port speed": "25G,10G,25G,25G",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "Current Breakout Mode": "4x25G",
        "lanes": "69,70,71,72",
        "alias_at_lanes": "Eth2/1, Eth2/2, Eth2/3, Eth2/4"
    },
    "Ethernet8": {
        "index": "3,3,3,3",
        "default_brkout_mode": "1x100G[40G]",
        "child ports": "Ethernet8",
        "child port speed": "100G",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "Current Breakout Mode": "1x100G[40G]",
        "lanes": "73,74,75,76",
        "alias_at_lanes": "Eth3/1, Eth3/2, Eth3/3, Eth3/4"
   },... continue
}
admin@lnos-x1-a-fab01:~$ show interfaces breakout current-mode Ethernet0
+-------------+-------------------------+
| Interface   | Current Breakout Mode   |
+=============+=========================+
| Ethernet0   | 4x25G[10G]              |
+-------------+-------------------------+
admin@lnos-x1-a-fab01:~$ show interfaces breakout current-mode
+-------------+-------------------------+
| Interface   | Current Breakout Mode   |
+=============+=========================+
| Ethernet0   | 4x25G[10G]              |
+-------------+-------------------------+
| Ethernet4   | 4x25G[10G]              |
+-------------+-------------------------+
| Ethernet8   | 4x25G[10G]              |
+-------------+-------------------------+

Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
@vasant17
Copy link
Contributor

vasant17 commented Apr 6, 2020

As discussed, lets add two more fields, breakout_interfaces, and their speeds. For example:

 "Ethernet0": {
        "index": "1,1,1,1",
        "default_brkout_mode": "4x25G[10G]",
        "lanes": "65,66,67,68",
        "brkout_mode": "4x25G[10G]",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "alias_at_lanes": "Eth1/1, Eth1/2, Eth1/3, Eth1/4"
        "breakout_interfaces": "Ethernet0, Ethernet1, Ethernet2, Ethernet3",
        "breakout_speeds": "25G, 25G, 25G, 25G"
    },

Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
@samaity
Copy link
Contributor Author

samaity commented May 7, 2020

As discussed, lets add two more fields, breakout_interfaces, and their speeds. For example:

 "Ethernet0": {
        "index": "1,1,1,1",
        "default_brkout_mode": "4x25G[10G]",
        "lanes": "65,66,67,68",
        "brkout_mode": "4x25G[10G]",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "alias_at_lanes": "Eth1/1, Eth1/2, Eth1/3, Eth1/4"
        "breakout_interfaces": "Ethernet0, Ethernet1, Ethernet2, Ethernet3",
        "breakout_speeds": "25G, 25G, 25G, 25G"
    },

Yes, updated the PR.

@jleveque jleveque self-requested a review May 28, 2020 23:56
show/main.py Outdated Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
@lgtm-com
Copy link

lgtm-com bot commented Jun 2, 2020

This pull request introduces 1 alert when merging ca30f74 into aae4f85 - view on LGTM.com

new alerts:

  • 1 for Result of integer division may be truncated

Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2020

This pull request introduces 1 alert when merging a5c71c1 into f7b7fcb - view on LGTM.com

new alerts:

  • 1 for Result of integer division may be truncated

@jleveque
Copy link
Contributor

jleveque commented Jun 5, 2020

Please fix LGTM alert

Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
@samaity
Copy link
Contributor Author

samaity commented Jun 8, 2020

Please fix LGTM alert

#done

@jleveque
Copy link
Contributor

Retest this please

@jleveque
Copy link
Contributor

Retest this please

1 similar comment
@zhenggen-xu
Copy link
Collaborator

Retest this please

@daall
Copy link
Contributor

daall commented Jun 25, 2020

retest this please

1 similar comment
@zhenggen-xu
Copy link
Collaborator

retest this please

@jleveque jleveque merged commit 90efd62 into sonic-net:master Jun 25, 2020
abdosi pushed a commit to abdosi/sonic-utilities that referenced this pull request Aug 4, 2020
)

**- What I did**
Implemented show interface breakout sub-command to show the port capability and the current breakout mode.

Available commands are mentioned below.
```
show interfaces breakout --help
show interfaces breakout current-mode
```
**- How I did it**
using platform.json, hwsku.json and config-db BREAKOUT_CFG table.

**- How to verify it**
```
admin@lnos-x1-a-fab01:~$ show interfaces breakout --help
Usage: show interfaces breakout [OPTIONS] COMMAND [ARGS]...

  Show interface breakout

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  current-mode  Show interface breakout current-mode
```
```
admin@lnos-x1-a-fab01:~$ show interfaces breakout
{
    "Ethernet0": {
        "index": "1,1,1,1",
        "default_brkout_mode": "1x100G[40G]",
        "child ports": "Ethernet0",
        "child port speed": "100G",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "Current Breakout Mode": "1x100G[40G]",
        "lanes": "65,66,67,68",
        "alias_at_lanes": "Eth1/1, Eth1/2, Eth1/3, Eth1/4"
    },
    "Ethernet4": {
        "index": "2,2,2,2",
        "default_brkout_mode": "1x100G[40G]",
        "child ports": "Ethernet4,Ethernet5,Ethernet6,Ethernet7",
        "child port speed": "25G,10G,25G,25G",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "Current Breakout Mode": "4x25G",
        "lanes": "69,70,71,72",
        "alias_at_lanes": "Eth2/1, Eth2/2, Eth2/3, Eth2/4"
    },
    "Ethernet8": {
        "index": "3,3,3,3",
        "default_brkout_mode": "1x100G[40G]",
        "child ports": "Ethernet8",
        "child port speed": "100G",
        "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]",
        "Current Breakout Mode": "1x100G[40G]",
        "lanes": "73,74,75,76",
        "alias_at_lanes": "Eth3/1, Eth3/2, Eth3/3, Eth3/4"
   },... continue
}
```
```
admin@lnos-x1-a-fab01:~$ show interfaces breakout current-mode Ethernet0
+-------------+-------------------------+
| Interface   | Current Breakout Mode   |
+=============+=========================+
| Ethernet0   | 4x25G[10G]              |
+-------------+-------------------------+
```
```
admin@lnos-x1-a-fab01:~$ show interfaces breakout current-mode
+-------------+-------------------------+
| Interface   | Current Breakout Mode   |
+=============+=========================+
| Ethernet0   | 4x25G[10G]              |
+-------------+-------------------------+
| Ethernet4   | 4x25G[10G]              |
+-------------+-------------------------+
| Ethernet8   | 4x25G[10G]              |
+-------------+-------------------------+
```


Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants