Skip to content

port counter support on sonic-vs#1275

Merged
vishnushetty merged 8 commits intosonic-net:masterfrom
vishnushetty:vs_port_counter
Aug 28, 2023
Merged

port counter support on sonic-vs#1275
vishnushetty merged 8 commits intosonic-net:masterfrom
vishnushetty:vs_port_counter

Conversation

@vishnushetty
Copy link
Contributor

@vishnushetty vishnushetty commented Aug 17, 2023

In sonic-vs 'show interface counters' is not supported (port counters set to zero). The counter support would be useful for debugging and automation. As part of this feature the basic port counters are fetched from corresponding host interface net stat "/sys/class/net/[hostif_name]/statistics".

The following SAI port counters are mapped to host interface statistics as below.

    { SAI_PORT_STAT_IF_IN_OCTETS, "rx_bytes" },
    { SAI_PORT_STAT_IF_IN_UCAST_PKTS, "rx_packets" },
    { SAI_PORT_STAT_IF_IN_ERRORS, "rx_errors" },
    { SAI_PORT_STAT_IF_IN_DISCARDS, "rx_dropped" },
    { SAI_PORT_STAT_IF_OUT_OCTETS, "tx_bytes" },
    { SAI_PORT_STAT_IF_OUT_UCAST_PKTS, "tx_packets" },
    { SAI_PORT_STAT_IF_OUT_ERRORS, "tx_errors" },
    { SAI_PORT_STAT_IF_OUT_DISCARDS, "tx_dropped" }

@vishnushetty vishnushetty requested a review from kcudnik August 17, 2023 04:41
@kcudnik
Copy link
Collaborator

kcudnik commented Aug 19, 2023

please fix build errors

@vishnushetty
Copy link
Contributor Author

sonic-sairedis is successful. Build error is in orchagent. How to refresh other repo and build?

In file included from dash/dashaclorch.h:19,
from orchdaemon.h:49,
from main.cpp:25:
dash/dashorch.h:21:10: fatal error: dash_api/appliance.pb.h: No such file or directory
21 | #include "dash_api/appliance.pb.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:905: orchagent-main.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/__w/1/s/orchagent'

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 19, 2023

@Pterosaur hey, you have been working on dash_api/ in swss repo, can you fix pipeline here on sairedis ? sonic-net/sonic-swss#2722 seems like your PR added some some libs libdashapi

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 19, 2023

my attempt to fix: #1276, this will probably fail for the same reason, since az pipeline needs to be checked in first to take effect

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 19, 2023

ok, seems like my attempt fixed swss build, test failure seems to be related to dash apii python module missing:

==================================== ERRORS ====================================
______________________ ERROR collecting test_dash_acl.py _______________________
ImportError while importing test module '/agent/_work/1/s/sonic-swss/tests/test_dash_acl.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_dash_acl.py:4: in <module>
    from dash_api.appliance_pb2 import *
E   ModuleNotFoundError: No module named 'dash_api'
______________________ ERROR collecting test_dash_vnet.py ______________________
ImportError while importing test module '/agent/_work/1/s/sonic-swss/tests/test_dash_vnet.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_dash_vnet.py:3: in <module>
    from dash_api.appliance_pb2 import *
E   ModuleNotFoundError: No module named 'dash_api'
---- generated xml file: /agent/_work/1/s/sonic-swss/tests/test_acl_tr.xml -----

@Pterosaur can you take a look ?

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 23, 2023

build was fixed by #1277, let restart

/azp/run

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 23, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 25, 2023

nice error XD

[       OK ] ClientServerSai.FDB_ENTRY (10 ms)
[ RUN      ] ClientServerSai.INSEG_ENTRY
Assertion failed: pfd.revents & POLLIN (src/signaler.cpp:265)
/bin/bash: line 6: 23663 Aborted                 (core dumped) ${dir}$tst

@kcudnik
Copy link
Collaborator

kcudnik commented Aug 26, 2023

please change pr name to more meaningful

@vishnushetty vishnushetty changed the title pr 1274 vslib port counter support review comments port counter support on sonic-vs Aug 28, 2023
@vishnushetty vishnushetty merged commit 4c2527f into sonic-net:master Aug 28, 2023
@skg-net
Copy link
Member

skg-net commented Feb 6, 2024

@vishnushetty Can you please update the Quality Metric (Alpha/Beta/GA) for the feature either in this PR comments or in HLD itself based on https://github.com/sonic-net/SONiC/blob/master/doc/SONiC%20feature%20quality%20definition.md
Thanks

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