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

[DASH] Add support for ENI counters #3266

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

vivekrnv
Copy link
Contributor

@vivekrnv vivekrnv commented Aug 24, 2024

What I did

Depends on sonic-net/sonic-sairedis#1418

  • Added support for ENI Counters
  • Refactored Flex Counter VS test to move the common infra logic and re-use in the dash vs tests

Why I did it

How I verified it

  • Add a VS test
  • Test Counters creation in VS Setup

Enable Flex Counter Creation:

<Enable FC for ENI>
sonic-db-cli CONFIG_DB HSET "FLEX_COUNTER_TABLE|ENI" FLEX_COUNTER_STATUS enable

<Check the FC Group Entry>
sonic-db-cli FLEX_COUNTER_DB HGETALL FLEX_COUNTER_GROUP_TABLE:ENI_STAT_COUNTER
{'POLL_INTERVAL': '10000', 'STATS_MODE': 'STATS_MODE_READ', 'FLEX_COUNTER_STATUS': 'enable'}

<Check the Counter ID list>
sonic-db-cli FLEX_COUNTER_DB HGETALL FLEX_COUNTER_TABLE:ENI_STAT_COUNTER:oid:0x76000000000027
{'ENI_COUNTER_ID_LIST': 'SAI_ENI_STAT_TIMED_FLOW_DELETE_ACK_FAILED_RECV,SAI_ENI_STAT_TIMED_FLOW_DELETE_REQ_FAILED,SAI_ENI_STAT_TIMED_FLOW_DELETE_REQ_RECV,SAI_ENI_STAT_TIMED_FLOW_DELETE_REQ_SENT,SAI_ENI_STAT_INLINE_FLOW_DELETE_ACK_FAILED_RECV,SAI_ENI_STAT_INBOUND_RX_PACKETS,SAI_ENI_STAT_TIMED_SYNC_PACKET_RX_BYTES,SAI_ENI_STAT_INLINE_SYNC_PACKET_TX_BYTES,SAI_ENI_STAT_TIMED_FLOW_CREATE_REQ_SENT,SAI_ENI_STAT_INLINE_FLOW_UPDATE_ACK_IGNORED_RECV,SAI_ENI_STAT_FLOW_DELETED,SAI_ENI_STAT_INLINE_FLOW_DELETE_ACK_IGNORED_RECV,SAI_ENI_STAT_LB_FAST_PATH_ICMP_IN_BYTES,SAI_ENI_STAT_FLOW_UPDATE_BY_RESIMULATION_FAILED,SAI_ENI_STAT_TIMED_FLOW_DELETE_ACK_RECV,SAI_ENI_STAT_FLOW_UPDATED,SAI_ENI_STAT_OUTBOUND_TX_PACKETS,SAI_ENI_STAT_INLINE_SYNC_PACKET_RX_BYTES,SAI_ENI_STAT_TIMED_SYNC_PACKET_TX_BYTES,SAI_ENI_STAT_TIMED_FLOW_UPDATE_REQ_SENT,SAI_ENI_STAT_TIMED_FLOW_UPDATE_ACK_FAILED_RECV,SAI_ENI_STAT_FLOW_CREATE_FAILED,SAI_ENI_STAT_INLINE_FLOW_CREATE_ACK_RECV,SAI_ENI_STAT_RX_PACKETS,SAI_ENI_STAT_INBOUND_RX_BYTES,SAI_ENI_STAT_INLINE_SYNC_PACKET_RX_PACKETS,SAI_ENI_STAT_INLINE_FLOW_CREATE_ACK_IGNORED_RECV,SAI_ENI_STAT_TX_BYTES,SAI_ENI_STAT_INLINE_FLOW_DELETE_REQ_FAILED,SAI_ENI_STAT_FLOW_AGED,SAI_ENI_STAT_FLOW_UPDATE_FAILED,SAI_ENI_STAT_OUTBOUND_RX_BYTES,SAI_ENI_STAT_INBOUND_TX_BYTES,SAI_ENI_STAT_OUTBOUND_RX_PACKETS,SAI_ENI_STAT_RX_BYTES,SAI_ENI_STAT_LB_FAST_PATH_ICMP_IN_PACKETS,SAI_ENI_STAT_INBOUND_TX_PACKETS,SAI_ENI_STAT_FLOW_CREATED,SAI_ENI_STAT_INLINE_FLOW_UPDATE_REQ_FAILED,SAI_ENI_STAT_TIMED_SYNC_PACKET_TX_PACKETS,SAI_ENI_STAT_INLINE_FLOW_UPDATE_REQ_SENT,SAI_ENI_STAT_TIMED_FLOW_UPDATE_ACK_IGNORED_RECV,SAI_ENI_STAT_FLOW_DELETE_FAILED,SAI_ENI_STAT_INLINE_FLOW_CREATE_REQ_SENT,SAI_ENI_STAT_INLINE_FLOW_CREATE_REQ_RECV,SAI_ENI_STAT_TIMED_FLOW_CREATE_REQ_RECV,SAI_ENI_STAT_TIMED_FLOW_UPDATE_REQ_RECV,SAI_ENI_STAT_INLINE_FLOW_CREATE_REQ_FAILED,SAI_ENI_STAT_INLINE_FLOW_DELETE_ACK_RECV,SAI_ENI_STAT_INLINE_FLOW_CREATE_ACK_FAILED_RECV,SAI_ENI_STAT_TIMED_SYNC_PACKET_RX_PACKETS,SAI_ENI_STAT_FLOW_UPDATED_BY_RESIMULATION,SAI_ENI_STAT_TIMED_FLOW_CREATE_ACK_RECV,SAI_ENI_STAT_INLINE_FLOW_DELETE_REQ_RECV,SAI_ENI_STAT_TIMED_FLOW_CREATE_ACK_FAILED_RECV,SAI_ENI_STAT_INLINE_FLOW_UPDATE_REQ_RECV,SAI_ENI_STAT_INLINE_SYNC_PACKET_TX_PACKETS,SAI_ENI_STAT_TIMED_FLOW_CREATE_ACK_IGNORED_RECV,SAI_ENI_STAT_TIMED_FLOW_DELETE_ACK_IGNORED_RECV,SAI_ENI_STAT_OUTBOUND_TX_BYTES,SAI_ENI_STAT_INLINE_FLOW_UPDATE_ACK_RECV,SAI_ENI_STAT_INLINE_FLOW_UPDATE_ACK_FAILED_RECV,SAI_ENI_STAT_TIMED_FLOW_CREATE_REQ_FAILED,SAI_ENI_STAT_TIMED_FLOW_UPDATE_REQ_FAILED,SAI_ENI_STAT_TIMED_FLOW_UPDATE_ACK_RECV,SAI_ENI_STAT_TX_PACKETS,SAI_ENI_STAT_INLINE_FLOW_DELETE_REQ_SENT'}

