Skip to content

Commit

Permalink
Add support for PoE feature
Browse files Browse the repository at this point in the history
Add target for poesyncd container
Add poe_vs hwsku
Add yang models

Signed-off-by: Serhiy Boiko <[email protected]>
  • Loading branch information
SerhiyBoikoPLV committed Jul 30, 2024
1 parent 0213180 commit df153cc
Show file tree
Hide file tree
Showing 30 changed files with 847 additions and 2 deletions.
20 changes: 20 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format of default_sku is a single line:
| ------ | ------ |
| Force10-S6000 | Dell Force10 S6000|
| brcm_gearbox_vs | Similar to Force10-S6000, but implements a virtual BRCM81724 Gearbox Phy |
| poe_vs | Similar to Force10-S6000, but implements PoE |

## Allowable values for default_preset

Expand Down Expand Up @@ -86,3 +87,22 @@ 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.

## poe_vs

This sku simulates a device with PoE capabilites. To enable, set default_sku to:


```
poe_vs t1
```

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

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

See https://github.com/sonic-net/sonic-utilities/blob/master/doc/Command-Reference.md#power-over-ethernet for details.
3 changes: 3 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/poe_vs/buffers.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%- set default_topo = 't1' %}
{%- include 'buffers_config.j2' %}

45 changes: 45 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/poe_vs/buffers_defaults_def.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":"ingress_lossless_pool",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"egress_lossless_pool",
"size":"0",
"static_th":"12766208"
},
"egress_lossy_profile": {
"pool":"egress_lossy_pool",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
45 changes: 45 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/poe_vs/buffers_defaults_t0.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":"ingress_lossless_pool",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"egress_lossless_pool",
"size":"0",
"static_th":"12766208"
},
"egress_lossy_profile": {
"pool":"egress_lossy_pool",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
45 changes: 45 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/poe_vs/buffers_defaults_t1.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":"ingress_lossless_pool",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"egress_lossless_pool",
"size":"0",
"static_th":"12766208"
},
"egress_lossy_profile": {
"pool":"egress_lossy_pool",
"size":"1518",
"dynamic_th":"3"
}
},
{%- endmacro %}
38 changes: 38 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/poe_vs/context_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"CONTEXTS": [
{
"guid" : 0,
"name" : "sw0",
"dbAsic" : "ASIC_DB",
"dbCounters" : "COUNTERS_DB",
"dbFlex": "FLEX_COUNTER_DB",
"dbState" : "STATE_DB",
"zmq_enable": false,
"zmq_endpoint": "tcp://127.0.0.1:5555",
"zmq_ntf_endpoint": "tcp://127.0.0.1:5556",
"switches": [
{
"index" : 0,
"hwinfo" : ""
}
]
},
{
"guid" : 1,
"name" : "poe1",
"dbAsic" : "POE_ASIC_DB",
"dbCounters" : "POE_COUNTERS_DB",
"dbFlex": "POE_FLEX_COUNTER_DB",
"dbState" : "STATE_DB",
"zmq_enable": false,
"zmq_endpoint": "tcp://127.0.0.1:5575",
"zmq_ntf_endpoint": "tcp://127.0.0.1:5576",
"switches": [
{
"index" : 1,
"hwinfo": ""
}
]
}
]
}
5 changes: 5 additions & 0 deletions device/virtual/x86_64-kvm_x86_64-r0/poe_vs/poe.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_POE
SAI_VS_SAI_SWITCH_TYPE=SAI_SWITCH_TYPE_POE
SAI_VS_HOSTIF_USE_TAP_DEVICE=false
SAI_VS_USE_BCMSIM_LINK_MON=true
SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini
Loading

0 comments on commit df153cc

Please sign in to comment.