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

[ptftest] Add p4_dash_utils #640

Merged
merged 5 commits into from
Nov 20, 2024
Merged

[ptftest] Add p4_dash_utils #640

merged 5 commits into from
Nov 20, 2024

Conversation

jimmyzhai
Copy link
Collaborator

@jimmyzhai jimmyzhai commented Nov 5, 2024

This PR adds a module p4_dash_utils to include helper functions for p4 pipeline.

  • Function set_internal_config aims to update pipeline internal configuration, neighbor mac, data port mac, cpu port mac, etc.
  • Decorator use_flow aims to enable flow lookup stage in p4 pipeline. It wrappers method setUp/tearDown of test class.

@jimmyzhai jimmyzhai requested a review from r12f November 5, 2024 12:53
@KrisNey-MSFT
Copy link
Collaborator

Author used P4 runtime directly to add a fixture to add underlay routing
PTF not using .py tests, so we will add more of a description and example
fyi SAI Challenger uses .py test

@jimmyzhai jimmyzhai changed the title [ptftest] Add decorator use_flow for test case fixture setUp/tearDown [ptftest] Add p4_dash_utils Nov 14, 2024
@jimmyzhai jimmyzhai requested a review from r12f November 14, 2024 02:23
Copy link
Collaborator

@r12f r12f left a comment

Choose a reason for hiding this comment

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

lgtm now! thanks Junhua for updating some tests as examples!


def set_internal_config(neighbor_mac :bytes = None,
mac :bytes = None,
dpapp_mac :bytes = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

cpu_mac

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -25,6 +25,11 @@ def setUp(self):
# SAI address family
self.sai_ip_addr_family = SAI_IP_ADDR_FAMILY_IPV4

self.dut_mac = get_mac("veth0")
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: space.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Copy link
Collaborator

@r12f r12f left a comment

Choose a reason for hiding this comment

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

lgtm!

@r12f r12f merged commit 62c9907 into sonic-net:main Nov 20, 2024
5 checks passed
@jimmyzhai jimmyzhai deleted the use_flow branch November 21, 2024 02:01
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