Skip to content

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled#3334

Merged
prsunny merged 3 commits intosonic-net:masterfrom
stephenxs:create-counter-for-cpu-queue
Nov 22, 2024
Merged

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled#3334
prsunny merged 3 commits intosonic-net:masterfrom
stephenxs:create-counter-for-cpu-queue

Conversation

@stephenxs
Copy link
Collaborator

What I did

Why I did it

How I verified it
Verified the following scenarios

  1. No BUFFER_QUEUE covering host CPU queue
       Port    TxQ    Counter/pkts    Counter/bytes    Drop/pkts    Drop/bytes
-----------  -----  --------------  ---------------  -----------  ------------
Ethernet248    UC0               0                0            0           N/A
Ethernet248    UC1               0                0            0           N/A
Ethernet248    UC2               0                0            0           N/A
Ethernet248    UC3               0                0            0           N/A
Ethernet248    UC4               0                0            0           N/A
Ethernet248    UC5               0                0            0           N/A
Ethernet248    UC6               0                0            0           N/A
Ethernet248    UC7             287            61730            0           N/A

admin@r-leopard-simx-74:~$ redis-cli -n 4
127.0.0.1:6379[4]> keys BUFFER_QUEUE*Ethernet248*
1) "BUFFER_QUEUE|Ethernet248|0-2"
2) "BUFFER_QUEUE|Ethernet248|5-6"
3) "BUFFER_QUEUE|Ethernet248|3-4"
  1. Remove irrelevant BUFFER_QUEUE on the port
admin@r-leopard-simx-74:~$ redis-cli -n 4          
127.0.0.1:6379[4]> del BUFFER_QUEUE|Ethernet248|5-6
(integer) 1
127.0.0.1:6379[4]> 
admin@r-leopard-simx-74:~$ queuestat -p Ethernet248
       Port    TxQ    Counter/pkts    Counter/bytes    Drop/pkts    Drop/bytes
-----------  -----  --------------  ---------------  -----------  ------------
Ethernet248    UC0               0                0            0           N/A
Ethernet248    UC1               0                0            0           N/A
Ethernet248    UC2               0                0            0           N/A
Ethernet248    UC3               0                0            0           N/A
Ethernet248    UC4               0                0            0           N/A
Ethernet248    UC7             294            63022            0           N/A
  1. Reconfig BUFFER_QEUUE covering host CPU queue
admin@r-leopard-simx-74:~$ redis-cli -n 4          
127.0.0.1:6379[4]> hset BUFFER_QUEUE|Ethernet248|5-7 profile q_lossy_profile
(integer) 1
127.0.0.1:6379[4]> exit
admin@r-leopard-simx-74:~$ queuestat -p Ethernet248
       Port    TxQ    Counter/pkts    Counter/bytes    Drop/pkts    Drop/bytes
-----------  -----  --------------  ---------------  -----------  ------------
Ethernet248    UC0               0                0            0           N/A
Ethernet248    UC1               0                0            0           N/A
Ethernet248    UC2               0                0            0           N/A
Ethernet248    UC3               0                0            0           N/A
Ethernet248    UC4               0                0            0           N/A
Ethernet248    UC5               0                0            0           N/A
Ethernet248    UC6               0                0            0           N/A
Ethernet248    UC7             298            63934            0           N/A
  1. Remove the configured BUFFER_QUEUE
admin@r-leopard-simx-74:~$ redis-cli -n 4          
127.0.0.1:6379[4]> del BUFFER_QUEUE|Ethernet248|5-7
(integer) 1
127.0.0.1:6379[4]> exit
admin@r-leopard-simx-74:~$ queuestat -p Ethernet248
       Port    TxQ    Counter/pkts    Counter/bytes    Drop/pkts    Drop/bytes
-----------  -----  --------------  ---------------  -----------  ------------
Ethernet248    UC0               0                0            0           N/A
Ethernet248    UC1               0                0            0           N/A
Ethernet248    UC2               0                0            0           N/A
Ethernet248    UC3               0                0            0           N/A
Ethernet248    UC4               0                0            0           N/A
Ethernet248    UC7             305            64818            0           N/A

Details if related

@stephenxs
Copy link
Collaborator Author

Failed due to some routing test cases which is not relevant to the PR. Retrying.

@stephenxs
Copy link
Collaborator Author

/apzw run

@stephenxs
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs stephenxs force-pushed the create-counter-for-cpu-queue branch 2 times, most recently from 3fb27c0 to 3b9b430 Compare October 30, 2024 23:28
@prabhataravind
Copy link
Contributor

