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

Incremental QOS config updater test update #5028

Merged
merged 6 commits into from
Feb 14, 2022

Conversation

isabelmsft
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911

Approach

What is the motivation for this PR?

End to End test support for Generic Updater apply-patch
Update qos config values to update based on Mellanox SPC1 buffer calculations

How did you do it?

Calculate proper buffer field values based, integrate into config updater JSON patch

How did you verify/test it?

Tested on msn2700 devices, all tests pass

Any platform specific information?

For Mellanox msn2700

Supported testbed topology if it's a new test case?

t0, t1

Documentation

@isabelmsft isabelmsft requested a review from a team as a code owner January 27, 2022 00:04
@lgtm-com
Copy link

lgtm-com bot commented Jan 27, 2022

This pull request introduces 3 alerts and fixes 4 when merging 662248c into d07e1d9 - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Result of integer division may be truncated

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import

@bingwang-ms
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).


"""
config_db_json = json.loads(duthost.shell("show runningconfig all")["stdout"])
device_neighbor_metadata = config_db_json["DEVICE_NEIGHBOR_METADATA"]
Copy link
Contributor

@qiluo-msft qiluo-msft Jan 29, 2022

Choose a reason for hiding this comment

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


expected_profile = 'pg_lossless_{}_{}_profile'.format(port_speed, cable_length)

xoff = int(duthost.shell('redis-cli hget "BUFFER_PROFILE_TABLE:{}" xoff'.format(expected_profile))['stdout'])
Copy link
Contributor

@qiluo-msft qiluo-msft Jan 29, 2022

Choose a reason for hiding this comment

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

redis-cli

redis-cli will read AppDB (database 0) by default. I think you need sonic-db-cli CONFIG_DB. #Closed

buffer_pool = "ingress_lossless_pool"
elif "egress_lossy_pool" in configdb_field:
buffer_pool = "egress_lossy_pool"
oid = duthost.shell('redis-cli -n 2 HGET COUNTERS_BUFFER_POOL_NAME_MAP {}'.format(buffer_pool))["stdout"]
Copy link
Contributor

@qiluo-msft qiluo-msft Jan 29, 2022

Choose a reason for hiding this comment

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

redis-cli -n 2

redis-cli is deprecated. Suggest use sonic-db-cli ASIC_DB #Closed


pytestmark = [
pytest.mark.topology('t0'),
pytest.mark.topology('t0', 't1'),
pytest.mark.asic('mellanox')
Copy link
Contributor

@qiluo-msft qiluo-msft Jan 29, 2022

Choose a reason for hiding this comment

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

mellanox

Is it safe to run this test on mellanox switch but not 2700? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These formula are only applicable to 2700

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wangxin Is there a marker we can add for 2700?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you only want this test to run on 2700? If so, you can add a pytest_requires condition in your test code entrance to only allow 2700. But why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the Mellanox SPC1 buffer calculations only apply to 2700 devices. @neethajohn may confirm/correct me

And thanks, I added pytest_require to check for 2700 in hwsku

@qiluo-msft
Copy link
Contributor

Could you fix valid LGTM alerts in the build checkers?

@lgtm-com
Copy link

lgtm-com bot commented Feb 1, 2022

This pull request introduces 1 alert and fixes 4 when merging f5f9744 into e4fe46f - view on LGTM.com

new alerts:

  • 1 for Result of integer division may be truncated

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import


xoff = int(duthost.shell('redis-cli hget "BUFFER_PROFILE_TABLE:{}" xoff'.format(expected_profile))['stdout'])
xon = int(duthost.shell('redis-cli hget "BUFFER_PROFILE_TABLE:{}" xon'.format(expected_profile))['stdout'])
pg_headroom = (xoff + xon) / 1024
Copy link
Contributor

@qiluo-msft qiluo-msft Feb 1, 2022

Choose a reason for hiding this comment

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

/

LGTM reports a warning here.
The main concern is that the behavior of / is different in python3 vs python2. And we can improve the code to make it behave the same way.

You may find some solutions https://stackoverflow.com/a/15633893/2514803. I prefer from __future__ import division with a int() conversion. #Closed

@lgtm-com
Copy link

lgtm-com bot commented Feb 2, 2022

This pull request fixes 4 alerts when merging 0bb712b into e4fe46f - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import

qiluo-msft
qiluo-msft previously approved these changes Feb 2, 2022
@lgtm-com
Copy link

lgtm-com bot commented Feb 5, 2022

This pull request fixes 4 alerts when merging 729e4f7 into ef91856 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import

qiluo-msft
qiluo-msft previously approved these changes Feb 8, 2022
@lgtm-com
Copy link

lgtm-com bot commented Feb 8, 2022

This pull request fixes 4 alerts when merging 3f25af979ec5b5a209b7c85d2a1ffbdfa7ffffca into c3bcea8 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Feb 10, 2022

This pull request introduces 17 alerts and fixes 8 when merging d631e0818f665d1ccce93da2ce1a961cfb22d0b8 into fbafa94 - view on LGTM.com

new alerts:

  • 13 for Unused import
  • 4 for Unused local variable

fixed alerts:

  • 6 for Unused import
  • 2 for Unused local variable

@qiluo-msft
Copy link
Contributor

The PR includes so many files due to recently merge. Is it expected?

@isabelmsft isabelmsft force-pushed the qos_update_config_test branch 2 times, most recently from 9650672 to 729e4f7 Compare February 10, 2022 05:55
@lgtm-com
Copy link

lgtm-com bot commented Feb 10, 2022

This pull request fixes 4 alerts when merging 0277347 into 377a9e5 - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import

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.

4 participants