[vs]: build sonic vs kvm image (#2269)

Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
lguohan 2018-11-20 22:32:40 -08:00 committed by GitHub
parent 465ebbafff
commit 64a2b1ce99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 1275 additions and 97 deletions

View File

@ -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'

View File

@ -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"
KVM_IMAGE_DISK=${OUTPUT_KVM_IMAGE%.gz}
sudo rm -f $KVM_IMAGE_DISK $KVM_IMAGE_DISK.gz
generate_onie_installer_image
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 $KVM_IMAGE_DISK ] || {
echo "Error : $KVM_IMAGE_DISK not generated!"
exit 1
}
gzip $KVM_IMAGE_DISK
[ -r $KVM_IMAGE_DISK.gz ] || {
echo "Error : gzip $KVM_IMAGE_DISK failed!"
exit 1
}
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
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

77
build_kvm_image.sh Executable file
View File

@ -0,0 +1,77 @@
#!/bin/sh -ex
# Copyright (C) 2014 Curt Brune <curt@cumulusnetworks.com>
#
# 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

54
check_install.py Executable file
View File

@ -0,0 +1,54 @@
#!/usr/bin/env python
import pexpect
import argparse
import sys
import time
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
time.sleep(5)
p.sendline('show version')
p.expect([cmd_prompt])
if __name__ == '__main__':
main()

View File

@ -1,5 +1,6 @@
{# 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 #}
@ -66,35 +67,19 @@
{% 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 }}",
"size": "12766208",
"type": "ingress",
"mode": "dynamic"
},
"egress_lossless_pool": {
"size": "{{ egress_lossless_pool_size }}",
"size": "12766208",
"type": "egress",
"mode": "dynamic"
"mode": "static"
},
"egress_lossy_pool": {
"size": "{{ egress_lossy_pool_size }}",
"size": "8072396",
"type": "egress",
"mode": "dynamic"
}
@ -102,61 +87,42 @@
"BUFFER_PROFILE": {
"ingress_lossless_profile": {
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"0"
"xon":"18432",
"xoff":"40560",
"size":"41808",
"dynamic_th":"-4",
"xon_offset":"2496"
},
"ingress_lossy_profile": {
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
"pool":"[BUFFER_POOL|ingress_lossless_pool]",
"size":"0",
"dynamic_th":"3"
},
"egress_lossless_profile": {
"pool":"[BUFFER_POOL|egress_lossless_pool]",
"size":"0",
"dynamic_th":"7"
"static_th":"12766208"
},
"egress_lossy_profile": {
"pool":"[BUFFER_POOL|egress_lossy_pool]",
"size":"4096",
"size":"1518",
"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 }}|3-4": {
"profile" : "[BUFFER_PROFILE|ingress_lossless_profile]"
},
"{{ port_names }}|0-1": {
"profile" : "[BUFFER_PROFILE|pg_lossy_profile]"
"profile" : "[BUFFER_PROFILE|ingress_lossy_profile]"
}
},
"BUFFER_QUEUE": {
"{{ port_names }}|3-4": {
"profile" : "[BUFFER_PROFILE|q_lossless_profile]"
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
},
"{{ port_names }}|0-1": {
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
"profile" : "[BUFFER_PROFILE|egress_lossy_profile]"
}
}
}

View File

@ -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: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
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

View File

@ -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

View File

@ -0,0 +1 @@
{%- include 'qos_config.j2' %}

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
Force10-S6000 t1

View File

@ -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}

View File

@ -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

View File

@ -1,4 +1,4 @@
HOWTO Use Virtual Switch
HOWTO Use Virtual Switch (Docker)
1. Create a docker with 32 front panel port

View File

@ -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
```

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"]

View File

@ -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

View File

@ -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

8
platform/vs/kvm-image.mk Normal file
View File

@ -0,0 +1,8 @@
# sonic kvm image
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)
$(SONIC_KVM_IMAGE)_FILES = $(ONIE_RECOVERY_IMAGE)
SONIC_INSTALLERS += $(SONIC_KVM_IMAGE)

7
platform/vs/one-image.mk Normal file
View File

@ -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)

4
platform/vs/onie.mk Normal file
View File

@ -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)

View File

View File

@ -1,4 +1,10 @@
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
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/onie.mk
include $(PLATFORM_PATH)/kvm-image.mk
SONIC_ALL += $(DOCKER_SONIC_VS)
SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_KVM_IMAGE) $(DOCKER_SONIC_VS)

View File

@ -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))

View File

@ -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)/

View File

@ -0,0 +1,8 @@
tee $1 > /dev/null <<EOF
build_version: '$sonic_version'
asic_type: $sonic_asic_platform
commit_id: '$(git rev-parse --short HEAD)'
build_date: $(date -u)
build_number: ${BUILD_NUMBER:-0}
built_by: $USER@$BUILD_HOSTNAME
EOF

77
platform/vs/sonic.xml Normal file
View File

@ -0,0 +1,77 @@
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>sonic</name>
<memory unit='KiB'>2048000</memory>
<currentMemory unit='KiB'>2048000</currentMemory>
<vcpu placement='static'>1</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-1.5'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback'/>
<source file='/data/sonic/sonic-buildimage/target/sonic-vs.img'/>
<target bus='virtio' dev='vda'/>
</disk>
<serial type='tcp'>
<source host='127.0.0.1' mode='bind' service='7000'/>
<target port='0'/>
<protocol type='telnet'/>
</serial>
<interface type='user'/>
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<interface type='ethernet' />
<controller type='usb' index='0'/>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'/>
<qemu:commandline>
<qemu:arg value='-redir'/>
<qemu:arg value='tcp:3040::22'/>
</qemu:commandline>
</domain>

View File

@ -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)

View File

@ -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) \
@ -485,6 +511,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)"
@ -532,6 +559,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)
@ -556,9 +585,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) \
@ -567,7 +594,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
@ -600,12 +628,14 @@ 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
###############################################################################
.PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_WHEELS) clean distclean configure
.PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_WHEELS) $(SONIC_PHONY_TARGETS) clean distclean configure
.INTERMEDIATE : $(SONIC_INSTALL_TARGETS) $(SONIC_INSTALL_WHEELS) $(DOCKER_LOAD_TARGETS) docker-start .platform

View File

@ -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

@ -1 +1 @@
Subproject commit 398d24aa4159903aacbb1b8a6b5ab3307a575075
Subproject commit efdd86f6a947c9dd975ee7d3c13faa38f9d6a6fc