sonic-db-cli COUNTERS_DB HGETALL "COUNTERS_ENI_NAME_MAP"
{'eth0': 'oid:0x76000000000027'}

sonic-db-cli COUNTERS_DB hgetall COUNTERS:oid:0x76000000000027
{'SAI_ENI_STAT_TIMED_FLOW_DELETE_ACK_FAILED_RECV': '0', 'SAI_ENI_STAT_TIMED_FLOW_DELETE_REQ_FAILED': '0', 'SAI_ENI_STAT_TIMED_FLOW_DELETE_REQ_RECV': '0', 'SAI_ENI_STAT_TIMED_FLOW_DELETE_REQ_SENT': '0', 'SAI_ENI_STAT_INLINE_FLOW_DELETE_ACK_FAILED_RECV': '0', 'SAI_ENI_STAT_INBOUND_RX_PACKETS': '0', 'SAI_ENI_STAT_TIMED_SYNC_PACKET_RX_BYTES': '0', 'SAI_ENI_STAT_INLINE_SYNC_PACKET_TX_BYTES': '0', 'SAI_ENI_STAT_TIMED_FLOW_CREATE_REQ_SENT': '0', 'SAI_ENI_STAT_INLINE_FLOW_UPDATE_ACK_IGNORED_RECV': '0', 'SAI_ENI_STAT_FLOW_DELETED': '0', 'SAI_ENI_STAT_INLINE_FLOW_DELETE_ACK_IGNORED_RECV': '0', 'SAI_ENI_STAT_LB_FAST_PATH_ICMP_IN_BYTES': '0', 'SAI_ENI_STAT_FLOW_UPDATE_BY_RESIMULATION_FAILED': '0', 'SAI_ENI_STAT_TIMED_FLOW_DELETE_ACK_RECV': '0', 'SAI_ENI_STAT_FLOW_UPDATED': '0', 'SAI_ENI_STAT_OUTBOUND_TX_PACKETS': '0', 'SAI_ENI_STAT_INLINE_SYNC_PACKET_RX_BYTES': '0', 'SAI_ENI_STAT_TIMED_SYNC_PACKET_TX_BYTES': '0', 'SAI_ENI_STAT_TIMED_FLOW_UPDATE_REQ_SENT': '0', 'SAI_ENI_STAT_TIMED_FLOW_UPDATE_ACK_FAILED_RECV': '0', 'SAI_ENI_STAT_FLOW_CREATE_FAILED': '0', 'SAI_ENI_STAT_INLINE_FLOW_CREATE_ACK_RECV': '0', 'SAI_ENI_STAT_RX_PACKETS': '0', 'SAI_ENI_STAT_INBOUND_RX_BYTES': '0', 'SAI_ENI_STAT_INLINE_SYNC_PACKET_RX_PACKETS': '0', 'SAI_ENI_STAT_INLINE_FLOW_CREATE_ACK_IGNORED_RECV': '0', 'SAI_ENI_STAT_TX_BYTES': '0', 'SAI_ENI_STAT_INLINE_FLOW_DELETE_REQ_FAILED': '0', 'SAI_ENI_STAT_FLOW_AGED': '0', 'SAI_ENI_STAT_FLOW_UPDATE_FAILED': '0', 'SAI_ENI_STAT_OUTBOUND_RX_BYTES': '0', 'SAI_ENI_STAT_INBOUND_TX_BYTES': '0', 'SAI_ENI_STAT_OUTBOUND_RX_PACKETS': '0', 'SAI_ENI_STAT_RX_BYTES': '0', 'SAI_ENI_STAT_LB_FAST_PATH_ICMP_IN_PACKETS': '0', 'SAI_ENI_STAT_INBOUND_TX_PACKETS': '0', 'SAI_ENI_STAT_FLOW_CREATED': '0', 'SAI_ENI_STAT_INLINE_FLOW_UPDATE_REQ_FAILED': '0', 'SAI_ENI_STAT_TIMED_SYNC_PACKET_TX_PACKETS': '0', 'SAI_ENI_STAT_INLINE_FLOW_UPDATE_REQ_SENT': '0', 'SAI_ENI_STAT_TIMED_FLOW_UPDATE_ACK_IGNORED_RECV': '0', 'SAI_ENI_STAT_FLOW_DELETE_FAILED': '0', 'SAI_ENI_STAT_INLINE_FLOW_CREATE_REQ_SENT': '0', 'SAI_ENI_STAT_INLINE_FLOW_CREATE_REQ_RECV': '0', 'SAI_ENI_STAT_TIMED_FLOW_CREATE_REQ_RECV': '0', 'SAI_ENI_STAT_TIMED_FLOW_UPDATE_REQ_RECV': '0', 'SAI_ENI_STAT_INLINE_FLOW_CREATE_REQ_FAILED': '0', 'SAI_ENI_STAT_INLINE_FLOW_DELETE_ACK_RECV': '0', 'SAI_ENI_STAT_INLINE_FLOW_CREATE_ACK_FAILED_RECV': '0', 'SAI_ENI_STAT_TIMED_SYNC_PACKET_RX_PACKETS': '0', 'SAI_ENI_STAT_FLOW_UPDATED_BY_RESIMULATION': '0', 'SAI_ENI_STAT_TIMED_FLOW_CREATE_ACK_RECV': '0', 'SAI_ENI_STAT_INLINE_FLOW_DELETE_REQ_RECV': '0', 'SAI_ENI_STAT_TIMED_FLOW_CREATE_ACK_FAILED_RECV': '0', 'SAI_ENI_STAT_INLINE_FLOW_UPDATE_REQ_RECV': '0', 'SAI_ENI_STAT_INLINE_SYNC_PACKET_TX_PACKETS': '0', 'SAI_ENI_STAT_TIMED_FLOW_CREATE_ACK_IGNORED_RECV': '0', 'SAI_ENI_STAT_TIMED_FLOW_DELETE_ACK_IGNORED_RECV': '0', 'SAI_ENI_STAT_OUTBOUND_TX_BYTES': '0', 'SAI_ENI_STAT_INLINE_FLOW_UPDATE_ACK_RECV': '0', 'SAI_ENI_STAT_INLINE_FLOW_UPDATE_ACK_FAILED_RECV': '0', 'SAI_ENI_STAT_TIMED_FLOW_CREATE_REQ_FAILED': '0', 'SAI_ENI_STAT_TIMED_FLOW_UPDATE_REQ_FAILED': '0', 'SAI_ENI_STAT_TIMED_FLOW_UPDATE_ACK_RECV': '0', 'SAI_ENI_STAT_TX_PACKETS': '0', 'SAI_ENI_STAT_INLINE_FLOW_DELETE_REQ_SENT': '0'}

Details if related

dgsudharsan
dgsudharsan previously approved these changes Aug 26, 2024
@vivekrnv
Copy link
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv
Copy link
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

dgsudharsan
dgsudharsan previously approved these changes Sep 18, 2024
@vivekrnv
Copy link
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@KrisNey-MSFT
Copy link

looks like branch is out of date w/base @vivekrnv

@KrisNey-MSFT
Copy link

Ok to merge this since @dgsudharsan approved last week?

@vivekrnv
Copy link
Contributor Author

@prabhataravind @theasianpianist @prsunny Can we finish the review on this?

@vivekrnv
Copy link
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv
Copy link
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).


m_eni_name_table->hdel("", name);
m_eni_stat_manager.clearCounterIdList(oid);
SWSS_LOG_DEBUG("Unregistered eni %s to Flex counter", name.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to set m_eni_fc_status to false here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not required, this is set in handleFCStatusUpdate if the request comes from DB/user

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.

6 participants