Connect controller to deployed BMV2 and retrieve existing P4Info for Helper use + Generic decoder for convert.py #508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Forwarding Pipeline P4Info retrieval + Generic decoder
Forwarding Pipeline P4Info retrieval
Current difficulty
Currently, reconfiguring an already running BMV2 is not possible because de p4info object is created and kept when the device is first configured by the connecting controller, but what if we want to connect to a running device and not re-program it?
Added functionality
The P4Runtime allows us to retrieve the P4Info object, and this will allow us to use the Helper to read and write to the device.
So a small function was added to the switch.py which allows us to retrieve the P4Info object.
Generic decoder
Current difficulty
If connecting to an already running device, we might not know what type of entries this already has in its table, which can make it difficult to decode the values in its match fields.
Added functionality
Added a more generic decode function to convert.py that checks if the value is either a MAC, IP or a numeric value, and decodes it accordingly.