Skip to content

Commit

Permalink
Add gearbox phy device files and a new physyncd docker to support VS …
Browse files Browse the repository at this point in the history
…gearbox phy feature (#4851)

* buildimage: Add gearbox phy device files and a new physyncd docker to support VS gearbox phy feature

* scripts and configuration needed to support a second syncd docker (physyncd)
* physyncd supports gearbox device and phy SAI APIs and runs multiple instances of syncd, one per phy in the device
* support for VS target (sonic-sairedis vslib has been extended to support a virtual BCM81724 gearbox PHY).

HLD is located at https://github.com/Azure/SONiC/blob/b817a12fd89520d3fd26bbc5897487928e7f6de7/doc/gearbox/gearbox_mgr_design.md

**- Why I did it**

This work is part of the gearbox phy joint effort between Microsoft and Broadcom, and is based
on multi-switch support in sonic-sairedis.

**- How I did it**

Overall feature was implemented across several projects. The collective pull requests (some in late stages of review at this point):

sonic-net/sonic-utilities#931 - CLI (merged)
sonic-net/sonic-swss-common#347 - Minor changes (merged)
sonic-net/sonic-swss#1321 - gearsyncd, config parsers, changes to orchargent to create gearbox phy on supported systems
sonic-net/sonic-sairedis#624 - physyncd, virtual BCM81724 gearbox phy added to vslib

**- How to verify it**

In a vslib build:

root@sonic:/home/admin# show gearbox interfaces status
  PHY Id    Interface        MAC Lanes    MAC Lane Speed        PHY Lanes    PHY Lane Speed    Line Lanes    Line Lane Speed    Oper    Admin
--------  -----------  ---------------  ----------------  ---------------  ----------------  ------------  -----------------  ------  -------
       1   Ethernet48  121,122,123,124               25G  200,201,202,203               25G       204,205                50G    down     down
       1   Ethernet49  125,126,127,128               25G  206,207,208,209               25G       210,211                50G    down     down
       1   Ethernet50      69,70,71,72               25G  212,213,214,215               25G           216               100G    down     down

In addition, docker ps | grep phy should show a physyncd docker running.

  Signed-off-by: syd.logan@broadcom.com
  • Loading branch information
sydlogan committed Sep 25, 2020
1 parent 584e222 commit 0311a4a
Show file tree
Hide file tree
Showing 33 changed files with 1,639 additions and 117 deletions.
88 changes: 88 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Changing the virtual device

You can control the hw sku and default factory configuration for the VS image
by modifying the content of the file default_sku in this directory.

The format of default_sku is a single line:

```
<hw_key> <default_preset>
```

## Allowable values for hw_key

| hw_key | Device |
| ------ | ------ |
| Force10-S6000 | Dell Force10 S6000|
| brcm_gearbox_vs | Similar to Force10-S6000, but implements a virtual BRCM81724 Gearbox Phy |

## Allowable values for default_preset

These include "t1", "l2", and "empty". See the file
sonic-buildimage/src/sonic-config-engine/config_samples.py for details on how
each default_preset value is interpreted.

# Changing the hwsku of an existing VS switch

To change the default hwsku for a VS image that has already been built and installed, follow these steps:

- Edit /usr/share/sonic/device/x86_64-kvm_x86_64-r0/default_sku. For details, see the section below (Device Specific Documentation)
- Edit /etc/sonic/config_db.json, and change the "hwsku" key in DEVICE_METADATA:localhost to match the hw_key used in default_sku. Example:

"DEVICE_METADATA": {
"localhost": {
...
"hwsku": "brcm_gearbox_vs",
...
}
},
...
- Reboot the switch
- Use "show platform summary" to verify, and follow any steps specific to the platform, as needed, such as those described below for the brcm_gearbox_vs hwsku.

# Device Specific Documentation

For general info on building, see https://github.com/Azure/sonic-buildimage/blob/master/README.md

## Force-10-S6000

This is the default VS for SONiC. To enable, set contents of default_sku to:

```
Force10-S6000 t1
```

To build:

```
make init
make configure PLATFORM=vs
make target/sonic-vs.img.gz
```

## brcm_gearbox_vs

This sku simulates a device with a Broadcom BRCM81724 gearbox PHY. To enable,
set default_sku to:


```
brcm_gearbox_vs t1
```

To build (same as Force-10-S6000):

```
make init
make configure PLATFORM=vs
make target/sonic-vs.img.gz
```

To verify, install and bring up SONiC. There will be a new gbsyncd docker
which is designed to respond to configuration directed towards the gearbox phy
"switch". swss will create that gearbox switch on startup after detecting the
gearbox is present (this is done by a short lived gearsyncd that runs in the
swss docker).

The commands "show gearbox interfaces status" and "show gearbox phys status" can be
used to verify the virtual gearbox phy has been created. See https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md#gearbox for details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%- set default_topo = 't1' %}
{%- include 'buffers_config.j2' %}

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{%- set default_cable = '300m' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
{% for port_idx in range(0,32) %}
{% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %}
{% endfor %}
{%- endmacro %}

{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "12766208",
"type": "ingress",
"mode": "dynamic"
},
"egress_lossless_pool": {
"size": "12766208",
"type": "egress",
"mode": "static"
},
"egress_lossy_pool": {
"size": "7326924",
"type": "egress",
"mode": "dynamic"
}
},
"BUFFER_PROFILE": {
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"0",
"static_th":"12766208"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{%- set default_cable = '300m' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
{% for port_idx in range(0,32) %}
{% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %}
{% endfor %}
{%- endmacro %}

{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "12766208",
"type": "ingress",
"mode": "dynamic"
},
"egress_lossless_pool": {
"size": "12766208",
"type": "egress",
"mode": "static"
},
"egress_lossy_pool": {
"size": "7326924",
"type": "egress",
"mode": "dynamic"
}
},
"BUFFER_PROFILE": {
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"0",
"static_th":"12766208"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{%- set default_cable = '300m' %}

{%- macro generate_port_lists(PORT_ALL) %}
{# Generate list of ports #}
{% for port_idx in range(0,32) %}
{% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %}
{% endfor %}
{%- endmacro %}

{%- macro generate_buffer_pool_and_profiles() %}
"BUFFER_POOL": {
"ingress_lossless_pool": {
"size": "12766208",
"type": "ingress",
"mode": "dynamic"
},
"egress_lossless_pool": {
"size": "12766208",
"type": "egress",
"mode": "static"
},
"egress_lossy_pool": {
"size": "7326924",
"type": "egress",
"mode": "dynamic"
}
},
"BUFFER_PROFILE": {
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"0",
"static_th":"12766208"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"CONTEXTS": [
{
"guid" : 0,
"name" : "sw0",
"dbAsic" : "ASIC_DB",
"dbCounters" : "COUNTERS_DB",
"dbFlex": "FLEX_COUNTER_DB",
"dbState" : "STATE_DB",
"switches": [
{
"index" : 0,
"hwinfo" : ""
}
]
},
{
"guid" : 1,
"name" : "phy1",
"dbAsic" : "GB_ASIC_DB",
"dbCounters" : "GB_COUNTERS_DB",
"dbFlex": "GB_FLEX_COUNTER_DB",
"dbState" : "STATE_DB",
"switches": [
{
"index" : 1,
"hwinfo" : ""
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"phys": [
{
"phy_id": 1,
"name": "sesto-1",
"address": "0x1000",
"lib_name": "libsai_phy_sesto-1.so",
"firmware_path": "/tmp/phy-sesto-1.bin",
"config_file": "/usr/share/sonic/hwsku/phy1_config_1.json",
"sai_init_config_file": "/usr/share/sonic/hwsku/sesto-1.bcm",
"phy_access": "mdio",
"bus_id": 0
}
],
"interfaces": [
{
"name": "Ethernet0",
"index": 0,
"phy_id" : 1,
"system_lanes": [200,201],
"line_lanes": [206]
},
{
"name": "Ethernet4",
"index": 1,
"phy_id" : 1,
"system_lanes": [202,203],
"line_lanes": [207]
},
{
"name": "Ethernet8",
"index": 2,
"phy_id" : 1,
"system_lanes": [204,205],
"line_lanes": [208]
}
]
}
32 changes: 32 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/brcm_gearbox_vs/lanemap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
eth1:25,26,27,28
eth2:29,30,31,32
eth3:33,34,35,36
eth4:37,38,39,40
eth5:45,46,47,48
eth6:41,42,43,44
eth7:1,2,3,4
eth8:5,6,7,8
eth9:13,14,15,16
eth10:9,10,11,12
eth11:17,18,19,20
eth12:21,22,23,24
eth13:53,54,55,56
eth14:49,50,51,52
eth15:57,58,59,60
eth16:61,62,63,64
eth17:69,70,71,72
eth18:65,66,67,68
eth19:73,74,75,76
eth20:77,78,79,80
eth21:109,110,111,112
eth22:105,106,107,108
eth23:113,114,115,116
eth24:117,118,119,120
eth25:125,126,127,128
eth26:121,122,123,124
eth27:81,82,83,84
eth28:85,86,87,88
eth29:93,94,95,96
eth30:89,90,91,92
eth31:101,102,103,104
eth32:97,98,99,100
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PG lossless profiles.
# speed cable size xon xoff threshold xon_offset
10000 5m 56368 18432 55120 -3 2496
25000 5m 56368 18432 55120 -3 2496
40000 5m 56368 18432 55120 -3 2496
50000 5m 56368 18432 55120 -3 2496
100000 5m 56368 18432 55120 -3 2496
10000 40m 56368 18432 55120 -3 2496
25000 40m 56368 18432 55120 -3 2496
40000 40m 56368 18432 55120 -3 2496
50000 40m 56368 18432 55120 -3 2496
100000 40m 56368 18432 55120 -3 2496
10000 300m 56368 18432 55120 -3 2496
25000 300m 56368 18432 55120 -3 2496
40000 300m 56368 18432 55120 -3 2496
50000 300m 56368 18432 55120 -3 2496
100000 300m 56368 18432 55120 -3 2496
Loading

0 comments on commit 0311a4a

Please sign in to comment.