p4lang / tdi Goto Github PK
View Code? Open in Web Editor NEWTable-Driven Interface (TDI) for a P4-programmable backend device.
License: Apache License 2.0
Table-Driven Interface (TDI) for a P4-programmable backend device.
License: Apache License 2.0
$ pylint -E tdi_python/tdicli.py
************* Module tdicli
third-party/tdi/tdi_python/tdicli.py:61:4: E0101: Explicit return in init (return-in-init)
third-party/tdi/tdi_python/tdicli.py:260:15: E1101: Class 'value' has no 'decode' member (no-member)
third-party/tdi/tdi_python/tdicli.py:461:27: E1101: Instance of 'TDIContext' has no '_get_children' member (no-member)
third-party/tdi/tdi_python/tdicli.py:467:33: E1101: Instance of 'TDIContext' has no '_parent_node' member (no-member)
third-party/tdi/tdi_python/tdicli.py:474:18: E1101: Instance of 'TDIContext' has no '_parent_node' member (no-member)
third-party/tdi/tdi_python/tdicli.py:815:24: E1101: Instance of 'TDILeaf' has no 'get_default' member (no-member)
third-party/tdi/tdi_python/tdicli.py:906:12: E1111: Assigning result of a function call, where the function has no return (assignment-from-no-return)
third-party/tdi/tdi_python/tdicli.py:906:27: E1120: No value for argument 'type' in function call (no-value-for-parameter)
third-party/tdi/tdi_python/tdicli.py:916:12: E1111: Assigning result of a function call, where the function has no return (assignment-from-no-return)
third-party/tdi/tdi_python/tdicli.py:916:27: E1120: No value for argument 'type' in function call (no-value-for-parameter)
third-party/tdi/tdi_python/tdicli.py:926:12: E1111: Assigning result of a function call, where the function has no return (assignment-from-no-return)
third-party/tdi/tdi_python/tdicli.py:926:27: E1120: No value for argument 'type' in function call (no-value-for-parameter)
third-party/tdi/tdi_python/tdicli.py:2278:20: E1101: Instance of 'TdiCli' has no 'cIntf_cls' member (no-member)
From the application though I passed the pipe=1 to the INFO command that is available inside the table run from the PIPE-0, it returning the PIPE-0 table information instead of PIPE-1 table information.
The expectation is: It should return the PIPE-1 table information as passed pipe=1 as the param.
Our application would call the TDI code to get the info.
But In the definition of TDILeaf.info() function. it will not receive PIPE-ID as parameter.
TDILeaf.info(self, return_info, print_info)
The workaround we found is: If user wants to get the info for pipe1, then he has to go into pipe1 node in cli and run info(pipe=1).
At line number
Line 1103 in 22cb07a
We have found that during the cmake stage itself all the header files of tdi and its third-party are copied to ${CMAKE_INSTALL_PREFIX}/include/
Few instances here:
https://github.com/p4lang/tdi/blob/22cb07ac887491450d2efdb65cca727f99ecd317/CMakeLists.txt#L15C1-L17C26
https://github.com/p4lang/target-utils/blob/455fc4787a199978e0ae53bd2a6eb0cd2af1b790/CMakeLists.txt#L54
Also during make, libraries are copied to ${CMAKE_INSTALL_PREFIX}/lib. Such as below:
├── libcjson.a
├── libclish.so
├── libtarget_sys.so
├── libtarget_utils.so
├── libtdi_json_parser.so
├── libtdi_pna.so
├── libtdi_psa.so
├── libtdi.so
└── libtdi_tna.so
Is this a standard practice?
From a usability point, these are the following customer requirements we are not able to meet (because of it):
Probable alternative:
Copy all the libs/artifacts to ${CMAKE_BINARY_DIR} so that we can internally include/link and proceed with the build.
Only "make install" should ideally copy the artifacts.
In this way we can reverse everything done by make install by using make uninstall.
TDI Python CLI: New enhancement Flags object to allow user to set/modify the flags value for associating the APIs.
Note: For DPDK, we just use the default value from initialization since the backend don't support this.
For other targets, we might need to have this capability.
Has there been any consideration given to the goal of interoperating with a DB such as OVSDB which is also designed for managing SDNs? OVSDB has its own JSON format.
The current build instruction cmake -DCMAKE_INSTALL_PREFIX=../install ..
does not work with latest commit.
Need to use cmake -DSTANDALONE=on -DCMAKE_INSTALL_PREFIX=../install ..
instead.
TDI parser needs to parsing the attributes field and populate the attributes_set correctly instead of using the class initialized the value (ENTRY_SCOPE = 0).
For the PortStat table,
"supported_operations" : [],
"attributes" : ["poll_intvl_ms"]
For the PortCfg table:
"supported_operations" : [],
"attributes" : ["port_status_notif_cb"]
Using generic Fedora and Ubuntu envs, building TDI as per the last couple of lines of the README fails with a cmake error. This is in part because the submodules need to be initialized and updated (which should be noted with the build notes). But even after that, cmake reports errors like:
`
-- Looking for inet_network - found
CMake Error at third-party/target-utils/third-party/CMakeLists.txt:45 (add_subdirectory):
The source directory
.../tdi/third-party/target-utils/third-party/cJSON
does not contain a CMakeLists.txt file.
`
and
`
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
EXPAT_LIB
linked by target "clish" in directory .../tdi/third-party/target-utils/third-party/klish
LIBEDIT_LIBRARIES (ADVANCED)
linked by target "clish" in directory .../tdi/third-party/target-utils/third-party/klish
-- Configuring incomplete, errors occurred!
`
Glancing at the CMakeFiles/CMakeErrors.log, maybe it's just some prereq packages that need to be installed? pcap.h, floor, pow, sqrt are mentioned as undefined.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.