Skip to content

add the tx_err related commands #1

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

Closed
wants to merge 2 commits into from
Closed

add the tx_err related commands #1

wants to merge 2 commits into from

Conversation

stephenxs
Copy link
Owner

config interface tx_error_threshold set PORT_NAME THRESHOLD
config interface tx_error_threshold clear PORT_NAME
config tx_error_stat_poll_period PERIOD

- What I did

- How I did it

- How to verify it

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

-->

 config interface tx_error_threshold set PORT_NAME THRESHOLD
 config interface tx_error_threshold clear PORT_NAME
 config tx_error_stat_poll_period PERIOD
Copy link

@keboliu keboliu left a comment

Choose a reason for hiding this comment

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

as comments

"""Set polling period of tx error statistics, 0 for disable, xxx for default"""
config_db = ConfigDBConnector()
config_db.connect()
config_db.set_entry("TX_ERR_CFG", ("GLOBAL_PERIOD"), {"tx_error_check_period": period})
Copy link

Choose a reason for hiding this comment

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

need to check if "period" is a valid number.

Copy link
Owner Author

Choose a reason for hiding this comment

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

solved.

ctx.fail("'interface_name' is None!")

config_db = ctx.obj["config_db"]
if interface_name.startswith("Ethernet"):
Copy link

Choose a reason for hiding this comment

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

need to further check whether this port exists on this switch

Copy link
Owner Author

Choose a reason for hiding this comment

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

solved.

config/main.py Outdated
ctx.fail("'interface_name' is None!")

config_db = ctx.obj["config_db"]
if interface_name.startswith("Ethernet"):
Copy link

Choose a reason for hiding this comment

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

need to further check whether this port exists on this switch and whether it has been configured.

Copy link
Owner Author

Choose a reason for hiding this comment

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

solved.

1. validate the parameters ahead of starting operations to redis-db in the following case:
  input parameter is not a invalid value when set polling period or tx error threshold
  input interface name is not a valid name when set/clear tx error threshold for an interface
  input interface name hasn't been configured with tx error threshold when clear it
2. implement "show interface tx_err" which display tx_status and statistics lasttime retreived.
@stephenxs stephenxs closed this May 29, 2019
stephenxs pushed a commit that referenced this pull request Nov 21, 2023
…aidump_by_route_size (sonic-net#2972)

* * [saidump]
•	Saidump for DNX-SAI sonic-net/sonic-buildimage#13561

Solution and modification:
To use the redis-db SAVE option to save the snapshot of DB each time and recover later, instead of looping through each entry in the table and saving it.

(1) Updated sonic-buildimage/build_debian.sh, to install Python library rdbtools into the host.
(2) Updated sonic-buildimage/src/sonic-sairedis/saidump/saidump.cpp, add a new option -r, which updates the rdbtools's output-JSON files' format.
(3) Add a new script file: files/scripts/saidump.sh, to do the below steps
  For each ASIC0, such as ASIC0,

  #1. Save the Redis data.
  sudo sonic-db-cli -n asic$1 SAVE > /dev/null

  #2. Move dump files to /var/run/redisX/
  docker exec database$1 sh -c "mv /var/lib/redis/dump.rdb /var/run/redis$1/"

  #3. Run rdb command to convert the dump files into JSON files
  sudo python /usr/local/bin/rdb --command json  /var/run/redis$1/dump.rdb | sudo tee /var/run/redis$1/dump.json > /dev/null

  #4. Run saidump -r to update the JSON files' format as same as the saidump before. Then we can get the saidump result in standard output.
  docker exec syncd$1 sh -c "saidump -r /var/run/redis$1/dump.json"

  #5. clear
  sudo rm -f /var/run/redis$1/dump.rdb
  sudo rm -f /var/run/redis$1/dump.json

(4) Update sonic-buildimage/src/sonic-utilities/scripts/generate_dump, replace saidump with saidump.sh
* * [saidump]
•	Saidump for DNX-SAI sonic-net/sonic-buildimage#13561
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.

2 participants