Skip to content

ON-16037: added functions to read stats for interfaces#52

Open
rdrinkwa-xilinx wants to merge 1 commit into
Xilinx-CNS:masterfrom
rdrinkwa-xilinx:ON-16037
Open

ON-16037: added functions to read stats for interfaces#52
rdrinkwa-xilinx wants to merge 1 commit into
Xilinx-CNS:masterfrom
rdrinkwa-xilinx:ON-16037

Conversation

@rdrinkwa-xilinx

Copy link
Copy Markdown

Added two functions to read the drop stats from the physical interfaces used by TCPDirect. Tested as working with physical interfaces themselves or a bond. The zfsink app was updated to make use of this additional functionality for testing and demo purposes.

The design mimics that of ef_vi itself with the two calls to get the layout and then the actual stats themselves. It could be changed to hold a copy of the layout internally within the stack so passing it back in wouldn't be required but it would add complexity and necessitate code changes in other files beyond the minimal updates to existing files here.

Testing with 'efsend' sending 1000 1-byte packets as a burst that is known to exceed zfsink's ability to avoid drops.

# testing physical interface with regular drops
[server1:static]$ ZF_ATTR="interface=enp1s0f0" ./zfsink -s 224.1.2.3:12345
# pkt-rate  bandwidth(Mbps)       total-pkts  RX CRC errors  RX trunk errors  RX no descriptor errors  RX abort errors
         0                0                0              0                0                        0                0
         0                0                0              0                0                        0                0
       710                0              710              0                0                      290                0
         0                0              710              0                0                        0                0
         0                0              710              0                0                        0                0
^C
# physical interface and backgrounded to cause more drops
[server1:static]$ ZF_ATTR="interface=enp1s0f0" ./zfsink -s 224.1.2.3:12345
# pkt-rate  bandwidth(Mbps)       total-pkts  RX CRC errors  RX trunk errors  RX no descriptor errors  RX abort errors
         0                0                0              0                0                        0                0
^Z
[1]+  Stopped                 ./zfsink -s 224.1.2.3:12345
[server1:static]$ fg
ZF_ATTR="interface=enp1s0f0" ./zfsink -s 224.1.2.3:12345
         0                0                0              0                0                      496                0
       504                0              504              0                0                        0                0
         0                0              504              0                0                        0                0
^C
 # running on a bond with burst on first then second intf. Output changed to show one line per intf.
[server1:static]$ ZF_ATTR="interface=bond0" ./zfsink -s 224.1.2.3:12345
# pkt-rate  bandwidth(Mbps)       total-pkts
#  RX CRC errors RX trunk errors RX no descriptor errors RX abort errors
         0                0                0
              0                0                        0                0
              0                0                        0                0
         0                0                0
              0                0                        0                0
              0                0                        0                0
       744                0              744
              0                0                      256                0
              0                0                        0                0
         0                0              744
              0                0                        0                0
              0                0                        0                0
       760                0             1504
              0                0                        0                0
              0                0                      240                0
         0                0             1504
              0                0                        0                0
              0                0                        0                0
         0                0             1504
              0                0                        0                0
              0                0                        0                0
^C
[server1:static]$

@rdrinkwa-xilinx rdrinkwa-xilinx requested a review from a team as a code owner October 30, 2024 18:49

@ligallag-amd ligallag-amd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you need to make static method which does the following.

pthread_mutex_lock(&printf_mutex);
printf(...)
pthread_mutex_unlock(&printf_mutex);

There is too much duplicated code. Please update #50 to do this also.

Comment thread src/include/zf/zf_stack.h Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
@rdrinkwa-xilinx rdrinkwa-xilinx force-pushed the ON-16037 branch 2 times, most recently from 4b95caa to 5723af0 Compare November 13, 2024 16:51
Comment thread src/lib/zf/zf_stats.c Outdated
Comment thread src/lib/zf/zf_stats.c Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/lib/zf/zf_stats.c Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/include/zf/zf_stack.h Outdated
Comment thread src/include/zf/zf_stack.h Outdated
Comment thread src/include/zf/zf_stack.h Outdated
Comment thread src/include/zf/zf_stack.h Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/tests/zf_apps/zfsink.c
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/tests/zf_apps/zfsink.c Outdated
Comment thread src/include/zf/zf_stats.h Outdated
Comment thread src/lib/zf/zf_stats.c Outdated
Comment thread src/lib/zf/zf_stats.c Outdated
Comment thread src/lib/zf/zf_stats.c Outdated
Comment thread src/lib/zf/zf_stats.c
@rdrinkwa-xilinx rdrinkwa-xilinx force-pushed the ON-16037 branch 3 times, most recently from cb554e6 to 3ec4c58 Compare January 23, 2025 17:25
Comment thread src/include/zf/zf_stats.h Outdated
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

Successfully merging this pull request may close these issues.

3 participants