Skip to content

Commit 3737781

Browse files
sydlogansanthosh-kt
authored andcommitted
Add gearbox phy device files and a new physyncd docker to support VS gearbox phy feature (sonic-net#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
1 parent 0fa706b commit 3737781

33 files changed

+1639
-117
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Changing the virtual device
2+
3+
You can control the hw sku and default factory configuration for the VS image
4+
by modifying the content of the file default_sku in this directory.
5+
6+
The format of default_sku is a single line:
7+
8+
```
9+
<hw_key> <default_preset>
10+
```
11+
12+
## Allowable values for hw_key
13+
14+
| hw_key | Device |
15+
| ------ | ------ |
16+
| Force10-S6000 | Dell Force10 S6000|
17+
| brcm_gearbox_vs | Similar to Force10-S6000, but implements a virtual BRCM81724 Gearbox Phy |
18+
19+
## Allowable values for default_preset
20+
21+
These include "t1", "l2", and "empty". See the file
22+
sonic-buildimage/src/sonic-config-engine/config_samples.py for details on how
23+
each default_preset value is interpreted.
24+
25+
# Changing the hwsku of an existing VS switch
26+
27+
To change the default hwsku for a VS image that has already been built and installed, follow these steps:
28+
29+
- Edit /usr/share/sonic/device/x86_64-kvm_x86_64-r0/default_sku. For details, see the section below (Device Specific Documentation)
30+
- 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:
31+
32+
"DEVICE_METADATA": {
33+
"localhost": {
34+
...
35+
"hwsku": "brcm_gearbox_vs",
36+
...
37+
}
38+
},
39+
...
40+
- Reboot the switch
41+
- 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.
42+
43+
# Device Specific Documentation
44+
45+
For general info on building, see https://github.com/Azure/sonic-buildimage/blob/master/README.md
46+
47+
## Force-10-S6000
48+
49+
This is the default VS for SONiC. To enable, set contents of default_sku to:
50+
51+
```
52+
Force10-S6000 t1
53+
```
54+
55+
To build:
56+
57+
```
58+
make init
59+
make configure PLATFORM=vs
60+
make target/sonic-vs.img.gz
61+
```
62+
63+
## brcm_gearbox_vs
64+
65+
This sku simulates a device with a Broadcom BRCM81724 gearbox PHY. To enable,
66+
set default_sku to:
67+
68+
69+
```
70+
brcm_gearbox_vs t1
71+
```
72+
73+
To build (same as Force-10-S6000):
74+
75+
```
76+
make init
77+
make configure PLATFORM=vs
78+
make target/sonic-vs.img.gz
79+
```
80+
81+
To verify, install and bring up SONiC. There will be a new gbsyncd docker
82+
which is designed to respond to configuration directed towards the gearbox phy
83+
"switch". swss will create that gearbox switch on startup after detecting the
84+
gearbox is present (this is done by a short lived gearsyncd that runs in the
85+
swss docker).
86+
87+
The commands "show gearbox interfaces status" and "show gearbox phys status" can be
88+
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 numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set default_topo = 't1' %}
2+
{%- include 'buffers_config.j2' %}
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{%- set default_cable = '300m' %}
2+
3+
{%- macro generate_port_lists(PORT_ALL) %}
4+
{# Generate list of ports #}
5+
{% for port_idx in range(0,32) %}
6+
{% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %}
7+
{% endfor %}
8+
{%- endmacro %}
9+
10+
{%- macro generate_buffer_pool_and_profiles() %}
11+
"BUFFER_POOL": {
12+
"ingress_lossless_pool": {
13+
"size": "12766208",
14+
"type": "ingress",
15+
"mode": "dynamic"
16+
},
17+
"egress_lossless_pool": {
18+
"size": "12766208",
19+
"type": "egress",
20+
"mode": "static"
21+
},
22+
"egress_lossy_pool": {
23+
"size": "7326924",
24+
"type": "egress",
25+
"mode": "dynamic"
26+
}
27+
},
28+
"BUFFER_PROFILE": {
29+
"ingress_lossy_profile": {
30+
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
31+
"size":"0",
32+
"dynamic_th":"3"
33+
},
34+
"egress_lossless_profile": {
35+
"pool":"[BUFFER_POOL|egress_lossless_pool]",
36+
"size":"0",
37+
"static_th":"12766208"
38+
},
39+
"egress_lossy_profile": {
40+
"pool":"[BUFFER_POOL|egress_lossy_pool]",
41+
"size":"1518",
42+
"dynamic_th":"3"
43+
}
44+
},
45+
{%- endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{%- set default_cable = '300m' %}
2+
3+
{%- macro generate_port_lists(PORT_ALL) %}
4+
{# Generate list of ports #}
5+
{% for port_idx in range(0,32) %}
6+
{% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %}
7+
{% endfor %}
8+
{%- endmacro %}
9+
10+
{%- macro generate_buffer_pool_and_profiles() %}
11+
"BUFFER_POOL": {
12+
"ingress_lossless_pool": {
13+
"size": "12766208",
14+
"type": "ingress",
15+
"mode": "dynamic"
16+
},
17+
"egress_lossless_pool": {
18+
"size": "12766208",
19+
"type": "egress",
20+
"mode": "static"
21+
},
22+
"egress_lossy_pool": {
23+
"size": "7326924",
24+
"type": "egress",
25+
"mode": "dynamic"
26+
}
27+
},
28+
"BUFFER_PROFILE": {
29+
"ingress_lossy_profile": {
30+
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
31+
"size":"0",
32+
"dynamic_th":"3"
33+
},
34+
"egress_lossless_profile": {
35+
"pool":"[BUFFER_POOL|egress_lossless_pool]",
36+
"size":"0",
37+
"static_th":"12766208"
38+
},
39+
"egress_lossy_profile": {
40+
"pool":"[BUFFER_POOL|egress_lossy_pool]",
41+
"size":"1518",
42+
"dynamic_th":"3"
43+
}
44+
},
45+
{%- endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{%- set default_cable = '300m' %}
2+
3+
{%- macro generate_port_lists(PORT_ALL) %}
4+
{# Generate list of ports #}
5+
{% for port_idx in range(0,32) %}
6+
{% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %}
7+
{% endfor %}
8+
{%- endmacro %}
9+
10+
{%- macro generate_buffer_pool_and_profiles() %}
11+
"BUFFER_POOL": {
12+
"ingress_lossless_pool": {
13+
"size": "12766208",
14+
"type": "ingress",
15+
"mode": "dynamic"
16+
},
17+
"egress_lossless_pool": {
18+
"size": "12766208",
19+
"type": "egress",
20+
"mode": "static"
21+
},
22+
"egress_lossy_pool": {
23+
"size": "7326924",
24+
"type": "egress",
25+
"mode": "dynamic"
26+
}
27+
},
28+
"BUFFER_PROFILE": {
29+
"ingress_lossy_profile": {
30+
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
31+
"size":"0",
32+
"dynamic_th":"3"
33+
},
34+
"egress_lossless_profile": {
35+
"pool":"[BUFFER_POOL|egress_lossless_pool]",
36+
"size":"0",
37+
"static_th":"12766208"
38+
},
39+
"egress_lossy_profile": {
40+
"pool":"[BUFFER_POOL|egress_lossy_pool]",
41+
"size":"1518",
42+
"dynamic_th":"3"
43+
}
44+
},
45+
{%- endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"CONTEXTS": [
3+
{
4+
"guid" : 0,
5+
"name" : "sw0",
6+
"dbAsic" : "ASIC_DB",
7+
"dbCounters" : "COUNTERS_DB",
8+
"dbFlex": "FLEX_COUNTER_DB",
9+
"dbState" : "STATE_DB",
10+
"switches": [
11+
{
12+
"index" : 0,
13+
"hwinfo" : ""
14+
}
15+
]
16+
},
17+
{
18+
"guid" : 1,
19+
"name" : "phy1",
20+
"dbAsic" : "GB_ASIC_DB",
21+
"dbCounters" : "GB_COUNTERS_DB",
22+
"dbFlex": "GB_FLEX_COUNTER_DB",
23+
"dbState" : "STATE_DB",
24+
"switches": [
25+
{
26+
"index" : 1,
27+
"hwinfo" : ""
28+
}
29+
]
30+
}
31+
]
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"phys": [
3+
{
4+
"phy_id": 1,
5+
"name": "sesto-1",
6+
"address": "0x1000",
7+
"lib_name": "libsai_phy_sesto-1.so",
8+
"firmware_path": "/tmp/phy-sesto-1.bin",
9+
"config_file": "/usr/share/sonic/hwsku/phy1_config_1.json",
10+
"sai_init_config_file": "/usr/share/sonic/hwsku/sesto-1.bcm",
11+
"phy_access": "mdio",
12+
"bus_id": 0
13+
}
14+
],
15+
"interfaces": [
16+
{
17+
"name": "Ethernet0",
18+
"index": 0,
19+
"phy_id" : 1,
20+
"system_lanes": [200,201],
21+
"line_lanes": [206]
22+
},
23+
{
24+
"name": "Ethernet4",
25+
"index": 1,
26+
"phy_id" : 1,
27+
"system_lanes": [202,203],
28+
"line_lanes": [207]
29+
},
30+
{
31+
"name": "Ethernet8",
32+
"index": 2,
33+
"phy_id" : 1,
34+
"system_lanes": [204,205],
35+
"line_lanes": [208]
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
eth1:25,26,27,28
2+
eth2:29,30,31,32
3+
eth3:33,34,35,36
4+
eth4:37,38,39,40
5+
eth5:45,46,47,48
6+
eth6:41,42,43,44
7+
eth7:1,2,3,4
8+
eth8:5,6,7,8
9+
eth9:13,14,15,16
10+
eth10:9,10,11,12
11+
eth11:17,18,19,20
12+
eth12:21,22,23,24
13+
eth13:53,54,55,56
14+
eth14:49,50,51,52
15+
eth15:57,58,59,60
16+
eth16:61,62,63,64
17+
eth17:69,70,71,72
18+
eth18:65,66,67,68
19+
eth19:73,74,75,76
20+
eth20:77,78,79,80
21+
eth21:109,110,111,112
22+
eth22:105,106,107,108
23+
eth23:113,114,115,116
24+
eth24:117,118,119,120
25+
eth25:125,126,127,128
26+
eth26:121,122,123,124
27+
eth27:81,82,83,84
28+
eth28:85,86,87,88
29+
eth29:93,94,95,96
30+
eth30:89,90,91,92
31+
eth31:101,102,103,104
32+
eth32:97,98,99,100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# PG lossless profiles.
2+
# speed cable size xon xoff threshold xon_offset
3+
10000 5m 56368 18432 55120 -3 2496
4+
25000 5m 56368 18432 55120 -3 2496
5+
40000 5m 56368 18432 55120 -3 2496
6+
50000 5m 56368 18432 55120 -3 2496
7+
100000 5m 56368 18432 55120 -3 2496
8+
10000 40m 56368 18432 55120 -3 2496
9+
25000 40m 56368 18432 55120 -3 2496
10+
40000 40m 56368 18432 55120 -3 2496
11+
50000 40m 56368 18432 55120 -3 2496
12+
100000 40m 56368 18432 55120 -3 2496
13+
10000 300m 56368 18432 55120 -3 2496
14+
25000 300m 56368 18432 55120 -3 2496
15+
40000 300m 56368 18432 55120 -3 2496
16+
50000 300m 56368 18432 55120 -3 2496
17+
100000 300m 56368 18432 55120 -3 2496

0 commit comments

Comments
 (0)