Code Monkey home page Code Monkey logo

tdi's Issues

Lot of pylint errors on TDI python code

$ 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)

info() command available inside table returning incorrect PIPE info details

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).

Parenthesis "()" in key field name is not properly handled in tdicli.py

At line number

p_name = name.decode('ascii').replace('$', '').replace('-', '_').replace(':', '_').replace('[', '_').replace(']', '_')
few of the special characters in key name is replaced with appropriate characters such that tdi cli does not throw error (i.e., These key names are used as python method argument identifiers, python identifiers has to be alpha numeric and it cannot contain special characters).
When referred to p4 spec, "isValid()" is also an allowed key name, so this key also has to be handled properly (i.e., replacement for "()")

Build artifacts and include files are copied during cmake and make

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):

  1. until make install is called the customer wants ${CMAKE_INSTALL_PREFIX} to be untouched.
  2. make uninstall should clean any file copied or created in ${CMAKE_INSTALL_PREFIX}

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.

Error building TDI

Hi,

I'm trying to build TDI but i get this error, do you have any clue to solve it?
Screenshot from 2022-08-08 17-56-04

Interoperation with obsdb

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.

Build instruction in README.md needs update

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.

Standalone build is not working on Fedora 33

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.