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

Invalid error code on P4RT write request with unknown device ID #1011

Open
pudelkoM opened this issue Jul 19, 2022 · 3 comments
Open

Invalid error code on P4RT write request with unknown device ID #1011

pudelkoM opened this issue Jul 19, 2022 · 3 comments
Labels
bug Something isn't working P4/P4Runtime Things related to P4 or P4Runtime

Comments

@pudelkoM
Copy link
Member

pudelkoM commented Jul 19, 2022

According to the spec, Stratum should return NOT_FOUND, not INVALID_ARGUMENT, in this case:

If device_id does not match any of the devices known to the P4Runtime server or if role does not match any of the roles for the device, the server must return a NOT_FOUND error.

uint64 node_id = req->device_id();
if (node_id == 0) {
return ::grpc::Status(::grpc::StatusCode::INVALID_ARGUMENT,
"Invalid device ID.");
}

@pudelkoM pudelkoM added bug Something isn't working P4/P4Runtime Things related to P4 or P4Runtime labels Jul 19, 2022
@yi-tseng-intel
Copy link
Contributor

I guess we can close this since #1000 is merged?

@pudelkoM
Copy link
Member Author

I think that PR addressed it inside the switch impls, but P4Service still returns the wrong code?

@yi-tseng-intel
Copy link
Contributor

I think that PR addressed it inside the switch impls, but P4Service still returns the wrong code?

Ah, right, I think I missed that part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P4/P4Runtime Things related to P4 or P4Runtime
Projects
None yet
Development

No branches or pull requests

2 participants