-
Notifications
You must be signed in to change notification settings - Fork 444
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
Improve diagnostics for MethodCallExpression
#4354
Conversation
e12dba2
to
509b3c7
Compare
MethodCallExpression
MethodCallExpression
509b3c7
to
b836b3c
Compare
Does anybody know what these |
This doesn't look right to me, I think this could lead to broken code because the DPDK back end relies on @usha1830 Do you have any other comments? |
@kfcripps The .spec files are the output of the p4c-dpdk back end. These .spec files can be loaded into a P4-DPDK software switch, which at a high level my understanding is that they are first translated into C source files, then compiled with a C compiler. For the purposes of the p4c repository, they are expected output files for CI runs that if they change, someone working on the p4c-dpdk back end should verify whether that change is correct. It seems like we have enough back ends and enough cases in how the automated p4c testing works that it might be nice to have a summary of the files in the p4c/testdata subdirectories, and how they are used during tests. |
Yes. there are several places where toString() is used in dpdk backend. |
Thanks @fruffy @jafingerhut @usha1830. @usha1830 Let me know when you've fixed this, and I will rebase this PR. Or you can just add these changes to your PR and I will close this one. |
@kfcripps I created a PR to fix the dpdk backend to use method->toString() instead of toString() directly on MCE #4383 |
32e61c3
to
bbfd127
Compare
a9a2d63
to
04037a7
Compare
MethodCallExpression
MethodCallExpression
This is ready for review. |
$TC p4template create table/calculator/MainControlImpl/calculate entry op 26 action calculator/MainControlImpl/operation_and permissions 0x1024 | ||
$TC p4template create table/calculator/MainControlImpl/calculate entry op 7c action calculator/MainControlImpl/operation_or permissions 0x1024 | ||
$TC p4template create table/calculator/MainControlImpl/calculate entry op 5e action calculator/MainControlImpl/operation_xor permissions 0x1024 | ||
$TC p4template create table/calculator/MainControlImpl/calculate entry op 2b action calculator/MainControlImpl/operation_add() permissions 0x1024 |
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.
Similar error as with the DPDK back end here?
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 assumed these were just log messages, are they not?
The entry action may vary based on the parameters of the action call, so just printing the action name here doesn't seem like enough information anyway.
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.
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.
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.
It looks like a command to me so in any case the formatting seems wrong here.
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 have updated the p4tc
backend to continue using just the action's name here.
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.
Oh, this is a bash script. @komaljai @usha1830 Should the
tc
commands be updated to somehow take the action param values for each entry action, or is the action name enough?
I presume we only expect the action name here. @vbnogueira @komaljai can comment further.
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.
Oh, this is a bash script. @komaljai @usha1830 Should the
tc
commands be updated to somehow take the action param values for each entry action, or is the action name enough?I presume we only expect the action name here. @vbnogueira @komaljai can comment further.
So, @kfcripps is right. It should pass the parameters also.
The format would be the following (imagine that operation_add had two parameters "a" and "b" in the calc example). So something like:
action operation_add(bit<32> a, bit<32> b) {
send_back(a + b);
}
The const entry declaration would look like:
const entries = {
0x2b : operation_add(1 + 42);
...
}
And the template script should generate:
$TC p4template create table/calc/MainControlImpl/calculate entry op 0x2b permissions 0x1024 action calc/MainControlImpl/operation_test param a 1 param b 42
5761f2d
to
43f81a6
Compare
…n is a MethodCallExpression
1ad301c
to
fe246a7
Compare
No description provided.