Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic_th failed because redis sends unchanged field to orchagent when updating dynamic_th #3971

Closed
MaxYaremchuk opened this issue Jan 3, 2020 · 4 comments
Assignees

Comments

@MaxYaremchuk
Copy link

Description
It's impossible to change dynamic_th value for lossless buffer profile which has been applied to some ports on the fly.

Describe the results you expected:
It should be eligible to change dynamic_th parameter on the fly.

Describe the results you received:

  1. The new value for dynamic_th is not offloaded to hardware.
  2. There are errors in syslog:
Jan  2 19:00:31.799935 sonic ERR swss#orchagent: :- meta_generic_validation_set: SAI_BUFFER_PROFILE_ATTR_POOL_ID:SAI_ATTR_VALUE_TYPE_OBJECT_ID attr is create only and cannot be modified
Jan  2 19:00:31.799935 sonic ERR swss#orchagent: :- processBufferProfile: Failed to modify buffer profile, name:pg_lossless_10000_5m_profile, sai object:190000000002f4, status:-5
Jan  2 19:00:31.799935 sonic ERR swss#orchagent: :- doTask: Failed to process buffer task, drop it

Steps to reproduce the issue:

  1. Install Master branch image on a switch.
  2. Configure qos: config qos reload
  3. Compose a json file for changing buffer parameter dynamic_th for lossless buffer which has been applied to some ports:
{
    "BUFFER_PROFILE": {
       "pg_lossless_10000_5m_profile": {
            "dynamic_th": "2",
            "pool": "[BUFFER_POOL|ingress_lossless_pool]"
       }
   }
}
  1. Try to change dynamic_th for lossless buffer profile on the fly:
    sonic-cfggen -j ./buf_prof4.json --write-to-db

Output of show version:

SONiC Software Version: SONiC.HEAD.129-0c9040de
Distribution: Debian 9.11
Kernel: 4.9.0-9-2-amd64
Build commit: 0c9040de
Build date: Thu Nov 21 12:50:41 UTC 2019
Built by: johnar@jenkins-worker-4

Platform: x86_64-mlnx_msn2100-r0
HwSKU: ACS-MSN2100
ASIC: mellanox
Serial Number: MT1646X05314
Uptime: 11:33:40 up 21 min,  3 users,  load average: 3.12, 3.11, 2.49

Docker images:
REPOSITORY                 TAG                 IMAGE ID            SIZE
docker-syncd-mlnx          HEAD.129-0c9040de   4f3b126274c2        373MB
docker-syncd-mlnx          latest              4f3b126274c2        373MB
docker-fpm-frr             HEAD.129-0c9040de   7345e105bf26        321MB
docker-fpm-frr             latest              7345e105bf26        321MB
docker-sflow               HEAD.129-0c9040de   f240b81ea842        305MB
docker-sflow               latest              f240b81ea842        305MB
docker-lldp-sv2            HEAD.129-0c9040de   f1b94915bf13        299MB
docker-lldp-sv2            latest              f1b94915bf13        299MB
docker-dhcp-relay          HEAD.129-0c9040de   7ba3cee353b6        289MB
docker-dhcp-relay          latest              7ba3cee353b6        289MB
docker-database            HEAD.129-0c9040de   c5c92210277c        281MB
docker-database            latest              c5c92210277c        281MB
docker-snmp-sv2            HEAD.129-0c9040de   ad01f8a547b1        335MB
docker-snmp-sv2            latest              ad01f8a547b1        335MB
docker-orchagent           HEAD.129-0c9040de   7fc54899dc92        322MB
docker-orchagent           latest              7fc54899dc92        322MB
docker-teamd               HEAD.129-0c9040de   c0316e26bbbd        304MB
docker-teamd               latest              c0316e26bbbd        304MB
docker-sonic-telemetry     HEAD.129-0c9040de   43df42f49e91        304MB
docker-sonic-telemetry     latest              43df42f49e91        304MB
docker-router-advertiser   HEAD.129-0c9040de   b0aff9280842        281MB
docker-router-advertiser   latest              b0aff9280842        281MB
docker-platform-monitor    HEAD.129-0c9040de   10013f82e4d7        565MB
docker-platform-monitor    latest              10013f82e4d7        565MB

Attach debug file sudo generate_dump:
sonic_dump_r-ethernet-sw230_20200102_204425.tar.gz

@stephenxs
Copy link
Collaborator

From the log I see it tries to modify SAI_BUFFER_PROFILE_ATTR_POOL_ID which is read-only while for dynamic_th the id should be SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH.
I think it's an issue of SONiC ore redis. I also encountered this kind of issue when I tried updating size of BUFFER_POOL table: when I tried updating size in BUFFER_POOL table it updated type as well and failed.