My understanding is that you are setting queue counters for queue 7 (control traffic tx queue). Isn't that already available on sonic today? At least "show queue counters" seems to show queue counters on cpu tx queue already. The first output in your verifications also show q7 counters, so what does this PR change affect? @bingwang-ms for viz

@stephenxs
Copy link
Collaborator Author

My understanding is that you are setting queue counters for queue 7 (control traffic tx queue). Isn't that already available on sonic today? At least "show queue counters" seems to show queue counters on cpu tx queue already. The first output in your verifications also show q7 counters, so what does this PR change affect? @bingwang-ms for viz

Hi @prabhataravind
This is not accurate. There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.

@stephenxs stephenxs force-pushed the create-counter-for-cpu-queue branch from 5ab8403 to 226fed5 Compare November 6, 2024 10:17
@prabhataravind
Copy link
Contributor

prabhataravind commented Nov 7, 2024

create_only_config_db_buffer
Hi @stephenxs, thanks for the clarification. I am assuming you are referring to #2883? If so, the issue should not be observed without this configuration, correct?

Could you please update the PR title/description to indicate that this handles queue counters for CPU TX queue for the specific case where create_only_config_db_buffers configuration is set?

@stephenxs stephenxs force-pushed the create-counter-for-cpu-queue branch from 226fed5 to c2cea72 Compare November 7, 2024 03:17
@stephenxs stephenxs changed the title Create counter for the queue to which the host CPU traffic is sent Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled Nov 7, 2024
@stephenxs
Copy link
Collaborator Author

stephenxs commented Nov 7, 2024

create_only_config_db_buffer
Hi @stephenxs, thanks for the clarification. I am assuming you are referring to #2883? If so, the issue should not be observed without this configuration, correct?

Could you please update the PR title/description to indicate that this handles queue counters for CPU TX queue for the specific case where create_only_config_db_buffers configuration is set?

yes, I am referring to #2883 and there is no issue without the configuration.

Sure. Done.

Copy link
Contributor

@prabhataravind prabhataravind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@prabhataravind
Copy link
Contributor

@prsunny to help merge

@stephenxs
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs stephenxs force-pushed the create-counter-for-cpu-queue branch 2 times, most recently from f04b1b7 to 27e2c9d Compare November 12, 2024 00:24
@bingwang-ms
Copy link
Contributor

/azp run Azure.sonic-swss

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Collaborator Author

vs failure is caused by code issue. fixing.

@stephenxs stephenxs force-pushed the create-counter-for-cpu-queue branch from 4f96093 to 8cbd3de Compare November 13, 2024 14:37
@stephenxs
Copy link
Collaborator Author

vs failure is caused by code issue. fixing.

The failure was caused on vs simulating DPU platform. On that platform, the queue IDs of a port are not fetched from SAI. We should not create counters if the queue ID was not available.

@stephenxs
Copy link
Collaborator Author

@stephenxs Can you please sync code with master branch? Thanks!

Done. We still need to wait for sonic-net/sonic-sairedis#1459 to be taken into the VS image to pass the VS test.

@stephenxs
Copy link
Collaborator Author

@stephenxs Can you please sync code with master branch? Thanks!

Done. We still need to wait for sonic-net/sonic-sairedis#1459 to be taken into the VS image to pass the VS test.

The vs image hasn't been built due to the wrong ipmitool version. @bingwang-ms who can help to fix it?

mv ipmitool_1.8.19-4+deb12u1_amd64.deb ipmitool-dbgsym_1.8.19-4+deb12u1_amd64.deb /sonic/target/debs/bookworm/
dget: retrieving https://deb.debian.org/debian/pool/main/i/ipmitool/ipmitool_1.8.19-4+deb12u1.dsc
mkdir: cannot create directory '/vcache/sonic-slave-bookworm/web': Permission denied
Warning: Failed to verify the package: https://deb.debian.org/debian/pool/main/i/ipmitool/ipmitool_1.8.19-4+deb12u1.dsc, the version is not specified
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1972  100  1972    0     0  30312      0 --:--:-- --:--:-- --:--:-- 30812

@stephenxs stephenxs force-pushed the create-counter-for-cpu-queue branch 2 times, most recently from aa3a9fd to 48bc625 Compare November 19, 2024 22:03
@stephenxs
Copy link
Collaborator Author

@prabhataravind @prsunny
Could you help to review and merge ?
I fixed vs test issues since last @prabhataravind approval

