Merge remote-tracking branch 'azure/master' into bf-master

This commit is contained in:
kram 2017-11-13 15:31:48 -08:00
commit 784d737b80
55 changed files with 435 additions and 492 deletions

1
.gitignore vendored
View File

@ -51,6 +51,7 @@ dockers/docker-teamd/Dockerfile
dockers/docker-sonic-mgmt/Dockerfile dockers/docker-sonic-mgmt/Dockerfile
platform/*/docker-syncd-*/Dockerfile platform/*/docker-syncd-*/Dockerfile
platform/*/docker-syncd-*-rpc/Dockerfile platform/*/docker-syncd-*-rpc/Dockerfile
platform/vs/docker-sonic-vs/Dockerfile
# Installer-related files and directories # Installer-related files and directories
installer/x86_64/platforms/ installer/x86_64/platforms/

6
.gitmodules vendored
View File

@ -68,3 +68,9 @@
[submodule "src/sonic-frr/frr"] [submodule "src/sonic-frr/frr"]
path = src/sonic-frr/frr path = src/sonic-frr/frr
url = https://github.com/FRRouting/frr.git url = https://github.com/FRRouting/frr.git
[submodule "platform/p4/p4-hlir/p4-hlir-v1.1"]
path = platform/p4/p4-hlir/p4-hlir-v1.1
url = https://github.com/p4lang/p4-hlir.git
[submodule "platform/p4/SAI-P4-BM"]
path = platform/p4/SAI-P4-BM
url = https://github.com/Mellanox/SAI-P4-BM.git

View File

@ -25,8 +25,8 @@ $(shell rm -f .screen)
MAKEFLAGS += -B MAKEFLAGS += -B
SLAVE_BASE_TAG = $(shell shasum sonic-slave/Dockerfile | awk '{print substr($$1,0,11);}') SLAVE_BASE_TAG = $(shell sha1sum sonic-slave/Dockerfile | awk '{print substr($$1,0,11);}')
SLAVE_TAG = $(shell cat sonic-slave/Dockerfile.user sonic-slave/Dockerfile | shasum | awk '{print substr($$1,0,11);}') SLAVE_TAG = $(shell cat sonic-slave/Dockerfile.user sonic-slave/Dockerfile | sha1sum | awk '{print substr($$1,0,11);}')
SLAVE_BASE_IMAGE = sonic-slave-base SLAVE_BASE_IMAGE = sonic-slave-base
SLAVE_IMAGE = sonic-slave-$(USER) SLAVE_IMAGE = sonic-slave-$(USER)

View File

@ -1,8 +1,12 @@
Broadcom: [![Broadcom](https://sonic-jenkins.westus.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-all) *master*: Broadcom: [![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-all)
Cavium: [![Cavium](https://sonic-jenkins.westus.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/) Mellanox: [![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all)
Centec: [![Centec](https://sonic-jenkins.westus.cloudapp.azure.com/job/centec/job/buildimage-centec-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/centec/job/buildimage-centec-all/) P4: [![P4](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all)
Mellanox: [![Mellanox](https://sonic-jenkins.westus.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all) VS: [![VS](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-all)
P4: [![Broadcom](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon)](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all)
*201709*: Cavium: [![Cavium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/cavium/job/buildimage-cavm-all/)
Centec: [![Centec](https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-all/)
Nephos: [![Nephos](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-all/)
Marvell: [![Marvell](https://sonic-jenkins.westus2.cloudapp.azure.com/job/marvell/job/buildimage-mrvl-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/marvell/job/buildimage-mrvl-all/)
# sonic-buildimage # sonic-buildimage
@ -10,7 +14,7 @@ P4: [![Broadcom](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buil
# Description # Description
Following is the instruction on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatiable network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC image are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [document](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buildimage-p4-all). Following is the instruction on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatiable network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC image are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [list](https://github.com/Azure/SONiC/wiki/Supported-Devices-and-Platforms)
# Hardware # Hardware
Any server can be a build image server. We are using a server with 1T hard disk. The OS is Ubuntu 16.04. Any server can be a build image server. We are using a server with 1T hard disk. The OS is Ubuntu 16.04.
@ -47,6 +51,7 @@ The SONiC installer contains all docker images needed. SONiC uses one image for
- PLATFORM=cavium - PLATFORM=cavium
- PLATFORM=centec - PLATFORM=centec
- PLATFORM=p4 - PLATFORM=p4
- PLATFORM=vs
For Broadcom ASIC, we build ONIE and EOS image. EOS image is used for Arista devices, ONIE image is used for all other Broadcom ASIC based devices. For Broadcom ASIC, we build ONIE and EOS image. EOS image is used for Arista devices, ONIE image is used for all other Broadcom ASIC based devices.
@ -92,6 +97,7 @@ This may take a while, but it is a one-time action, so please be patient.
- docker-syncd-cavm.gz: docker image for the daemon to sync database and Cavium switch ASIC (gzip tar archive) - docker-syncd-cavm.gz: docker image for the daemon to sync database and Cavium switch ASIC (gzip tar archive)
- docker-syncd-mlnx.gz: docker image for the daemon to sync database and Mellanox switch ASIC (gzip tar archive) - docker-syncd-mlnx.gz: docker image for the daemon to sync database and Mellanox switch ASIC (gzip tar archive)
- docker-sonic-p4.gz: docker image for all-in-one for p4 software switch (gzip tar archive) - docker-sonic-p4.gz: docker image for all-in-one for p4 software switch (gzip tar archive)
- docker-sonic-vs.gz: docker image for all-in-one for software virtual switch (gzip tar archive)
## Contribution Guide ## Contribution Guide

View File

@ -1,121 +1,123 @@
# name lanes alias index # name lanes alias index
Ethernet0 77,78 Ethernet1/1 1 Ethernet0 77,78 Ethernet1/1 1
Ethernet2 79,80 Ethernet1/3 2 Ethernet2 79,80 Ethernet1/3 1
Ethernet4 65,66 Ethernet2/1 3 Ethernet4 65,66 Ethernet2/1 2
Ethernet6 67,68 Ethernet2/3 4 Ethernet6 67,68 Ethernet2/3 2
Ethernet8 85,86 Ethernet3/1 5 Ethernet8 85,86 Ethernet3/1 3
Ethernet10 87,88 Ethernet3/3 6 Ethernet10 87,88 Ethernet3/3 3
Ethernet12 89,90 Ethernet4/1 7 Ethernet12 89,90 Ethernet4/1 4
Ethernet14 91,92 Ethernet4/3 8 Ethernet14 91,92 Ethernet4/3 4
Ethernet16 109,110 Ethernet5/1 9 Ethernet16 109,110 Ethernet5/1 5
Ethernet18 111,112 Ethernet5/3 10 Ethernet18 111,112 Ethernet5/3 5
Ethernet20 97,98 Ethernet6/1 11 Ethernet20 97,98 Ethernet6/1 6
Ethernet22 99,100 Ethernet6/3 12 Ethernet22 99,100 Ethernet6/3 6
Ethernet24 5,6 Ethernet7/1 13 Ethernet24 5,6 Ethernet7/1 7
Ethernet26 7,8 Ethernet7/3 14 Ethernet26 7,8 Ethernet7/3 7
Ethernet28 13,14 Ethernet8/1 15 Ethernet28 13,14 Ethernet8/1 8
Ethernet30 15,16 Ethernet8/3 16 Ethernet30 15,16 Ethernet8/3 8
Ethernet32 25,26 Ethernet9/1 17 Ethernet32 25,26 Ethernet9/1 9
Ethernet34 27,28 Ethernet9/3 18 Ethernet34 27,28 Ethernet9/3 9
Ethernet36 21,22 Ethernet10/1 19 Ethernet36 21,22 Ethernet10/1 10
Ethernet38 23,24 Ethernet10/3 20 Ethernet38 23,24 Ethernet10/3 10
Ethernet40 37,38 Ethernet11/1 21 Ethernet40 37,38 Ethernet11/1 11
Ethernet42 39,40 Ethernet11/3 22 Ethernet42 39,40 Ethernet11/3 11
Ethernet44 45,46 Ethernet12/1 23 Ethernet44 45,46 Ethernet12/1 12
Ethernet46 47,48 Ethernet12/3 24 Ethernet46 47,48 Ethernet12/3 12
Ethernet48 57,58 Ethernet13/1 25 Ethernet48 57,58 Ethernet13/1 13
Ethernet50 59,60 Ethernet13/3 26 Ethernet50 59,60 Ethernet13/3 13
Ethernet52 53,54 Ethernet14/1 27 Ethernet52 53,54 Ethernet14/1 14
Ethernet54 55,56 Ethernet14/3 28 Ethernet54 55,56 Ethernet14/3 14
Ethernet56 117,118 Ethernet15/1 29 Ethernet56 117,118 Ethernet15/1 15
Ethernet58 119,120 Ethernet15/3 30 Ethernet58 119,120 Ethernet15/3 15
Ethernet60 121,122 Ethernet16/1 31 Ethernet60 121,122 Ethernet16/1 16
Ethernet62 123,124 Ethernet16/3 32 Ethernet62 123,124 Ethernet16/3 16
Ethernet64 141,142 Ethernet17/1 33 Ethernet64 141,142 Ethernet17/1 17
Ethernet66 143,144 Ethernet17/3 34 Ethernet66 143,144 Ethernet17/3 17
Ethernet68 133,134,135,136 Ethernet18/1 35 Ethernet68 133,134 Ethernet18/1 18
Ethernet72 197,198 Ethernet19/1 36 Ethernet70 135,136 Ethernet18/3 18
Ethernet74 199,200 Ethernet19/3 37 Ethernet72 197,198 Ethernet19/1 19
Ethernet76 205,206,207,208 Ethernet20/1 38 Ethernet74 199,200 Ethernet19/3 19
Ethernet80 217,218 Ethernet21/1 39 Ethernet76 205,206 Ethernet20/1 20
Ethernet82 219,220 Ethernet21/3 40 Ethernet78 207,208 Ethernet20/3 20
Ethernet84 213,214 Ethernet22/1 41 Ethernet80 217,218 Ethernet21/1 21
Ethernet86 215,216 Ethernet22/3 42 Ethernet82 219,220 Ethernet21/3 21
Ethernet88 229,230 Ethernet23/1 43 Ethernet84 213,214 Ethernet22/1 22
Ethernet90 231,232 Ethernet23/3 44 Ethernet86 215,216 Ethernet22/3 22
Ethernet92 237,238 Ethernet24/1 45 Ethernet88 229,230 Ethernet23/1 23
Ethernet94 239,240 Ethernet24/3 46 Ethernet90 231,232 Ethernet23/3 23
Ethernet96 249,250 Ethernet25/1 47 Ethernet92 237,238 Ethernet24/1 24
Ethernet98 251,252 Ethernet25/3 48 Ethernet94 239,240 Ethernet24/3 24
Ethernet100 245,246 Ethernet26/1 49 Ethernet96 249,250 Ethernet25/1 25
Ethernet102 247,248 Ethernet26/3 50 Ethernet98 251,252 Ethernet25/3 25
Ethernet104 149,150 Ethernet27/1 51 Ethernet100 245,246 Ethernet26/1 26
Ethernet106 151,152 Ethernet27/3 52 Ethernet102 247,248 Ethernet26/3 26
Ethernet108 153,154 Ethernet28/1 53 Ethernet104 149,150 Ethernet27/1 27
Ethernet110 155,156 Ethernet28/3 54 Ethernet106 151,152 Ethernet27/3 27
Ethernet112 173,174 Ethernet29/1 55 Ethernet108 153,154 Ethernet28/1 28
Ethernet114 175,176 Ethernet29/3 56 Ethernet110 155,156 Ethernet28/3 28
Ethernet116 161,162 Ethernet30/1 57 Ethernet112 173,174 Ethernet29/1 29
Ethernet118 163,164 Ethernet30/3 58 Ethernet114 175,176 Ethernet29/3 29
Ethernet120 181,182 Ethernet31/1 59 Ethernet116 161,162 Ethernet30/1 30
Ethernet122 183,184 Ethernet31/3 60 Ethernet118 163,164 Ethernet30/3 30
Ethernet124 185,186 Ethernet32/1 61 Ethernet120 181,182 Ethernet31/1 31
Ethernet126 187,188 Ethernet32/3 62 Ethernet122 183,184 Ethernet31/3 31
Ethernet128 69,70 Ethernet33/1 63 Ethernet124 185,186 Ethernet32/1 32
Ethernet130 71,72 Ethernet33/3 64 Ethernet126 187,188 Ethernet32/3 32
Ethernet132 73,74 Ethernet34/1 65 Ethernet128 69,70 Ethernet33/1 33
Ethernet134 75,76 Ethernet34/3 66 Ethernet130 71,72 Ethernet33/3 33
Ethernet136 93,94 Ethernet35/1 67 Ethernet132 73,74 Ethernet34/1 34
Ethernet138 95,96 Ethernet35/3 68 Ethernet134 75,76 Ethernet34/3 34
Ethernet140 81,82 Ethernet36/1 69 Ethernet136 93,94 Ethernet35/1 35
Ethernet142 83,84 Ethernet36/3 70 Ethernet138 95,96 Ethernet35/3 35
Ethernet144 101,102 Ethernet37/1 71 Ethernet140 81,82 Ethernet36/1 36
Ethernet146 103,104 Ethernet37/3 72 Ethernet142 83,84 Ethernet36/3 36
Ethernet148 105,106 Ethernet38/1 73 Ethernet144 101,102 Ethernet37/1 37
Ethernet150 107,108 Ethernet38/3 74 Ethernet146 103,104 Ethernet37/3 37
Ethernet152 9,10 Ethernet39/1 75 Ethernet148 105,106 Ethernet38/1 38
Ethernet154 11,12 Ethernet39/3 76 Ethernet150 107,108 Ethernet38/3 38
Ethernet156 1,2 Ethernet40/1 77 Ethernet152 9,10 Ethernet39/1 39
Ethernet158 3,4 Ethernet40/3 78 Ethernet154 11,12 Ethernet39/3 39
Ethernet160 17,18 Ethernet41/1 79 Ethernet156 1,2 Ethernet40/1 40
Ethernet162 19,20 Ethernet41/3 80 Ethernet158 3,4 Ethernet40/3 40
Ethernet164 29,30 Ethernet42/1 81 Ethernet160 17,18 Ethernet41/1 41
Ethernet166 31,32 Ethernet42/1 82 Ethernet162 19,20 Ethernet41/3 41
Ethernet168 41,42 Ethernet43/1 83 Ethernet164 29,30 Ethernet42/1 42
Ethernet170 43,44 Ethernet43/3 84 Ethernet166 31,32 Ethernet42/3 42
Ethernet172 33,34 Ethernet44/1 85 Ethernet168 41,42 Ethernet43/1 43
Ethernet174 35,36 Ethernet44/3 86 Ethernet170 43,44 Ethernet43/3 43
Ethernet176 49,50,51,52 Ethernet45/1 87 Ethernet172 33,34 Ethernet44/1 44
Ethernet180 61,62,63,64 Ethernet46/1 88 Ethernet174 35,36 Ethernet44/3 44
Ethernet184 125,126,127,128 Ethernet47/1 89 Ethernet176 49,50,51,52 Ethernet45/1 45
Ethernet188 113,114,115,116 Ethernet48/1 90 Ethernet180 61,62,63,64 Ethernet46/1 46
Ethernet192 129,130,131,132 Ethernet49/1 91 Ethernet184 125,126,127,128 Ethernet47/1 47
Ethernet196 137,138,139,140 Ethernet50/1 92 Ethernet188 113,114,115,116 Ethernet48/1 48
Ethernet200 201,202,203,204 Ethernet51/1 93 Ethernet192 129,130,131,132 Ethernet49/1 49
Ethernet204 193,194,195,196 Ethernet52/1 94 Ethernet196 137,138,139,140 Ethernet50/1 50
Ethernet208 209,210 Ethernet53/1 95 Ethernet200 201,202,203,204 Ethernet51/1 51
Ethernet210 211,212 Ethernet53/3 96 Ethernet204 193,194,195,196 Ethernet52/1 52
Ethernet212 221,222 Ethernet54/1 97 Ethernet208 209,210 Ethernet53/1 53
Ethernet214 223,224 Ethernet54/3 98 Ethernet210 211,212 Ethernet53/3 53
Ethernet216 233,234 Ethernet55/1 99 Ethernet212 221,222 Ethernet54/1 54
Ethernet218 235,236 Ethernet55/3 100 Ethernet214 223,224 Ethernet54/3 54
Ethernet220 225,226 Ethernet56/1 101 Ethernet216 233,234 Ethernet55/1 55
Ethernet222 227,228 Ethernet56/3 102 Ethernet218 235,236 Ethernet55/3 55
Ethernet224 241,242 Ethernet57/1 103 Ethernet220 225,226 Ethernet56/1 56
Ethernet226 243,244 Ethernet57/3 104 Ethernet222 227,228 Ethernet56/3 56
Ethernet228 253,254 Ethernet58/1 105 Ethernet224 241,242 Ethernet57/1 57
Ethernet230 255,256 Ethernet58/3 106 Ethernet226 243,244 Ethernet57/3 57
Ethernet232 157,158 Ethernet59/1 107 Ethernet228 253,254 Ethernet58/1 58
Ethernet234 159,160 Ethernet59/3 108 Ethernet230 255,256 Ethernet58/3 58
Ethernet236 145,146 Ethernet60/1 109 Ethernet232 157,158 Ethernet59/1 59
Ethernet238 147,148 Ethernet60/3 110 Ethernet234 159,160 Ethernet59/3 59
Ethernet240 165,166 Ethernet61/1 111 Ethernet236 145,146 Ethernet60/1 60
Ethernet242 167,168 Ethernet61/3 112 Ethernet238 147,148 Ethernet60/3 60
Ethernet244 169,170 Ethernet62/1 113 Ethernet240 165,166 Ethernet61/1 61
Ethernet246 171,172 Ethernet62/3 114 Ethernet242 167,168 Ethernet61/3 61
Ethernet248 189,190 Ethernet63/1 115 Ethernet244 169,170 Ethernet62/1 62
Ethernet250 191,192 Ethernet63/3 116 Ethernet246 171,172 Ethernet62/3 62
Ethernet252 177,178 Ethernet64/1 117 Ethernet248 189,190 Ethernet63/1 63
Ethernet254 179,180 Ethernet64/3 118 Ethernet250 191,192 Ethernet63/3 63
Ethernet256 257 Ethernet257 119 Ethernet252 177,178 Ethernet64/1 64
Ethernet260 259 Ethernet259 120 Ethernet254 179,180 Ethernet64/3 64
Ethernet256 257 Ethernet65 65
Ethernet260 259 Ethernet66 66

View File

@ -4,14 +4,6 @@
{%- if port_names_list.append(port) %}{% endif %} {%- if port_names_list.append(port) %}{% endif %}
{% endfor %} {% endfor %}
{% set port_names = port_names_list | join(',') %} {% set port_names = port_names_list | join(',') %}
{
"BUFFER_POOL_TABLE:ingress_lossless_pool": {
"size": "3024486",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{ {
"BUFFER_POOL_TABLE:ingress_lossy_pool": { "BUFFER_POOL_TABLE:ingress_lossy_pool": {
"size": "6422528", "size": "6422528",
@ -106,6 +98,7 @@
}, },
{# The following template part is for variable PG profile configuration #} {# The following template part is for variable PG profile configuration #}
{% set non_pg_lossless_pool_size = 866726 %}
{% set pg_range = '3-4' %} {% set pg_range = '3-4' %}
{# Lists of supported speed and cable length #} {# Lists of supported speed and cable length #}
{% set supported_speed = [10000, 25000, 40000, 50000, 100000] %} {% set supported_speed = [10000, 25000, 40000, 50000, 100000] %}
@ -239,7 +232,7 @@
{%- set profile_config = pg_profiles[profile_name] %} {%- set profile_config = pg_profiles[profile_name] %}
{ {
"BUFFER_PROFILE_TABLE:{{ profile_name }}": { "BUFFER_PROFILE_TABLE:{{ profile_name }}": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossless_pg_pool]", "pool":"[BUFFER_POOL_TABLE:ingress_lossless_pool]",
"xon":"{{ profile_config['xon'] }}", "xon":"{{ profile_config['xon'] }}",
"xoff":"{{ profile_config['xoff'] }}", "xoff":"{{ profile_config['xoff'] }}",
"size":"{{ profile_config['size'] }}", "size":"{{ profile_config['size'] }}",
@ -249,10 +242,10 @@
}, },
{% endfor -%} {% endfor -%}
{# Pool declaration #} {# Lossless pool declaration #}
{ {
"BUFFER_POOL_TABLE:ingress_lossless_pg_pool": { "BUFFER_POOL_TABLE:ingress_lossless_pool": {
"size": "{{ ingress_lossless_pg_pool_size | sum }}", "size": "{{ ingress_lossless_pg_pool_size | sum + non_pg_lossless_pool_size }}",
"type": "ingress", "type": "ingress",
"mode": "dynamic" "mode": "dynamic"
}, },

View File

@ -22,6 +22,10 @@ supervisorctl start neighsyncd
supervisorctl start swssconfig supervisorctl start swssconfig
supervisorctl start vlanmgrd
supervisorctl start intfmgrd
# Start arp_update when VLAN exists # Start arp_update when VLAN exists
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
if [ "$VLAN" != "" ]; then if [ "$VLAN" != "" ]; then

View File

@ -67,3 +67,19 @@ autostart=false
autorestart=true autorestart=true
stdout_logfile=syslog stdout_logfile=syslog
stderr_logfile=syslog stderr_logfile=syslog
[program:vlanmgrd]
command=/usr/bin/vlanmgrd
priority=9
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
[program:intfmgrd]
command=/usr/bin/intfmgrd
priority=10
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

View File

@ -65,9 +65,6 @@ extract_image() {
## vfat does not support symbol link ## vfat does not support symbol link
if [ -n "$sonic_upgrade" ] || [ "$rootfs_type" != "vfat" ]; then if [ -n "$sonic_upgrade" ] || [ "$rootfs_type" != "vfat" ]; then
## on ext4, other doesn't have access to the flash by default
chmod o+rx "$target_path"
mkdir -p "$image_path/{{ DOCKERFS_DIR }}" mkdir -p "$image_path/{{ DOCKERFS_DIR }}"
if [ -n "$sonic_upgrade" ]; then if [ -n "$sonic_upgrade" ]; then
@ -133,7 +130,7 @@ platform_specific() {
aboot_machine=arista_7260cx3_64 aboot_machine=arista_7260cx3_64
fi fi
if [ "$platform" = "rook" ]; then if [ "$platform" = "rook" ]; then
varlog_size=200 varlog_size=4096
readprefdl -f /tmp/.system-prefdl -d > /mnt/flash/.system-prefdl readprefdl -f /tmp/.system-prefdl -d > /mnt/flash/.system-prefdl
fi fi

View File

@ -18,6 +18,7 @@ ExecStartPre=/usr/bin/docker exec database redis-cli -n 0 FLUSHDB
ExecStartPre=/usr/bin/docker exec database redis-cli -n 1 FLUSHDB ExecStartPre=/usr/bin/docker exec database redis-cli -n 1 FLUSHDB
ExecStartPre=/usr/bin/docker exec database redis-cli -n 2 FLUSHDB ExecStartPre=/usr/bin/docker exec database redis-cli -n 2 FLUSHDB
ExecStartPre=/usr/bin/docker exec database redis-cli -n 5 FLUSHDB ExecStartPre=/usr/bin/docker exec database redis-cli -n 5 FLUSHDB
ExecStartPre=/usr/bin/docker exec database redis-cli -n 6 FLUSHDB
{% if sonic_asic_platform == 'mellanox' %} {% if sonic_asic_platform == 'mellanox' %}
TimeoutStartSec=3min TimeoutStartSec=3min

View File

@ -1,16 +1,6 @@
#!/bin/bash #!/bin/bash
SONIC_ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type) sonic-cfggen -d -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces
SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
# Align last byte of MAC if necessary
if [ "$SONIC_ASIC_TYPE" == "mellanox" -o "$SONIC_ASIC_TYPE" == "centec" ]; then
last_byte=$(python -c "print '$SYSTEM_MAC_ADDRESS'[-2:]")
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) & 0b11000000), '02x')") # put mask and take away the 0x prefix
SYSTEM_MAC_ADDRESS=$(python -c "print '$SYSTEM_MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC
fi
sonic-cfggen -d -a '{"hwaddr":"'$SYSTEM_MAC_ADDRESS'"}' -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces
[ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid [ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid

View File

@ -55,24 +55,11 @@ iface eth0 inet dhcp
{% for (name, prefix) in INTERFACE %} {% for (name, prefix) in INTERFACE %}
allow-hotplug {{ name }} allow-hotplug {{ name }}
iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static
mtu 9100 mtu {{ PORT[name]['mtu'] if PORT[name]['mtu'] else 9100 }}
address {{ prefix | ip }} address {{ prefix | ip }}
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}
# #
{% endfor %} {% endfor %}
{% if VLAN %}
# "|| true" is added to suppress the error when interface is already a member of VLAN
{% for vlan in VLAN.keys()|sort %}
{% for member in VLAN[vlan]['members'] %}
allow-hotplug {{ member }}
iface {{ member }} inet manual
pre-up ifconfig {{ member }} up mtu 9100
post-up brctl addif {{ vlan }} {{ member }} || true
post-down ifconfig {{ member }} down
#
{% endfor %}
{% endfor %}
{% endif %}
{% if PORTCHANNEL %} {% if PORTCHANNEL %}
# "|| true" is added to suppress the error when interface is already a member of LAG # "|| true" is added to suppress the error when interface is already a member of LAG
# "ip link show | grep -q master" is added to ensure interface is enslaved # "ip link show | grep -q master" is added to ensure interface is enslaved
@ -88,27 +75,13 @@ iface {{ member }} inet manual
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endblock front_panel_interfaces %} {% endblock front_panel_interfaces %}
{% block vlan_interfaces %}
{% if VLAN_INTERFACE %}
# Vlan interfaces
{% for (name, prefix) in VLAN_INTERFACE.keys() | sort %}
auto {{ name }}
iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static
bridge_ports none
hwaddress ether {{ hwaddr }}
address {{ prefix | ip }}
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}
{% endfor %}
#
{% endif %}
{% endblock vlan_interfaces %}
{% block pc_interfaces %} {% block pc_interfaces %}
{% if PORTCHANNEL_INTERFACE %} {% if PORTCHANNEL_INTERFACE %}
# Portchannel interfaces # Portchannel interfaces
{% for (name, prefix) in PORTCHANNEL_INTERFACE.keys() | sort %} {% for (name, prefix) in PORTCHANNEL_INTERFACE.keys() | sort %}
allow-hotplug {{ name }} allow-hotplug {{ name }}
iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static
mtu 9100 mtu {{ PORTCHANNEL[name]['mtu'] if PORTCHANNEL[name]['mtu'] else 9100 }}
address {{ prefix | ip }} address {{ prefix | ip }}
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}
# #

View File

@ -1,6 +1,5 @@
[Unit] [Unit]
Description=Update NTP configuration Description=Update NTP configuration
Before=ntp.service
Requires=database.service Requires=database.service
After=database.service After=database.service

View File

@ -1,3 +1,5 @@
#!/bin/bash #!/bin/bash
sonic-cfggen -d -t /usr/share/sonic/templates/ntp.conf.j2 >/etc/ntp.conf sonic-cfggen -d -t /usr/share/sonic/templates/ntp.conf.j2 >/etc/ntp.conf
systemctl restart ntp

View File

@ -43,6 +43,15 @@ firsttime_exit()
exit 0 exit 0
} }
test_config()
{
if [ -d /host/old_config ] && ( [ -f /host/old_config/minigraph.xml ] || [ -f /host/old_config/config_db.json ] ); then
return 0
fi
return 1
}
# Given a string of tuples of the form field=value, extract the value for a field # Given a string of tuples of the form field=value, extract the value for a field
# In : $string, $field # In : $string, $field
# Out: $value # Out: $value
@ -70,26 +79,40 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then
firsttime_exit firsttime_exit
fi fi
# setup initial switch mac
SONIC_ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
# Align last byte of MAC if necessary
if [ "$SONIC_ASIC_TYPE" == "mellanox" -o "$SONIC_ASIC_TYPE" == "centec" ]; then
last_byte=$(python -c "print '$SYSTEM_MAC_ADDRESS'[-2:]")
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) & 0b11000000), '02x')") # put mask and take away the 0x prefix
SYSTEM_MAC_ADDRESS=$(python -c "print '$SYSTEM_MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC
fi
if [ -f /etc/sonic/init_cfg.json ]; then
sonic-cfggen -j /etc/sonic/init_cfg.json -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' --print-data > /tmp/init_cfg.json
mv /tmp/init_cfg.json /etc/sonic/init_cfg.json
else
sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' --print-data > /etc/sonic/init_cfg.json
fi
# Try to take old configuration saved during installation # Try to take old configuration saved during installation
if [ -d /host/old_config ]; then if test_config; then
rm -f /host/old_config/sonic_version.yml rm -f /host/old_config/sonic_version.yml
mv -f /host/old_config/* /etc/sonic/ mv -f /host/old_config/* /etc/sonic/
if [ ! -f /etc/sonic/config_db.json ]; then
sonic-cfggen -m -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json
fi
elif [ -f /host/minigraph.xml ]; then elif [ -f /host/minigraph.xml ]; then
mv /host/minigraph.xml /etc/sonic/ mv /host/minigraph.xml /etc/sonic/
# Combine information in minigraph and init_cfg.json to form initiate config DB dump file. # Combine information in minigraph and init_cfg.json to form initiate config DB dump file.
# TODO: After moving all information from minigraph to DB, sample config DB dump should be provide # TODO: After moving all information from minigraph to DB, sample config DB dump should be provide
if [ -f /etc/sonic/init_cfg.json ]; then sonic-cfggen -m -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json
sonic-cfggen -m -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json
else
sonic-cfggen -m --print-data > /etc/sonic/config_db.json
fi
else else
# Use default minigraph.xml
cp /usr/share/sonic/device/$platform/minigraph.xml /etc/sonic/ cp /usr/share/sonic/device/$platform/minigraph.xml /etc/sonic/
if [ -f /etc/sonic/init_cfg.json ]; then sonic-cfggen -m -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json
sonic-cfggen -m -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json
else
sonic-cfggen -m --print-data > /etc/sonic/config_db.json
fi
fi fi
if [ -d /host/image-$sonic_version/platform/$platform ]; then if [ -d /host/image-$sonic_version/platform/$platform ]; then

View File

@ -82,6 +82,13 @@ run_cmd() {
fi fi
} }
fixup_flash_permissions() {
# properly set flash permissions for others
# this allows the sonic admin user to have read access on the flash
local flash_mnt="$1"
chmod o+rx "$flash_mnt"
}
# Extract kernel parameters # Extract kernel parameters
set -- $(cat /proc/cmdline) set -- $(cat /proc/cmdline)
for x in "$@"; do for x in "$@"; do
@ -111,7 +118,14 @@ if ! wait_for_root_dev; then
fi fi
# exit when the root is ext4 # exit when the root is ext4
blkid | grep "$root_dev.*vfat" -q || exit 0 if ! blkid | grep "$root_dev.*vfat" -q; then
mkdir -p "$root_mnt"
mount -t ext4 "$root_dev" "$root_mnt"
fixup_flash_permissions "$root_mnt"
umount "$root_mnt"
rmdir "$root_mnt"
exit 0
fi
# Get flash dev name # Get flash dev name
if [ -z "$block_flash" ]; then if [ -z "$block_flash" ]; then
@ -176,3 +190,5 @@ run_cmd "$cmd" "$err_msg"
err_msg="Error: copying files form $tmp_mnt to $root_mnt failed" err_msg="Error: copying files form $tmp_mnt to $root_mnt failed"
cmd="cp -a $tmp_mnt/. $root_mnt/" cmd="cp -a $tmp_mnt/. $root_mnt/"
run_cmd "$cmd" "$err_msg" run_cmd "$cmd" "$err_msg"
fixup_flash_permissions "$root_mnt"

View File

@ -1,9 +1,9 @@
BRCM_SAI = libsaibcm_3.0.3.2-10_amd64.deb BRCM_SAI = libsaibcm_3.0.3.2-11_amd64.deb
$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2-10_amd64.deb?sv=2015-04-05&sr=b&sig=tByZ7QDBsYlJ4UHbapnzqHYrbA8rD92%2FQXEpupITTmM%3D&se=2031-07-06T19%3A19%3A32Z&sp=r" $(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.0.3.2-11_amd64.deb?sv=2015-04-05&sr=b&sig=sXvf3ejJ8npF9iPfkTIYUneN4N8wvHKo2V6A8YoTbhk%3D&se=2031-07-17T23%3A08%3A43Z&sp=r"
BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2-10_amd64.deb BRCM_SAI_DEV = libsaibcm-dev_3.0.3.2-11_amd64.deb
$(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV)))
$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2-10_amd64.deb?sv=2015-04-05&sr=b&sig=T6U8sF%2BW8B%2FffBzPoUJ9peLcg2O9MunHBBKSu7SZOKo%3D&se=2031-07-06T19%3A19%3A52Z&sp=r" $(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.0.3.2-11_amd64.deb?sv=2015-04-05&sr=b&sig=Q%2FSC7B0xDuhvHGL7GERoOw483nv6hkAQrDUaabS9JOs%3D&se=2031-07-17T23%3A09%3A08Z&sp=r"
SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV)
$(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI)

@ -1 +1 @@
Subproject commit d1417bff17780255d4cc371b315f620087673eb8 Subproject commit f985b188326e480124ec49541b4fecc51a213889

View File

@ -1,6 +1,6 @@
# mellanox firmware # mellanox firmware
MLNX_FW_VERSION = 13.1400.0126 MLNX_FW_VERSION = 13.1530.0152
MLNX_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_FW_VERSION))-EVB.mfa MLNX_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_FW_VERSION))-EVB.mfa
$(MLNX_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_FW_FILE) $(MLNX_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_FW_FILE)
SONIC_ONLINE_FILES += $(MLNX_FW_FILE) SONIC_ONLINE_FILES += $(MLNX_FW_FILE)

View File

@ -1,7 +1,7 @@
# Mellanox SAI # Mellanox SAI
MLNX_SAI_VERSION = sonic1.9.1fixes-master MLNX_SAI_VERSION = SAIRel1.9.2-master
MLNX_SAI_REVISION = dc0e84b3762f847369524a917e271ceb2878b4d3 MLNX_SAI_REVISION = 16900748ee3c97bc5836ab3684ee05b8db6ec31b
export MLNX_SAI_VERSION MLNX_SAI_REVISION export MLNX_SAI_VERSION MLNX_SAI_REVISION

View File

@ -1,5 +1,5 @@
MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/4ebc01e95b754c56da7f8b5fb45b82fbe661d05a/sdk MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/16900748ee3c97bc5836ab3684ee05b8db6ec31b/sdk
MLNX_SDK_VERSION = 4.2.5010 MLNX_SDK_VERSION = 4.2.6011
MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2) $(SX_ACL_RM) $(SX_COMPLIB) \ MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2) $(SX_ACL_RM) $(SX_COMPLIB) \
$(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SX_SDN_HAL) \ $(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SX_SDN_HAL) \
$(SXD_LIBS) $(TESTX) $(SXD_LIBS) $(TESTX)

1
platform/p4/SAI-P4-BM Submodule

@ -0,0 +1 @@
Subproject commit c25b5aecabbb09270dc805459434ee396792ccb3

View File

@ -4,13 +4,13 @@ DOCKER_SONIC_P4 = docker-sonic-p4.gz
$(DOCKER_SONIC_P4)_PATH = $(PLATFORM_PATH)/docker-sonic-p4 $(DOCKER_SONIC_P4)_PATH = $(PLATFORM_PATH)/docker-sonic-p4
$(DOCKER_SONIC_P4)_DEPENDS += $(SWSS) $(SYNCD) $(P4_SWITCH) $(REDIS_SERVER) $(REDIS_TOOLS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(DOCKER_SONIC_P4)_DEPENDS += $(SWSS) $(SYNCD) $(P4_SWITCH) $(REDIS_SERVER) $(REDIS_TOOLS) $(LIBTEAMDCT) $(LIBTEAM_UTILS)
ifeq ($(ROUTING_STACK), quagga) # ifeq ($(ROUTING_STACK), quagga)
$(DOCKER_SONIC_P4)_DEPENDS += $(QUAGGA) $(DOCKER_SONIC_P4)_DEPENDS += $(QUAGGA)
else ifeq ($(ROUTING_STACK), frr) # else ifeq ($(ROUTING_STACK), frr)
$(DOCKER_SONIC_P4)_DEPENDS += $(FRR) # $(DOCKER_SONIC_P4)_DEPENDS += $(FRR)
else # else
$(DOCKER_SONIC_P4)_DEPENDS += $(GOBGP) # $(DOCKER_SONIC_P4)_DEPENDS += $(GOBGP)
endif # endif
$(DOCKER_SONIC_P4)_LOAD_DOCKERS += $(DOCKER_BASE) $(DOCKER_SONIC_P4)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_P4) SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_P4)

View File

@ -20,6 +20,7 @@ debs/{{ deb }}{{' '}}
ADD port_config.ini /port_config.ini ADD port_config.ini /port_config.ini
ADD startup.sh /scripts/startup.sh ADD startup.sh /scripts/startup.sh
ADD run_bm.sh /scripts/run_bm.sh
ADD rsyslog.conf /etc/rsyslog.conf ADD rsyslog.conf /etc/rsyslog.conf

View File

@ -1,5 +1,33 @@
# alias lanes # name lanes
Ethernet0 1 Ethernet0 0
Ethernet1 2 Ethernet1 1
Ethernet2 3 Ethernet2 2
Ethernet3 4 Ethernet3 3
Ethernet4 4
Ethernet5 5
Ethernet6 6
Ethernet7 7
Ethernet8 8
Ethernet9 9
Ethernet10 10
Ethernet11 11
Ethernet12 12
Ethernet13 13
Ethernet14 14
Ethernet15 15
Ethernet16 16
Ethernet17 17
Ethernet18 18
Ethernet19 19
Ethernet20 20
Ethernet21 21
Ethernet22 22
Ethernet23 23
Ethernet24 24
Ethernet25 25
Ethernet26 26
Ethernet27 27
Ethernet28 28
Ethernet29 29
Ethernet30 30
Ethernet31 31

View File

@ -31,6 +31,8 @@ $ModLoad imuxsock # provides support for local system logging
########################### ###########################
#Set remote syslog server #Set remote syslog server
*.* @172.17.0.1:514 *.* @172.17.0.1:514
#Set local syslog
#*.* /var/log/messages
# #
# Use traditional timestamp format. # Use traditional timestamp format.

View File

@ -0,0 +1,23 @@
#!/bin/sh
# handler()
# {
# kill -s INT $ROUTER_PID
# kill -s INT $BRIDGE_PID
# }
set -m
ip netns exec sw_net simple_switch -i 0@router_port1 -i 250@router_cpu_port --thrift-port 9091 --log-file /tmp/router_log --log-flush --notifications-addr ipc:///tmp/bmv2-router-notifications.ipc /usr/share/p4-sai-bm/sai_router.json &
export ROUTER_PID=$!
ip netns exec sw_net simple_switch -i 0@sw_port0 -i 1@sw_port1 -i 2@sw_port2 -i 3@sw_port3 -i 4@sw_port4 -i 5@sw_port5 -i 6@sw_port6 -i 7@sw_port7 -i 7@sw_port7 -i 8@sw_port8 -i 9@sw_port9 -i 10@sw_port10 -i 11@sw_port11 -i 12@sw_port12 -i 13@sw_port13 -i 14@sw_port14 -i 15@sw_port15 -i 16@sw_port16 -i 17@sw_port17 -i 18@sw_port18 -i 19@sw_port19 -i 20@sw_port20 -i 21@sw_port21 -i 22@sw_port22 -i 23@sw_port23 -i 24@sw_port24 -i 25@sw_port25 -i 26@sw_port26 -i 27@sw_port27 -i 28@sw_port28 -i 29@sw_port29 -i 30@sw_port30 -i 31@sw_port31 -i 250@cpu_port -i 251@router_port0 --log-file /tmp/bridge_log --log-flush /usr/share/p4-sai-bm/sai_bridge.json &
export BRIDGE_PID=$!
sleep 10
simple_switch_CLI --pre SimplePreLAG < /usr/share/p4-sai-bm/bridge_default_config.txt
simple_switch_CLI < /usr/share/p4-sai-bm/bridge_default_config_mirror.txt
simple_switch_CLI --pre SimplePreLAG --thrift-port 9091 < /usr/share/p4-sai-bm/router_default_config.txt
simple_switch_CLI --thrift-port 9091 < /usr/share/p4-sai-bm/router_default_config_mirror.txt
# echo "router and bridge are running send SIGINT to close"
# trap handler INT
# sleep inf
# sudo kill -s SIGINT 3319

View File

@ -8,16 +8,16 @@ rm -f /var/run/rsyslogd.pid
service rsyslog start service rsyslog start
echo "Start redis server" echo "Start redis server"
service redis-server start service redis-server start &
sleep 3
redis-cli flushall
echo "Veth setup" echo "Veth setup"
/usr/share/bmpd/tools/veth_setup.sh > /tmp/veth_setup.log 2>&1 veth_setup.sh > /tmp/veth_setup.log 2>&1
echo "Disable IPv6"
/usr/share/bmpd/tools/veth_disable_ipv6.sh > /tmp/veth_disable.log 2>&1
echo "Start BMV2" echo "Start BMV2"
/run_bm.sh > /tmp/run_bm.log 2>&1 & /scripts/run_bm.sh > /tmp/run_bm.log 2>&1 &
sleep 15 sleep 15
redis-cli -n 1 set LOGLEVEL DEBUG redis-cli -n 1 set LOGLEVEL DEBUG

View File

@ -1,7 +1,7 @@
# p4 bmv package # p4 bmv package
P4_BMV = p4-bmv2_1.0.0_amd64.deb P4_BMV = sai-p4-bm_1.0.0_amd64.deb
$(P4_BMV)_DEPENDS += $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4_BMV)_DEPENDS += $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4C_BM)
$(P4_BMV)_RDEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4_BMV)_RDEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(THRIFT_COMPILER)
$(P4_BMV)_SRC_PATH = $(PLATFORM_PATH)/p4-bmv/behavioral-model $(P4_BMV)_SRC_PATH = $(PLATFORM_PATH)/SAI-P4-BM/p4-switch
SONIC_DPKG_DEBS += $(P4_BMV) SONIC_DPKG_DEBS += $(P4_BMV)

@ -1 +0,0 @@
Subproject commit a6ccf267bc9c5c31fd40fe5841893e38e03abeb4

View File

@ -1,5 +1,9 @@
# p4 bmv package # p4 bmv package
P4_HLIR_V1_1 = python-p4-hlir-v1-1_1.1.7-1_all.deb
$(P4_HLIR_V1_1)_SRC_PATH = $(PLATFORM_PATH)/p4-hlir/p4-hlir-v1.1
SONIC_PYTHON_STDEB_DEBS += $(P4_HLIR_V1_1)
P4_HLIR = python-p4-hlir_0.9.36-1_all.deb P4_HLIR = python-p4-hlir_0.9.36-1_all.deb
$(P4_HLIR)_SRC_PATH = $(PLATFORM_PATH)/p4-hlir/p4-hlir $(P4_HLIR)_SRC_PATH = $(PLATFORM_PATH)/p4-hlir/p4-hlir
SONIC_PYTHON_STDEB_DEBS += $(P4_HLIR) SONIC_PYTHON_STDEB_DEBS += $(P4_HLIR)

@ -0,0 +1 @@
Subproject commit fdee55e2567fe65463f328d70558b5079894b420

View File

@ -1,7 +1,7 @@
# p4 switch package # p4 sai adapter package
P4_SWITCH = p4-switch_1.0.0_amd64.deb P4_SWITCH = p4-sai-adapter_0.1-0_amd64.deb
$(P4_SWITCH)_DEPENDS += $(P4C_BM) $(P4_BMV) $(P4_SWITCH)_DEPENDS += $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4_BMV)
$(P4_SWITCH)_RDEPENDS += $(P4C_BM) $(P4_BMV) $(P4_SWITCH)_RDEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4_BMV)
$(P4_SWITCH)_SRC_PATH = $(PLATFORM_PATH)/p4-switch $(P4_SWITCH)_SRC_PATH = $(PLATFORM_PATH)/SAI-P4-BM/sai_adapter
SONIC_MAKE_DEBS += $(P4_SWITCH) SONIC_DPKG_DEBS += $(P4_SWITCH)

View File

@ -1,17 +0,0 @@
SHELL = /bin/bash
.ONESHELL:
MAIN_TARGET = p4-switch_1.0.0_amd64.deb
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
pushd switch
mkdir -p p4-build/bmv2/switch
mkdir -p p4-build/bmv2/pd_thrift_gen
./autogen.sh
dpkg-buildpackage -us -uc -b -j4
popd
mv $* $(DEST)/

@ -1 +0,0 @@
Subproject commit e934752f356d3ad48cbec99067f47c83795ddcec

View File

@ -2,6 +2,6 @@
P4C_BM = python-p4c-bm_1.0.0-5415c416-1_all.deb P4C_BM = python-p4c-bm_1.0.0-5415c416-1_all.deb
$(P4C_BM)_SRC_PATH = $(PLATFORM_PATH)/p4c-bm/p4c-bm $(P4C_BM)_SRC_PATH = $(PLATFORM_PATH)/p4c-bm/p4c-bm
$(P4C_BM)_DEPENDS += $(TENJIN) $(P4_HLIR) $(P4C_BM)_DEPENDS += $(TENJIN) $(P4_HLIR) $(P4_HLIR_V1_1)
$(P4C_BM)_RDEPENDS += $(TENJIN) $(P4_HLIR) $(P4C_BM)_RDEPENDS += $(TENJIN) $(P4_HLIR) $(P4_HLIR_V1_1)
SONIC_PYTHON_STDEB_DEBS += $(P4C_BM) SONIC_PYTHON_STDEB_DEBS += $(P4C_BM)

View File

@ -1,8 +1,10 @@
include $(PLATFORM_PATH)/p4-switch.mk # include $(PLATFORM_PATH)/p4-softswitch.mk
include $(PLATFORM_PATH)/p4-bmv.mk include $(PLATFORM_PATH)/tenjin.mk
include $(PLATFORM_PATH)/p4-hlir.mk include $(PLATFORM_PATH)/p4-hlir.mk
include $(PLATFORM_PATH)/p4c-bm.mk include $(PLATFORM_PATH)/p4c-bm.mk
include $(PLATFORM_PATH)/tenjin.mk # include $(PLATFORM_PATH)/p4-sai-bm.mk
include $(PLATFORM_PATH)/p4-bmv.mk
include $(PLATFORM_PATH)/p4-switch.mk
include $(PLATFORM_PATH)/docker-sonic-p4.mk include $(PLATFORM_PATH)/docker-sonic-p4.mk
SONIC_ALL += $(DOCKER_SONIC_P4) SONIC_ALL += $(DOCKER_SONIC_P4)

View File

@ -9,7 +9,7 @@ MAIN_TARGET = python-tenjin_$(TENJIN_VERSION_FULL)_all.deb
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf Tenjin-$(TENJIN_VERSION) rm -rf Tenjin-$(TENJIN_VERSION)
wget -nc http://pypi.python.org/packages/source/T/Tenjin/Tenjin-$(TENJIN_VERSION).tar.gz wget -nc https://pypi.python.org/packages/source/T/Tenjin/Tenjin-$(TENJIN_VERSION).tar.gz
tar xzf Tenjin-$(TENJIN_VERSION).tar.gz tar xzf Tenjin-$(TENJIN_VERSION).tar.gz
pushd Tenjin-$(TENJIN_VERSION) pushd Tenjin-$(TENJIN_VERSION)

View File

@ -4,14 +4,72 @@ HOWTO Use Virtual Switch
1. Create a docker with 32 front panel port 1. Create a docker with 32 front panel port
``` ```
docker run -id --name sw debian bash $ docker run -id --name sw debian bash
sudo ./create_vnet.sh sw $ sudo ./create_vnet.sh sw
$ ip netns list
sw-srv31 (id: 37)
sw-srv30 (id: 35)
sw-srv29 (id: 34)
sw-srv28 (id: 33)
sw-srv27 (id: 32)
sw-srv26 (id: 31)
sw-srv25 (id: 30)
sw-srv24 (id: 29)
sw-srv23 (id: 28)
sw-srv22 (id: 27)
sw-srv21 (id: 26)
sw-srv20 (id: 25)
sw-srv19 (id: 24)
sw-srv18 (id: 23)
sw-srv17 (id: 22)
sw-srv16 (id: 21)
sw-srv15 (id: 20)
sw-srv14 (id: 19)
sw-srv13 (id: 18)
sw-srv12 (id: 17)
sw-srv11 (id: 16)
sw-srv10 (id: 15)
sw-srv9 (id: 14)
sw-srv8 (id: 13)
sw-srv7 (id: 12)
sw-srv6 (id: 11)
sw-srv5 (id: 10)
sw-srv4 (id: 9)
sw-srv3 (id: 8)
sw-srv2 (id: 7)
sw-srv1 (id: 6)
sw-srv0 (id: 5)
``` ```
2. Create sonic virtual switch docker 2. Start sonic virtual switch docker
``` ```
docker run --privileged --network container:sw -d docker-sonic-vs $ docker run --privileged --network container:sw -d docker-sonic-vs
``` ```
3. Run test in virtual switch docker (TBD) 3. Setup IP in the virtual switch docker
```
$ docker exec -it vs bash
root@2e9b5c2dc2a2:/# ifconfig Ethernet0 10.0.0.0/31 up
root@2e9b5c2dc2a2:/# ifconfig Ethernet4 10.0.0.2/31 up
```
4. Setup IP in the server network namespace
```
$ sudo ip netns exec sw-srv0 ifconfig eth0 10.0.0.1/31
$ sudo ip netns exec sw-srv0 ip route add default via 10.0.0.0
$ sudo ip netns exec sw-srv1 ifconfig eth0 10.0.0.3/31
$ sudo ip netns exec sw-srv1 ip route add default via 10.0.0.2
```
5. Ping from sw-srv0 to sw-srv1
```
$ sudo ip netns exec sw-srv0 ping 10.0.0.3
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
64 bytes from 10.0.0.3: icmp_seq=1 ttl=63 time=0.137 ms
64 bytes from 10.0.0.3: icmp_seq=2 ttl=63 time=0.148 ms
64 bytes from 10.0.0.3: icmp_seq=3 ttl=63 time=0.149 ms
```

View File

@ -2,7 +2,7 @@
DOCKER_SONIC_VS = docker-sonic-vs.gz DOCKER_SONIC_VS = docker-sonic-vs.gz
$(DOCKER_SONIC_VS)_PATH = $(PLATFORM_PATH)/docker-sonic-vs $(DOCKER_SONIC_VS)_PATH = $(PLATFORM_PATH)/docker-sonic-vs
$(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) $(SYNCD_VS) $(REDIS_SERVER) $(REDIS_TOOLS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(SONIC_DEVICE_DATA) $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) $(SYNCD_VS) $(REDIS_SERVER) $(REDIS_TOOLS) $(PYTHON_SWSSCOMMON) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(SONIC_DEVICE_DATA)
ifeq ($(SONIC_ROUTING_STACK), quagga) ifeq ($(SONIC_ROUTING_STACK), quagga)
$(DOCKER_SONIC_VS)_DEPENDS += $(QUAGGA) $(DOCKER_SONIC_VS)_DEPENDS += $(QUAGGA)

View File

@ -1,51 +0,0 @@
FROM docker-config-engine
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y net-tools \
ethtool \
tcpdump \
ifupdown \
bridge-utils \
python-ply \
libqt5core5a \
libqt5network5 \
libboost-program-options1.55.0 \
libboost-system1.55.0 \
libboost-thread1.55.0 \
libgmp10 \
libjudydebian1 \
libnanomsg0 \
libdaemon0 \
libjansson4 \
libjemalloc1 \
openssh-client \
openssh-server \
libc-ares2 \
iproute
COPY \
debs/libnl-route-3-200_3.2.27-1_amd64.deb debs/libnl-genl-3-200_3.2.27-1_amd64.deb debs/libnl-nf-3-200_3.2.27-1_amd64.deb debs/libhiredis0.13_0.13.3-2_amd64.deb debs/libnl-3-200_3.2.27-1_amd64.deb debs/libnl-cli-3-200_3.2.27-1_amd64.deb debs/libswsscommon_1.0.0_amd64.deb debs/libsairedis_1.0.0_amd64.deb debs/libsaimetadata_1.0.0_amd64.deb debs/libteam5_1.26-1_amd64.deb debs/libsaivs_1.0.0_amd64.deb debs/swss_1.0.0_amd64.deb debs/syncd-vs_1.0.0_amd64.deb debs/redis-server_3.2.4-1~bpo8+1_amd64.deb debs/redis-tools_3.2.4-1~bpo8+1_amd64.deb debs/libteamdctl0_1.26-1_amd64.deb debs/libteam-utils_1.26-1_amd64.deb debs/sonic-device-data_1.0-1_all.deb debs/quagga_0.99.24.1-2.1_amd64.deb debs/
RUN dpkg -i \
debs/libnl-route-3-200_3.2.27-1_amd64.deb debs/libnl-genl-3-200_3.2.27-1_amd64.deb debs/libnl-nf-3-200_3.2.27-1_amd64.deb debs/libhiredis0.13_0.13.3-2_amd64.deb debs/libnl-3-200_3.2.27-1_amd64.deb debs/libnl-cli-3-200_3.2.27-1_amd64.deb debs/libswsscommon_1.0.0_amd64.deb debs/libsairedis_1.0.0_amd64.deb debs/libsaimetadata_1.0.0_amd64.deb debs/libteam5_1.26-1_amd64.deb debs/libsaivs_1.0.0_amd64.deb debs/swss_1.0.0_amd64.deb debs/syncd-vs_1.0.0_amd64.deb debs/redis-server_3.2.4-1~bpo8+1_amd64.deb debs/redis-tools_3.2.4-1~bpo8+1_amd64.deb debs/libteamdctl0_1.26-1_amd64.deb debs/libteam-utils_1.26-1_amd64.deb debs/sonic-device-data_1.0-1_all.deb debs/quagga_0.99.24.1-2.1_amd64.deb
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
RUN sed -ri 's/^daemonize yes$/daemonize no/; \
s/^logfile .*$/logfile ""/; \
s/^# syslog-enabled no$/syslog-enabled no/; \
s/^# unixsocket/unixsocket/ \
' /etc/redis/redis.conf
COPY ["50-default.conf", "/etc/rsyslog.d/"]
COPY ["start.sh", "orchagent.sh", "/usr/bin/"]
COPY ["brcm.profile.ini", "/usr/share/sonic/device/vswitch/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
ENTRYPOINT ["/usr/bin/supervisord"]

View File

@ -25,7 +25,8 @@ RUN apt-get install -y net-tools \
openssh-client \ openssh-client \
openssh-server \ openssh-server \
libc-ares2 \ libc-ares2 \
iproute iproute \
libpython2.7
COPY \ COPY \
{% for deb in docker_sonic_vs_debs.split(' ') -%} {% for deb in docker_sonic_vs_debs.split(' ') -%}

View File

@ -26,6 +26,8 @@ supervisorctl start intfsyncd
supervisorctl start neighsyncd supervisorctl start neighsyncd
supervisorctl start teamsyncd
# Start arp_update when VLAN exists # Start arp_update when VLAN exists
# VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` # VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
# if [ "$VLAN" != "" ]; then # if [ "$VLAN" != "" ]; then

View File

@ -66,3 +66,11 @@ autostart=false
autorestart=false autorestart=false
stdout_logfile=syslog stdout_logfile=syslog
stderr_logfile=syslog stderr_logfile=syslog
[program:teamsyncd]
command=/usr/bin/teamsyncd
priority=9
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

View File

@ -12,6 +12,9 @@ SONIC_DPKG_DEBS += $(LIBSWSSCOMMON)
LIBSWSSCOMMON_DEV = libswsscommon-dev_1.0.0_amd64.deb LIBSWSSCOMMON_DEV = libswsscommon-dev_1.0.0_amd64.deb
$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DEV))) $(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DEV)))
PYTHON_SWSSCOMMON = python-swsscommon_1.0.0_amd64.deb
$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(PYTHON_SWSSCOMMON)))
LIBSWSSCOMMON_DBG = libswsscommon-dbg_1.0.0_amd64.deb LIBSWSSCOMMON_DBG = libswsscommon-dbg_1.0.0_amd64.deb
$(LIBSWSSCOMMON_DBG)_DEPENDS += $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DBG)_DEPENDS += $(LIBSWSSCOMMON)
$(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON)

View File

@ -24,7 +24,7 @@ ns = "Microsoft.Search.Autopilot.Evolution"
ns1 = "http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution" ns1 = "http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"
ns2 = "Microsoft.Search.Autopilot.NetMux" ns2 = "Microsoft.Search.Autopilot.NetMux"
ns3 = "http://www.w3.org/2001/XMLSchema-instance" ns3 = "http://www.w3.org/2001/XMLSchema-instance"
KEY_SEPARATOR = '|'
class minigraph_encoder(json.JSONEncoder): class minigraph_encoder(json.JSONEncoder):
def default(self, obj): def default(self, obj):
@ -86,7 +86,7 @@ def parse_png(png, hname):
if child.tag == str(QName(ns, "Devices")): if child.tag == str(QName(ns, "Devices")):
for device in child.findall(str(QName(ns, "Device"))): for device in child.findall(str(QName(ns, "Device"))):
(lo_prefix, mgmt_prefix, name, hwsku, d_type) = parse_device(device) (lo_prefix, mgmt_prefix, name, hwsku, d_type) = parse_device(device)
device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku } device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku }
devices[name] = device_data devices[name] = device_data
if child.tag == str(QName(ns, "DeviceInterfaceLinks")): if child.tag == str(QName(ns, "DeviceInterfaceLinks")):
@ -153,6 +153,7 @@ def parse_dpg(dpg, hname):
vlanintfs = child.find(str(QName(ns, "VlanInterfaces"))) vlanintfs = child.find(str(QName(ns, "VlanInterfaces")))
vlan_intfs = [] vlan_intfs = []
vlans = {} vlans = {}
vlan_members = {}
for vintf in vlanintfs.findall(str(QName(ns, "VlanInterface"))): for vintf in vlanintfs.findall(str(QName(ns, "VlanInterface"))):
vintfname = vintf.find(str(QName(ns, "Name"))).text vintfname = vintf.find(str(QName(ns, "Name"))).text
vlanid = vintf.find(str(QName(ns, "VlanID"))).text vlanid = vintf.find(str(QName(ns, "VlanID"))).text
@ -160,7 +161,10 @@ def parse_dpg(dpg, hname):
vmbr_list = vintfmbr.split(';') vmbr_list = vintfmbr.split(';')
for i, member in enumerate(vmbr_list): for i, member in enumerate(vmbr_list):
vmbr_list[i] = port_alias_map.get(member, member) vmbr_list[i] = port_alias_map.get(member, member)
vlan_attributes = {'members': vmbr_list, 'vlanid': vlanid} sonic_vlan_member_name = "Vlan%s%s%s" % (vlanid, KEY_SEPARATOR, vmbr_list[i])
vlan_members[sonic_vlan_member_name] = {'tagging_mode': 'untagged'}
vlan_attributes = {'vlanid': vlanid}
# If this VLAN requires a DHCP relay agent, it will contain a <DhcpRelays> element # If this VLAN requires a DHCP relay agent, it will contain a <DhcpRelays> element
# containing a list of DHCP server IPs # containing a list of DHCP server IPs
@ -194,8 +198,8 @@ def parse_dpg(dpg, hname):
break; break;
if acl_intfs: if acl_intfs:
acls[aclname] = { 'policy_desc': aclname, 'ports': acl_intfs, 'type': 'MIRROR' if is_mirror else 'L3'} acls[aclname] = { 'policy_desc': aclname, 'ports': acl_intfs, 'type': 'MIRROR' if is_mirror else 'L3'}
return intfs, lo_intfs, mgmt_intf, vlans, pcs, acls return intfs, lo_intfs, mgmt_intf, vlans, vlan_members, pcs, acls
return None, None, None, None, None, None return None, None, None, None, None, None, None
def parse_cpg(cpg, hname): def parse_cpg(cpg, hname):
@ -318,6 +322,7 @@ def parse_xml(filename, platform=None, port_config_file=None):
vlan_intfs = None vlan_intfs = None
pc_intfs = None pc_intfs = None
vlans = None vlans = None
vlan_members = None
pcs = None pcs = None
mgmt_intf = None mgmt_intf = None
lo_intf = None lo_intf = None
@ -345,7 +350,7 @@ def parse_xml(filename, platform=None, port_config_file=None):
port_alias_map.update(alias_map) port_alias_map.update(alias_map)
for child in root: for child in root:
if child.tag == str(QName(ns, "DpgDec")): if child.tag == str(QName(ns, "DpgDec")):
(intfs, lo_intfs, mgmt_intf, vlans, pcs, acls) = parse_dpg(child, hostname) (intfs, lo_intfs, mgmt_intf, vlans, vlan_members, pcs, acls) = parse_dpg(child, hostname)
elif child.tag == str(QName(ns, "CpgDec")): elif child.tag == str(QName(ns, "CpgDec")):
(bgp_sessions, bgp_asn, bgp_peers_with_range) = parse_cpg(child, hostname) (bgp_sessions, bgp_asn, bgp_peers_with_range) = parse_cpg(child, hostname)
elif child.tag == str(QName(ns, "PngDec")): elif child.tag == str(QName(ns, "PngDec")):
@ -393,6 +398,7 @@ def parse_xml(filename, platform=None, port_config_file=None):
results['PORT'] = ports results['PORT'] = ports
results['PORTCHANNEL'] = pcs results['PORTCHANNEL'] = pcs
results['VLAN'] = vlans results['VLAN'] = vlans
results['VLAN_MEMBER'] = vlan_members
results['DEVICE_NEIGHBOR'] = neighbors results['DEVICE_NEIGHBOR'] = neighbors
results['DEVICE_NEIGHBOR_METADATA'] = { key:devices[key] for key in devices if key != hostname } results['DEVICE_NEIGHBOR_METADATA'] = { key:devices[key] for key in devices if key != hostname }

View File

@ -44,151 +44,6 @@ iface eth0 inet6 static
down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default
# #
# The switch front panel interfaces # The switch front panel interfaces
# "|| true" is added to suppress the error when interface is already a member of VLAN
allow-hotplug fortyGigE0/4
iface fortyGigE0/4 inet manual
pre-up ifconfig fortyGigE0/4 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/4 || true
post-down ifconfig fortyGigE0/4 down
#
allow-hotplug fortyGigE0/8
iface fortyGigE0/8 inet manual
pre-up ifconfig fortyGigE0/8 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/8 || true
post-down ifconfig fortyGigE0/8 down
#
allow-hotplug fortyGigE0/12
iface fortyGigE0/12 inet manual
pre-up ifconfig fortyGigE0/12 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/12 || true
post-down ifconfig fortyGigE0/12 down
#
allow-hotplug fortyGigE0/16
iface fortyGigE0/16 inet manual
pre-up ifconfig fortyGigE0/16 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/16 || true
post-down ifconfig fortyGigE0/16 down
#
allow-hotplug fortyGigE0/20
iface fortyGigE0/20 inet manual
pre-up ifconfig fortyGigE0/20 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/20 || true
post-down ifconfig fortyGigE0/20 down
#
allow-hotplug fortyGigE0/24
iface fortyGigE0/24 inet manual
pre-up ifconfig fortyGigE0/24 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/24 || true
post-down ifconfig fortyGigE0/24 down
#
allow-hotplug fortyGigE0/28
iface fortyGigE0/28 inet manual
pre-up ifconfig fortyGigE0/28 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/28 || true
post-down ifconfig fortyGigE0/28 down
#
allow-hotplug fortyGigE0/32
iface fortyGigE0/32 inet manual
pre-up ifconfig fortyGigE0/32 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/32 || true
post-down ifconfig fortyGigE0/32 down
#
allow-hotplug fortyGigE0/36
iface fortyGigE0/36 inet manual
pre-up ifconfig fortyGigE0/36 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/36 || true
post-down ifconfig fortyGigE0/36 down
#
allow-hotplug fortyGigE0/40
iface fortyGigE0/40 inet manual
pre-up ifconfig fortyGigE0/40 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/40 || true
post-down ifconfig fortyGigE0/40 down
#
allow-hotplug fortyGigE0/44
iface fortyGigE0/44 inet manual
pre-up ifconfig fortyGigE0/44 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/44 || true
post-down ifconfig fortyGigE0/44 down
#
allow-hotplug fortyGigE0/48
iface fortyGigE0/48 inet manual
pre-up ifconfig fortyGigE0/48 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/48 || true
post-down ifconfig fortyGigE0/48 down
#
allow-hotplug fortyGigE0/52
iface fortyGigE0/52 inet manual
pre-up ifconfig fortyGigE0/52 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/52 || true
post-down ifconfig fortyGigE0/52 down
#
allow-hotplug fortyGigE0/56
iface fortyGigE0/56 inet manual
pre-up ifconfig fortyGigE0/56 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/56 || true
post-down ifconfig fortyGigE0/56 down
#
allow-hotplug fortyGigE0/60
iface fortyGigE0/60 inet manual
pre-up ifconfig fortyGigE0/60 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/60 || true
post-down ifconfig fortyGigE0/60 down
#
allow-hotplug fortyGigE0/64
iface fortyGigE0/64 inet manual
pre-up ifconfig fortyGigE0/64 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/64 || true
post-down ifconfig fortyGigE0/64 down
#
allow-hotplug fortyGigE0/68
iface fortyGigE0/68 inet manual
pre-up ifconfig fortyGigE0/68 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/68 || true
post-down ifconfig fortyGigE0/68 down
#
allow-hotplug fortyGigE0/72
iface fortyGigE0/72 inet manual
pre-up ifconfig fortyGigE0/72 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/72 || true
post-down ifconfig fortyGigE0/72 down
#
allow-hotplug fortyGigE0/76
iface fortyGigE0/76 inet manual
pre-up ifconfig fortyGigE0/76 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/76 || true
post-down ifconfig fortyGigE0/76 down
#
allow-hotplug fortyGigE0/80
iface fortyGigE0/80 inet manual
pre-up ifconfig fortyGigE0/80 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/80 || true
post-down ifconfig fortyGigE0/80 down
#
allow-hotplug fortyGigE0/84
iface fortyGigE0/84 inet manual
pre-up ifconfig fortyGigE0/84 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/84 || true
post-down ifconfig fortyGigE0/84 down
#
allow-hotplug fortyGigE0/88
iface fortyGigE0/88 inet manual
pre-up ifconfig fortyGigE0/88 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/88 || true
post-down ifconfig fortyGigE0/88 down
#
allow-hotplug fortyGigE0/92
iface fortyGigE0/92 inet manual
pre-up ifconfig fortyGigE0/92 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/92 || true
post-down ifconfig fortyGigE0/92 down
#
allow-hotplug fortyGigE0/96
iface fortyGigE0/96 inet manual
pre-up ifconfig fortyGigE0/96 up mtu 9100
post-up brctl addif Vlan1000 fortyGigE0/96 || true
post-down ifconfig fortyGigE0/96 down
#
# "|| true" is added to suppress the error when interface is already a member of LAG # "|| true" is added to suppress the error when interface is already a member of LAG
# "ip link show | grep -q master" is added to ensure interface is enslaved # "ip link show | grep -q master" is added to ensure interface is enslaved
allow-hotplug fortyGigE0/112 allow-hotplug fortyGigE0/112
@ -215,14 +70,6 @@ iface fortyGigE0/124 inet manual
post-up ip link show fortyGigE0/124 | grep -q master && ifconfig fortyGigE0/124 up post-up ip link show fortyGigE0/124 | grep -q master && ifconfig fortyGigE0/124 up
post-down ifconfig fortyGigE0/124 down post-down ifconfig fortyGigE0/124 down
# #
# Vlan interfaces
auto Vlan1000
iface Vlan1000 inet static
bridge_ports none
hwaddress ether e4:1d:2d:a5:f3:ad
address 192.168.0.1
netmask 255.255.255.224
#
# Portchannel interfaces # Portchannel interfaces
allow-hotplug PortChannel01 allow-hotplug PortChannel01
iface PortChannel01 inet static iface PortChannel01 inet static

View File

@ -1,12 +1,4 @@
[ [
{
"BUFFER_POOL_TABLE:ingress_lossless_pool": {
"size": "3024486",
"type": "ingress",
"mode": "dynamic"
},
"OP": "SET"
},
{ {
"BUFFER_POOL_TABLE:ingress_lossy_pool": { "BUFFER_POOL_TABLE:ingress_lossy_pool": {
"size": "6422528", "size": "6422528",
@ -297,7 +289,7 @@
{ {
"BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile": { "BUFFER_PROFILE_TABLE:pg_lossless_40G_300m_profile": {
"pool":"[BUFFER_POOL_TABLE:ingress_lossless_pg_pool]", "pool":"[BUFFER_POOL_TABLE:ingress_lossless_pool]",
"xon":"18432", "xon":"18432",
"xoff":"75776", "xoff":"75776",
"size":"94208", "size":"94208",
@ -306,8 +298,8 @@
"OP": "SET" "OP": "SET"
}, },
{ {
"BUFFER_POOL_TABLE:ingress_lossless_pg_pool": { "BUFFER_POOL_TABLE:ingress_lossless_pool": {
"size": "3014656", "size": "3881382",
"type": "ingress", "type": "ingress",
"mode": "dynamic" "mode": "dynamic"
}, },

View File

@ -88,7 +88,12 @@ class TestCfgGen(TestCase):
def test_minigraph_vlans(self): def test_minigraph_vlans(self):
argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN' argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN'
output = self.run_script(argument) output = self.run_script(argument)
self.assertEqual(output.strip(), "{'Vlan1000': {'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'members': ['Ethernet8'], 'vlanid': '1000'}}") self.assertEqual(output.strip(), "{'Vlan1000': {'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '1000'}}")
def test_minigraph_vlan_members(self):
argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN_MEMBER'
output = self.run_script(argument)
self.assertEqual(output.strip(), "{'Vlan1000|Ethernet8': {'tagging_mode': 'untagged'}}")
def test_minigraph_vlan_interfaces(self): def test_minigraph_vlan_interfaces(self):
argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()"' argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()"'

@ -1 +1 @@
Subproject commit d68c286ba7c984c98ebfafc2bb5fe24905659e5f Subproject commit d1df4717627acf9421861545b71e411acf3c5f32

@ -1 +1 @@
Subproject commit 294f5406e971396352b06c3b4954a2f80dd8ba34 Subproject commit 674fb107dfb8e45b23a55e3e7be34e39d5630942

@ -1 +1 @@
Subproject commit e0366e03b884b155bc93751999ae08b961592026 Subproject commit 62dea03d74a49716a6647e3fa3a3654b19bf46ad

@ -1 +1 @@
Subproject commit 1b347a4337f77e5d166601fbabeaca4b32875f23 Subproject commit 01899cdc33df5dc9ae95bf6bd09979a08e620035

@ -1 +1 @@
Subproject commit adf7d4cb3c22061bf781ef6ce7b79964ce505730 Subproject commit be508cff8947cf07a712d21afe2ae80238ccc483

@ -1 +1 @@
Subproject commit 1d37c9c199b7934653f907095bf11e685889df23 Subproject commit e87bb97760a4cf069da51b2a0da732f7a40f3215