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

PBH CLI #3

Closed
wants to merge 80 commits into from
Closed

PBH CLI #3

wants to merge 80 commits into from

Conversation

vadymhlushko-mlnx
Copy link
Owner

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)

Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
…tions

Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
if (ip_mask is None) and (hash_field in hf_v4_and_v6):
is_error = True

if (ip_mask is not None) and (hash_field in hf_no_ip):
Copy link
Collaborator

Choose a reason for hiding this comment

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

@vadymhlushko-mlnx if (ip_mask is not None) and (hash_field not in hf_v4_and_v6): ?

Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
hf_v4 = ['INNER_DST_IPV4', 'INNER_SRC_IPV4']
hf_v6 = ['INNER_DST_IPV6', 'INNER_SRC_IPV6']

if (ip_mask is None) and (hash_field in hf_v4_and_v6):
Copy link
Collaborator

Choose a reason for hiding this comment

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

@vadymhlushko-mlnx what if hash_field is None? Do we guarantee that only ip_mask can be None inside this method?

vadymhlushko-mlnx and others added 16 commits July 13, 2021 15:17
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
…to parametrized

Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
vadymhlushko-mlnx pushed a commit that referenced this pull request Nov 27, 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
vadymhlushko-mlnx pushed a commit that referenced this pull request Jan 23, 2024
…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