-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add bf pktpy source #221
Add bf pktpy source #221
Conversation
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
so that when ptf is installed via `pip install ptf`, all of those other Python packages will also be installed. Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
…capy Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
@fruffy All p4c tests are passing using the version of ptf as modified by this PR, plus some changes in p4c tests to use bf_pktpy instead of scapy. You can see the p4c requirements.txt file I used here: https://github.com/p4lang/p4c/pull/5145/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552 This PR's copy of the bf_pktpy source files is the same as the latest in https://github.com/p4lang/open-p4studio, except it also has the small additions proposed in this PR: p4lang/open-p4studio#85 which enable more code in p4c tests to avoid using Scapy. |
Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
install_requires = | ||
six | ||
getmac | ||
scapy_helper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this particular dependency needed for? License looks fine and it doesn't pull in scapy. Just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked in detail. All I know is that if you try to do import bf_pktpy
without this package, you get an error that it cannot find it. It appears to define a few little functions for converting between different IP and MAC address formats, and probably a couple of other things I'm forgetting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also correctly export bf_pktpy as top-level module?
Yes. I have done |
Sounds good. After merging this we should consider making bf_pktpy the default. |
We can talk about that. I'd prefer discussing it over a later separate PR, if that is OK. |
No problem, let's give this PR some time so @antoninbas can have a look. Then we can merge it. |
Thanks @fruffy, but unfortunately I don't really have the cycles to review PRs in this repo - especially large PRs such as this one - and I don't have all the background related to this change / bf_pktpy. Feel free to move forward without my input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @fruffy, but unfortunately I don't really have the cycles to review PRs in this repo - especially large PRs such as this one - and I don't have all the background related to this change / bf_pktpy. Feel free to move forward without my input.
Sounds good. Was mostly pinging in case you had reservations on including this code with PTF.
@antoninbas If you are interested in reviewing this (no obligation, of course), here is some background: In 2021-2022, Barefoot folks after the Intel acquisition were told by Intel legal/software-license folks that because Scapy is licensed GPLv2, they should do something different if they wanted to release code under the Apache 2.0 license that used After lots of internal discussion, the decision was made to create a new module named Before Jan 15, 2025 when Intel released the code in https://github.com/p4lang/open-p4studio, That repo is about 1 GByte of code to clone it. The only known use case for The code is pretty much a straight copy from the open-p4studio repo, plus changes to make the black formatter happy, plus a dozen-line addition I made to make more names visible in the bf_pktpy module that is imported by |
Being brave and hitting the merge button on this one. |
No description provided.