127.0.0.1:6379[4]> hset BUFFER_POOL|ingress_lossless_pool size 9150000
(integer) 0

From the log I saw it tries updating other fields like type and mode as well.

Apr  6 23:46:31.358697 mtbc-3700c-01 DEBUG swss#orchagent: :> doTask: enter
Apr  6 23:46:31.358712 mtbc-3700c-01 DEBUG swss#orchagent: :> processBufferPool: enter
Apr  6 23:46:31.358723 mtbc-3700c-01 DEBUG swss#orchagent: :- processBufferPool: object name:ingress_lossless_pool
Apr  6 23:46:31.358723 mtbc-3700c-01 DEBUG swss#orchagent: :- processBufferPool: found existing object:ingress_lossless_pool of type:BUFFER_POOL
Apr  6 23:46:31.358723 mtbc-3700c-01 DEBUG swss#orchagent: :- processBufferPool: processing command:SET
Apr  6 23:46:31.358742 mtbc-3700c-01 DEBUG swss#orchagent: :- processBufferPool: field:type, value:ingress
Apr  6 23:46:31.358777 mtbc-3700c-01 DEBUG swss#orchagent: :- processBufferPool: field:mode, value:dynamic
Apr  6 23:46:31.358806 mtbc-3700c-01 DEBUG swss#orchagent: :- processBufferPool: field:size, value:9150000

and results in the following error which fails the setting.

Apr  6 23:46:31.359330 mtbc-3700c-01 ERR swss#orchagent: :- meta_generic_validation_set: SAI_BUFFER_POOL_ATTR_TYPE:SAI_ATTR_VALUE_TYPE_INT32 attr is create only and cannot be modified
Apr  6 23:46:31.359360 mtbc-3700c-01 ERR swss#orchagent: :- processBufferPool: Failed to modify buffer pool, name:ingress_lossless_pool, sai object:1800000000058f, status:-5
Apr  6 23:46:31.359376 mtbc-3700c-01 ERR swss#orchagent: :- doTask: Failed to process buffer task, drop it

@stephenxs
Copy link
Collaborator

stephenxs commented Apr 7, 2020

@lguohan Could you please assign someone to look into this issue, especially my comments?
I suspect when I modify one field the redis sends other fields that aren't modified to orchagent as well.
Thank you.

@MaxYaremchuk MaxYaremchuk changed the title "dynamic_th" parameter for lossless buffer profile can't be change on the fly. dynamic_th failed because redis sends unchanged field to orchagent when updating dynamic_th Apr 7, 2020
@liat-grozovik
Copy link
Collaborator

@neethajohn what is the plan for fixing this issue?

abdosi added a commit that referenced this issue Sep 19, 2020
Avoid adding loopback interface (ip link add) when setting nat zone on
loopback interface (#1434)
    [acl] Remove Ethertype from L3V6 qualifiers (#1433)
    Sflow fixes during DEL processing (#1427)
    Fix #3971 by skipping create-only SAI attributes when modifying
    buffer pools or profiles in orchagent (#1430)
    Fix issue: bufferorch only pass the first attribute to sai when
    setting attribute (#1442)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-buildimage that referenced this issue Jan 14, 2021
…ing buffer pools or profiles in orchagent (sonic-net#1430)

* Skip create-only fields when modify buffer pool or profile in orchagent

This PR also fixes the issue sonic-net#3971 redis sends unchanged field

Signed-off-by: Stephen Sun <stephens@mellanox.com>

* Fix review comments

Signed-off-by: Stephen Sun <stephens@nvidia.com>

Co-authored-by: Stephen Sun <stephens@mellanox.com>
@MaxYaremchuk
Copy link
Author

Bug has been fixed.
Verified on:

SONiC Software Version: SONiC.201911.51-dea38d15
Distribution: Debian 9.13
Kernel: 4.9.0-11-2-amd64
Build commit: dea38d15
Build date: Mon Jan  4 13:38:57 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci02

theasianpianist pushed a commit to theasianpianist/sonic-buildimage that referenced this issue Feb 5, 2022
…ing buffer pools or profiles in orchagent (sonic-net#1430)

* Skip create-only fields when modify buffer pool or profile in orchagent

This PR also fixes the issue sonic-net#3971 redis sends unchanged field

Signed-off-by: Stephen Sun <stephens@mellanox.com>

* Fix review comments

Signed-off-by: Stephen Sun <stephens@nvidia.com>

Co-authored-by: Stephen Sun <stephens@mellanox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants