From 05ae651d1f8de3f59ae6f672d19318254dd89b56 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sat, 17 Nov 2018 09:35:15 +0000 Subject: [PATCH 01/12] build sonic-vs.bin Signed-off-by: Guohan Lu --- platform/vs/docker-orchagent-vs.mk | 24 +++++++++++ platform/vs/docker-syncd-vs.mk | 14 ++++++ platform/vs/docker-syncd-vs/Dockerfile.j2 | 30 +++++++++++++ platform/vs/docker-syncd-vs/start.sh | 45 ++++++++++++++++++++ platform/vs/docker-syncd-vs/supervisord.conf | 28 ++++++++++++ platform/vs/one-image.mk | 7 +++ platform/vs/platform.conf | 0 platform/vs/rules.mk | 5 ++- 8 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 platform/vs/docker-orchagent-vs.mk create mode 100644 platform/vs/docker-syncd-vs.mk create mode 100644 platform/vs/docker-syncd-vs/Dockerfile.j2 create mode 100755 platform/vs/docker-syncd-vs/start.sh create mode 100644 platform/vs/docker-syncd-vs/supervisord.conf create mode 100644 platform/vs/one-image.mk create mode 100644 platform/vs/platform.conf diff --git a/platform/vs/docker-orchagent-vs.mk b/platform/vs/docker-orchagent-vs.mk new file mode 100644 index 000000000000..185e3ce07701 --- /dev/null +++ b/platform/vs/docker-orchagent-vs.mk @@ -0,0 +1,24 @@ +# docker image for orchagent + +DOCKER_ORCHAGENT_VS = docker-orchagent-vs.gz +$(DOCKER_ORCHAGENT_VS)_PATH = $(DOCKERS_PATH)/docker-orchagent +$(DOCKER_ORCHAGENT_VS)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(IPROUTE2) +ifeq ($(INSTALL_DEBUG_TOOLS), y) +$(DOCKER_ORCHAGENT_VS)_DEPENDS += $(SWSS_DBG) \ + $(LIBSWSSCOMMON_DBG) \ + $(LIBSAIREDIS_DBG) +endif +$(DOCKER_ORCHAGENT_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) +SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_VS) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_VS) + +$(DOCKER_ORCHAGENT_VS)_CONTAINER_NAME = swss +$(DOCKER_ORCHAGENT_VS)_RUN_OPT += --net=host --privileged -t +$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro +$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro +$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /host/machine.conf:/host/machine.conf:ro +$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_ORCHAGENT_VS)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw + +$(DOCKER_ORCHAGENT_VS)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel +$(DOCKER_ORCHAGENT_VS)_FILES += $(ARP_UPDATE_SCRIPT) diff --git a/platform/vs/docker-syncd-vs.mk b/platform/vs/docker-syncd-vs.mk new file mode 100644 index 000000000000..12fbf65468a9 --- /dev/null +++ b/platform/vs/docker-syncd-vs.mk @@ -0,0 +1,14 @@ +# docker image for vs syncd + +DOCKER_SYNCD_VS = docker-syncd-vs.gz +$(DOCKER_SYNCD_VS)_PATH = $(PLATFORM_PATH)/docker-syncd-vs +$(DOCKER_SYNCD_VS)_DEPENDS += $(SYNCD_VS) +$(DOCKER_SYNCD_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) +SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_VS) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_VS) + +$(DOCKER_SYNCD_VS)_CONTAINER_NAME = syncd +$(DOCKER_SYNCD_VS)_RUN_OPT += --net=host --privileged -t +$(DOCKER_SYNCD_VS)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf +$(DOCKER_SYNCD_VS)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SYNCD_VS)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/vs/docker-syncd-vs/Dockerfile.j2 b/platform/vs/docker-syncd-vs/Dockerfile.j2 new file mode 100644 index 000000000000..7bef89fe57b5 --- /dev/null +++ b/platform/vs/docker-syncd-vs/Dockerfile.j2 @@ -0,0 +1,30 @@ +FROM docker-config-engine + +ARG docker_container_name +RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +COPY \ +{% for deb in docker_syncd_vs_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -i \ +{% for deb in docker_syncd_vs_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} + +COPY ["start.sh", "/usr/bin/"] + +COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs + +ENTRYPOINT ["/usr/bin/supervisord"] diff --git a/platform/vs/docker-syncd-vs/start.sh b/platform/vs/docker-syncd-vs/start.sh new file mode 100755 index 000000000000..98c7d9c15a0d --- /dev/null +++ b/platform/vs/docker-syncd-vs/start.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +PLATFORM_DIR=/usr/share/sonic/platform +HWSKU_DIR=/usr/share/sonic/hwsku + +SYNCD_SOCKET_FILE=/var/run/sswsyncd/sswsyncd.socket + +# Function: wait until syncd has created the socket for bcmcmd to connect to +wait_syncd() { + while true; do + if [ -e ${SYNCD_SOCKET_FILE} ]; then + break + fi + sleep 1 + done + + # wait until bcm sdk is ready to get a request + sleep 3 +} + + +# Remove stale files if they exist +rm -f /var/run/rsyslogd.pid +rm -f ${SYNCD_SOCKET_FILE} + +supervisorctl start rsyslogd + +mkdir -p /etc/sai.d/ + +# Create/Copy the sai.profile to /etc/sai.d/sai.profile +if [ -f $HWSKU_DIR/sai.profile.j2 ]; then + sonic-cfggen -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile +else + if [ -f $HWSKU_DIR/sai.profile ]; then + cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile + fi +fi + +supervisorctl start syncd + +# If this platform has an initialization file for the Broadcom LED microprocessor, load it +if [ -r ${PLATFORM_DIR}/led_proc_init.soc ]; then + wait_syncd + supervisorctl start ledinit +fi diff --git a/platform/vs/docker-syncd-vs/supervisord.conf b/platform/vs/docker-syncd-vs/supervisord.conf new file mode 100644 index 000000000000..1af5d70a1d0c --- /dev/null +++ b/platform/vs/docker-syncd-vs/supervisord.conf @@ -0,0 +1,28 @@ +[supervisord] +logfile_maxbytes=1MB +logfile_backups=2 +nodaemon=true + +[program:start.sh] +command=/usr/bin/start.sh +priority=1 +autostart=true +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n +priority=2 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + +[program:syncd] +command=/usr/bin/syncd_start.sh +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog diff --git a/platform/vs/one-image.mk b/platform/vs/one-image.mk new file mode 100644 index 000000000000..2adbf98f90e0 --- /dev/null +++ b/platform/vs/one-image.mk @@ -0,0 +1,7 @@ +# sonic vs one image installer + +SONIC_ONE_IMAGE = sonic-vs.bin +$(SONIC_ONE_IMAGE)_MACHINE = vs +$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie +$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) +SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/vs/platform.conf b/platform/vs/platform.conf new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index 28dba54a5a4e..27bcf590946e 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -1,4 +1,7 @@ include $(PLATFORM_PATH)/syncd-vs.mk include $(PLATFORM_PATH)/docker-sonic-vs.mk +include $(PLATFORM_PATH)/docker-syncd-vs.mk +include $(PLATFORM_PATH)/docker-orchagent-vs.mk +include $(PLATFORM_PATH)/one-image.mk -SONIC_ALL += $(DOCKER_SONIC_VS) +SONIC_ALL += $(SONIC_ONE_IMAGE) $(DOCKER_SONIC_VS) From 9a7ef5bce42b37ddc307049f285c1e3d90708e5e Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sun, 18 Nov 2018 04:12:08 +0000 Subject: [PATCH 02/12] add Force10-S6000 sku Signed-off-by: Guohan Lu --- .../Force10-S6000/buffers.json.j2 | 128 ++++ .../Force10-S6000/port_config.ini | 33 + .../Force10-S6000/qos.json.j2 | 1 + .../Force10-S6000/sai.profile | 4 + .../Force10-S6000/td2-s6000-32x40G.config.bcm | 646 ++++++++++++++++++ .../virtual/x86_64-kvm_x86_64-r0/default_sku | 1 + .../x86_64-kvm_x86_64-r0/installer.conf | 0 7 files changed, 813 insertions(+) create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/buffers.json.j2 create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/port_config.ini create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/qos.json.j2 create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/td2-s6000-32x40G.config.bcm create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/default_sku create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/installer.conf diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/buffers.json.j2 b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/buffers.json.j2 new file mode 100644 index 000000000000..551f73ca0477 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/buffers.json.j2 @@ -0,0 +1,128 @@ +{# Default values which will be used if no actual configura available #} +{% set default_cable = '300m' %} +{% set default_speed = '100G' %} +{% set default_ports_num = 32 -%} + +{# Port configuration to cable length look-up table #} +{# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #} +{# Roles described in the minigraph #} +{% set ports2cable = { + 'torrouter_server' : '5m', + 'leafrouter_torrouter' : '40m', + 'spinerouter_leafrouter' : '300m' + } +%} + +{%- macro cable_length(port_name) -%} + {%- set cable_len = [] -%} + {%- for local_port in DEVICE_NEIGHBOR -%} + {%- if local_port == port_name -%} + {%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} + {%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} + {%- set neighbor_role = neighbor.type -%} + {%- set roles1 = switch_role + '_' + neighbor_role %} + {%- set roles2 = neighbor_role + '_' + switch_role -%} + {%- set roles1 = roles1 | lower -%} + {%- set roles2 = roles2 | lower -%} + {%- if roles1 in ports2cable -%} + {%- if cable_len.append(ports2cable[roles1]) -%}{%- endif -%} + {%- elif roles2 in ports2cable -%} + {%- if cable_len.append(ports2cable[roles2]) -%}{%- endif -%} + {%- endif -%} + {%- endif -%} + {%- endif -%} + {%- endfor -%} + {%- if cable_len -%} + {{ cable_len.0 }} + {%- else -%} + {{ default_cable }} + {%- endif -%} +{% endmacro %} + +{%- if DEVICE_METADATA is defined %} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} +{%- endif -%} + +{# Generate list of ports if not defined #} +{% if PORT is not defined %} + {% set PORT = [] %} + {% for port_idx in range(0,default_ports_num) %} + {% if PORT.append("Ethernet%d" % (port_idx*4)) %}{% endif %} + {% endfor %} +{% endif -%} + +{% set port_names_list = [] %} +{% for port in PORT %} + {%- if port_names_list.append(port) %}{% endif %} +{% endfor %} +{% set port_names = port_names_list | join(',') -%} + +{ + "CABLE_LENGTH": { + "AZURE": { + {% for port in PORT %} + {% set cable = cable_length(port) -%} + "{{ port }}": "{{ cable }}"{%- if not loop.last -%},{% endif %} + + {% endfor %} + } + }, + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "8072396", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "xon":"18432", + "xoff":"40560", + "size":"41808", + "dynamic_th":"-4", + "xon_offset":"2496" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, + "BUFFER_PG": { + "{{ port_names }}|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "{{ port_names }}|0-1": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + "BUFFER_QUEUE": { + "{{ port_names }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port_names }}|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/port_config.ini new file mode 100644 index 000000000000..06898f1d7964 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/port_config.ini @@ -0,0 +1,33 @@ +# name lanes alias +Ethernet0 29,30,31,32 fortyGigE0/0 +Ethernet4 25,26,27,28 fortyGigE0/4 +Ethernet8 37,38,39,40 fortyGigE0/8 +Ethernet12 33,34,35,36 fortyGigE0/12 +Ethernet16 41,42,43,44 fortyGigE0/16 +Ethernet20 45,46,47,48 fortyGigE0/20 +Ethernet24 5,6,7,8 fortyGigE0/24 +Ethernet28 1,2,3,4 fortyGigE0/28 +Ethernet32 9,10,11,12 fortyGigE0/32 +Ethernet36 13,14,15,16 fortyGigE0/36 +Ethernet40 21,22,23,24 fortyGigE0/40 +Ethernet44 17,18,19,20 fortyGigE0/44 +Ethernet48 49,50,51,52 fortyGigE0/48 +Ethernet52 53,54,55,56 fortyGigE0/52 +Ethernet56 61,62,63,64 fortyGigE0/56 +Ethernet60 57,58,59,60 fortyGigE0/60 +Ethernet64 65,66,67,68 fortyGigE0/64 +Ethernet68 69,70,71,72 fortyGigE0/68 +Ethernet72 77,78,79,80 fortyGigE0/72 +Ethernet76 73,74,75,76 fortyGigE0/76 +Ethernet80 105,106,107,108 fortyGigE0/80 +Ethernet84 109,110,111,112 fortyGigE0/84 +Ethernet88 117,118,119,120 fortyGigE0/88 +Ethernet92 113,114,115,116 fortyGigE0/92 +Ethernet96 121,122,123,124 fortyGigE0/96 +Ethernet100 125,126,127,128 fortyGigE0/100 +Ethernet104 85,86,87,88 fortyGigE0/104 +Ethernet108 81,82,83,84 fortyGigE0/108 +Ethernet112 89,90,91,92 fortyGigE0/112 +Ethernet116 93,94,95,96 fortyGigE0/116 +Ethernet120 97,98,99,100 fortyGigE0/120 +Ethernet124 101,102,103,104 fortyGigE0/124 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/qos.json.j2 b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile new file mode 100644 index 000000000000..23cd24c73a35 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile @@ -0,0 +1,4 @@ +SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin +SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin +SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850 +SAI_VS_HOSTIF_USE_TAP_DEVICE=true diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/td2-s6000-32x40G.config.bcm b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/td2-s6000-32x40G.config.bcm new file mode 100644 index 000000000000..068b587202bd --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/td2-s6000-32x40G.config.bcm @@ -0,0 +1,646 @@ +# Old LPM only configuration +# l2_mem_entries=163840 +# l3_mem_entries=90112 +# l3_alpm_enable=0 +# ipv6_lpm_128b_enable=0 +# +# ALPM enable +l3_alpm_enable=2 +ipv6_lpm_128b_enable=1 +l2_mem_entries=32768 +l3_mem_entries=16384 + +# From old config file +os=unix +higig2_hdr_mode=1 + +# Parity +parity_correction=1 +parity_enable=1 +stat_if_parity_enable=0 + +# +bcm_num_cos=8 +bcm_stat_interval=2000000 +l2xmsg_hostbuf_size=8192 +l2xmsg_mode=1 +lls_num_l2uc=12 +max_vp_lags=0 +miim_intr_enable=0 +mmu_lossless=0 +module_64ports=0 +schan_intr_enable=0 +stable_size=0x2000000 +tdma_timeout_usec=5000000 + +pbmp_oversubscribe=0x000007fffffffffffffffffffffffffe +pbmp_xport_xe=0x000007fffffffffffffffffffffffffe + +# Ports configuration +# xe0 (40G) +portmap_1=29:40 +xgxs_rx_lane_map_1=0x213 +xgxs_tx_lane_map_1=0x213 +phy_xaui_rx_polarity_flip_1=0xc +phy_xaui_tx_polarity_flip_1=0x9 +serdes_driver_current_lane0_xe0=0x6 +serdes_driver_current_lane1_xe0=0x7 +serdes_driver_current_lane2_xe0=0x6 +serdes_driver_current_lane3_xe0=0x6 +serdes_pre_driver_current_lane0_xe0=0x6 +serdes_pre_driver_current_lane1_xe0=0x7 +serdes_pre_driver_current_lane2_xe0=0x6 +serdes_pre_driver_current_lane3_xe0=0x6 +serdes_preemphasis_lane0_xe0=0xc2f0 +serdes_preemphasis_lane1_xe0=0xd2b0 +serdes_preemphasis_lane2_xe0=0xc6e0 +serdes_preemphasis_lane3_xe0=0xc2f0 + +# xe1 (40G) +portmap_2=25:40 +xgxs_rx_lane_map_2=0x213 +xgxs_tx_lane_map_2=0x2031 +phy_xaui_rx_polarity_flip_2=0xe +phy_xaui_tx_polarity_flip_2=0x2 +serdes_driver_current_lane0_xe1=0x5 +serdes_driver_current_lane1_xe1=0x5 +serdes_driver_current_lane2_xe1=0x5 +serdes_driver_current_lane3_xe1=0x5 +serdes_pre_driver_current_lane0_xe1=0x5 +serdes_pre_driver_current_lane1_xe1=0x5 +serdes_pre_driver_current_lane2_xe1=0x5 +serdes_pre_driver_current_lane3_xe1=0x5 +serdes_preemphasis_lane0_xe1=0xcad0 +serdes_preemphasis_lane1_xe1=0xc6e0 +serdes_preemphasis_lane2_xe1=0xc6e0 +serdes_preemphasis_lane3_xe1=0xd2b0 + +# xe2 (40G) +portmap_3=37:40 +xgxs_rx_lane_map_3=0x213 +xgxs_tx_lane_map_3=0x1203 +phy_xaui_rx_polarity_flip_3=0x3 +phy_xaui_tx_polarity_flip_3=0xe +serdes_driver_current_lane0_xe2=0x4 +serdes_driver_current_lane1_xe2=0x4 +serdes_driver_current_lane2_xe2=0x4 +serdes_driver_current_lane3_xe2=0x4 +serdes_pre_driver_current_lane0_xe2=0x4 +serdes_pre_driver_current_lane1_xe2=0x4 +serdes_pre_driver_current_lane2_xe2=0x4 +serdes_pre_driver_current_lane3_xe2=0x4 +serdes_preemphasis_lane0_xe2=0xcad0 +serdes_preemphasis_lane1_xe2=0xcad0 +serdes_preemphasis_lane2_xe2=0xc2f0 +serdes_preemphasis_lane3_xe2=0xc2f0 + +# xe3 (40G) +portmap_4=33:40 +xgxs_rx_lane_map_4=0x213 +xgxs_tx_lane_map_4=0x132 +phy_xaui_rx_polarity_flip_4=0xe +phy_xaui_tx_polarity_flip_4=0x2 +serdes_driver_current_lane0_xe3=0x4 +serdes_driver_current_lane1_xe3=0x4 +serdes_driver_current_lane2_xe3=0x4 +serdes_driver_current_lane3_xe3=0x4 +serdes_pre_driver_current_lane0_xe3=0x4 +serdes_pre_driver_current_lane1_xe3=0x4 +serdes_pre_driver_current_lane2_xe3=0x4 +serdes_pre_driver_current_lane3_xe3=0x4 +serdes_preemphasis_lane0_xe3=0xc6e0 +serdes_preemphasis_lane1_xe3=0xc6e0 +serdes_preemphasis_lane2_xe3=0xc6e0 +serdes_preemphasis_lane3_xe3=0xc6e0 + +# xe4 (40G) +portmap_5=41:40 +xgxs_rx_lane_map_5=0x213 +xgxs_tx_lane_map_5=0x3021 +phy_xaui_rx_polarity_flip_5=0x3 +phy_xaui_tx_polarity_flip_5=0xb +serdes_driver_current_lane0_xe4=0x4 +serdes_driver_current_lane1_xe4=0x4 +serdes_driver_current_lane2_xe4=0x4 +serdes_driver_current_lane3_xe4=0x4 +serdes_pre_driver_current_lane0_xe4=0x4 +serdes_pre_driver_current_lane1_xe4=0x4 +serdes_pre_driver_current_lane2_xe4=0x4 +serdes_pre_driver_current_lane3_xe4=0x4 +serdes_preemphasis_lane0_xe4=0xc6e0 +serdes_preemphasis_lane1_xe4=0xc2f0 +serdes_preemphasis_lane2_xe4=0xc2f0 +serdes_preemphasis_lane3_xe4=0xcad0 + +# xe5 (40G) +portmap_6=45:40 +xgxs_rx_lane_map_6=0x213 +xgxs_tx_lane_map_6=0x213 +phy_xaui_rx_polarity_flip_6=0xe +phy_xaui_tx_polarity_flip_6=0x8 +serdes_driver_current_lane0_xe5=0x4 +serdes_driver_current_lane1_xe5=0x4 +serdes_driver_current_lane2_xe5=0x4 +serdes_driver_current_lane3_xe5=0x4 +serdes_pre_driver_current_lane0_xe5=0x4 +serdes_pre_driver_current_lane1_xe5=0x4 +serdes_pre_driver_current_lane2_xe5=0x4 +serdes_pre_driver_current_lane3_xe5=0x4 +serdes_preemphasis_lane0_xe5=0xc2f0 +serdes_preemphasis_lane1_xe5=0xc2f0 +serdes_preemphasis_lane2_xe5=0xc2f0 +serdes_preemphasis_lane3_xe5=0xc2f0 + +# xe6 (40G) +portmap_7=5:40 +xgxs_rx_lane_map_7=0x213 +xgxs_tx_lane_map_7=0x1203 +phy_xaui_rx_polarity_flip_7=0xc +phy_xaui_tx_polarity_flip_7=0x1 +serdes_driver_current_lane0_xe6=0x4 +serdes_driver_current_lane1_xe6=0x4 +serdes_driver_current_lane2_xe6=0x4 +serdes_driver_current_lane3_xe6=0x4 +serdes_pre_driver_current_lane0_xe6=0x4 +serdes_pre_driver_current_lane1_xe6=0x4 +serdes_pre_driver_current_lane2_xe6=0x4 +serdes_pre_driver_current_lane3_xe6=0x4 +serdes_preemphasis_lane0_xe6=0xc6e0 +serdes_preemphasis_lane1_xe6=0xc6e0 +serdes_preemphasis_lane2_xe6=0xc6e0 +serdes_preemphasis_lane3_xe6=0xc6e0 + +# xe7 (40G) +portmap_8=1:40 +xgxs_rx_lane_map_8=0x213 +xgxs_tx_lane_map_8=0x2031 +phy_xaui_rx_polarity_flip_8=0xe +phy_xaui_tx_polarity_flip_8=0xd +serdes_driver_current_lane0_xe7=0x5 +serdes_driver_current_lane1_xe7=0x5 +serdes_driver_current_lane2_xe7=0x5 +serdes_driver_current_lane3_xe7=0x5 +serdes_pre_driver_current_lane0_xe7=0x5 +serdes_pre_driver_current_lane1_xe7=0x5 +serdes_pre_driver_current_lane2_xe7=0x5 +serdes_pre_driver_current_lane3_xe7=0x5 +serdes_preemphasis_lane0_xe7=0xc6e0 +serdes_preemphasis_lane1_xe7=0xcad0 +serdes_preemphasis_lane2_xe7=0xc6e0 +serdes_preemphasis_lane3_xe7=0xcad0 + +# xe9 (40G) +portmap_9=9:40 +xgxs_rx_lane_map_9=0x3120 +xgxs_tx_lane_map_9=0x3021 +phy_xaui_rx_polarity_flip_9=0x0 +phy_xaui_tx_polarity_flip_9=0x4 +serdes_driver_current_lane0_xe8=0x3 +serdes_driver_current_lane1_xe8=0x3 +serdes_driver_current_lane2_xe8=0x3 +serdes_driver_current_lane3_xe8=0x3 +serdes_pre_driver_current_lane0_xe8=0x3 +serdes_pre_driver_current_lane1_xe8=0x3 +serdes_pre_driver_current_lane2_xe8=0x3 +serdes_pre_driver_current_lane3_xe8=0x3 +serdes_preemphasis_lane0_xe8=0xc2f0 +serdes_preemphasis_lane1_xe8=0xc6e0 +serdes_preemphasis_lane2_xe8=0xbf00 +serdes_preemphasis_lane3_xe8=0xc2f0 + +# xe9 (40G) +portmap_10=13:40 +xgxs_rx_lane_map_10=0x213 +xgxs_tx_lane_map_10=0x132 +phy_xaui_rx_polarity_flip_10=0xe +phy_xaui_tx_polarity_flip_10=0x0 +serdes_driver_current_lane0_xe9=0x2 +serdes_driver_current_lane1_xe9=0x3 +serdes_driver_current_lane2_xe9=0x2 +serdes_driver_current_lane3_xe9=0x2 +serdes_pre_driver_current_lane0_xe9=0x2 +serdes_pre_driver_current_lane1_xe9=0x3 +serdes_pre_driver_current_lane2_xe9=0x2 +serdes_pre_driver_current_lane3_xe9=0x2 +serdes_preemphasis_lane0_xe9=0xb270 +serdes_preemphasis_lane1_xe9=0xbb10 +serdes_preemphasis_lane2_xe9=0xb720 +serdes_preemphasis_lane3_xe9=0xb720 + +# xe10 (40G) +portmap_11=21:40 +xgxs_rx_lane_map_11=0x123 +xgxs_tx_lane_map_11=0x1203 +phy_xaui_rx_polarity_flip_11=0xc +phy_xaui_tx_polarity_flip_11=0xe +serdes_driver_current_lane0_xe10=0x2 +serdes_driver_current_lane1_xe10=0x2 +serdes_driver_current_lane2_xe10=0x2 +serdes_driver_current_lane3_xe10=0x2 +serdes_pre_driver_current_lane0_xe10=0x2 +serdes_pre_driver_current_lane1_xe10=0x2 +serdes_pre_driver_current_lane2_xe10=0x2 +serdes_pre_driver_current_lane3_xe10=0x2 +serdes_preemphasis_lane0_xe10=0xb330 +serdes_preemphasis_lane1_xe10=0xb330 +serdes_preemphasis_lane2_xe10=0xb330 +serdes_preemphasis_lane3_xe10=0xb330 + +# xe11 (40G) +portmap_12=17:40 +xgxs_rx_lane_map_12=0x213 +xgxs_tx_lane_map_12=0x132 +phy_xaui_rx_polarity_flip_12=0xe +phy_xaui_tx_polarity_flip_12=0x0 +serdes_driver_current_lane0_xe11=0x2 +serdes_driver_current_lane1_xe11=0x2 +serdes_driver_current_lane2_xe11=0x2 +serdes_driver_current_lane3_xe11=0x2 +serdes_pre_driver_current_lane0_xe11=0x2 +serdes_pre_driver_current_lane1_xe11=0x2 +serdes_pre_driver_current_lane2_xe11=0x2 +serdes_pre_driver_current_lane3_xe11=0x2 +serdes_preemphasis_lane0_xe11=0xb330 +serdes_preemphasis_lane1_xe11=0xbb10 +serdes_preemphasis_lane2_xe11=0xbb10 +serdes_preemphasis_lane3_xe11=0xbb10 + +# xe12 (40G) +portmap_13=49:40 +xgxs_rx_lane_map_13=0x1302 +xgxs_tx_lane_map_13=0x2031 +phy_xaui_rx_polarity_flip_13=0xb +phy_xaui_tx_polarity_flip_13=0x3 +serdes_driver_current_lane0_xe12=0x2 +serdes_driver_current_lane1_xe12=0x2 +serdes_driver_current_lane2_xe12=0x2 +serdes_driver_current_lane3_xe12=0x2 +serdes_pre_driver_current_lane0_xe12=0x2 +serdes_pre_driver_current_lane1_xe12=0x2 +serdes_pre_driver_current_lane2_xe12=0x2 +serdes_pre_driver_current_lane3_xe12=0x2 +serdes_preemphasis_lane0_xe12=0xa760 +serdes_preemphasis_lane1_xe12=0xa760 +serdes_preemphasis_lane2_xe12=0xa760 +serdes_preemphasis_lane3_xe12=0xa760 + +# xe13 (40G) +portmap_14=53:40 +xgxs_rx_lane_map_14=0x213 +xgxs_tx_lane_map_14=0x231 +phy_xaui_rx_polarity_flip_14=0x1 +phy_xaui_tx_polarity_flip_14=0x0 +serdes_driver_current_lane0_xe13=0x2 +serdes_driver_current_lane1_xe13=0x2 +serdes_driver_current_lane2_xe13=0x2 +serdes_driver_current_lane3_xe13=0x2 +serdes_pre_driver_current_lane0_xe13=0x2 +serdes_pre_driver_current_lane1_xe13=0x2 +serdes_pre_driver_current_lane2_xe13=0x2 +serdes_pre_driver_current_lane3_xe13=0x2 +serdes_preemphasis_lane0_xe13=0xaf40 +serdes_preemphasis_lane1_xe13=0xaf40 +serdes_preemphasis_lane2_xe13=0xaf40 +serdes_preemphasis_lane3_xe13=0xaf40 + +# xe14 (40G) +portmap_15=61:40 +xgxs_rx_lane_map_15=0x132 +xgxs_tx_lane_map_15=0x213 +phy_xaui_rx_polarity_flip_15=0x0 +phy_xaui_tx_polarity_flip_15=0x0 +serdes_driver_current_lane0_xe14=0x2 +serdes_driver_current_lane1_xe14=0x2 +serdes_driver_current_lane2_xe14=0x2 +serdes_driver_current_lane3_xe14=0x2 +serdes_pre_driver_current_lane0_xe14=0x2 +serdes_pre_driver_current_lane1_xe14=0x2 +serdes_pre_driver_current_lane2_xe14=0x2 +serdes_pre_driver_current_lane3_xe14=0x2 +serdes_preemphasis_lane0_xe14=0xa760 +serdes_preemphasis_lane1_xe14=0xa760 +serdes_preemphasis_lane2_xe14=0xa760 +serdes_preemphasis_lane3_xe14=0xa760 + +# xe15 (40G) +portmap_16=57:40 +xgxs_rx_lane_map_16=0x213 +xgxs_tx_lane_map_16=0x2031 +phy_xaui_rx_polarity_flip_16=0x1 +phy_xaui_tx_polarity_flip_16=0x0 +serdes_driver_current_lane0_xe15=0x1 +serdes_driver_current_lane1_xe15=0x1 +serdes_driver_current_lane2_xe15=0x1 +serdes_driver_current_lane3_xe15=0x1 +serdes_pre_driver_current_lane0_xe15=0x1 +serdes_pre_driver_current_lane1_xe15=0x1 +serdes_pre_driver_current_lane2_xe15=0x1 +serdes_pre_driver_current_lane3_xe15=0x1 +serdes_preemphasis_lane0_xe15=0xa760 +serdes_preemphasis_lane1_xe15=0xa760 +serdes_preemphasis_lane2_xe15=0xa760 +serdes_preemphasis_lane3_xe15=0xa760 + +# xe16 (40G) +portmap_17=65:40 +xgxs_rx_lane_map_17=0x132 +xgxs_tx_lane_map_17=0x2031 +phy_xaui_rx_polarity_flip_17=0x3 +phy_xaui_tx_polarity_flip_17=0x9 +serdes_driver_current_lane0_xe16=0x1 +serdes_driver_current_lane1_xe16=0x1 +serdes_driver_current_lane2_xe16=0x1 +serdes_driver_current_lane3_xe16=0x1 +serdes_pre_driver_current_lane0_xe16=0x1 +serdes_pre_driver_current_lane1_xe16=0x1 +serdes_pre_driver_current_lane2_xe16=0x1 +serdes_pre_driver_current_lane3_xe16=0x1 +serdes_preemphasis_lane0_xe16=0xa370 +serdes_preemphasis_lane1_xe16=0xa370 +serdes_preemphasis_lane2_xe16=0xa370 +serdes_preemphasis_lane3_xe16=0xa370 + +# xe17 (40G) +portmap_18=69:40 +xgxs_rx_lane_map_18=0x213 +xgxs_tx_lane_map_18=0x2130 +phy_xaui_rx_polarity_flip_18=0x1 +phy_xaui_tx_polarity_flip_18=0xf +serdes_driver_current_lane0_xe17=0x1 +serdes_driver_current_lane1_xe17=0x1 +serdes_driver_current_lane2_xe17=0x1 +serdes_driver_current_lane3_xe17=0x1 +serdes_pre_driver_current_lane0_xe17=0x1 +serdes_pre_driver_current_lane1_xe17=0x1 +serdes_pre_driver_current_lane2_xe17=0x1 +serdes_pre_driver_current_lane3_xe17=0x1 +serdes_preemphasis_lane0_xe17=0xa760 +serdes_preemphasis_lane1_xe17=0xa760 +serdes_preemphasis_lane2_xe17=0xa760 +serdes_preemphasis_lane3_xe17=0xa760 + +# xe19 (40G) +portmap_19=77:40 +xgxs_rx_lane_map_19=0x123 +xgxs_tx_lane_map_19=0x1203 +phy_xaui_rx_polarity_flip_19=0x3 +phy_xaui_tx_polarity_flip_19=0xe +serdes_driver_current_lane0_xe18=0x2 +serdes_driver_current_lane1_xe18=0x2 +serdes_driver_current_lane2_xe18=0x2 +serdes_driver_current_lane3_xe18=0x2 +serdes_pre_driver_current_lane0_xe18=0x2 +serdes_pre_driver_current_lane1_xe18=0x2 +serdes_pre_driver_current_lane2_xe18=0x2 +serdes_pre_driver_current_lane3_xe18=0x2 +serdes_preemphasis_lane0_xe18=0xaf40 +serdes_preemphasis_lane1_xe18=0xaf40 +serdes_preemphasis_lane2_xe18=0xaf40 +serdes_preemphasis_lane3_xe18=0xaf40 + +# xe19 (40G) +portmap_20=73:40 +xgxs_rx_lane_map_20=0x213 +xgxs_tx_lane_map_20=0x2031 +phy_xaui_rx_polarity_flip_20=0x1 +phy_xaui_tx_polarity_flip_20=0x0 +serdes_driver_current_lane0_xe19=0x2 +serdes_driver_current_lane1_xe19=0x2 +serdes_driver_current_lane2_xe19=0x2 +serdes_driver_current_lane3_xe19=0x2 +serdes_pre_driver_current_lane0_xe19=0x2 +serdes_pre_driver_current_lane1_xe19=0x2 +serdes_pre_driver_current_lane2_xe19=0x2 +serdes_pre_driver_current_lane3_xe19=0x2 +serdes_preemphasis_lane0_xe19=0xa760 +serdes_preemphasis_lane1_xe19=0xa760 +serdes_preemphasis_lane2_xe19=0xa760 +serdes_preemphasis_lane3_xe19=0xa760 + +# xe20 (40G) +portmap_21=105:40 +xgxs_rx_lane_map_21=0x1320 +xgxs_tx_lane_map_21=0x3021 +phy_xaui_rx_polarity_flip_21=0xd +phy_xaui_tx_polarity_flip_21=0xb +serdes_driver_current_lane0_xe20=0x1 +serdes_driver_current_lane1_xe20=0x1 +serdes_driver_current_lane2_xe20=0x1 +serdes_driver_current_lane3_xe20=0x1 +serdes_pre_driver_current_lane0_xe20=0x1 +serdes_pre_driver_current_lane1_xe20=0x1 +serdes_pre_driver_current_lane2_xe20=0x1 +serdes_pre_driver_current_lane3_xe20=0x1 +serdes_preemphasis_lane0_xe20=0xb330 +serdes_preemphasis_lane1_xe20=0xb330 +serdes_preemphasis_lane2_xe20=0xb330 +serdes_preemphasis_lane3_xe20=0xb330 + +# xe21 (40G) +portmap_22=109:40 +xgxs_rx_lane_map_22=0x132 +xgxs_tx_lane_map_22=0x132 +phy_xaui_rx_polarity_flip_22=0x8 +phy_xaui_tx_polarity_flip_22=0x0 +serdes_driver_current_lane0_xe21=0x1 +serdes_driver_current_lane1_xe21=0x1 +serdes_driver_current_lane2_xe21=0x1 +serdes_driver_current_lane3_xe21=0x2 +serdes_pre_driver_current_lane0_xe21=0x1 +serdes_pre_driver_current_lane1_xe21=0x1 +serdes_pre_driver_current_lane2_xe21=0x1 +serdes_pre_driver_current_lane3_xe21=0x2 +serdes_preemphasis_lane0_xe21=0xb330 +serdes_preemphasis_lane1_xe21=0xb330 +serdes_preemphasis_lane2_xe21=0xb330 +serdes_preemphasis_lane3_xe21=0xbff0 + +# xe22 (40G) +portmap_23=117:40 +xgxs_rx_lane_map_23=0x231 +xgxs_tx_lane_map_23=0x1203 +phy_xaui_rx_polarity_flip_23=0x3 +phy_xaui_tx_polarity_flip_23=0xe +serdes_driver_current_lane0_xe22=0x3 +serdes_driver_current_lane1_xe22=0x5 +serdes_driver_current_lane2_xe22=0x3 +serdes_driver_current_lane3_xe22=0x3 +serdes_pre_driver_current_lane0_xe22=0x3 +serdes_pre_driver_current_lane1_xe22=0x5 +serdes_pre_driver_current_lane2_xe22=0x3 +serdes_pre_driver_current_lane3_xe22=0x3 +serdes_preemphasis_lane0_xe22=0xc6e0 +serdes_preemphasis_lane1_xe22=0xc6e0 +serdes_preemphasis_lane2_xe22=0xc6e0 +serdes_preemphasis_lane3_xe22=0xc6e0 + +# xe23 (40G) +portmap_24=113:40 +xgxs_rx_lane_map_24=0x132 +xgxs_tx_lane_map_24=0x132 +phy_xaui_rx_polarity_flip_24=0x8 +phy_xaui_tx_polarity_flip_24=0x0 +serdes_driver_current_lane0_xe23=0x1 +serdes_driver_current_lane1_xe23=0x1 +serdes_driver_current_lane2_xe23=0x1 +serdes_driver_current_lane3_xe23=0x1 +serdes_pre_driver_current_lane0_xe23=0x1 +serdes_pre_driver_current_lane1_xe23=0x1 +serdes_pre_driver_current_lane2_xe23=0x1 +serdes_pre_driver_current_lane3_xe23=0x1 +serdes_preemphasis_lane0_xe23=0xbb10 +serdes_preemphasis_lane1_xe23=0xbb10 +serdes_preemphasis_lane2_xe23=0xbb10 +serdes_preemphasis_lane3_xe23=0xc2f0 + +# xe24 (40G) +portmap_25=121:40 +xgxs_rx_lane_map_25=0x1320 +xgxs_tx_lane_map_25=0x3021 +phy_xaui_rx_polarity_flip_25=0xd +phy_xaui_tx_polarity_flip_25=0xb +serdes_driver_current_lane0_xe24=0x4 +serdes_driver_current_lane1_xe24=0x4 +serdes_driver_current_lane2_xe24=0x4 +serdes_driver_current_lane3_xe24=0x4 +serdes_pre_driver_current_lane0_xe24=0x4 +serdes_pre_driver_current_lane1_xe24=0x4 +serdes_pre_driver_current_lane2_xe24=0x4 +serdes_pre_driver_current_lane3_xe24=0x4 +serdes_preemphasis_lane0_xe24=0xc6e0 +serdes_preemphasis_lane1_xe24=0xc6e0 +serdes_preemphasis_lane2_xe24=0xc6e0 +serdes_preemphasis_lane3_xe24=0xc6e0 + +# xe25 (40G) +portmap_26=125:40 +xgxs_rx_lane_map_26=0x132 +xgxs_tx_lane_map_26=0x132 +phy_xaui_rx_polarity_flip_26=0x8 +phy_xaui_tx_polarity_flip_26=0x0 +serdes_driver_current_lane0_xe25=0x4 +serdes_driver_current_lane1_xe25=0x4 +serdes_driver_current_lane2_xe25=0x4 +serdes_driver_current_lane3_xe25=0x4 +serdes_pre_driver_current_lane0_xe25=0x4 +serdes_pre_driver_current_lane1_xe25=0x4 +serdes_pre_driver_current_lane2_xe25=0x4 +serdes_pre_driver_current_lane3_xe25=0x4 +serdes_preemphasis_lane0_xe25=0xc6e0 +serdes_preemphasis_lane1_xe25=0xc6e0 +serdes_preemphasis_lane2_xe25=0xc6e0 +serdes_preemphasis_lane3_xe25=0xcec0 + +# xe26 (40G) +portmap_27=85:40 +xgxs_rx_lane_map_27=0x213 +xgxs_tx_lane_map_27=0x1203 +phy_xaui_rx_polarity_flip_27=0xc +phy_xaui_tx_polarity_flip_27=0xe +serdes_driver_current_lane0_xe26=0x4 +serdes_driver_current_lane1_xe26=0x5 +serdes_driver_current_lane2_xe26=0x4 +serdes_driver_current_lane3_xe26=0x5 +serdes_pre_driver_current_lane0_xe26=0x4 +serdes_pre_driver_current_lane1_xe26=0x5 +serdes_pre_driver_current_lane2_xe26=0x4 +serdes_pre_driver_current_lane3_xe26=0x5 +serdes_preemphasis_lane0_xe26=0xc2f0 +serdes_preemphasis_lane1_xe26=0xc6e0 +serdes_preemphasis_lane2_xe26=0xc6e0 +serdes_preemphasis_lane3_xe26=0xc6e0 + +# xe27 (40G) +portmap_28=81:40 +xgxs_rx_lane_map_28=0x1320 +xgxs_tx_lane_map_28=0x2031 +phy_xaui_rx_polarity_flip_28=0x1 +phy_xaui_tx_polarity_flip_28=0x2 +serdes_driver_current_lane0_xe27=0x2 +serdes_driver_current_lane1_xe27=0x2 +serdes_driver_current_lane2_xe27=0x2 +serdes_driver_current_lane3_xe27=0x2 +serdes_pre_driver_current_lane0_xe27=0x2 +serdes_pre_driver_current_lane1_xe27=0x2 +serdes_pre_driver_current_lane2_xe27=0x2 +serdes_pre_driver_current_lane3_xe27=0x2 +serdes_preemphasis_lane0_xe27=0xbb10 +serdes_preemphasis_lane1_xe27=0xbb10 +serdes_preemphasis_lane2_xe27=0xbf00 +serdes_preemphasis_lane3_xe27=0xbb10 + +# xe29 (40G) +portmap_29=89:40 +xgxs_rx_lane_map_29=0x1320 +xgxs_tx_lane_map_29=0x3021 +phy_xaui_rx_polarity_flip_29=0x2 +phy_xaui_tx_polarity_flip_29=0xb +serdes_driver_current_lane0_xe28=0x4 +serdes_driver_current_lane1_xe28=0x4 +serdes_driver_current_lane2_xe28=0x4 +serdes_driver_current_lane3_xe28=0x4 +serdes_pre_driver_current_lane0_xe28=0x4 +serdes_pre_driver_current_lane1_xe28=0x4 +serdes_pre_driver_current_lane2_xe28=0x4 +serdes_pre_driver_current_lane3_xe28=0x4 +serdes_preemphasis_lane0_xe28=0xcad0 +serdes_preemphasis_lane1_xe28=0xc6e0 +serdes_preemphasis_lane2_xe28=0xc6e0 +serdes_preemphasis_lane3_xe28=0xc6e0 + +# xe29 (40G) +portmap_30=93:40 +xgxs_rx_lane_map_30=0x1320 +xgxs_tx_lane_map_30=0x2031 +phy_xaui_rx_polarity_flip_30=0x1 +phy_xaui_tx_polarity_flip_30=0x2 +serdes_driver_current_lane0_xe29=0x4 +serdes_driver_current_lane1_xe29=0x4 +serdes_driver_current_lane2_xe29=0x4 +serdes_driver_current_lane3_xe29=0x4 +serdes_pre_driver_current_lane0_xe29=0x4 +serdes_pre_driver_current_lane1_xe29=0x4 +serdes_pre_driver_current_lane2_xe29=0x4 +serdes_pre_driver_current_lane3_xe29=0x4 +serdes_preemphasis_lane0_xe29=0xc2f0 +serdes_preemphasis_lane1_xe29=0xc2f0 +serdes_preemphasis_lane2_xe29=0xc2f0 +serdes_preemphasis_lane3_xe29=0xc2f0 + +# xe30 (40G) +portmap_31=97:40 +xgxs_rx_lane_map_31=0x213 +xgxs_tx_lane_map_31=0x2031 +phy_xaui_rx_polarity_flip_31=0xc +phy_xaui_tx_polarity_flip_31=0x3 +serdes_driver_current_lane0_xe30=0x5 +serdes_driver_current_lane1_xe30=0x5 +serdes_driver_current_lane2_xe30=0x5 +serdes_driver_current_lane3_xe30=0x5 +serdes_pre_driver_current_lane0_xe30=0x5 +serdes_pre_driver_current_lane1_xe30=0x5 +serdes_pre_driver_current_lane2_xe30=0x5 +serdes_pre_driver_current_lane3_xe30=0x5 +serdes_preemphasis_lane0_xe30=0xcad0 +serdes_preemphasis_lane1_xe30=0xcad0 +serdes_preemphasis_lane2_xe30=0xcad0 +serdes_preemphasis_lane3_xe30=0xcad0 + +# xe31 (40G) +portmap_32=101:40 +xgxs_rx_lane_map_32=0x1320 +xgxs_tx_lane_map_32=0x1203 +phy_xaui_rx_polarity_flip_32=0x1 +phy_xaui_tx_polarity_flip_32=0x6 +serdes_driver_current_lane0_xe31=0x6 +serdes_driver_current_lane1_xe31=0x6 +serdes_driver_current_lane2_xe31=0x6 +serdes_driver_current_lane3_xe31=0x7 +serdes_pre_driver_current_lane0_xe31=0x6 +serdes_pre_driver_current_lane1_xe31=0x6 +serdes_pre_driver_current_lane2_xe31=0x6 +serdes_pre_driver_current_lane3_xe31=0x7 +serdes_preemphasis_lane0_xe31=0xcec0 +serdes_preemphasis_lane1_xe31=0xcec0 +serdes_preemphasis_lane2_xe31=0xcad0 +serdes_preemphasis_lane3_xe31=0xc6e0 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/default_sku b/device/virtual/x86_64-kvm_x86_64-r0/default_sku new file mode 100644 index 000000000000..493e1989b662 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/default_sku @@ -0,0 +1 @@ +Force10-S6000 t1 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/installer.conf b/device/virtual/x86_64-kvm_x86_64-r0/installer.conf new file mode 100644 index 000000000000..e69de29bb2d1 From 309cfac8584d6965d84ca9eb061fdbe24d3b7e37 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sun, 18 Nov 2018 08:39:35 +0000 Subject: [PATCH 03/12] use -m to set switch mac address for virtual switch --- dockers/docker-orchagent/orchagent.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 7758ceeed590..05a62cf4734e 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -27,6 +27,8 @@ elif [ "$platform" == "centec" ]; then ORCHAGENT_ARGS+="-m $ALIGNED_MAC_ADDRESS" elif [ "$platform" == "barefoot" ]; then ORCHAGENT_ARGS+="-m $MAC_ADDRESS" +elif [ "$platform" == "vs" ]; then + ORCHAGENT_ARGS+="-m $MAC_ADDRESS" fi exec /usr/bin/orchagent ${ORCHAGENT_ARGS} From 1b97e9c3e71bd796ba4d1172b65af4a18106a65c Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sun, 18 Nov 2018 23:56:13 +0000 Subject: [PATCH 04/12] update sonic-sairedis Signed-off-by: Guohan Lu --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 398d24aa4159..5ddafbcf5a9d 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 398d24aa4159903aacbb1b8a6b5ab3307a575075 +Subproject commit 5ddafbcf5a9d6ae3328cacfc9bf2d43fa4bd3b33 From d6521a7e82dbd0efa7dc25eaeed2174735d0a7e4 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Mon, 19 Nov 2018 03:29:43 +0000 Subject: [PATCH 05/12] add SONIC_MAKE_FILES target and switch ixgbe to use SONIC_MAKE_FILES target Signed-off-by: Guohan Lu --- build_debian.sh | 2 +- rules/ixgbe.mk | 4 ++-- slave.mk | 37 ++++++++++++++++++++++++++++++++----- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 24552cfe4441..5d438cf249cb 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -152,7 +152,7 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd ## Install latest intel ixgbe driver -sudo cp target/debs/ixgbe.ko $FILESYSTEM_ROOT/lib/modules/${LINUX_KERNEL_VERSION}-amd64/kernel/drivers/net/ethernet/intel/ixgbe/ixgbe.ko +sudo cp target/files/ixgbe.ko $FILESYSTEM_ROOT/lib/modules/${LINUX_KERNEL_VERSION}-amd64/kernel/drivers/net/ethernet/intel/ixgbe/ixgbe.ko ## Install docker echo '[INFO] Install docker' diff --git a/rules/ixgbe.mk b/rules/ixgbe.mk index c9ce6d97ad63..86a0e8453a2b 100644 --- a/rules/ixgbe.mk +++ b/rules/ixgbe.mk @@ -6,6 +6,6 @@ export IXGBE_DRIVER_VERSION IXGBE_DRIVER = ixgbe.ko $(IXGBE_DRIVER)_SRC_PATH = $(SRC_PATH)/ixgbe $(IXGBE_DRIVER)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) -SONIC_MAKE_DEBS += $(IXGBE_DRIVER) +SONIC_MAKE_FILES += $(IXGBE_DRIVER) -SONIC_STRETCH_DEBS += $(IXGBE_DRIVER) +SONIC_STRETCH_FILES += $(IXGBE_DRIVER) diff --git a/slave.mk b/slave.mk index e6306d166156..fc43f89d2329 100644 --- a/slave.mk +++ b/slave.mk @@ -212,6 +212,32 @@ $(addprefix $(FILES_PATH)/, $(SONIC_ONLINE_FILES)) : $(FILES_PATH)/% : .platform SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_ONLINE_FILES)) +############################################################################### +## Build targets +############################################################################### + +# Build project using build.sh script +# They are essentially a one-time build projects that get sources from some URL +# and compile them +# Add new file for build: +# SOME_NEW_FILE = some_new_deb.deb +# $(SOME_NEW_FILE)_SRC_PATH = $(SRC_PATH)/project_name +# $(SOME_NEW_FILE)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ... +# SONIC_MAKE_FILES += $(SOME_NEW_FILE) +$(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) + $(HEADER) + # Remove target to force rebuild + rm -f $(addprefix $(FILES_PATH)/, $*) + # Apply series of patches if exist + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + # Build project and take package + make DEST=$(shell pwd)/$(FILES_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(FILES_PATH)/$* $(LOG) + # Clean up + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi + $(FOOTER) + +SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) + ############################################################################### ## Debian package related targets ############################################################################### @@ -468,9 +494,9 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $$(addprefix $(DEBS_PATH)/,$$($$*_INSTALLS)) \ $$(addprefix $(DEBS_PATH)/,$$($$*_LAZY_INSTALLS)) \ $$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \ + $(addprefix $(FILES_PATH)/,$(IXGBE_DRIVER)) \ $(addprefix $(DEBS_PATH)/,$(INITRAMFS_TOOLS) \ $(LINUX_KERNEL) \ - $(IXGBE_DRIVER) \ $(SONIC_DEVICE_DATA) \ $(PYTHON_CLICK) \ $(SONIC_UTILS) \ @@ -554,9 +580,7 @@ SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) SONIC_CLEAN_DEBS = $(addsuffix -clean,$(addprefix $(DEBS_PATH)/, \ $(SONIC_ONLINE_DEBS) \ - $(SONIC_ONLINE_FILES) \ $(SONIC_COPY_DEBS) \ - $(SONIC_COPY_FILES) \ $(SONIC_MAKE_DEBS) \ $(SONIC_DPKG_DEBS) \ $(SONIC_PYTHON_STDEB_DEBS) \ @@ -565,7 +589,8 @@ SONIC_CLEAN_DEBS = $(addsuffix -clean,$(addprefix $(DEBS_PATH)/, \ SONIC_CLEAN_FILES = $(addsuffix -clean,$(addprefix $(FILES_PATH)/, \ $(SONIC_ONLINE_FILES) \ - $(SONIC_COPY_FILES))) + $(SONIC_COPY_FILES) \ + $(SONIC_MAKE_FILES))) $(SONIC_CLEAN_DEBS) : $(DEBS_PATH)/%-clean : .platform $$(addsuffix -clean,$$(addprefix $(DEBS_PATH)/,$$($$*_MAIN_DEB))) @# remove derived or extra targets if main one is removed, because we treat them @@ -598,7 +623,9 @@ clean : .platform clean-logs $$(SONIC_CLEAN_DEBS) $$(SONIC_CLEAN_FILES) $$(SONIC all : .platform $$(addprefix $(TARGET_PATH)/,$$(SONIC_ALL)) -stretch : $$(addprefix $(DEBS_PATH)/,$$(SONIC_STRETCH_DEBS)) +stretch : $$(addprefix $(DEBS_PATH)/,$$(SONIC_STRETCH_DEBS)) \ + $$(addprefix $(FILES_PATH)/,$$(SONIC_STRETCH_FILES)) + ############################################################################### ## Standard targets From ad50677d81d399a83fa3c2283a5b30b0d25ab0f8 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Mon, 19 Nov 2018 05:12:21 +0000 Subject: [PATCH 06/12] add sonic_version.yml in docker-sonic-vs Signed-off-by: Guohan Lu --- platform/vs/docker-sonic-vs.mk | 3 +- platform/vs/docker-sonic-vs/Dockerfile.j2 | 4 +- platform/vs/docker-sonic-vs/brcm.profile.ini | 4 - platform/vs/docker-sonic-vs/buffers.json.j2 | 162 ------------------ .../vs/docker-sonic-vs/pg_profile_lookup.ini | 17 -- platform/vs/docker-sonic-vs/start.sh | 9 +- platform/vs/docker-sonic-vs/supervisord.conf | 6 +- platform/vs/rules.mk | 1 + platform/vs/sonic-version.mk | 13 ++ platform/vs/sonic-version/Makefile | 10 ++ .../vs/sonic-version/build_sonic_version.sh | 8 + slave.mk | 2 +- 12 files changed, 46 insertions(+), 193 deletions(-) delete mode 100644 platform/vs/docker-sonic-vs/brcm.profile.ini delete mode 100644 platform/vs/docker-sonic-vs/buffers.json.j2 delete mode 100644 platform/vs/docker-sonic-vs/pg_profile_lookup.ini create mode 100644 platform/vs/sonic-version.mk create mode 100644 platform/vs/sonic-version/Makefile create mode 100755 platform/vs/sonic-version/build_sonic_version.sh diff --git a/platform/vs/docker-sonic-vs.mk b/platform/vs/docker-sonic-vs.mk index ea0d15134f5a..6b3f9f96c07e 100644 --- a/platform/vs/docker-sonic-vs.mk +++ b/platform/vs/docker-sonic-vs.mk @@ -30,7 +30,8 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(GOBGP) endif $(DOCKER_SONIC_VS)_FILES += $(CONFIGDB_LOAD_SCRIPT) \ - $(ARP_UPDATE_SCRIPT) + $(ARP_UPDATE_SCRIPT) \ + $(SONIC_VERSION) $(DOCKER_SONIC_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_VS) diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index e3fe4dd0197e..c26da98da2aa 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -84,12 +84,10 @@ RUN sed -ri 's/^(save .*$)/# \1/g; COPY ["50-default.conf", "/etc/rsyslog.d/"] COPY ["start.sh", "orchagent.sh", "/usr/bin/"] -COPY ["brcm.profile.ini", "/usr/share/sonic/device/vswitch/"] -COPY ["buffers.json.j2", "/usr/share/sonic/device/vswitch/"] -COPY ["pg_profile_lookup.ini", "/usr/share/sonic/device/vswitch/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["files/configdb-load.sh", "/usr/bin/"] COPY ["files/arp_update", "/usr/bin"] +COPY ["files/sonic_version.yml", "/etc/sonic/"] # Workaround the tcpdump issue RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump diff --git a/platform/vs/docker-sonic-vs/brcm.profile.ini b/platform/vs/docker-sonic-vs/brcm.profile.ini deleted file mode 100644 index 23cd24c73a35..000000000000 --- a/platform/vs/docker-sonic-vs/brcm.profile.ini +++ /dev/null @@ -1,4 +0,0 @@ -SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin -SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin -SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850 -SAI_VS_HOSTIF_USE_TAP_DEVICE=true diff --git a/platform/vs/docker-sonic-vs/buffers.json.j2 b/platform/vs/docker-sonic-vs/buffers.json.j2 deleted file mode 100644 index da9c764db92b..000000000000 --- a/platform/vs/docker-sonic-vs/buffers.json.j2 +++ /dev/null @@ -1,162 +0,0 @@ -{# Default values which will be used if no actual configura available #} -{% set default_cable = '300m' %} -{% set default_ports_num = 32 -%} - -{# Port configuration to cable length look-up table #} -{# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #} -{# Roles described in the minigraph #} -{% set ports2cable = { - 'torrouter_server' : '5m', - 'leafrouter_torrouter' : '40m', - 'spinerouter_leafrouter' : '300m' - } -%} - -{%- macro cable_length(port_name) -%} - {%- set cable_len = [] -%} - {%- for local_port in DEVICE_NEIGHBOR -%} - {%- if local_port == port_name -%} - {%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} - {%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%} - {%- set neighbor_role = neighbor.type -%} - {%- set roles1 = switch_role + '_' + neighbor_role %} - {%- set roles2 = neighbor_role + '_' + switch_role -%} - {%- set roles1 = roles1 | lower -%} - {%- set roles2 = roles2 | lower -%} - {%- if roles1 in ports2cable -%} - {%- if cable_len.append(ports2cable[roles1]) -%}{%- endif -%} - {%- elif roles2 in ports2cable -%} - {%- if cable_len.append(ports2cable[roles2]) -%}{%- endif -%} - {%- endif -%} - {%- endif -%} - {%- endif -%} - {%- endfor -%} - {%- if cable_len -%} - {{ cable_len.0 }} - {%- else -%} - {{ default_cable }} - {%- endif -%} -{% endmacro %} - -{%- if DEVICE_METADATA is defined %} -{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} -{%- endif -%} - -{# Generate list of ports if not defined #} -{% if PORT is not defined %} - {% set PORT = [] %} - {% for port_idx in range(0,default_ports_num) %} - {% if PORT.append("Ethernet%d" % (port_idx*4)) %}{% endif %} - {% endfor %} -{% endif -%} - -{% set port_names_list = [] %} -{% for port in PORT %} - {%- if port_names_list.append(port) %}{% endif %} -{% endfor %} -{% set port_names = port_names_list | join(',') -%} - -{ - "CABLE_LENGTH": { - "AZURE": { - {% for port in PORT %} - {% set cable = cable_length(port) -%} - "{{ port }}": "{{ cable }}"{%- if not loop.last -%},{% endif %} - - {% endfor %} - } - }, -{%if switch_role == 'ToRRouter' %} -{% set ingress_lossless_pool_size = '4194304' %} -{% set ingress_lossy_pool_size = '7340032' %} -{% set egress_lossless_pool_size = '16777152' %} -{% set egress_lossy_pool_size = '7340032' %} -{% else %} -{% set ingress_lossless_pool_size = '2097152' %} -{% set ingress_lossy_pool_size = '5242880' %} -{% set egress_lossless_pool_size = '16777152' %} -{% set egress_lossy_pool_size = '5242880' %} -{%endif %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "{{ ingress_lossless_pool_size }}", - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - "size": "{{ ingress_lossy_pool_size }}", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - "size": "{{ egress_lossy_pool_size }}", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"0" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"4096", - "dynamic_th":"3" - }, - "pg_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "q_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, - "BUFFER_PORT_INGRESS_PROFILE_LIST": { - "{{ port_names }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - } - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { - "{{ port_names }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - } - }, - "BUFFER_PG": { - "{{ port_names }}|0-1": { - "profile" : "[BUFFER_PROFILE|pg_lossy_profile]" - } - }, - "BUFFER_QUEUE": { - "{{ port_names }}|3-4": { - "profile" : "[BUFFER_PROFILE|q_lossless_profile]" - }, - "{{ port_names }}|0-1": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - } - } -} diff --git a/platform/vs/docker-sonic-vs/pg_profile_lookup.ini b/platform/vs/docker-sonic-vs/pg_profile_lookup.ini deleted file mode 100644 index b66b129fe43f..000000000000 --- a/platform/vs/docker-sonic-vs/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold - 10000 5m 34816 18432 16384 0 - 25000 5m 34816 18432 16384 0 - 40000 5m 34816 18432 16384 0 - 50000 5m 34816 18432 16384 0 - 100000 5m 36864 18432 18432 0 - 10000 40m 36864 18432 18432 0 - 25000 40m 39936 18432 21504 0 - 40000 40m 41984 18432 23552 0 - 50000 40m 41984 18432 23552 0 - 100000 40m 54272 18432 35840 0 - 10000 300m 49152 18432 30720 0 - 25000 300m 71680 18432 53248 0 - 40000 300m 94208 18432 75776 0 - 50000 300m 94208 18432 75776 0 - 100000 300m 184320 18432 165888 0 diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 83e818fe0874..6eec5b5dbc99 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -2,6 +2,11 @@ # generate configuration +PLATFORM=x86_64-kvm_x86_64-r0 +HWSKU=Force10-S6000 + +ln -sf /usr/share/sonic/device/$PLATFORM/$HWSKU /usr/share/sonic/hwsku + [ -d /etc/sonic ] || mkdir -p /etc/sonic SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') @@ -12,8 +17,8 @@ if [ -f /etc/sonic/config_db.json ]; then mv /tmp/config_db.json /etc/sonic/config_db.json else # generate and merge buffers configuration into config file - sonic-cfggen -t /usr/share/sonic/device/vswitch/buffers.json.j2 > /tmp/buffers.json - sonic-cfggen -p /usr/share/sonic/device/x86_64-dell_s6000_s1220-r0/Force10-S6000/port_config.ini -k Force10-S6000 --print-data > /tmp/ports.json + sonic-cfggen -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json + sonic-cfggen -p /usr/share/sonic/hwsku/port_config.ini -k $HWSKU --print-data > /tmp/ports.json sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/buffers.json -j /tmp/ports.json --print-data > /etc/sonic/config_db.json fi diff --git a/platform/vs/docker-sonic-vs/supervisord.conf b/platform/vs/docker-sonic-vs/supervisord.conf index c4ec73b41fad..3435f245758f 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf +++ b/platform/vs/docker-sonic-vs/supervisord.conf @@ -28,7 +28,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:syncd] -command=/usr/bin/syncd -u -p /usr/share/sonic/device/vswitch/brcm.profile.ini +command=/usr/bin/syncd_start.sh priority=4 autostart=false autorestart=false @@ -44,7 +44,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:portsyncd] -command=/usr/bin/portsyncd -p /usr/share/sonic/device/x86_64-dell_s6000_s1220-r0/Force10-S6000/port_config.ini +command=/usr/bin/portsyncd -p /usr/share/sonic/hwsku/port_config.ini priority=6 autostart=false autorestart=false @@ -140,7 +140,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:buffermgrd] -command=/usr/bin/buffermgrd -l /usr/share/sonic/device/vswitch/pg_profile_lookup.ini +command=/usr/bin/buffermgrd -l /usr/share/sonic/hwsku/pg_profile_lookup.ini priority=17 autostart=false autorestart=false diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index 27bcf590946e..6cc1b3eab574 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -1,4 +1,5 @@ include $(PLATFORM_PATH)/syncd-vs.mk +include $(PLATFORM_PATH)/sonic-version.mk include $(PLATFORM_PATH)/docker-sonic-vs.mk include $(PLATFORM_PATH)/docker-syncd-vs.mk include $(PLATFORM_PATH)/docker-orchagent-vs.mk diff --git a/platform/vs/sonic-version.mk b/platform/vs/sonic-version.mk new file mode 100644 index 000000000000..9e21573227b3 --- /dev/null +++ b/platform/vs/sonic-version.mk @@ -0,0 +1,13 @@ +# sonic version yml file + +sonic_version=$(SONIC_GET_VERSION) +sonic_asic_platform=$(CONFIGURED_PLATFORM) + +export sonic_version +export sonic_asic_platform + +SONIC_VERSION = sonic_version.yml +$(SONIC_VERSION)_SRC_PATH = $(PLATFORM_PATH)/sonic-version +SONIC_MAKE_FILES += $(SONIC_VERSION) + +SONIC_PHONY_TARGETS += $(addprefix $(FILES_PATH)/, $(SONIC_VERSION)) diff --git a/platform/vs/sonic-version/Makefile b/platform/vs/sonic-version/Makefile new file mode 100644 index 000000000000..2b2386031c9b --- /dev/null +++ b/platform/vs/sonic-version/Makefile @@ -0,0 +1,10 @@ +.ONESHELL: +SHELL = /bin/bash +.SHELLFLAGS += -e + +MAIN_TARGET = sonic_version.yml + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + ./build_sonic_version.sh $(MAIN_TARGET) + + mv $(MAIN_TARGET) $(DEST)/ diff --git a/platform/vs/sonic-version/build_sonic_version.sh b/platform/vs/sonic-version/build_sonic_version.sh new file mode 100755 index 000000000000..f118a1c20a6d --- /dev/null +++ b/platform/vs/sonic-version/build_sonic_version.sh @@ -0,0 +1,8 @@ +tee $1 > /dev/null < Date: Tue, 20 Nov 2018 04:26:16 +0000 Subject: [PATCH 07/12] build sonic-vs kvm image Signed-off-by: Guohan Lu --- build_image.sh | 26 +++++++++++++- build_kvm_image.sh | 77 ++++++++++++++++++++++++++++++++++++++++ check_install.py | 53 +++++++++++++++++++++++++++ onie-image.conf | 10 ++++-- platform/vs/kvm-image.mk | 8 +++++ platform/vs/onie.mk | 4 +++ platform/vs/rules.mk | 2 ++ slave.mk | 3 ++ sonic-slave/Dockerfile | 11 ++++-- 9 files changed, 189 insertions(+), 5 deletions(-) create mode 100755 build_kvm_image.sh create mode 100755 check_install.py create mode 100644 platform/vs/kvm-image.mk create mode 100644 platform/vs/onie.mk diff --git a/build_image.sh b/build_image.sh index d1f9c2241ae6..d1371c9602f6 100755 --- a/build_image.sh +++ b/build_image.sh @@ -77,6 +77,30 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then mv $OUTPUT_RAW_IMAGE.gz $OUTPUT_RAW_IMAGE echo "The compressed raw image is in $OUTPUT_RAW_IMAGE" +elif [ "$IMAGE_TYPE" = "kvm" ]; then + + echo "Build KVM image" + sudo rm -f $OUTPUT_KVM_IMAGE $OUTPUT_KVM_IMAGE.gz + + generate_onie_installer_image + + SONIC_USERNAME=$USERNAME PASSWD=$PASSWORD sudo -E ./build_kvm_image.sh $OUTPUT_KVM_IMAGE $onie_recovery_image $OUTPUT_ONIE_IMAGE $KVM_IMAGE_DISK_SIZE + + [ -r $OUTPUT_KVM_IMAGE ] || { + echo "Error : $OUTPUT_KVM_IMAGE not generated!" + exit 1 + } + + gzip $OUTPUT_KVM_IMAGE + + [ -r $OUTPUT_KVM_IMAGE.gz ] || { + echo "Error : gzip $OUTPUT_KVM_IMAGE failed!" + exit 1 + } + + mv $OUTPUT_KVM_IMAGE.gz $OUTPUT_KVM_IMAGE + echo "The compressed kvm image is in $OUTPUT_KVM_IMAGE" + ## Use 'aboot' as target machine category which includes Aboot as bootloader elif [ "$IMAGE_TYPE" = "aboot" ]; then echo "Build Aboot installer" @@ -104,6 +128,6 @@ elif [ "$IMAGE_TYPE" = "aboot" ]; then zip -g $OUTPUT_ABOOT_IMAGE $ABOOT_BOOT_IMAGE rm $ABOOT_BOOT_IMAGE else - echo "Error: Non supported target platform: $TARGET_PLATFORM" + echo "Error: Non supported image type $IMAGE_TYPE" exit 1 fi diff --git a/build_kvm_image.sh b/build_kvm_image.sh new file mode 100755 index 000000000000..2e1f767329aa --- /dev/null +++ b/build_kvm_image.sh @@ -0,0 +1,77 @@ +#!/bin/sh -ex + +# Copyright (C) 2014 Curt Brune +# +# SPDX-License-Identifier: GPL-2.0 + +MEM=2048 +DISK=$1 +ONIE_RECOVERY_ISO=$2 +INSTALLER=$3 +DISK_SIZE=$4 + +INSTALLER_DISK="./sonic-installer.img" + +# VM will listen on telnet port $KVM_PORT +KVM_PORT=9000 + +on_exit() +{ + rm -f $kvm_log +} + +kvm_log=$(mktemp) +trap on_exit EXIT + +create_disk() +{ + echo "Creating SONiC kvm disk : $DISK of size $DISK_SIZE GB" + qemu-img create -f qcow2 $DISK ${DISK_SIZE}G +} + +prepare_installer_disk() +{ + fallocate -l 1024M $INSTALLER_DISK + + mkfs.vfat $INSTALLER_DISK + + tmpdir=$(mktemp -d) + + mount -o loop $INSTALLER_DISK $tmpdir + + cp $INSTALLER $tmpdir/onie-installer.bin + + umount $tmpdir +} + +create_disk +prepare_installer_disk + +/usr/bin/kvm -m $MEM \ + -name "onie" \ + -boot "order=cd,once=d" -cdrom "$ONIE_RECOVERY_ISO" \ + -device e1000,netdev=onienet \ + -netdev user,id=onienet,hostfwd=:0.0.0.0:3041-:22 \ + -vnc 0.0.0.0:0 \ + -vga std \ + -drive file=$DISK,media=disk,if=virtio,index=0 \ + -drive file=$INSTALLER_DISK,if=virtio,index=1 \ + -serial telnet:localhost:$KVM_PORT,server > $kvm_log 2>&1 & + +kvm_pid=$! + +sleep 2.0 + +[ -d "/proc/$kvm_pid" ] || { + echo "ERROR: kvm died." + cat $kvm_log + exit 1 +} + +echo "to kill kvm: sudo kill $kvm_pid" + +./check_install.py -u $SONIC_USERNAME -P $PASSWD -p $KVM_PORT + +kill $kvm_pid + +exit 0 diff --git a/check_install.py b/check_install.py new file mode 100755 index 000000000000..940355e3ca5b --- /dev/null +++ b/check_install.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +import pexpect +import argparse +import sys + +def main(): + + parser = argparse.ArgumentParser(description='test_login cmdline parser') + parser.add_argument('-u', default="admin", help='login user name') + parser.add_argument('-P', default="YourPaSsWoRd", help='login password') + parser.add_argument('-p', type=int, default=9000, help='local port') + + args = parser.parse_args() + + KEY_UP = '\x1b[A' + KEY_DOWN = '\x1b[B' + KEY_RIGHT = '\x1b[C' + KEY_LEFT = '\x1b[D' + + login_prompt = 'sonic login:' + passwd_prompt = 'Password:' + cmd_prompt = "%s@sonic:~\$ $" % args.u + grub_selection = "The highlighted entry will be executed" + + p = pexpect.spawn("telnet 127.0.0.1 %s" % args.p, timeout=600, logfile=sys.stdout) + + # select ONIE embed + p.expect(grub_selection) + p.sendline(KEY_DOWN) + + # install sonic image + while True: + i = p.expect([login_prompt, passwd_prompt, grub_selection, cmd_prompt]) + if i == 0: + # send user name + p.sendline(args.u) + elif i == 1: + # send password + p.sendline(args.P) + elif i == 2: + # select onie install + p.sendline() + else: + break + + # check version + p.sendline('show version') + p.expect([cmd_prompt]) + print p.before + +if __name__ == '__main__': + main() diff --git a/onie-image.conf b/onie-image.conf index 0ffc9914c732..1d7c6f1e8aa5 100644 --- a/onie-image.conf +++ b/onie-image.conf @@ -27,12 +27,18 @@ DOCKERFS_DIR=docker ## Output file name for onie installer OUTPUT_ONIE_IMAGE=target/sonic-$TARGET_MACHINE.bin -### Output file name for raw image +## Output file name for raw image OUTPUT_RAW_IMAGE=target/sonic-$TARGET_MACHINE.raw -### Raw image size in MB +## Raw image size in MB RAW_IMAGE_DISK_SIZE=1024 +## Output file name for kvm image +OUTPUT_KVM_IMAGE=target/sonic-$TARGET_MACHINE.img + +## Kvm image size in GB +KVM_IMAGE_DISK_SIZE=16 + ## Output file name for aboot installer OUTPUT_ABOOT_IMAGE=target/sonic-aboot-$TARGET_MACHINE.swi diff --git a/platform/vs/kvm-image.mk b/platform/vs/kvm-image.mk new file mode 100644 index 000000000000..e71776708542 --- /dev/null +++ b/platform/vs/kvm-image.mk @@ -0,0 +1,8 @@ +# sonic kvm image + +SONIC_KVM_IMAGE = sonic-vs.img +$(SONIC_KVM_IMAGE)_MACHINE = vs +$(SONIC_KVM_IMAGE)_IMAGE_TYPE = kvm +$(SONIC_KVM_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) +$(SONIC_KVM_IMAGE)_FILES = $(ONIE_RECOVERY_IMAGE) +SONIC_INSTALLERS += $(SONIC_KVM_IMAGE) diff --git a/platform/vs/onie.mk b/platform/vs/onie.mk new file mode 100644 index 000000000000..09a807c25b2a --- /dev/null +++ b/platform/vs/onie.mk @@ -0,0 +1,4 @@ +ONIE_RECOVERY_IMAGE = onie-recovery-x86_64-kvm_x86_64-r0.iso +$(ONIE_RECOVERY_IMAGE)_URL = "https://sonicstorage.blob.core.windows.net/packages/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso?sv=2015-04-05&sr=b&sig=XMAk1cttBFM369CMbihe5oZgXwe4uaDVfwg4CTLT%2F5U%3D&se=2155-10-13T10%3A40%3A13Z&sp=r" + +SONIC_ONLINE_FILES += $(ONIE_RECOVERY_IMAGE) diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index 6cc1b3eab574..99c5c198b732 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -4,5 +4,7 @@ include $(PLATFORM_PATH)/docker-sonic-vs.mk include $(PLATFORM_PATH)/docker-syncd-vs.mk include $(PLATFORM_PATH)/docker-orchagent-vs.mk include $(PLATFORM_PATH)/one-image.mk +include $(PLATFORM_PATH)/onie.mk +include $(PLATFORM_PATH)/kvm-image.mk SONIC_ALL += $(SONIC_ONE_IMAGE) $(DOCKER_SONIC_VS) diff --git a/slave.mk b/slave.mk index 0ade6aeb13d7..a24b44ae49b9 100644 --- a/slave.mk +++ b/slave.mk @@ -510,6 +510,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ # Pass initramfs and linux kernel explicitly. They are used for all platforms export initramfs_tools="$(DEBS_PATH)/$(INITRAMFS_TOOLS)" export linux_kernel="$(DEBS_PATH)/$(LINUX_KERNEL)" + export onie_recovery_image="$(FILES_PATH)/$(ONIE_RECOVERY_IMAGE)" export kversion="$(KVERSION)" export image_type="$($*_IMAGE_TYPE)" export sonicadmin_user="$(USERNAME)" @@ -556,6 +557,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ PASSWORD="$(PASSWORD)" \ ./build_debian.sh $(LOG) + USERNAME="$(USERNAME)" \ + PASSWORD="$(PASSWORD)" \ TARGET_MACHINE=$($*_MACHINE) \ IMAGE_TYPE=$($*_IMAGE_TYPE) \ ./build_image.sh $(LOG) diff --git a/sonic-slave/Dockerfile b/sonic-slave/Dockerfile index fe018eb941db..3fd4633d04aa 100644 --- a/sonic-slave/Dockerfile +++ b/sonic-slave/Dockerfile @@ -232,7 +232,7 @@ RUN apt-get update && apt-get install -y \ texi2html \ # For initramfs bash-completion \ -#For Mellanox CRIU build +# For Mellanox CRIU build libprotobuf-dev \ libprotobuf-c0-dev \ protobuf-c-compiler \ @@ -244,7 +244,11 @@ RUN apt-get update && apt-get install -y \ libaio-dev \ asciidoc \ xmlto \ - checkinstall + checkinstall \ +# For sonic vs image build + dosfstools \ + qemu-kvm \ + libvirt-bin # For linux build RUN apt-get -y build-dep linux @@ -279,6 +283,9 @@ RUN pip install click-default-group click natsort tabulate # For supervisor build RUN pip install meld3 mock +# For vs image build +RUN pip install pexpect==4.6.0 + # Install dependencies for isc-dhcp-relay build RUN apt-get -y build-dep isc-dhcp From cb4df1ffa8986fc3d10feea13c59b84e3de52e71 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Tue, 20 Nov 2018 10:57:17 +0000 Subject: [PATCH 08/12] use lane map to decide physical port in vs Signed-off-by: Guohan Lu --- .../Force10-S6000/lanemap.ini | 34 +++++++++++++++++++ .../Force10-S6000/sai.profile | 1 + src/sonic-sairedis | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini new file mode 100644 index 000000000000..72d64751e02b --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini @@ -0,0 +1,34 @@ +; comment +# comment +eth1:29,30,31,32 +eth2:25,26,27,28 +eth3:37,38,39,40 +eth4:33,34,35,36 +eth5:41,42,43,44 +eth6:45,46,47,48 +eth7:5,6,7,8 +eth8:1,2,3,4 +eth9:9,10,11,12 +eth10:13,14,15,16 +eth11:21,22,23,24 +eth12:17,18,19,20 +eth13:249,50,51,52 +eth14:353,54,55,56 +eth15:461,62,63,64 +eth16:557,58,59,60 +eth17:665,66,67,68 +eth18:769,70,71,72 +eth19:877,78,79,80 +eth20:973,74,75,76 +eth21:105,106,107,108 +eth22:109,110,111,112 +eth23:117,118,119,120 +eth24:113,114,115,116 +eth25:121,122,123,124 +eth26:125,126,127,128 +eth27:85,86,87,88 +eth28:81,82,83,84 +eth29:89,90,91,92 +eth30:93,94,95,96 +eth31:97,98,99,100 +eth32:101,102,103,104 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile index 23cd24c73a35..bfc466f27e54 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/sai.profile @@ -2,3 +2,4 @@ SAI_WARM_BOOT_READ_FILE=/var/cache/sai_warmboot.bin SAI_WARM_BOOT_WRITE_FILE=/var/cache/sai_warmboot.bin SAI_VS_SWITCH_TYPE=SAI_VS_SWITCH_TYPE_BCM56850 SAI_VS_HOSTIF_USE_TAP_DEVICE=true +SAI_VS_INTERFACE_LANE_MAP_FILE=/usr/share/sonic/hwsku/lanemap.ini diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 5ddafbcf5a9d..efdd86f6a947 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 5ddafbcf5a9d6ae3328cacfc9bf2d43fa4bd3b33 +Subproject commit efdd86f6a947c9dd975ee7d3c13faa38f9d6a6fc From b56ea86a78ed0364c074f7e3d484ecc0a4991452 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Tue, 20 Nov 2018 11:17:23 +0000 Subject: [PATCH 09/12] add document to use VS VM Signed-off-by: Guohan Lu --- platform/vs/{README.md => README.vsdocker.md} | 2 +- platform/vs/README.vsvm.md | 35 +++++++++ platform/vs/create_vnet.sh | 2 +- platform/vs/rules.mk | 2 +- platform/vs/sonic.xml | 77 +++++++++++++++++++ 5 files changed, 115 insertions(+), 3 deletions(-) rename platform/vs/{README.md => README.vsdocker.md} (97%) create mode 100644 platform/vs/README.vsvm.md create mode 100644 platform/vs/sonic.xml diff --git a/platform/vs/README.md b/platform/vs/README.vsdocker.md similarity index 97% rename from platform/vs/README.md rename to platform/vs/README.vsdocker.md index 30d29b371b6e..42e1cafc8469 100644 --- a/platform/vs/README.md +++ b/platform/vs/README.vsdocker.md @@ -1,4 +1,4 @@ -HOWTO Use Virtual Switch +HOWTO Use Virtual Switch (Docker) 1. Create a docker with 32 front panel port diff --git a/platform/vs/README.vsvm.md b/platform/vs/README.vsvm.md new file mode 100644 index 000000000000..d627859578b4 --- /dev/null +++ b/platform/vs/README.vsvm.md @@ -0,0 +1,35 @@ +HOWTO Use Virtual Switch (VM) + +1. Install libvirt, kvm, qemu + +``` +sudo apt-get install libvirt-clients qemu-kvm libvirt-bin +``` + +2. Create SONiC VM + +``` +$ virsh +Welcome to virsh, the virtualization interactive terminal. + +Type: 'help' for help with commands + 'quit' to quit + +virsh # +virsh # create sonic.xml +Domain sonic created from sonic.xml + +virsh # +``` + +2. Connect SONiC VM via console + +``` +$ telnet 127.0.0.1 7000 +``` + +3. Connect SONiC VM via SSH + +``` +$ ssh -p 3040 admin@127.0.0.1 +``` diff --git a/platform/vs/create_vnet.sh b/platform/vs/create_vnet.sh index 857a61b52cc5..4746e16cbbaf 100755 --- a/platform/vs/create_vnet.sh +++ b/platform/vs/create_vnet.sh @@ -22,7 +22,7 @@ for srv in `seq 0 $SERVERS`; do # add virtual link between neighbor and the virtual switch docker - IF="vEthernet$((srv*4))" + IF="eth$((srv+1))" ip link add ${SRV}eth0 type veth peer name $IF ip link set ${SRV}eth0 netns $SRV diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index 99c5c198b732..7ba2da0db0ff 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -7,4 +7,4 @@ include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/onie.mk include $(PLATFORM_PATH)/kvm-image.mk -SONIC_ALL += $(SONIC_ONE_IMAGE) $(DOCKER_SONIC_VS) +SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_KVM_IMAGE) $(DOCKER_SONIC_VS) diff --git a/platform/vs/sonic.xml b/platform/vs/sonic.xml new file mode 100644 index 000000000000..a359de6bd318 --- /dev/null +++ b/platform/vs/sonic.xml @@ -0,0 +1,77 @@ + + sonic + 2048000 + 2048000 + 1 + + /machine + + + hvm + + + + + + + + destroy + restart + restart + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + From cdc0a2fefab3bbd9584b8f19c99c0f65b4eb4812 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Tue, 20 Nov 2018 17:07:38 +0000 Subject: [PATCH 10/12] rename sonic-vs.img to sonic-vs.img.gz Signed-off-by: Guohan Lu --- build_image.sh | 16 ++++++++-------- platform/vs/kvm-image.mk | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build_image.sh b/build_image.sh index d1371c9602f6..caae3546fb41 100755 --- a/build_image.sh +++ b/build_image.sh @@ -80,25 +80,25 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then elif [ "$IMAGE_TYPE" = "kvm" ]; then echo "Build KVM image" - sudo rm -f $OUTPUT_KVM_IMAGE $OUTPUT_KVM_IMAGE.gz + KVM_IMAGE_DISK = ${OUTPUT_KVM_IMAGE%.gz} + sudo rm -f $OUTPUT_KVM_IMAGE $KVM_IMAGE_DISK generate_onie_installer_image - SONIC_USERNAME=$USERNAME PASSWD=$PASSWORD sudo -E ./build_kvm_image.sh $OUTPUT_KVM_IMAGE $onie_recovery_image $OUTPUT_ONIE_IMAGE $KVM_IMAGE_DISK_SIZE + SONIC_USERNAME=$USERNAME PASSWD=$PASSWORD sudo -E ./build_kvm_image.sh $KVM_IMAGE_DISK $onie_recovery_image $OUTPUT_ONIE_IMAGE $KVM_IMAGE_DISK_SIZE - [ -r $OUTPUT_KVM_IMAGE ] || { - echo "Error : $OUTPUT_KVM_IMAGE not generated!" + [ -r $KVM_IMAGE_DISK ] || { + echo "Error : $KVM_IMAGE_DISK not generated!" exit 1 } - gzip $OUTPUT_KVM_IMAGE + gzip $KVM_IMAGE_DISK - [ -r $OUTPUT_KVM_IMAGE.gz ] || { - echo "Error : gzip $OUTPUT_KVM_IMAGE failed!" + [ -r $OUTPUT_KVM_IMAGE ] || { + echo "Error : gzip $KVM_IMAGE_DISK failed!" exit 1 } - mv $OUTPUT_KVM_IMAGE.gz $OUTPUT_KVM_IMAGE echo "The compressed kvm image is in $OUTPUT_KVM_IMAGE" ## Use 'aboot' as target machine category which includes Aboot as bootloader diff --git a/platform/vs/kvm-image.mk b/platform/vs/kvm-image.mk index e71776708542..4c1cdd18b0d6 100644 --- a/platform/vs/kvm-image.mk +++ b/platform/vs/kvm-image.mk @@ -1,6 +1,6 @@ # sonic kvm image -SONIC_KVM_IMAGE = sonic-vs.img +SONIC_KVM_IMAGE = sonic-vs.img.gz $(SONIC_KVM_IMAGE)_MACHINE = vs $(SONIC_KVM_IMAGE)_IMAGE_TYPE = kvm $(SONIC_KVM_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) From 7138dfba91906ae4b468bb6e3560b9385cb3c525 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Tue, 20 Nov 2018 19:33:43 +0000 Subject: [PATCH 11/12] fix build_image.sh Signed-off-by: Guohan Lu --- build_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_image.sh b/build_image.sh index caae3546fb41..cc5144a43e81 100755 --- a/build_image.sh +++ b/build_image.sh @@ -80,7 +80,7 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then elif [ "$IMAGE_TYPE" = "kvm" ]; then echo "Build KVM image" - KVM_IMAGE_DISK = ${OUTPUT_KVM_IMAGE%.gz} + KVM_IMAGE_DISK=${OUTPUT_KVM_IMAGE%.gz} sudo rm -f $OUTPUT_KVM_IMAGE $KVM_IMAGE_DISK generate_onie_installer_image From d9cc81587eed8ae699895f3d1acce0788fbf78f7 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Tue, 20 Nov 2018 20:55:42 +0000 Subject: [PATCH 12/12] fixes Signed-off-by: Guohan Lu --- build_image.sh | 6 +++--- check_install.py | 3 ++- .../Force10-S6000/lanemap.ini | 16 ++++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/build_image.sh b/build_image.sh index cc5144a43e81..05eb3ca78b78 100755 --- a/build_image.sh +++ b/build_image.sh @@ -81,7 +81,7 @@ elif [ "$IMAGE_TYPE" = "kvm" ]; then echo "Build KVM image" KVM_IMAGE_DISK=${OUTPUT_KVM_IMAGE%.gz} - sudo rm -f $OUTPUT_KVM_IMAGE $KVM_IMAGE_DISK + sudo rm -f $KVM_IMAGE_DISK $KVM_IMAGE_DISK.gz generate_onie_installer_image @@ -94,12 +94,12 @@ elif [ "$IMAGE_TYPE" = "kvm" ]; then gzip $KVM_IMAGE_DISK - [ -r $OUTPUT_KVM_IMAGE ] || { + [ -r $KVM_IMAGE_DISK.gz ] || { echo "Error : gzip $KVM_IMAGE_DISK failed!" exit 1 } - echo "The compressed kvm image is in $OUTPUT_KVM_IMAGE" + echo "The compressed kvm image is in $KVM_IMAGE_DISK.gz" ## Use 'aboot' as target machine category which includes Aboot as bootloader elif [ "$IMAGE_TYPE" = "aboot" ]; then diff --git a/check_install.py b/check_install.py index 940355e3ca5b..c8d07003f44e 100755 --- a/check_install.py +++ b/check_install.py @@ -3,6 +3,7 @@ import pexpect import argparse import sys +import time def main(): @@ -45,9 +46,9 @@ def main(): break # check version + time.sleep(5) p.sendline('show version') p.expect([cmd_prompt]) - print p.before if __name__ == '__main__': main() diff --git a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini index 72d64751e02b..16a4d5b9ac78 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini +++ b/device/virtual/x86_64-kvm_x86_64-r0/Force10-S6000/lanemap.ini @@ -12,14 +12,14 @@ eth9:9,10,11,12 eth10:13,14,15,16 eth11:21,22,23,24 eth12:17,18,19,20 -eth13:249,50,51,52 -eth14:353,54,55,56 -eth15:461,62,63,64 -eth16:557,58,59,60 -eth17:665,66,67,68 -eth18:769,70,71,72 -eth19:877,78,79,80 -eth20:973,74,75,76 +eth13:49,50,51,52 +eth14:53,54,55,56 +eth15:61,62,63,64 +eth16:57,58,59,60 +eth17:65,66,67,68 +eth18:69,70,71,72 +eth19:77,78,79,80 +eth20:73,74,75,76 eth21:105,106,107,108 eth22:109,110,111,112 eth23:117,118,119,120