Thanks

@stephenxs
Copy link
Collaborator Author

The vs failed due to the segment failed in orchagent while setting SAI redis attribute SAI_REDIS_SWITCH_ATTR_NOTIFY_SYNCD to SAI_REDIS_NOTIFY_SYNCD_INIT_VIEW

(gdb) bt
#0  0x00007ffff6520af8 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff68b2ac1 in redisvFormatCommand () from /usr/lib/x86_64-linux-gnu/libhiredis.so.0.14
#2  0x00007ffff731243d in swss::RedisCommand::format(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libswsscommon.so.0
#3  0x0000555556b907f7 in swss::RedisPipeline::publish (this=0x555558ed4340) at /usr/include/swss/redispipeline.h:181
#4  0x0000555556b906b5 in swss::RedisPipeline::flush (this=0x555558ed4340) at /usr/include/swss/redispipeline.h:133
#5  0x00007ffff72f9706 in swss::ProducerTable::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/x86_64-linux-gnu/libswsscommon.so.0
#6  0x00007ffff7e87b47 in sairedis::RedisChannel::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#7  0x00007ffff7e0eec8 in sairedis::RedisRemoteSaiInterface::notifySyncd(unsigned long, _sai_redis_notify_syncd_t) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#8  0x00007ffff7e1268f in sairedis::RedisRemoteSaiInterface::sai_redis_notify_syncd(unsigned long, _sai_attribute_t const*) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#9  0x00007ffff7e20f06 in sairedis::RedisRemoteSaiInterface::setRedisExtensionAttribute(_sai_object_type_t, unsigned long, _sai_attribute_t const*) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#10 0x00007ffff7e21e88 in sairedis::RedisRemoteSaiInterface::set(_sai_object_type_t, unsigned long, _sai_attribute_t const*) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#11 0x00007ffff7e4d146 in sairedis::Sai::set(_sai_object_type_t, unsigned long, _sai_attribute_t const*) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#12 0x00007ffff7dcd586 in sairedis::ServerSai::set(_sai_object_type_t, unsigned long, _sai_attribute_t const*) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#13 0x00007ffff7dbbe16 in sairedis::ClientServerSai::set(_sai_object_type_t, unsigned long, _sai_attribute_t const*) () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#14 0x00007ffff7db3bfe in ?? () from /usr/lib/x86_64-linux-gnu/libsairedis.so.0
#15 0x0000555556b48fc1 in initSaiRedis () at saihelper.cpp:382
#16 0x000055555648d6bc in main (argc=8, argv=0x7fffffffec48) at main.cpp:469

@stephenxs stephenxs force-pushed the create-counter-for-cpu-queue branch from e24d79d to dcc7f56 Compare November 22, 2024 05:51
@prsunny prsunny merged commit 3d5ac54 into sonic-net:master Nov 22, 2024
@stephenxs stephenxs deleted the create-counter-for-cpu-queue branch November 22, 2024 22:07
github-actions bot pushed a commit to bradh352/sonic-swss that referenced this pull request Nov 23, 2024
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
mssonicbld pushed a commit to mssonicbld/sonic-swss that referenced this pull request Dec 2, 2024
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #3408

mssonicbld pushed a commit that referenced this pull request Dec 3, 2024
…en create_only_config_db_buffers is enabled (#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
bradh352 pushed a commit to bradh352/sonic-swss that referenced this pull request Dec 4, 2024
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
bradh352 pushed a commit to bradh352/sonic-swss that referenced this pull request Dec 4, 2024
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
divyachandralekha pushed a commit to divyachandralekha/sonic-swss that referenced this pull request Dec 12, 2024
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
divyachandralekha pushed a commit to divyachandralekha/sonic-swss that referenced this pull request Dec 12, 2024
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
shiraez pushed a commit to Marvell-switching/sonic-swss that referenced this pull request Feb 17, 2025
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
…en create_only_config_db_buffers is enabled (sonic-net#3334)

Create counter for the queue to which the host CPU traffic is sent when create_only_config_db_buffers is enabled
*There is a configuration to optimize the buffer performance DEVICE_METADATA|localhost.create_only_config_db_buffers. Using this configuration the buffer counters are created only for the queues and PGs with buffer configured for performance optimization.
However, to have counters for CPU tx queue, we have to configure it in BUFFER_QUEUE, mainly for data traffic, which is a bad coupling.
Using this PR the counter will be created for CPU tx queue without data buffer configuration.

Signed-off-by: Baorong Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants