diff --git a/.gitignore b/.gitignore index 9ca9d2ff1a..c5ed255e62 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,7 @@ dockers/docker-teamd/Dockerfile dockers/docker-sonic-mgmt/Dockerfile platform/*/docker-syncd-*/Dockerfile platform/*/docker-syncd-*-rpc/Dockerfile +platform/vs/docker-sonic-vs/Dockerfile # Installer-related files and directories installer/x86_64/platforms/ diff --git a/.gitmodules b/.gitmodules index 7471fd1e6b..7aa9fa333b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -68,3 +68,9 @@ [submodule "src/sonic-frr/frr"] path = src/sonic-frr/frr 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 diff --git a/Makefile b/Makefile index bf9e0da0c7..800cd32093 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ $(shell rm -f .screen) MAKEFLAGS += -B -SLAVE_BASE_TAG = $(shell shasum 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_BASE_TAG = $(shell sha1sum sonic-slave/Dockerfile | 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_IMAGE = sonic-slave-$(USER) diff --git a/README.md b/README.md index 53e8b8ff22..dc0e34a614 100644 --- a/README.md +++ b/README.md @@ -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) -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/) -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/) -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) -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) +*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) +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) +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) +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) + +*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 @@ -10,7 +14,7 @@ P4: [![Broadcom](https://sonic-jenkins.westus.cloudapp.azure.com/job/p4/job/buil # 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 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=centec - 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. @@ -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-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-vs.gz: docker image for all-in-one for software virtual switch (gzip tar archive) ## Contribution Guide diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini index 35a2175cf2..d67a4f1bc0 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/port_config.ini @@ -1,121 +1,123 @@ # name lanes alias index Ethernet0 77,78 Ethernet1/1 1 -Ethernet2 79,80 Ethernet1/3 2 -Ethernet4 65,66 Ethernet2/1 3 -Ethernet6 67,68 Ethernet2/3 4 -Ethernet8 85,86 Ethernet3/1 5 -Ethernet10 87,88 Ethernet3/3 6 -Ethernet12 89,90 Ethernet4/1 7 -Ethernet14 91,92 Ethernet4/3 8 -Ethernet16 109,110 Ethernet5/1 9 -Ethernet18 111,112 Ethernet5/3 10 -Ethernet20 97,98 Ethernet6/1 11 -Ethernet22 99,100 Ethernet6/3 12 -Ethernet24 5,6 Ethernet7/1 13 -Ethernet26 7,8 Ethernet7/3 14 -Ethernet28 13,14 Ethernet8/1 15 -Ethernet30 15,16 Ethernet8/3 16 -Ethernet32 25,26 Ethernet9/1 17 -Ethernet34 27,28 Ethernet9/3 18 -Ethernet36 21,22 Ethernet10/1 19 -Ethernet38 23,24 Ethernet10/3 20 -Ethernet40 37,38 Ethernet11/1 21 -Ethernet42 39,40 Ethernet11/3 22 -Ethernet44 45,46 Ethernet12/1 23 -Ethernet46 47,48 Ethernet12/3 24 -Ethernet48 57,58 Ethernet13/1 25 -Ethernet50 59,60 Ethernet13/3 26 -Ethernet52 53,54 Ethernet14/1 27 -Ethernet54 55,56 Ethernet14/3 28 -Ethernet56 117,118 Ethernet15/1 29 -Ethernet58 119,120 Ethernet15/3 30 -Ethernet60 121,122 Ethernet16/1 31 -Ethernet62 123,124 Ethernet16/3 32 -Ethernet64 141,142 Ethernet17/1 33 -Ethernet66 143,144 Ethernet17/3 34 -Ethernet68 133,134,135,136 Ethernet18/1 35 -Ethernet72 197,198 Ethernet19/1 36 -Ethernet74 199,200 Ethernet19/3 37 -Ethernet76 205,206,207,208 Ethernet20/1 38 -Ethernet80 217,218 Ethernet21/1 39 -Ethernet82 219,220 Ethernet21/3 40 -Ethernet84 213,214 Ethernet22/1 41 -Ethernet86 215,216 Ethernet22/3 42 -Ethernet88 229,230 Ethernet23/1 43 -Ethernet90 231,232 Ethernet23/3 44 -Ethernet92 237,238 Ethernet24/1 45 -Ethernet94 239,240 Ethernet24/3 46 -Ethernet96 249,250 Ethernet25/1 47 -Ethernet98 251,252 Ethernet25/3 48 -Ethernet100 245,246 Ethernet26/1 49 -Ethernet102 247,248 Ethernet26/3 50 -Ethernet104 149,150 Ethernet27/1 51 -Ethernet106 151,152 Ethernet27/3 52 -Ethernet108 153,154 Ethernet28/1 53 -Ethernet110 155,156 Ethernet28/3 54 -Ethernet112 173,174 Ethernet29/1 55 -Ethernet114 175,176 Ethernet29/3 56 -Ethernet116 161,162 Ethernet30/1 57 -Ethernet118 163,164 Ethernet30/3 58 -Ethernet120 181,182 Ethernet31/1 59 -Ethernet122 183,184 Ethernet31/3 60 -Ethernet124 185,186 Ethernet32/1 61 -Ethernet126 187,188 Ethernet32/3 62 -Ethernet128 69,70 Ethernet33/1 63 -Ethernet130 71,72 Ethernet33/3 64 -Ethernet132 73,74 Ethernet34/1 65 -Ethernet134 75,76 Ethernet34/3 66 -Ethernet136 93,94 Ethernet35/1 67 -Ethernet138 95,96 Ethernet35/3 68 -Ethernet140 81,82 Ethernet36/1 69 -Ethernet142 83,84 Ethernet36/3 70 -Ethernet144 101,102 Ethernet37/1 71 -Ethernet146 103,104 Ethernet37/3 72 -Ethernet148 105,106 Ethernet38/1 73 -Ethernet150 107,108 Ethernet38/3 74 -Ethernet152 9,10 Ethernet39/1 75 -Ethernet154 11,12 Ethernet39/3 76 -Ethernet156 1,2 Ethernet40/1 77 -Ethernet158 3,4 Ethernet40/3 78 -Ethernet160 17,18 Ethernet41/1 79 -Ethernet162 19,20 Ethernet41/3 80 -Ethernet164 29,30 Ethernet42/1 81 -Ethernet166 31,32 Ethernet42/1 82 -Ethernet168 41,42 Ethernet43/1 83 -Ethernet170 43,44 Ethernet43/3 84 -Ethernet172 33,34 Ethernet44/1 85 -Ethernet174 35,36 Ethernet44/3 86 -Ethernet176 49,50,51,52 Ethernet45/1 87 -Ethernet180 61,62,63,64 Ethernet46/1 88 -Ethernet184 125,126,127,128 Ethernet47/1 89 -Ethernet188 113,114,115,116 Ethernet48/1 90 -Ethernet192 129,130,131,132 Ethernet49/1 91 -Ethernet196 137,138,139,140 Ethernet50/1 92 -Ethernet200 201,202,203,204 Ethernet51/1 93 -Ethernet204 193,194,195,196 Ethernet52/1 94 -Ethernet208 209,210 Ethernet53/1 95 -Ethernet210 211,212 Ethernet53/3 96 -Ethernet212 221,222 Ethernet54/1 97 -Ethernet214 223,224 Ethernet54/3 98 -Ethernet216 233,234 Ethernet55/1 99 -Ethernet218 235,236 Ethernet55/3 100 -Ethernet220 225,226 Ethernet56/1 101 -Ethernet222 227,228 Ethernet56/3 102 -Ethernet224 241,242 Ethernet57/1 103 -Ethernet226 243,244 Ethernet57/3 104 -Ethernet228 253,254 Ethernet58/1 105 -Ethernet230 255,256 Ethernet58/3 106 -Ethernet232 157,158 Ethernet59/1 107 -Ethernet234 159,160 Ethernet59/3 108 -Ethernet236 145,146 Ethernet60/1 109 -Ethernet238 147,148 Ethernet60/3 110 -Ethernet240 165,166 Ethernet61/1 111 -Ethernet242 167,168 Ethernet61/3 112 -Ethernet244 169,170 Ethernet62/1 113 -Ethernet246 171,172 Ethernet62/3 114 -Ethernet248 189,190 Ethernet63/1 115 -Ethernet250 191,192 Ethernet63/3 116 -Ethernet252 177,178 Ethernet64/1 117 -Ethernet254 179,180 Ethernet64/3 118 -Ethernet256 257 Ethernet257 119 -Ethernet260 259 Ethernet259 120 +Ethernet2 79,80 Ethernet1/3 1 +Ethernet4 65,66 Ethernet2/1 2 +Ethernet6 67,68 Ethernet2/3 2 +Ethernet8 85,86 Ethernet3/1 3 +Ethernet10 87,88 Ethernet3/3 3 +Ethernet12 89,90 Ethernet4/1 4 +Ethernet14 91,92 Ethernet4/3 4 +Ethernet16 109,110 Ethernet5/1 5 +Ethernet18 111,112 Ethernet5/3 5 +Ethernet20 97,98 Ethernet6/1 6 +Ethernet22 99,100 Ethernet6/3 6 +Ethernet24 5,6 Ethernet7/1 7 +Ethernet26 7,8 Ethernet7/3 7 +Ethernet28 13,14 Ethernet8/1 8 +Ethernet30 15,16 Ethernet8/3 8 +Ethernet32 25,26 Ethernet9/1 9 +Ethernet34 27,28 Ethernet9/3 9 +Ethernet36 21,22 Ethernet10/1 10 +Ethernet38 23,24 Ethernet10/3 10 +Ethernet40 37,38 Ethernet11/1 11 +Ethernet42 39,40 Ethernet11/3 11 +Ethernet44 45,46 Ethernet12/1 12 +Ethernet46 47,48 Ethernet12/3 12 +Ethernet48 57,58 Ethernet13/1 13 +Ethernet50 59,60 Ethernet13/3 13 +Ethernet52 53,54 Ethernet14/1 14 +Ethernet54 55,56 Ethernet14/3 14 +Ethernet56 117,118 Ethernet15/1 15 +Ethernet58 119,120 Ethernet15/3 15 +Ethernet60 121,122 Ethernet16/1 16 +Ethernet62 123,124 Ethernet16/3 16 +Ethernet64 141,142 Ethernet17/1 17 +Ethernet66 143,144 Ethernet17/3 17 +Ethernet68 133,134 Ethernet18/1 18 +Ethernet70 135,136 Ethernet18/3 18 +Ethernet72 197,198 Ethernet19/1 19 +Ethernet74 199,200 Ethernet19/3 19 +Ethernet76 205,206 Ethernet20/1 20 +Ethernet78 207,208 Ethernet20/3 20 +Ethernet80 217,218 Ethernet21/1 21 +Ethernet82 219,220 Ethernet21/3 21 +Ethernet84 213,214 Ethernet22/1 22 +Ethernet86 215,216 Ethernet22/3 22 +Ethernet88 229,230 Ethernet23/1 23 +Ethernet90 231,232 Ethernet23/3 23 +Ethernet92 237,238 Ethernet24/1 24 +Ethernet94 239,240 Ethernet24/3 24 +Ethernet96 249,250 Ethernet25/1 25 +Ethernet98 251,252 Ethernet25/3 25 +Ethernet100 245,246 Ethernet26/1 26 +Ethernet102 247,248 Ethernet26/3 26 +Ethernet104 149,150 Ethernet27/1 27 +Ethernet106 151,152 Ethernet27/3 27 +Ethernet108 153,154 Ethernet28/1 28 +Ethernet110 155,156 Ethernet28/3 28 +Ethernet112 173,174 Ethernet29/1 29 +Ethernet114 175,176 Ethernet29/3 29 +Ethernet116 161,162 Ethernet30/1 30 +Ethernet118 163,164 Ethernet30/3 30 +Ethernet120 181,182 Ethernet31/1 31 +Ethernet122 183,184 Ethernet31/3 31 +Ethernet124 185,186 Ethernet32/1 32 +Ethernet126 187,188 Ethernet32/3 32 +Ethernet128 69,70 Ethernet33/1 33 +Ethernet130 71,72 Ethernet33/3 33 +Ethernet132 73,74 Ethernet34/1 34 +Ethernet134 75,76 Ethernet34/3 34 +Ethernet136 93,94 Ethernet35/1 35 +Ethernet138 95,96 Ethernet35/3 35 +Ethernet140 81,82 Ethernet36/1 36 +Ethernet142 83,84 Ethernet36/3 36 +Ethernet144 101,102 Ethernet37/1 37 +Ethernet146 103,104 Ethernet37/3 37 +Ethernet148 105,106 Ethernet38/1 38 +Ethernet150 107,108 Ethernet38/3 38 +Ethernet152 9,10 Ethernet39/1 39 +Ethernet154 11,12 Ethernet39/3 39 +Ethernet156 1,2 Ethernet40/1 40 +Ethernet158 3,4 Ethernet40/3 40 +Ethernet160 17,18 Ethernet41/1 41 +Ethernet162 19,20 Ethernet41/3 41 +Ethernet164 29,30 Ethernet42/1 42 +Ethernet166 31,32 Ethernet42/3 42 +Ethernet168 41,42 Ethernet43/1 43 +Ethernet170 43,44 Ethernet43/3 43 +Ethernet172 33,34 Ethernet44/1 44 +Ethernet174 35,36 Ethernet44/3 44 +Ethernet176 49,50,51,52 Ethernet45/1 45 +Ethernet180 61,62,63,64 Ethernet46/1 46 +Ethernet184 125,126,127,128 Ethernet47/1 47 +Ethernet188 113,114,115,116 Ethernet48/1 48 +Ethernet192 129,130,131,132 Ethernet49/1 49 +Ethernet196 137,138,139,140 Ethernet50/1 50 +Ethernet200 201,202,203,204 Ethernet51/1 51 +Ethernet204 193,194,195,196 Ethernet52/1 52 +Ethernet208 209,210 Ethernet53/1 53 +Ethernet210 211,212 Ethernet53/3 53 +Ethernet212 221,222 Ethernet54/1 54 +Ethernet214 223,224 Ethernet54/3 54 +Ethernet216 233,234 Ethernet55/1 55 +Ethernet218 235,236 Ethernet55/3 55 +Ethernet220 225,226 Ethernet56/1 56 +Ethernet222 227,228 Ethernet56/3 56 +Ethernet224 241,242 Ethernet57/1 57 +Ethernet226 243,244 Ethernet57/3 57 +Ethernet228 253,254 Ethernet58/1 58 +Ethernet230 255,256 Ethernet58/3 58 +Ethernet232 157,158 Ethernet59/1 59 +Ethernet234 159,160 Ethernet59/3 59 +Ethernet236 145,146 Ethernet60/1 60 +Ethernet238 147,148 Ethernet60/3 60 +Ethernet240 165,166 Ethernet61/1 61 +Ethernet242 167,168 Ethernet61/3 61 +Ethernet244 169,170 Ethernet62/1 62 +Ethernet246 171,172 Ethernet62/3 62 +Ethernet248 189,190 Ethernet63/1 63 +Ethernet250 191,192 Ethernet63/3 63 +Ethernet252 177,178 Ethernet64/1 64 +Ethernet254 179,180 Ethernet64/3 64 +Ethernet256 257 Ethernet65 65 +Ethernet260 259 Ethernet66 66 diff --git a/dockers/docker-orchagent/msn27xx.32ports.buffers.json.j2 b/dockers/docker-orchagent/msn27xx.32ports.buffers.json.j2 index 075385079a..ce1ddedbba 100644 --- a/dockers/docker-orchagent/msn27xx.32ports.buffers.json.j2 +++ b/dockers/docker-orchagent/msn27xx.32ports.buffers.json.j2 @@ -4,14 +4,6 @@ {%- if port_names_list.append(port) %}{% endif %} {% endfor %} {% 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": { "size": "6422528", @@ -106,6 +98,7 @@ }, {# The following template part is for variable PG profile configuration #} +{% set non_pg_lossless_pool_size = 866726 %} {% set pg_range = '3-4' %} {# Lists of supported speed and cable length #} {% set supported_speed = [10000, 25000, 40000, 50000, 100000] %} @@ -239,7 +232,7 @@ {%- set profile_config = pg_profiles[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'] }}", "xoff":"{{ profile_config['xoff'] }}", "size":"{{ profile_config['size'] }}", @@ -249,10 +242,10 @@ }, {% endfor -%} - {# Pool declaration #} + {# Lossless pool declaration #} { - "BUFFER_POOL_TABLE:ingress_lossless_pg_pool": { - "size": "{{ ingress_lossless_pg_pool_size | sum }}", + "BUFFER_POOL_TABLE:ingress_lossless_pool": { + "size": "{{ ingress_lossless_pg_pool_size | sum + non_pg_lossless_pool_size }}", "type": "ingress", "mode": "dynamic" }, diff --git a/dockers/docker-orchagent/start.sh b/dockers/docker-orchagent/start.sh index aa4e5b7dae..9f3ba3cb07 100755 --- a/dockers/docker-orchagent/start.sh +++ b/dockers/docker-orchagent/start.sh @@ -22,6 +22,10 @@ supervisorctl start neighsyncd supervisorctl start swssconfig +supervisorctl start vlanmgrd + +supervisorctl start intfmgrd + # Start arp_update when VLAN exists VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` if [ "$VLAN" != "" ]; then diff --git a/dockers/docker-orchagent/supervisord.conf b/dockers/docker-orchagent/supervisord.conf index 09850b13d4..95e92be622 100644 --- a/dockers/docker-orchagent/supervisord.conf +++ b/dockers/docker-orchagent/supervisord.conf @@ -67,3 +67,19 @@ autostart=false autorestart=true stdout_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 diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index b88c0ec35b..18d1ee126c 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -65,9 +65,6 @@ extract_image() { ## vfat does not support symbol link 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 }}" if [ -n "$sonic_upgrade" ]; then @@ -133,7 +130,7 @@ platform_specific() { aboot_machine=arista_7260cx3_64 fi if [ "$platform" = "rook" ]; then - varlog_size=200 + varlog_size=4096 readprefdl -f /tmp/.system-prefdl -d > /mnt/flash/.system-prefdl fi diff --git a/files/build_templates/swss.service.j2 b/files/build_templates/swss.service.j2 index 74fafb0037..ad52f395d0 100644 --- a/files/build_templates/swss.service.j2 +++ b/files/build_templates/swss.service.j2 @@ -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 2 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' %} TimeoutStartSec=3min diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index bd5111a01f..06174790f0 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -1,16 +1,6 @@ #!/bin/bash -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 - -sonic-cfggen -d -a '{"hwaddr":"'$SYSTEM_MAC_ADDRESS'"}' -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces +sonic-cfggen -d -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 diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index 7822858ca0..92d06d9aec 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -55,24 +55,11 @@ iface eth0 inet dhcp {% for (name, prefix) in INTERFACE %} allow-hotplug {{ name }} iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static - mtu 9100 + mtu {{ PORT[name]['mtu'] if PORT[name]['mtu'] else 9100 }} address {{ prefix | ip }} netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} # {% 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 %} # "|| 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 @@ -88,27 +75,13 @@ iface {{ member }} inet manual {% endfor %} {% endif %} {% 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 %} {% if PORTCHANNEL_INTERFACE %} # Portchannel interfaces {% for (name, prefix) in PORTCHANNEL_INTERFACE.keys() | sort %} allow-hotplug {{ name }} iface {{ name }} {{ 'inet' if prefix | ipv4 else 'inet6' }} static - mtu 9100 + mtu {{ PORTCHANNEL[name]['mtu'] if PORTCHANNEL[name]['mtu'] else 9100 }} address {{ prefix | ip }} netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }} # diff --git a/files/image_config/ntp/ntp-config.service b/files/image_config/ntp/ntp-config.service index 05e6211b97..d41f1ba2dd 100644 --- a/files/image_config/ntp/ntp-config.service +++ b/files/image_config/ntp/ntp-config.service @@ -1,6 +1,5 @@ [Unit] Description=Update NTP configuration -Before=ntp.service Requires=database.service After=database.service diff --git a/files/image_config/ntp/ntp-config.sh b/files/image_config/ntp/ntp-config.sh index 7c79a16c0e..601b7bd421 100755 --- a/files/image_config/ntp/ntp-config.sh +++ b/files/image_config/ntp/ntp-config.sh @@ -1,3 +1,5 @@ #!/bin/bash sonic-cfggen -d -t /usr/share/sonic/templates/ntp.conf.j2 >/etc/ntp.conf + +systemctl restart ntp diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index d3ecba7d85..f4dd9cb3ad 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -43,6 +43,15 @@ firsttime_exit() 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 # In : $string, $field # Out: $value @@ -70,26 +79,40 @@ if [ -f /host/image-$sonic_version/platform/firsttime ]; then firsttime_exit 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 - if [ -d /host/old_config ]; then + if test_config; then rm -f /host/old_config/sonic_version.yml 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 mv /host/minigraph.xml /etc/sonic/ # 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 - if [ -f /etc/sonic/init_cfg.json ]; then - 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 + sonic-cfggen -m -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json else + # Use default minigraph.xml 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 - else - sonic-cfggen -m --print-data > /etc/sonic/config_db.json - fi + sonic-cfggen -m -j /etc/sonic/init_cfg.json --print-data > /etc/sonic/config_db.json fi if [ -d /host/image-$sonic_version/platform/$platform ]; then diff --git a/files/initramfs-tools/arista-convertfs.j2 b/files/initramfs-tools/arista-convertfs.j2 index 75ce011e83..cea25bd398 100644 --- a/files/initramfs-tools/arista-convertfs.j2 +++ b/files/initramfs-tools/arista-convertfs.j2 @@ -82,6 +82,13 @@ run_cmd() { 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 set -- $(cat /proc/cmdline) for x in "$@"; do @@ -111,7 +118,14 @@ if ! wait_for_root_dev; then fi # 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 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" cmd="cp -a $tmp_mnt/. $root_mnt/" run_cmd "$cmd" "$err_msg" + +fixup_flash_permissions "$root_mnt" diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 5b66026f29..015d85b24a 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,9 +1,9 @@ -BRCM_SAI = libsaibcm_3.0.3.2-10_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 = libsaibcm_3.0.3.2-11_amd64.deb +$(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))) -$(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) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index d1417bff17..f985b18832 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit d1417bff17780255d4cc371b315f620087673eb8 +Subproject commit f985b188326e480124ec49541b4fecc51a213889 diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 8c40d46d91..201e5205da 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -1,6 +1,6 @@ # 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)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_FW_FILE) SONIC_ONLINE_FILES += $(MLNX_FW_FILE) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index bba1013216..80b6d893da 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,7 +1,7 @@ # Mellanox SAI -MLNX_SAI_VERSION = sonic1.9.1fixes-master -MLNX_SAI_REVISION = dc0e84b3762f847369524a917e271ceb2878b4d3 +MLNX_SAI_VERSION = SAIRel1.9.2-master +MLNX_SAI_REVISION = 16900748ee3c97bc5836ab3684ee05b8db6ec31b export MLNX_SAI_VERSION MLNX_SAI_REVISION diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 7c517627c2..ad34ba84e2 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -1,5 +1,5 @@ -MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/4ebc01e95b754c56da7f8b5fb45b82fbe661d05a/sdk -MLNX_SDK_VERSION = 4.2.5010 +MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/16900748ee3c97bc5836ab3684ee05b8db6ec31b/sdk +MLNX_SDK_VERSION = 4.2.6011 MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2) $(SX_ACL_RM) $(SX_COMPLIB) \ $(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SX_SDN_HAL) \ $(SXD_LIBS) $(TESTX) diff --git a/platform/p4/SAI-P4-BM b/platform/p4/SAI-P4-BM new file mode 160000 index 0000000000..c25b5aecab --- /dev/null +++ b/platform/p4/SAI-P4-BM @@ -0,0 +1 @@ +Subproject commit c25b5aecabbb09270dc805459434ee396792ccb3 diff --git a/platform/p4/docker-sonic-p4.mk b/platform/p4/docker-sonic-p4.mk index a23284e503..b5a63773fb 100644 --- a/platform/p4/docker-sonic-p4.mk +++ b/platform/p4/docker-sonic-p4.mk @@ -4,13 +4,13 @@ DOCKER_SONIC_P4 = docker-sonic-p4.gz $(DOCKER_SONIC_P4)_PATH = $(PLATFORM_PATH)/docker-sonic-p4 $(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) -else ifeq ($(ROUTING_STACK), frr) -$(DOCKER_SONIC_P4)_DEPENDS += $(FRR) -else -$(DOCKER_SONIC_P4)_DEPENDS += $(GOBGP) -endif +# else ifeq ($(ROUTING_STACK), frr) +# $(DOCKER_SONIC_P4)_DEPENDS += $(FRR) +# else +# $(DOCKER_SONIC_P4)_DEPENDS += $(GOBGP) +# endif $(DOCKER_SONIC_P4)_LOAD_DOCKERS += $(DOCKER_BASE) SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_P4) diff --git a/platform/p4/docker-sonic-p4/Dockerfile.j2 b/platform/p4/docker-sonic-p4/Dockerfile.j2 index 1b8d1746b2..debb89de9c 100644 --- a/platform/p4/docker-sonic-p4/Dockerfile.j2 +++ b/platform/p4/docker-sonic-p4/Dockerfile.j2 @@ -20,6 +20,7 @@ debs/{{ deb }}{{' '}} ADD port_config.ini /port_config.ini ADD startup.sh /scripts/startup.sh +ADD run_bm.sh /scripts/run_bm.sh ADD rsyslog.conf /etc/rsyslog.conf diff --git a/platform/p4/docker-sonic-p4/port_config.ini b/platform/p4/docker-sonic-p4/port_config.ini index 574f8f976e..2a88c4a723 100644 --- a/platform/p4/docker-sonic-p4/port_config.ini +++ b/platform/p4/docker-sonic-p4/port_config.ini @@ -1,5 +1,33 @@ -# alias lanes -Ethernet0 1 -Ethernet1 2 -Ethernet2 3 -Ethernet3 4 +# name lanes +Ethernet0 0 +Ethernet1 1 +Ethernet2 2 +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 \ No newline at end of file diff --git a/platform/p4/docker-sonic-p4/rsyslog.conf b/platform/p4/docker-sonic-p4/rsyslog.conf index 3480e18f99..9afd889f50 100644 --- a/platform/p4/docker-sonic-p4/rsyslog.conf +++ b/platform/p4/docker-sonic-p4/rsyslog.conf @@ -31,6 +31,8 @@ $ModLoad imuxsock # provides support for local system logging ########################### #Set remote syslog server *.* @172.17.0.1:514 +#Set local syslog +#*.* /var/log/messages # # Use traditional timestamp format. diff --git a/platform/p4/docker-sonic-p4/run_bm.sh b/platform/p4/docker-sonic-p4/run_bm.sh new file mode 100755 index 0000000000..66cea4f5d5 --- /dev/null +++ b/platform/p4/docker-sonic-p4/run_bm.sh @@ -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 diff --git a/platform/p4/docker-sonic-p4/startup.sh b/platform/p4/docker-sonic-p4/startup.sh index 18cd471658..5880d43167 100755 --- a/platform/p4/docker-sonic-p4/startup.sh +++ b/platform/p4/docker-sonic-p4/startup.sh @@ -8,16 +8,16 @@ rm -f /var/run/rsyslogd.pid service rsyslog start echo "Start redis server" -service redis-server start +service redis-server start & +sleep 3 + +redis-cli flushall echo "Veth setup" -/usr/share/bmpd/tools/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 +veth_setup.sh > /tmp/veth_setup.log 2>&1 echo "Start BMV2" -/run_bm.sh > /tmp/run_bm.log 2>&1 & +/scripts/run_bm.sh > /tmp/run_bm.log 2>&1 & sleep 15 redis-cli -n 1 set LOGLEVEL DEBUG diff --git a/platform/p4/p4-bmv.mk b/platform/p4/p4-bmv.mk index 6fe00d189e..affb0d5ac8 100644 --- a/platform/p4/p4-bmv.mk +++ b/platform/p4/p4-bmv.mk @@ -1,7 +1,7 @@ # p4 bmv package -P4_BMV = p4-bmv2_1.0.0_amd64.deb -$(P4_BMV)_DEPENDS += $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) +P4_BMV = sai-p4-bm_1.0.0_amd64.deb +$(P4_BMV)_DEPENDS += $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4C_BM) $(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) diff --git a/platform/p4/p4-bmv/behavioral-model b/platform/p4/p4-bmv/behavioral-model deleted file mode 160000 index a6ccf267bc..0000000000 --- a/platform/p4/p4-bmv/behavioral-model +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a6ccf267bc9c5c31fd40fe5841893e38e03abeb4 diff --git a/platform/p4/p4-hlir.mk b/platform/p4/p4-hlir.mk index 2873275983..61307c7ff7 100644 --- a/platform/p4/p4-hlir.mk +++ b/platform/p4/p4-hlir.mk @@ -1,5 +1,9 @@ # 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)_SRC_PATH = $(PLATFORM_PATH)/p4-hlir/p4-hlir SONIC_PYTHON_STDEB_DEBS += $(P4_HLIR) diff --git a/platform/p4/p4-hlir/p4-hlir-v1.1 b/platform/p4/p4-hlir/p4-hlir-v1.1 new file mode 160000 index 0000000000..fdee55e256 --- /dev/null +++ b/platform/p4/p4-hlir/p4-hlir-v1.1 @@ -0,0 +1 @@ +Subproject commit fdee55e2567fe65463f328d70558b5079894b420 diff --git a/platform/p4/p4-switch.mk b/platform/p4/p4-switch.mk index 6fc07f9087..fb092fa2c5 100644 --- a/platform/p4/p4-switch.mk +++ b/platform/p4/p4-switch.mk @@ -1,7 +1,7 @@ -# p4 switch package +# p4 sai adapter package -P4_SWITCH = p4-switch_1.0.0_amd64.deb -$(P4_SWITCH)_DEPENDS += $(P4C_BM) $(P4_BMV) -$(P4_SWITCH)_RDEPENDS += $(P4C_BM) $(P4_BMV) -$(P4_SWITCH)_SRC_PATH = $(PLATFORM_PATH)/p4-switch -SONIC_MAKE_DEBS += $(P4_SWITCH) +P4_SWITCH = p4-sai-adapter_0.1-0_amd64.deb +$(P4_SWITCH)_DEPENDS += $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4_BMV) +$(P4_SWITCH)_RDEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(P4_BMV) +$(P4_SWITCH)_SRC_PATH = $(PLATFORM_PATH)/SAI-P4-BM/sai_adapter +SONIC_DPKG_DEBS += $(P4_SWITCH) diff --git a/platform/p4/p4-switch/Makefile b/platform/p4/p4-switch/Makefile deleted file mode 100644 index 57f6a05999..0000000000 --- a/platform/p4/p4-switch/Makefile +++ /dev/null @@ -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)/ diff --git a/platform/p4/p4-switch/switch b/platform/p4/p4-switch/switch deleted file mode 160000 index e934752f35..0000000000 --- a/platform/p4/p4-switch/switch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e934752f356d3ad48cbec99067f47c83795ddcec diff --git a/platform/p4/p4c-bm.mk b/platform/p4/p4c-bm.mk index f51595772c..1982ee3592 100644 --- a/platform/p4/p4c-bm.mk +++ b/platform/p4/p4c-bm.mk @@ -2,6 +2,6 @@ P4C_BM = python-p4c-bm_1.0.0-5415c416-1_all.deb $(P4C_BM)_SRC_PATH = $(PLATFORM_PATH)/p4c-bm/p4c-bm -$(P4C_BM)_DEPENDS += $(TENJIN) $(P4_HLIR) -$(P4C_BM)_RDEPENDS += $(TENJIN) $(P4_HLIR) +$(P4C_BM)_DEPENDS += $(TENJIN) $(P4_HLIR) $(P4_HLIR_V1_1) +$(P4C_BM)_RDEPENDS += $(TENJIN) $(P4_HLIR) $(P4_HLIR_V1_1) SONIC_PYTHON_STDEB_DEBS += $(P4C_BM) diff --git a/platform/p4/rules.mk b/platform/p4/rules.mk index 408a58041f..20def91333 100644 --- a/platform/p4/rules.mk +++ b/platform/p4/rules.mk @@ -1,8 +1,10 @@ -include $(PLATFORM_PATH)/p4-switch.mk -include $(PLATFORM_PATH)/p4-bmv.mk +# include $(PLATFORM_PATH)/p4-softswitch.mk +include $(PLATFORM_PATH)/tenjin.mk include $(PLATFORM_PATH)/p4-hlir.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 SONIC_ALL += $(DOCKER_SONIC_P4) diff --git a/platform/p4/tenjin/Makefile b/platform/p4/tenjin/Makefile index 3f36866fe0..83b27d390a 100644 --- a/platform/p4/tenjin/Makefile +++ b/platform/p4/tenjin/Makefile @@ -9,7 +9,7 @@ MAIN_TARGET = python-tenjin_$(TENJIN_VERSION_FULL)_all.deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : 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 pushd Tenjin-$(TENJIN_VERSION) diff --git a/platform/vs/README.md b/platform/vs/README.md index a7ec588561..52f3f30eac 100644 --- a/platform/vs/README.md +++ b/platform/vs/README.md @@ -4,14 +4,72 @@ HOWTO Use Virtual Switch 1. Create a docker with 32 front panel port ``` -docker run -id --name sw debian bash -sudo ./create_vnet.sh sw +$ docker run -id --name sw debian bash +$ 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 +``` diff --git a/platform/vs/docker-sonic-vs.mk b/platform/vs/docker-sonic-vs.mk index b529657871..e9d23db493 100644 --- a/platform/vs/docker-sonic-vs.mk +++ b/platform/vs/docker-sonic-vs.mk @@ -2,7 +2,7 @@ DOCKER_SONIC_VS = docker-sonic-vs.gz $(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) $(DOCKER_SONIC_VS)_DEPENDS += $(QUAGGA) diff --git a/platform/vs/docker-sonic-vs/Dockerfile b/platform/vs/docker-sonic-vs/Dockerfile deleted file mode 100644 index 2a75868cd9..0000000000 --- a/platform/vs/docker-sonic-vs/Dockerfile +++ /dev/null @@ -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"] \ No newline at end of file diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index f6e784017f..32b91e8cf4 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -25,7 +25,8 @@ RUN apt-get install -y net-tools \ openssh-client \ openssh-server \ libc-ares2 \ - iproute + iproute \ + libpython2.7 COPY \ {% for deb in docker_sonic_vs_debs.split(' ') -%} diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 26633c24a7..07d0fb7a04 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -26,6 +26,8 @@ supervisorctl start intfsyncd supervisorctl start neighsyncd +supervisorctl start teamsyncd + # Start arp_update when VLAN exists # VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` # if [ "$VLAN" != "" ]; then diff --git a/platform/vs/docker-sonic-vs/supervisord.conf b/platform/vs/docker-sonic-vs/supervisord.conf index 35c56420b4..c6fefef141 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf +++ b/platform/vs/docker-sonic-vs/supervisord.conf @@ -66,3 +66,11 @@ autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog + +[program:teamsyncd] +command=/usr/bin/teamsyncd +priority=9 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog diff --git a/rules/swss-common.mk b/rules/swss-common.mk index a4ccdafc23..623410d4cd 100644 --- a/rules/swss-common.mk +++ b/rules/swss-common.mk @@ -12,6 +12,9 @@ SONIC_DPKG_DEBS += $(LIBSWSSCOMMON) LIBSWSSCOMMON_DEV = libswsscommon-dev_1.0.0_amd64.deb $(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)_DEPENDS += $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index c51b24afed..8269970633 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -24,7 +24,7 @@ ns = "Microsoft.Search.Autopilot.Evolution" ns1 = "http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution" ns2 = "Microsoft.Search.Autopilot.NetMux" ns3 = "http://www.w3.org/2001/XMLSchema-instance" - +KEY_SEPARATOR = '|' class minigraph_encoder(json.JSONEncoder): def default(self, obj): @@ -86,7 +86,7 @@ def parse_png(png, hname): if child.tag == str(QName(ns, "Devices")): for device in child.findall(str(QName(ns, "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 if child.tag == str(QName(ns, "DeviceInterfaceLinks")): @@ -153,6 +153,7 @@ def parse_dpg(dpg, hname): vlanintfs = child.find(str(QName(ns, "VlanInterfaces"))) vlan_intfs = [] vlans = {} + vlan_members = {} for vintf in vlanintfs.findall(str(QName(ns, "VlanInterface"))): vintfname = vintf.find(str(QName(ns, "Name"))).text vlanid = vintf.find(str(QName(ns, "VlanID"))).text @@ -160,7 +161,10 @@ def parse_dpg(dpg, hname): vmbr_list = vintfmbr.split(';') for i, member in enumerate(vmbr_list): 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 element # containing a list of DHCP server IPs @@ -194,8 +198,8 @@ def parse_dpg(dpg, hname): break; if acl_intfs: 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 None, None, None, None, None, None + return intfs, lo_intfs, mgmt_intf, vlans, vlan_members, pcs, acls + return None, None, None, None, None, None, None def parse_cpg(cpg, hname): @@ -318,6 +322,7 @@ def parse_xml(filename, platform=None, port_config_file=None): vlan_intfs = None pc_intfs = None vlans = None + vlan_members = None pcs = None mgmt_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) for child in root: 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")): (bgp_sessions, bgp_asn, bgp_peers_with_range) = parse_cpg(child, hostname) 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['PORTCHANNEL'] = pcs results['VLAN'] = vlans + results['VLAN_MEMBER'] = vlan_members results['DEVICE_NEIGHBOR'] = neighbors results['DEVICE_NEIGHBOR_METADATA'] = { key:devices[key] for key in devices if key != hostname } diff --git a/src/sonic-config-engine/tests/sample_output/interfaces b/src/sonic-config-engine/tests/sample_output/interfaces index 5fb4738064..cd906badd4 100644 --- a/src/sonic-config-engine/tests/sample_output/interfaces +++ b/src/sonic-config-engine/tests/sample_output/interfaces @@ -44,151 +44,6 @@ iface eth0 inet6 static down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default # # 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 # "ip link show | grep -q master" is added to ensure interface is enslaved 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-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 allow-hotplug PortChannel01 iface PortChannel01 inet static diff --git a/src/sonic-config-engine/tests/sample_output/msn27.32ports.json b/src/sonic-config-engine/tests/sample_output/msn27.32ports.json index 876706b5de..c65ebb847d 100644 --- a/src/sonic-config-engine/tests/sample_output/msn27.32ports.json +++ b/src/sonic-config-engine/tests/sample_output/msn27.32ports.json @@ -1,12 +1,4 @@ [ - { - "BUFFER_POOL_TABLE:ingress_lossless_pool": { - "size": "3024486", - "type": "ingress", - "mode": "dynamic" - }, - "OP": "SET" - }, { "BUFFER_POOL_TABLE:ingress_lossy_pool": { "size": "6422528", @@ -297,7 +289,7 @@ { "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", "xoff":"75776", "size":"94208", @@ -306,8 +298,8 @@ "OP": "SET" }, { - "BUFFER_POOL_TABLE:ingress_lossless_pg_pool": { - "size": "3014656", + "BUFFER_POOL_TABLE:ingress_lossless_pool": { + "size": "3881382", "type": "ingress", "mode": "dynamic" }, diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 31663077c4..47cc006f46 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -88,7 +88,12 @@ class TestCfgGen(TestCase): def test_minigraph_vlans(self): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN' 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): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()"' diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index d68c286ba7..d1df471762 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit d68c286ba7c984c98ebfafc2bb5fe24905659e5f +Subproject commit d1df4717627acf9421861545b71e411acf3c5f32 diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 294f5406e9..674fb107df 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 294f5406e971396352b06c3b4954a2f80dd8ba34 +Subproject commit 674fb107dfb8e45b23a55e3e7be34e39d5630942 diff --git a/src/sonic-sairedis b/src/sonic-sairedis index e0366e03b8..62dea03d74 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit e0366e03b884b155bc93751999ae08b961592026 +Subproject commit 62dea03d74a49716a6647e3fa3a3654b19bf46ad diff --git a/src/sonic-swss b/src/sonic-swss index 1b347a4337..01899cdc33 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 1b347a4337f77e5d166601fbabeaca4b32875f23 +Subproject commit 01899cdc33df5dc9ae95bf6bd09979a08e620035 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index adf7d4cb3c..be508cff89 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit adf7d4cb3c22061bf781ef6ce7b79964ce505730 +Subproject commit be508cff8947cf07a712d21afe2ae80238ccc483 diff --git a/src/sonic-utilities b/src/sonic-utilities index 1d37c9c199..e87bb97760 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 1d37c9c199b7934653f907095bf11e685889df23 +Subproject commit e87bb97760a4cf069da51b2a0da732f7a40f3215