Added guide to add table entries in P4 dpdk using native control plan…#116
Added guide to add table entries in P4 dpdk using native control plan…#116swaroopsarma merged 10 commits intop4lang:mainfrom
Conversation
|
@jafingerhut please review this |
swaroopsarma
left a comment
There was a problem hiding this comment.
initial placement comments
|
@swaroopsarma I have made the changes can you review them |
|
Makefile in e2e-test p4rt missing |
|
The gitignore file has mentioned Makefile so should i remove it from there or I add that part in the guide?? |
you can still add it with git add -f though its in gitignore |
|
@swaroopsarma I have added the makefile |
The makefile I see added in the PR is an empty file. That was not the intent of the comment, I don't think. |
|
@jafingerhut I have updated the code of makefile |
I would be happy to do so when I have some time to try out the steps and see if they work. I would like to ask: have you tried out the steps in your instructions and successfully installed the necessary software on a aystem of your own, and successfully run the test P4 program and control plane code interacting with it? |
Davide Scano and I discussed this PR today. My apologies for not commenting on this much sooner. My preference would be that before I review this, I would really want someone else to confirm the following: I (person X, not Andy) started from version Y of Linux distribution Z (e.g. Ubuntu 22.04 or Ubuntu 24.04 are ideal, but others are OK, too), and followed exactly the sequence of steps S, using the changes in this PR, to install all of the software required. As a result, I could run this "hello world" style example, i.e. compiling some simple P4 program and adding table entries and sending test packets through. And, it all works. I am not personally interested in spending hours of experimentation to learn what those steps might be. I'd rather be told what they are, and have someone else confirm that they work. |
|
@jafingerhut I am working on this. Some steps are not working , I will update those steps and will update the pr soon |
Thanks for doing that. I would also recommend that for ease of following the instructions by others in the future, that all of the installation steps before the step "Verify P4RT Installation" would be good to put into a Bash script as a separate file. Then the install instructions can be reduced to simply "Run this command:" with a command something like |
|
sure will do that
|
f99ec0d to
764c376
Compare
|
@Dscano @jafingerhut can you please review it, I have tested these instructions on a Ubuntu22.04 VM and my switch started and it was running fine |
764c376 to
83aaf84
Compare
|
Can you add riyazahm22 and jafingerhut to the reviewers? |
@riyazahm22 can you please review this pr |
|
@Dscano @swaroopsarma @jafingerhut @riyazahm22 can you please review this pr |
ef6c02a to
49eb2f5
Compare
|
@swaroopsarma this was the error In file included from /home/p4/sde/install/include/tdi/common/tdi_attributes.hpp:35,
from /home/p4/sde/install/include/tdi/common/tdi_table.hpp:32,
from /home/p4/sde/install/include/tdi/common/tdi_utils.hpp:28,
from tdi_rt/tdi_port/dpdk/tdi_port_table_impl.cpp:21:
/home/p4/sde/install/include/tdi/common/tdi_table_key.hpp:198:24: error: 'virtual tdi_status_t tdi::TableKey::getValue(const tdi_id_t&, tdi::KeyFieldValue*) const' was hidden [-Werror=overloaded-virtual=]
198 | virtual tdi_status_t getValue(const tdi_id_t &field_id,
| ^~~~~~~~
In file included from ./tdi_rt/tdi_port/dpdk/tdi_port_table_impl.hpp:22,
from tdi_rt/tdi_port/dpdk/tdi_port_table_impl.cpp:23:
./tdi_rt/tdi_port/tdi_port_table_key_impl.hpp:101:16: note: by 'tdi::PortHdlInfoTableKey::getValue'
101 | tdi_status_t getValue(const tdi_id_t &field_id,
| ^~~~~~~~
/home/p4/sde/install/include/tdi/common/tdi_table_key.hpp:187:24: error: 'virtual tdi_status_t tdi::TableKey::setValue(const tdi_id_t&, const tdi::KeyFieldValue&)' was hidden [-Werror=overloaded-virtual=]
187 | virtual tdi_status_t setValue(const tdi_id_t &field_id,
| ^~~~~~~~
./tdi_rt/tdi_port/tdi_port_table_key_impl.hpp:95:16: note: by 'tdi::PortHdlInfoTableKey::setValue'
95 | tdi_status_t setValue(const tdi_id_t &field_id,
| ^~~~~~~~
/home/p4/sde/install/include/tdi/common/tdi_table_key.hpp:198:24: error: 'virtual tdi_status_t tdi::TableKey::getValue(const tdi_id_t&, tdi::KeyFieldValue*) const' was hidden [-Werror=overloaded-virtual=]
198 | virtual tdi_status_t getValue(const tdi_id_t &field_id,
| ^~~~~~~~
./tdi_rt/tdi_port/tdi_port_table_key_impl.hpp:133:16: note: by 'tdi::PortFpIdxInfoTableKey::getValue'
133 | tdi_status_t getValue(const tdi_id_t &field_id,
| ^~~~~~~~
/home/p4/sde/install/include/tdi/common/tdi_table_key.hpp:187:24: error: 'virtual tdi_status_t tdi::TableKey::setValue(const tdi_id_t&, const tdi::KeyFieldValue&)' was hidden [-Werror=overloaded-virtual=]
187 | virtual tdi_status_t setValue(const tdi_id_t &field_id,
| ^~~~~~~~
./tdi_rt/tdi_port/tdi_port_table_key_impl.hpp:127:16: note: by 'tdi::PortFpIdxInfoTableKey::setValue'
127 | tdi_status_t setValue(const tdi_id_t &field_id,
| ^~~~~~~~
/home/p4/sde/install/include/tdi/common/tdi_table_key.hpp:198:24: error: 'virtual tdi_status_t tdi::TableKey::getValue(const tdi_id_t&, tdi::KeyFieldValue*) const' was hidden [-Werror=overloaded-virtual=]
198 | virtual tdi_status_t getValue(const tdi_id_t &field_id,
| ^~~~~~~~
./tdi_rt/tdi_port/tdi_port_table_key_impl.hpp:155:16: note: by 'tdi_status_t tdi::PortStrInfoTableKey::getValue(const tdi_id_t&, std::string*) const'
155 | tdi_status_t getValue(const tdi_id_t &field_id, std::string *value) const;
| ^~~~~~~~
/home/p4/sde/install/include/tdi/common/tdi_table_key.hpp:187:24: error: 'virtual tdi_status_t tdi::TableKey::setValue(const tdi_id_t&, const tdi::KeyFieldValue&)' was hidden [-Werror=overloaded-virtual=]
187 | virtual tdi_status_t setValue(const tdi_id_t &field_id,
| ^~~~~~~~
./tdi_rt/tdi_port/tdi_port_table_key_impl.hpp:153:16: note: by 'tdi_status_t tdi::PortStrInfoTableKey::setValue(const tdi_id_t&, const std::string&)'
153 | tdi_status_t setValue(const tdi_id_t &field_id, const std::string &value);
| ^~~~~~~~
cc1plus: all warnings being treated as errors
make[4]: *** [Makefile:2651: tdi_rt/tdi_port/dpdk/libbfrt_la-tdi_port_table_impl.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/p4/sde/p4-dpdk-target/src'
make[3]: *** [Makefile:3083: all-recursive] Error 1
make[3]: Leaving directory '/home/p4/sde/p4-dpdk-target/src'
make[2]: *** [Makefile:1181: all] Error 2
make[2]: Leaving directory '/home/p4/sde/p4-dpdk-target/src'
make[1]: *** [Makefile:529: all-recursive] Error 1
make[1]: Leaving directory '/home/p4/sde/p4-dpdk-target'
make: *** [Makefile:416: all] Error 2
(.venv) p4@p4dev:~/sde/p4-dpdk-target$ |
Signed-off-by: Vineet1101 <[email protected]>
Signed-off-by: Vineet1101 <[email protected]>
removed them |
Dscano
left a comment
There was a problem hiding this comment.
@Vineet1101 I suggest taking a quick pass over the changes before pushing. A few times the updates were only partially correct.
Sorry for that I thought both the sections should be removed |
To summarize, keep the section titled Remove the following sections:
|
Signed-off-by: Vineet1101 <[email protected]>
There are two files |
In my opinion, we can delete the README file and keep only README.md. What do you think @swaroopsarma ? |
Signed-off-by: Vineet1101 <[email protected]>
@swaroopsarma, do you have any thoughts on this? |
Fix should be otherway around. I believe this is warning with latest compilers. The reporting routines are missing override final to tell compiler that we are overriding these routines from base class without which those base class will be hidden and compiler is indicating same. SO isuggest to add override final which is our intention |
Signed-off-by: Vineet1101 <[email protected]>
Dscano
left a comment
There was a problem hiding this comment.
The section text looks good, but the build_p4dpdk_ubuntu "job" needs to pass.
Signed-off-by: Vineet1101 <[email protected]>
|
@Vineet1101 if you dont find a matching function to override , your initial version of using base class is right thing for those. I missed those details when proposing to add override. |
Ok even when I tried to build using override it was failing |
Signed-off-by: Vineet1101 <[email protected]>
|
@Dscano @swaroopsarma the build was completed so can we merge this?? |
|
So can we merge this?? |
PR Title: Add Guide for Adding Table Entries to P4 DPDK Using Native Control Plane API
Description:
This PR adds a comprehensive guide on how to add table entries to a P4 DPDK pipeline using its native control plane API. The guide walks through the necessary steps to interact with the P4 DPDK control plane, providing an in-depth explanation of:
Related Issues:
Fixes #27