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

multiple switch definition p4 files #39

Closed
duanev opened this issue Oct 24, 2017 · 5 comments
Closed

multiple switch definition p4 files #39

duanev opened this issue Oct 24, 2017 · 5 comments

Comments

@duanev
Copy link

duanev commented Oct 24, 2017

I would like to use the h1<->s1<->s2<->s3<->h2 topology with two different switch p4 definitions (s1,s3 = switch_a, s2 = switch_b). Can this be done?

@theojepsen
Copy link
Contributor

Running a different P4 program on each switch is not currently supported.

It shouldn't be too difficult to add this feature. The hardest part will be figuring out how change the manifest schema. Right now, there is only one P4 program per p4app.json manifest file. To support multiple programs, we would have to change the schema so that a program can be associated with a specific switch.

@duanev
Copy link
Author

duanev commented Oct 26, 2017

I suppose conditionals based on the switch config could be an immediate workaround?

@theojepsen
Copy link
Contributor

p4app started off with idea that you'd specify a p4 program in the manifest, and then run it with different targets. The top-level p4app script compiles the p4 program, and passes it as an argument to one of the targets, which is a separate script. "multiswitch" is one of these targets.

In order to support multiple programs, we would have to redesign the manifest, and the flow between the scripts. For example, some targets only support a single p4 program -- if you had multiple programs, which one would you pass to these targets?

If you can propose an elegant solution (or even better, a PR), that would be great!

@theojepsen
Copy link
Contributor

Hi @duanev

With the new version of p4app:
#54
you can specify a different P4 program per switch:
https://github.com/theojepsen/p4app/blob/tj/v2/examples/two-programs.p4app/main.py#L24

@robertsoule-barefoot
Copy link
Contributor

Fixed by #54.

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

No branches or pull requests

3 participants