diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 0000000000..ba3e498830 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,59 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- set ingress_lossless_pool_size = '32689152' %} +{%- set egress_lossless_pool_size = '32340992' %} +{%- if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %} + {%- set ingress_lossless_pool_size = '32441856' %} + {%- set egress_lossless_pool_size = '32441856' %} +{%- endif %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic", + "xoff": "2058240" + }, + "egress_lossy_pool": { + "size": "24192256", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{egress_lossless_pool_size }}", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "static_th":"{{ingress_lossless_pool_size }}" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"0", + "static_th":"{{egress_lossless_pool_size }}" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1792", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{% import 'buffers_extra_queues.j2' as defs with context %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 0000000000..eb1dc510e9 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "32712448", + "type": "ingress", + "mode": "dynamic", + "xoff": "1622016" + }, + "egress_lossy_pool": { + "size": "24709632", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "32599040", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "static_th":"32712448" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"0", + "static_th":"32599040" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"1792", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/pg_profile_lookup.ini new file mode 100644 index 0000000000..aaca1b9a4c --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,11 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 4608 4608 160000 0 4608 + 50000 5m 4608 4608 160000 0 4608 + 100000 5m 4608 4608 160000 0 4608 + 10000 40m 4608 4608 160000 0 4608 + 50000 40m 4608 4608 160000 0 4608 + 100000 40m 4608 4608 160000 0 4608 + 10000 300m 4608 4608 160000 0 4608 + 50000 300m 4608 4608 160000 0 4608 + 100000 300m 4608 4608 160000 0 4608 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/qos.json.j2 new file mode 100644 index 0000000000..74059a27d2 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/BALANCED/qos.json.j2 @@ -0,0 +1,285 @@ +{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} +{% set different_dscp_to_tc_map = true %} +{% set different_tc_to_queue_map = true %} +{%- macro generate_dscp_to_tc_map() %} + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0", + "8": "0" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "0", + "8": "0" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_queue_map() %} + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "3", + "4": "4", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + }, + "AZURE_UPLINK": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "1" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_dscp_map() %} + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48", + "8": "33" + } + }, +{%- endmacro %} +{% endif %} +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/RDMA-CENTRIC b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/RDMA-CENTRIC new file mode 120000 index 0000000000..d6f7127aa7 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/RDMA-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/TCP-CENTRIC b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/TCP-CENTRIC new file mode 120000 index 0000000000..d6f7127aa7 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers.json.j2 new file mode 100644 index 0000000000..1083a6210f --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_defaults_t0.j2 new file mode 120000 index 0000000000..9524e6a476 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_defaults_t1.j2 new file mode 120000 index 0000000000..c25cc95d6d --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_extra_queues.j2 new file mode 120000 index 0000000000..2c4dff993c --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/buffers_extra_queues.j2 @@ -0,0 +1 @@ +../Arista-7050CX3-32S-D48C8/buffers_extra_queues.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/pg_profile_lookup.ini new file mode 120000 index 0000000000..297cddb2d2 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/qos.json.j2 new file mode 120000 index 0000000000..aef6b6765c --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C28S4/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/dockers/docker-sonic-bmp/Dockerfile.j2 b/dockers/docker-sonic-bmp/Dockerfile.j2 index 2e79001dbf..8b4fbbae06 100755 --- a/dockers/docker-sonic-bmp/Dockerfile.j2 +++ b/dockers/docker-sonic-bmp/Dockerfile.j2 @@ -40,11 +40,10 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor/"] RUN chmod +x /usr/bin/bmp.sh -RUN touch /var/log/openbmpd.log RUN apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ rm -rf /debs -ENTRYPOINT ["/usr/local/bin/supervisord"] \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/dockers/docker-sonic-bmp/supervisord.conf b/dockers/docker-sonic-bmp/supervisord.conf index 6f9c7d56a8..8548d32fa3 100644 --- a/dockers/docker-sonic-bmp/supervisord.conf +++ b/dockers/docker-sonic-bmp/supervisord.conf @@ -49,7 +49,7 @@ stderr_logfile=syslog dependent_startup=true [program:openbmpd] -command=/usr/bin/openbmpd -f -l /var/log/openbmpd.log -c /etc/bmp/openbmpd.conf +command=/usr/bin/openbmpd -f -c /etc/bmp/openbmpd.conf priority=3 autostart=false autorestart=false diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 08f189b36f..dabf4958af 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -359,6 +359,7 @@ function postStartAction() {%- else %} : # nothing {%- endif %} + /etc/resolvconf/update-libc.d/update-containers ${DOCKERNAME} & } start() { @@ -681,7 +682,7 @@ start() { {%- endif %} {%- if sonic_asic_platform == "broadcom" %} {%- if docker_container_name == "syncd" %} - --shm-size=${SYNCD_SHM_SIZE:-64m} \ + --shm-size=${SYNCD_SHM_SIZE:-512m} \ -v /var/run/docker-syncd$DEV:/var/run/sswsyncd \ {%- endif %} {%- endif %} diff --git a/files/image_config/monit/container_checker b/files/image_config/monit/container_checker index 4eae9f82c3..28dd26e7db 100755 --- a/files/image_config/monit/container_checker +++ b/files/image_config/monit/container_checker @@ -69,6 +69,9 @@ def get_expected_running_containers(): container_list = [] for container_name in feature_table.keys(): + # skip frr_bmp since it's not container just bmp option used by bgpd + if container_name == "frr_bmp": + continue # slim image does not have telemetry container and corresponding docker image if container_name == "telemetry": ret = check_docker_image("docker-sonic-telemetry") diff --git a/files/image_config/resolv-config/update-containers b/files/image_config/resolv-config/update-containers index 891fd2ea74..ca2ef3f8b2 100755 --- a/files/image_config/resolv-config/update-containers +++ b/files/image_config/resolv-config/update-containers @@ -1,12 +1,120 @@ #!/bin/bash +SCRIPT_NAME=$(basename "$0") +DEBUG=${DEBUG:-false} +WAIT_TIMEOUT=5 # 5 seconds timeout for waiting containers to start + +# Function to log messages to syslog +log_message() { + local level=$1 + local message=$2 + local caller=${FUNCNAME[1]} + # Skip debug messages if DEBUG is not true + if [[ "$level" == "debug" && "$DEBUG" != "true" ]]; then + return + fi + logger -t "resolv-config" -p "user.${level}" "[${SCRIPT_NAME}:${caller}] ${message}" +} + +# Function to wait for container to start +# Used only when updating a specific container that is not running +wait_for_container() { + local container=$1 + local start_time=$(date +%s) + local container_name=$(docker inspect --format '{{.Name}}' ${container} | sed 's/^\///') + while [[ $(($(date +%s) - start_time)) -lt $WAIT_TIMEOUT ]]; do + if docker inspect --format '{{.State.Status}}' ${container} | grep -q "running"; then + log_message "info" "Container ${container_name} (${container}) is now running" + return 0 + fi + sleep 1 + done + return 1 +} + +# Function to update resolv.conf for a single container +# Parameters: +# $1: container ID +# $2: wait_for_start (optional) - if true, will attempt to start and wait for stopped containers +update_container_resolv() { + local container=$1 + local wait_for_start=${2:-false} # Default to false for bulk updates + local container_name=$(docker inspect --format '{{.Name}}' ${container} | sed 's/^\///') + local container_state=$(docker inspect --format '{{.State.Status}}' ${container}) + if [[ "$container_state" != "running" ]]; then + if [[ "$wait_for_start" == "true" ]]; then + log_message "debug" "Container ${container_name} (${container}) is not running, attempting to start it" + if ! docker start ${container}; then + log_message "error" "Failed to start container ${container_name} (${container})" + return 1 + fi + if ! wait_for_container "$container"; then + log_message "error" "Container ${container_name} (${container}) failed to start within timeout" + return 1 + fi + else + log_message "debug" "Container ${container_name} (${container}) is not running, skipping update" + return 0 + fi + fi + if ! docker exec -t ${container} bash -c "echo '${RESOLV_CONTENT}' > /etc/resolv.conf"; then + log_message "info" "Failed to update resolv.conf for container ${container_name} (${container})" + return 1 + fi + log_message "debug" "Successfully updated resolv.conf for container ${container_name} (${container})" +} + +# Read resolv.conf content once +RESOLV_CONTENT=$(cat /etc/resolv.conf) +# Empty resolv.conf is valid, so we don't check for empty content +if [[ ! -f /etc/resolv.conf ]]; then + log_message "error" "File /etc/resolv.conf does not exist" + exit 1 +fi + +# Check if a container name was provided as an argument +if [[ $# -gt 0 ]]; then + container_name=$1 + # Find container ID by name (including stopped containers) + container_id=$(docker ps -aq -f "name=^${container_name}$") + if [[ -z "$container_id" ]]; then + log_message "error" "Container with name '${container_name}' not found" + exit 1 + fi + log_message "info" "Updating resolv.conf for container ${container_name}" + # For single container updates, attempt to start and wait if container is stopped + update_container_resolv "$container_id" "true" + exit $? +fi + +# Check if networking service is active (only for bulk updates) networking_status=$(systemctl is-active networking.service 2>/dev/null) if [[ $networking_status != "active" ]]; then + log_message "info" "Networking service is not active, skipping container updates" exit 0 fi -for container in $(docker ps -q); do - docker cp -L /etc/resolv.conf ${container}:/_resolv.conf - docker exec -t ${container} bash -c "cat /_resolv.conf > /etc/resolv.conf" - docker exec -t ${container} bash -c "rm /_resolv.conf" +# If no container name provided, update only running containers +log_message "info" "Starting resolv.conf update for running containers" + +# Get list of running containers only +containers=$(docker ps -q) +container_count=$(echo "${containers}" | wc -l) +log_message "info" "Found ${container_count} running containers to process" + +# Run updates in parallel using background processes +# For bulk updates, skip any non-running containers without waiting +for container in $containers; do + update_container_resolv "$container" "false" & done + +# Wait for all background processes to complete +wait + +# Check if any updates failed +if [[ $? -ne 0 ]]; then + log_message "error" "Some container updates failed" + exit 1 +fi + +log_message "info" "Completed resolv.conf updates for all running containers" diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 18657b9aba..6c04f75802 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 18657b9aba3c0c08564a062883e88a606a12594b +Subproject commit 6c04f758025296fe98ab570f3836eae5a8eb5944