p4lang / p4runtime

Specification documents for the P4Runtime control-plane API
Apache License 2.0
142 stars 88 forks source link

Read table entries from a particular role only #345

Closed konne88 closed 3 years ago

konne88 commented 3 years ago

Right now, reads return all table entries. It's very common that a controller only wants to read the table entries associated with its own role. So it would be great if the Read request could filter all table entries that don't match the specified role.

message ReadRequest { uint64 device_id = 1; // if specified, only table entries programmed by this role will be returned. string role_name = 3; repeated Entity entities = 2; }

jafingerhut commented 3 years ago

@konne88 Did you mean to assign this to me? I suppose I can look into what P4Runtime API spec changes would be required here and try to write them up. Just didn't expect it :-)

konne88 commented 3 years ago

Sorry, wasn't so much meant as you need to review this, but more as a "this is what's going on, just in case you want to know". I reduced the number of people.

jafingerhut commented 3 years ago

FYI, you can ping someone in a Github comment by putting an @ before their Github user id, too.

konne88 commented 3 years ago

@antoninbas @stefanheule What do you think about this idea? If this seems reasonable, I'm happy to send out the PR to change the spec.

stefanheule commented 3 years ago

I fully support this, reading entries not for your own role is pretty annoying and does not seem like it would ever be beneficial.