Giter VIP home page Giter VIP logo

ipdk's People

Contributors

5abeel avatar abdulawal1 avatar artek-koltun avatar asafravid avatar bartlomiejx avatar bharticemk avatar dandaly avatar dependabot[bot] avatar ffoulkes avatar glimchb avatar idandaly avatar intelfisz avatar ipdksw avatar jakubsikorski avatar kamleshbhalui avatar kkongusa avatar llabordehpe avatar mestery avatar mgaravin avatar n-sandeep avatar namrata-intel avatar namratalimaye avatar nupuruttarwar avatar pkulax avatar qzhan16 avatar rilnickx avatar rst0git avatar saynb avatar stolsma avatar vsureshkumarp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipdk's Issues

Error running ipdk demo on Fedora 33

The following error is observed while running ipdk demo on Fedora 33:
Creating vhost-user ports
Return grpc errno (14), Reason: failed to connect to all addresses
Return grpc errno (14), Reason: failed to connect to all addresses
Generating simple_l3 pipeline package with P4C and OVS pipeline builder
I20220207 23:07:56.364490 567 bf_pipeline_builder.cc:113] Found P4 program: simple_l3
I20220207 23:07:56.364598 567 bf_pipeline_builder.cc:120] Found pipeline: pipe
Programming P4-OVS pipeline
CRITICAL:root:StreamChannel error, closing stream
CRITICAL:root:P4Runtime RPC error (UNAVAILABLE): failed to connect to all addresses
CRITICAL:root:Failed to establish session with server
Add table rules to the pipeline
CRITICAL:root:StreamChannel error, closing stream
CRITICAL:root:P4Runtime RPC error (UNAVAILABLE): failed to connect to all addresses
CRITICAL:root:Failed to establish session with server
CRITICAL:root:StreamChannel error, closing stream
CRITICAL:root:P4Runtime RPC error (UNAVAILABLE): failed to connect to all addresses
CRITICAL:root:Failed to establish session with server

Error building p4-sde

Seeing the following error consistently when running source start_p4ovs.sh /root after running make volume. Any pointers as to what is going wrong here?

make[4]: Entering directory '/root/p4-sde/p4-driver/src'                                                                   
  CCLD     libutils.la                                                                                                     
  CC       bf_rt/cli/bfshell_plugin_bf_rt_la-bf_rt_cli.lo                                                                  
  CC       pipe_mgr/core/bfshell_plugin_pipemgr_la-pipe_mgr_cli.lo                                                       
In file included from ../include/pipe_mgr/shared/pipe_mgr_mat.h:28,                                                                       
                         from ../include/pipe_mgr/pipe_mgr_intf.h:34,                                                                             
                         from ../include/bf_rt/bf_rt_common.h:26,                                                                                 
                         from ../include/bf_rt/bf_rt_init.h:19,                                                                                   
                         from bf_rt/cli/bf_rt_cli.c:19:                                                                          
../include/osdep/p4_sde_osdep.h:10:10: fatal error: target_sys/bf_sal/bf_sys_intf.h: No such file or directory              
   10 | #include <target_sys/bf_sal/bf_sys_intf.h>                                                                             
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                       
compilation terminated.                                                                                                  
make[4]: *** [Makefile:1579: bf_rt/cli/bfshell_plugin_bf_rt_la-bf_rt_cli.lo] Error 1                                     
make[4]: *** Waiting for unfinished jobs....                                                                             
pipe_mgr/core/pipe_mgr_cli.c:16:10: fatal error: target_utils/clish/shell.h: No such file or directory                      
     16 | #include "target_utils/clish/shell.h"                                                                                  
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                            
compilation terminated.                                                                                                  
make[4]: *** [Makefile:1593: pipe_mgr/core/bfshell_plugin_pipemgr_la-pipe_mgr_cli.lo] Error 1                            
make[4]: Leaving directory '/root/p4-sde/p4-driver/src'                                                                  
make[3]: *** [Makefile:2391: all-recursive] Error 1                                                                      
make[3]: Leaving directory '/root/p4-sde/p4-driver/src'                                                                  
make[2]: *** [Makefile:965: all] Error 2                                                                                 
make[2]: Leaving directory '/root/p4-sde/p4-driver/src'                                                                  
make[1]: *** [Makefile:521: all-recursive] Error 1                                                                       
make[1]: Leaving directory '/root/p4-sde/p4-driver'                                                                      
make: *** [Makefile:408: all] Error 2                                                                                    
make: *** [Makefile:56: volume] Error 2                     

Include SDE build steps in the dockerfile itself & do some cleanup

The steps starting at

4) Clone and install dependencies using
are done from within the container. This adds manual steps and also means the changes are ephemeral - if you lose the container you'd have to redo everything, and it is fairly time-consuming. (It took nearly a full day to completely build and modify the container - I have slowish downlink) In my case I did a docker commit of the running container to a new image to preserve it.

Could those steps 4-5, (possibly #6) be moved into the dockerfile to reduce effort and result in a more complete, durable image?

Also, I think the image could benefit from some cleanup after all the installing is done. The docker commit following SDE install produced a 13GB image! See below - the first image is the committed container after SDE install.

$ docker images
REPOSITORY         TAG       IMAGE ID       CREATED       SIZE
ipdk               latest    b801f17e5efd   11 days ago   13.3GB
ipdk/p4-ovs-fc33   1e7b540   96137ba4f7bf   11 days ago   1.67GB
fedora             33        a5465556eeb2   6 weeks ago   172MB

Ubuntu20.04, error upon build_p4sde.sh within start_p4ovs.sh

What could cause the below failure upon invocation of build_p4sde.sh within start_p4ovs.sh?

Found ninja-1.10.0 at /usr/bin/ninja
[2264/2745] Compiling C object 'lib/76b5a35@@rte_vhost@sta/vhost_vhost_crypto.c.o'.
FAILED: lib/76b5a35@@rte_vhost@sta/vhost_vhost_crypto.c.o
cc -Ilib/76b5a35@@rte_vhost@sta -Ilib -I../lib -Ilib/vhost -I../lib/vhost -I. -I../ -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/x86/include -I../lib/eal/x86/include -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/telemetry/../metrics -I../lib/telemetry/../metrics -Ilib/telemetry -I../lib/telemetry -Ilib/ethdev -I../lib/ethdev -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/meter -I../lib/meter -Ilib/cryptodev -I../lib/cryptodev -Ilib/rcu -I../lib/rcu -Ilib/hash -I../lib/hash -Ilib/pci -I../lib/pci -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -march=native -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DVHOST_GCC_UNROLL_PRAGMA -fno-strict-aliasing -DRTE_LOG_DEFAULT_LOGTYPE=lib.vhost -MD -MQ 'lib/76b5a35@@rte_vhost@sta/vhost_vhost_crypto.c.o' -MF 'lib/76b5a35@@rte_vhost@sta/vhost_vhost_crypto.c.o.d' -o 'lib/76b5a35@@rte_vhost@sta/vhost_vhost_crypto.c.o' -c ../lib/vhost/vhost_crypto.c
{standard input}: Assembler messages:
{standard input}:1867: Warning: end of file not at end of a line; newline inserted
{standard input}:3330: Error: unknown pseudo-op: `.lcolde'
cc: fatal error: Killed signal terminated program cc1
compilation terminated.
[2311/2745] Compiling C object 'drivers/a715181@@tmp_rte_event_octeontx2@sta/event_octeontx2_otx2_worker_dual.c.o'.
ninja: build stopped: subcommand failed.
make[4]: *** [Makefile:480: all] Error 1
make[4]: Leaving directory '/root/p4-sde/p4-driver/src/lld/dpdk'
make[3]: *** [Makefile:2392: all-recursive] Error 1
make[3]: Leaving directory '/root/p4-sde/p4-driver/src'
make[2]: *** [Makefile:966: all] Error 2
make[2]: Leaving directory '/root/p4-sde/p4-driver/src'
make[1]: *** [Makefile:522: all-recursive] Error 1
make[1]: Leaving directory '/root/p4-sde/p4-driver'
make: *** [Makefile:409: all] Error 2
Makefile:56: recipe for target 'volume' failed
make: *** [volume] Error 2
root@pt-dtl3992:/local/store/docker/ipdk/build/IPDK_Container/Ubuntu20.04#

The main issue is that once there's a failure the whole docker stops, and I cannot debug the issue and it takes very long to re-reach the point of failure

ovs-p4ctl dump-entries fails

Trying to dump entries from a P4-OVS switch and it's failing:

root@ubuntu2004:~# ovs-p4ctl dump-entries ovs-p4
Table entries for bridge ovs-p4:
Error: <_MultiThreadedRendezvous of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "One or more read operations failed."
	debug_error_string = "{"created":"@1641404328.702716142","description":"Error received from peer ipv4:127.0.0.1:9559","file":"src/core/lib/surface/call.cc","fil"
>
root@ubuntu2004:~#

"benign" warning? ovs-vswitchd: error while loading shared libraries: libtarget_utils.so: cannot open shared object file: No such file or directory

Looks like all is up now, just verifying the below error can be safely ignored?

root@05eb99eb621b:~/P4-OVS# /root/scripts/run_ovs.sh
Killing OVS Processes If Already Running....
Creating /var/run/openvswitch
Starting OvS DB server....
Staring OvS VSWITCHD Process....
ovs-vswitchd: error while loading shared libraries: libtarget_utils.so: cannot open shared object file: No such file or directory
root@05eb99eb621b:~/P4-OVS# ps -ef | grep ovs
root       87864       1  0 21:03 ?        00:00:00 ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
root       87868       1  0 21:04 pts/0    00:00:00 grep --color=auto ovs
root@05eb99eb621b:~/P4-OVS#

Some systems require more sudo apt-get install packages for build_p4c to run successfully

build_p4c () {
    chmod +x ${SCRIPTS_DIR}/build_p4c.sh && \
        ${SHELL_STRING} ${SCRIPTS_DIR}/build_p4c.sh "$WORKDIR"
}

Within it cmake -DENABLE_BMV2=OFF -DENABLE_EBPF=OFF -DENABLE -DENABLE_P4C_GRAPHS=OFF -DENABLE_P4TEST=OFF -DENABLE_GTESTS=OFF .. may fail if FLEX_EXECUTABLE is missing:

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find FLEX (missing: FLEX_EXECUTABLE) (Required is at least
  version "2.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindFLEX.cmake:220 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:104 (find_package)

Solution, have sudo apt-get install flex be called prior (or earlier in Dockerfile)

"sudo gnmi-cli set "device:..." step fails in Section 2

From within the container (ovsdb server running well), The following step in the readme (stage 2

~/scripts# sudo gnmi-cli set "device:virtual-device,name:net_vhhost0,host:host1,\
       device-type:VIRTIO_NET,queues:1,socket-path:/tmp/vhost-user-0,\
       port-type:LINK"
Return grpc errno (14), Reason: failed to connect to all addresses
root@82a4bd994e76:~/scripts#

What am I missing?

Sectio 2 steps:

root@82a4bd994e76:~/scripts# ps -ef | grep ovs
root        27     1  0 18:58 ?        00:00:00 ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
root        43     1  0 19:00 pts/0    00:00:00 grep --color=auto ovs
root@82a4bd994e76:~/scripts# rm -rf /tmp/vhost-user-*
t/p4-sde/install6:~/scripts# cd /root/scripts/ && source p4ovs_env_setup.sh /root
OS and Version details...
Ubuntu : 20.04


Updated Environment Variables ...
SDE_INSTALL: /root/p4-sde/install
PKG_CONFIG_PATH: /root/p4-sde/install/lib/aarch64-linux-gnu/pkgconfig
LIBRARY_PATH:
LD_LIBRARY_PATH: :/root/p4-sde/install/lib:/root/p4-sde/install/lib64:/root/p4-sde/install/lib/aarch64-linux-gnu:/usr/local/lib:/usr/local/lib64:/root/p4-sde/install/lib:/root/p4-sde/install/lib64:/root/p4-sde/install/lib/aarch64-linux-gnu:/usr/local/lib:/usr/local/lib64
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
C_INCLUDE_PATH:
CPLUS_INCLUDE_PATH:

RY_PATH="$LD_LIBRARY_PATH"'# alias sudo='sudo PATH="$PATH" HOME="$HOME" LD_LIBRAR
host0,host:host1,\~/scripts# sudo gnmi-cli set "device:virtual-device,name:net_vh
>        device-type:VIRTIO_NET,queues:1,socket-path:/tmp/vhost-user-0,\
>        port-type:LINK"

Return grpc errno (14), Reason: failed to connect to all addresses
root@82a4bd994e76:~/scripts#
host0,host:host1,\~/scripts# sudo gnmi-cli set "device:virtual-device,name:net_vh
       device-type:VIRTIO_NET,queues:1,socket-path:/tmp/vhost-user-0,\
       port-type:LINK"
Return grpc errno (14), Reason: failed to connect to all addresses
root@82a4bd994e76:~/scripts#

"terminate called after throwing an instance of 'bfrt::(anonymous namespace)::fileOpenFailException'" upon invocation of "/root/scripts/run_ovs.sh"

Upon invocation of root@df5632ec08ff:~/scripts# /root/scripts/run_ovs.sh

I get and error: BF_BFRT FATAL - Unable to find any BfRt Json File

root@df5632ec08ff:~/scripts# /root/scripts/run_ovs.sh
Killing OVS Processes If Already Running....
Killing ovsdb-server process....
Creating /var/run/openvswitch
Starting OvS DB server....
Staring OvS VSWITCHD Process....
2022-01-10T20:54:07Z|00001|vlog|INFO|opened log file /tmp/ovs-vswitchd.log
2022-01-10T20:54:07Z|00002|ovs_numa|INFO|Discovered 24 CPU cores on NUMA node 0
2022-01-10T20:54:07Z|00003|ovs_numa|INFO|Discovered 1 NUMA nodes and 24 CPU cores
WARNING: Logging before InitGoogleLogging() is written to STDERR
I20220110 20:54:07.516815 18364 bf_sde_wrapper.cc:1530] bf_sysfs_fname: /sys/class/bf/bf0/device/dev_add
Install dir: /usr (0xaaaaba385a70)
bf_switchd: system services initialized
bf_switchd: loading conf_file /usr/share/stratum/target_skip_p4_no_bsp.conf...
bf_switchd: processing device configuration...
Configuration for dev_id 0
  Family        : dpdk
bf_switchd: processing P4 configuration...
P4 profile for dev_id 0
P4 EAL args dummy -n 4 -c 3
num P4 programs 1
  p4_name: dummy
  bfrt_config:
  port_config:
  p4_pipeline_name: pipe
    context:
    config:
  Pipes in scope [0 1 2 3 ]
  diag:
  accton diag:
  non_default_port_ppgs: 0
  SAI default initialize: 1
Operational mode set to DPDK MODEL
Initialized the device types using PAL handler registration
bf_switchd: drivers initialized
Skipping P4 program load for dev_id 0
EAL: Detected CPU lcores: 24
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: No available 16777216 kB hugepages reported
EAL: 1024 hugepages of size 2097152 reserved, but no mounted hugetlbfs found for that size
EAL: VFIO support initialized
TELEMETRY: No legacy callbacks, legacy socket not created
2022-01-10 20:54:08.064048 BF_BFRT FATAL - Unable to find any BfRt Json File
terminate called after throwing an instance of 'bfrt::(anonymous namespace)::fileOpenFailException'
terminate called recursively
2022-01-10T20:54:09Z|00002|daemon_unix|ERR|fork child died before signaling startup (killed (Aborted), core dumped)
ovs-vswitchd: could not detach from foreground session
root@df5632ec08ff:~/scripts#

Any ideas how to approach/fix this?

Environment is arm64 (aarch64)

Cleanup the documentation and build instructions and code

Now that we merged #37 and #38, we should cleanup the documentation at the top level to make things a bit more clear as to what is going on. For example, the majority of the Makefile logic is no longer necessary. This issue will track the removal of the old cruft, and a better organization of the documentation.

Missing SCRIPT_DIR=<path> in README_NATIVE if using a proxy?

README_NATIVE.md instructions say to use this command if you are not using a proxy:

root@ubuntu2004:~# SCRIPT_DIR=/git/ipdk/build/scripts /git/ipdk/build/scripts/host_install.sh

but to use this command (note no SCRIPT_DIR=) if you are using a proxy:

root@ubuntu2004:~# /git/ipdk/build/scripts/host_install.sh -p [proxy name]

Should the proxy version be this instead?

root@ubuntu2004:~# SCRIPT_DIR=/git/ipdk/build/scripts /git/ipdk/build/scripts/host_install.sh -p [proxy name]

Failure building gnmi_cli.cc with ubuntu container image

Seeing the following error after applying #81

/bin/bash ./libtool  --tag=CC   --mode=link gcc -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow -Wmultistatement-macros -Wcast-align=strict -I/root/p4-sde/install/include    -O0 -g  -L/root/p4-sde/install/lib -L/root/p4-sde/install/lib/x86_64-linux-gnu   -o utilities/ovs-vsctl utilities/ovs-vsctl.o lib/libopenvswitch.la -lbf_switchd_lib -ltarget_sys -ltarget_utils -ldriver -lpython3.8 -lstdc++ -ldpdk_infra -latomic -lpthread -lrt -lm  -lunwind
libtool: link: gcc -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow -Wmultistatement-macros -Wcast-align=strict -I/root/p4-sde/install/include -O0 -g -o utilities/ovs-vsctl utilities/ovs-vsctl.o  -L/root/p4-sde/install/lib -L/root/p4-sde/install/lib/x86_64-linux-gnu lib/.libs/libopenvswitch.a /root/P4-OVS/lib/.libs/libopenvswitchavx512.a -L../src /root/p4-sde/install/lib/libbf_switchd_lib.so -lclish -lcjson -ltarget_sys /root/p4-sde/install/lib/libdriver.so -ltarget_utils -ldl -lpython3.8 -lstdc++ -ldpdk_infra -latomic -lpthread -lrt -lm -lunwind -Wl,-rpath -Wl,/root/p4-sde/install/lib -Wl,-rpath -Wl,/root/p4-sde/install/lib
g++ -DHAVE_CONFIG_H -I.    -I ./include -I ./include -I ./lib -I ./lib  -I /root/p4-sde/install/include   -I ./p4proto/p4rt/proto/p4 -I /usr/local/include   -g -O2 -MT utilities/gnmi_cli-gnmi_cli.o -MD -MP -MF utilities/.deps/gnmi_cli-gnmi_cli.Tpo -c -o utilities/gnmi_cli-gnmi_cli.o `test -f 'utilities/gnmi_cli.cc' || echo './'`utilities/gnmi_cli.cc
utilities/gnmi_cli.cc:11:10: fatal error: gflags/gflags.h: No such file or directory
   11 | #include "gflags/gflags.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:7561: utilities/gnmi_cli-gnmi_cli.o] Error 1
make[2]: Leaving directory '/root/P4-OVS'
make[1]: Leaving directory '/root/P4-OVS'
make[1]: *** [Makefile:7980: all-recursive] Error 1
make: *** [Makefile:4413: all] Error 2
make  install-recursive
make[1]: Entering directory '/root/P4-OVS'

Question regarding NUM_CORES and NUM_THEADS

What is the motivation of dividing NUM_CORES by 4, why can't all available cpus be used?

get_num_cores()
{
   nproc_exist=$(which nproc)
   if [ ! -z "$nproc_exist" ];
   then
       NUM_CORES=$(nproc --all)
       echo "Num cores on a system: $NUM_CORES"
       if [ "$NUM_CORES" -gt 4 ]
       then
           NUM_THREADS=$(($NUM_CORES / 4))
           NUM_THREADS=-j$NUM_THREADS
       fi
else
    NUM_CORES=""
fi
}

qcow VM more elaborated instructions

In the informative readme, (so as to make it more informative / efficient) Can you please provide a link (or better yet, add your step by step instructions) demonstrating how to run a qcow vm and which image you used? I’m having trouble running / logging into the VM using ssh so searching for a simpler way and/or something to save time here and concentrate on the ovs traffic part

Much appreciated

On certain rootfs the /etc/resolv.conf has the default (ubuntu image pull) nameserver 8.8.8.8 instead of required one and requires a workaround

Due to some restrictions on the rootfs (using the thin provisioning storage), the /etc/resolv.conf is unchangeable (I think due to certain rottfs restrictions)

Hence, my workaround (which works well, but I suppose a cleaner way should be committed):

RUN echo "nameserver 10.5.102.111" >> /etc/resolv.conf && cat /etc/resolv.conf && apt-get update
For each RUN command as each RUN command runs in its own container rendering any change in /etc/resolv.conf irrelevant for the following RUN command (within Dockerfile)

Suggestions (apart from my workaround above)?

How about running the whole thing in a single RUN command? Or making the /etc/resolv.conf stateful (meaning it remains the same after being changed, during the following RUN command within the Dockerfile)?

Error: P4Runtime RPC error (INTERNAL): 'bf_pal_device_add(device, &device_profile)' failed with error message: Unexpected error

Hi,

I am trying to bring up P4-ovs with simple_l3 p4 backend on an Ubuntu baremetal server. When I try to configure the forwarding plane as per the example, I get this error :
Error: P4Runtime RPC error (INTERNAL): 'bf_pal_device_add(device, &device_profile)' failed with error message: Unexpected error.

Please Note, this works perfectly with Fedora server.

Logs from p4_driver.log:
2021-11-24 21:07:33.400521 INFO BF_DVM bf_device_warm_init_begin:218 Entering WARM_INIT_BEGIN for device 0 with warm_init_mode 1
2021-11-24 21:07:33.400585 INFO BF_DVM bf_device_warm_init_begin:255 Exiting WARM_INIT_BEGIN for device 0
2021-11-24 21:07:33.400713 INFO BF_DVM bf_device_add dev id 0, is_sw_model 1
2021-11-24 21:07:33.400749 INFO BF_LLD Entering :lld_dev_add

2021-11-24 21:07:33.400760 INFO BF_LLD Exiting :lld_dev_add

2021-11-24 21:07:33.400778 INFO BF_PORT Entering port_mgr_dev_add
2021-11-24 21:07:33.400793 INFO BF_PORT Enter port_mgr_config_import
2021-11-24 21:07:33.400815 INFO BF_PORT port_mgr_config_import: device 0, file (null)
2021-11-24 21:07:33.400824 INFO BF_PORT Exit port_mgr_config_import
2021-11-24 21:07:33.400950 ERROR BF_PIPE Error -17 at line 6: Struct registration error.
.
2021-11-24 21:07:33.401045 ERROR BF_DVM Device add handling failed for dev 0, sts Unexpected error (15), Client pipe-mgr
2021-11-24 21:07:33.401067 ERROR BF_DVM Device add failed for dev 0, sts Unexpected error (15)
2021-11-24 21:07:33.401088 INFO BF_PORT Entering port_mgr_dev_remove
2021-11-24 21:07:33.401107 INFO BF_PORT Entering port_mgr_cleanup
2021-11-24 21:07:33.401116 INFO BF_PORT Already cleaned up. Exiting port_mgr_cleanup

Kind Regards,
Dhanya

Following README_HOST_INSTALL.md instructions causes host_install.sh to have a couple of errors

I followed the instructions as of this commit of this entire repo:

commit 115c67d8d2bf26b4974fe57bbfb0a4c5a5c679c8
Merge: 9e8c855 01e0854
Author: Kyle Mestery <[email protected]>
Date:   Tue Jan 11 12:23:22 2022 -0600

    Merge pull request #52 from mestery/ebpf
    
    build_p4c.sh: Enable eBPF p4c backend

with only one very small modification, done so I could see more clearly what the host_install.sh script was doing: I added a new line set -x before the first real line of the host_install.sh script before executing the command /git/ipdk/scripts/host_install.sh. Here was what I saw near the beginning of the output from running /git/ipdk/scripts/host_install.sh:

+ source os_ver_details.sh
/git/ipdk/scripts/host_install.sh: line 9: os_ver_details.sh: No such file or directory
+ get_os_ver_details
/git/ipdk/scripts/host_install.sh: line 10: get_os_ver_details: command not found

It seems like either host_install.sh should be modified so that the command source os_ver_details.sh successfully finds the file it is trying to source, if the later script actually needs it, or if it does not, then delete those two lines. It is not clear to me whether the later parts of the host_install.sh script actually need those two lines to execute first.

Explain edit http-proxy instructions in README

I suggest to edit

1) Edit the IPDK_Container/docker.env and IPDK_Container/start_p4ovs.sh files
a little better, folks are having trouble with this step.

In my case, I don't have a proxy, so I edited build/IPDK_Container/docker.env to comment out the line as follows:

#export PROXY=<Your Proxy> 

Likewise I ignored the already-commented-out lines in IPDK_Container/start_p4ovs.sh:

#export http_proxy=<your proxy>
#export https_proxy=<your proxy>

To be consistent, why not comment out the line in build/IPDK_Container/docker.env, then provide instructions for editing if a proxy is required, which might be the exception case anyway? Thanks.

Not use docker volume but reference to local dir?

At the moment the docker volume implementation is used for creating a location where the vhost links are put. As every distribution is using a different default location for this created directory (and Docker Desktop for Windows with WSL2 is even trying to hide it) I want to propose to use the docker -v <dir location>:/tmp directive to declare the directory to use for the /tmp location inside the container.

This directory could be one defined in the repo as that will also make it possible to share P4 pre-compiled .bin files from the host to the container and to have a default location for the path=/var/lib/docker/volumes/shared/_data/vhost-user-1 directive for VM startups.

If agreed I will take a stab at it!

Preventing the ipdk container from exiting upon each error in the bash

It is frustrating (big big overhead on slow storage) that every error in bash command line (for instance the below wrong command) makes the container exit.

root@f1b5dceeb02b:/p4-sde# cat /root/
cat: /root/: Is a directory

Makefile:57: recipe for target 'volume' failed
make: *** [volume] Error 1
root@node1:

How can this be prevented?

Can you add -dit instead of -it in the Makefile?

## Create a volume and then configure the container to use it.
volume: ;docker volume create shared; docker run --rm --cap-add ALL --privileged -v shared:/tmp -dit ${IMAGE_NAME}:${TAG}

Other suggestions are more than welcome

Additional questions and an important request:

  1. What is the difference between make volume and make run?

  2. What is the difference between make build and make build-nc? Maybe cache is preferred? I see that using make build uses previous fetches so looks like a very efficient way to run after some bash failure -> Please add this important information in the Readme (could have saved me hours and hours of work had I known about it. I digged in the Makefile and found out about it only just now)

     2) i) Run - 'make build-nc' - To build a docker image while no proxy.
        ii) Run - 'make build-nc-proxy' - To build a docker image while running
            behind proxy.
        iii) Run - 'make build' - To build a docker image while no proxy, **with cached previous build's data.** so as to save valuable re-run time. 
    

Build failure

With the latest code up to commit 52e06c4, when I run ipdk build --no-cache I see the following obtuse error and it fails:

-- Build files have been written to: /root/P4OVS_DEPS_SRC_CODE/gflags/build
make: *** empty string invalid as file name.  Stop.
The command '/bin/bash -c /root/start_p4ovs.sh /root &&      /root/scripts/run_cleanup.sh /root ${KEEP_SOURCE_CODE}' returned a non-zero code: 2
/git/ipdk/build
vagrant@ubuntu2004:/git/ipdk/build$

invalid reference format?

Hi, what does invalid reference format refer to below?

build# cd IPDK_Container/
IPDK_Container# ls
Dockerfile Ubuntu20.04 ovs-patches.md scripts
Makefile docker.env ovs-with-p4_howto start_p4ovs.sh
README examples run_ovs_cmds
IPDK_Container# docker build .
Sending build context to Docker daemon 68.61kB
Step 1/13 : ARG OS_VERSION=${OS_VERSION}
Step 2/13 : FROM fedora:${OS_VERSION} AS base
invalid reference format <----------------
IPDK_Container#

No space left on device when trying to make p4c-dpdk

Has anyone encountered No space left on device when trying to make p4c-dpdk?
I'm using

-- Installing: /usr/local/bin/p4c-dpdk
CMake Error at backends/dpdk/cmake_install.cmake:47 (file):
  file INSTALL cannot copy file "/root/P4C/build/backends/dpdk/p4c-dpdk" to
  "/usr/local/bin/p4c-dpdk": No space left on device.
Call Stack (most recent call first):
  cmake_install.cmake:50 (include)

make: *** [Makefile:74: install] Error 1


df -h
Filesystem                                        Size  Used Avail Use% Mounted on
10.5.210.2:/srv/tftpboot/aravid/cn96xx/ln_rootfs  917G  562G  309G  65% /
devtmpfs                                           24G     0   24G   0% /dev
tmpfs                                              24G     0   24G   0% /dev/shm
tmpfs                                              24G   15M   24G   1% /run
tmpfs                                             5.0M     0  5.0M   0% /run/lock
tmpfs                                              24G     0   24G   0% /sys/fs/cgroup
tmpfs                                             4.8G     0  4.8G   0% /run/user/0


~/ipdk/build/IPDK_Container/Ubuntu20.04# docker images
REPOSITORY                TAG       IMAGE ID       CREATED        SIZE
ipdk/p4-ovs-ubuntu20.04   ba2eda1   6a450e6bdd1f   2 hours ago    1.53GB
root@kub-node1-smadarf:~/ipdk/build/IPDK_Container/Ubuntu20.04#

Enable CI using GitHub Actions

This issue tracks enabling GitHub Actions to do basic CI on pull requests to the IPDK repository. For now, it's actually a bit of a brute force approach, in that we dynamically configure each Runner with the tools we need, including Docker. We next run shellcheck, followed by the full build.

Some ways to optimize this in the future:

  • Build our runner which has all the tools configured and installed.
  • Modularize the build a bit to remove redundant steps.
  • Work to get patches into upstream projects so we don't have to build
    them each time.

IPDK tutorial on Fedora 33 baremetal

I have P4-OVS and p4-sde all built successfully on Fedora 33 host.
But an error occurs with gnmi-cli for interface creation. "Return grpc errno (14), Reason: Connect Failed"

Any pointers?

make volume fails after successful make build-nc

This is a frustrating error:
After a long and successful run of the make build-nc, the make volume fails:

Step 14/18 : COPY ./start_p4ovs.sh /root/start_p4ovs_stage1.sh
 ---> fa5667d28322
Step 15/18 : COPY ./start_p4ovs.sh /root/start_p4ovs_stage2.sh
 ---> ea7d954f5ddb
Step 16/18 : COPY ./start_p4ovs.sh /root/start_p4ovs_stage3.sh
 ---> 86a5213e3b8b
Step 17/18 : COPY ./meson.build /root/meson.build
 ---> 5bff07c0f2f7
Step 18/18 : COPY ./run_ovs_cmds /root/run_ovs_cmds
 ---> 2a832892f052
Successfully built 2a832892f052
Successfully tagged ipdk/p4-ovs-ubuntu20.04:ba2eda1
root@kub-node1-smadarf:~/ipdk/build/IPDK_Container/Ubuntu20.04# make volume
docker volume create shared; docker run --rm --cap-add ALL --privileged -v shared:/tmp -itd ipdk/p4-ovs-ubuntu20.04:ba2eda1
shared
Unable to find image 'ipdk/p4-ovs-ubuntu20.04:ba2eda1' locally
docker: Error response from daemon: pull access denied for ipdk/p4-ovs-ubuntu20.04, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
Makefile:57: recipe for target 'volume' failed
make: *** [volume] Error 125

What could this be caused by?

extend the cli with `ipdk install [environment]` option

Add to the install command a possibility to change to another container environment (i.e. base image): ipdk install [environment] -> ipdk install ubuntu2004 This will make changing to another container base image a lot easier...

Confused about a line in README_NATIVE.md

One line of instructions in README_NATIVE.md says this:

Note: To skip installing and building dependencies in the future, add a -s flag to the host_install.sh script.

I am not sure, but it sounds like it is suggesting that for the same VM, someone might follow all of these instructions once, then go back and run host_install.sh again later in that same VM, but want to skip some steps.

Is it ever useful in any way to run host_install.sh on the same VM if it has ever been run before? If so, in what scenario would someone actually want to do that?

Running on target (HW)

When running make volume and then going through the steps on a host machine, the process is quite long as many libraries are cloned, processed, built, etc

For a host machine that takes ~20-30 minutes to reach step 5) in the Readme.

For the target HW, how (if at all) can this be skipped such that all is ready (cloned and **cross-**compiled for arm) for the Section 2: Example scenario setup ( VM1 <-> IPDK Container <-> VM2 ) tests?

In other words,

  1. Does the HW target need to clone, make, process (etc) all the steps in order to have the p4 ovs ready?
  2. Is there a way to prepare the docker image on host and then simply run it (with ovs ready and running) on a HW target DPU?
  3. Otherwise, as I understand, I should have Ubuntu20.04 (per available example in repo) running on the Target HW - correct?
  4. Did you guys test this on any HW (such as Marvell / Melanox DPUs)?

Fedora log when chose ubuntu

I cloned the latest head, and seeing fedora image pull instead of ubuntu

~/ipdk/build# ./ipdk install
Loaded /root/ipdk/build/scripts/ipdk_default.env

As last step execute:
  export PATH=/root/ipdk/build:$PATH
to add the IPDK CLI to your path in the running environment!
~/ipdk/build# export PATH=/root/ipdk/build:$PATH
~/ipdk/build# BASE_IMG=ubuntu:20.04
~/ipdk/build# IMAGE_NAME=ipdk/p4-ovs-ubuntu20.04
~/ipdk/build# DOCKERFILE=${SCRIPT_DIR}/Dockerfile.ubuntu
~/ipdk/build# ipdk build --no-cache
Loaded /root/ipdk/build/scripts/ipdk_default.env
Loaded /root/.ipdk/ipdk.env
~/ipdk/build ~/ipdk/build
Sending build context to Docker daemon  131.6kB
Step 1/15 : ARG BASE_IMG=${BASE_IMG}
Step 2/15 : FROM ${BASE_IMG} AS base
33: Pulling from library/fedora
c1323e24d83b: Extracting [============================================>      ]  55.15MB/61.52MB

Is this normal/ok? a typo? am I missing something?

Benign error:BF_BFRT FATAL - Unable to find any BfRt Json File

Got an apparently benign error after executing /root/scripts/run_ovs.sh per step 8 on https://github.com/ipdk-io/ipdk/blob/main/build/IPDK_Container/README:

[root@aea8dd7ac07e P4-OVS]# /root/scripts/run_ovs.sh
Killing OVS Processes If Already Running....
Creating /var/run/openvswitch
Starting OvS DB server....
Staring OvS VSWITCHD Process....
2021-11-16T19:38:41Z|00001|vlog|INFO|opened log file /tmp/ovs-vswitchd.log
2021-11-16T19:38:41Z|00002|ovs_numa|INFO|Discovered 12 CPU cores on NUMA node 0
2021-11-16T19:38:41Z|00003|ovs_numa|INFO|Discovered 1 NUMA nodes and 12 CPU cores
WARNING: Logging before InitGoogleLogging() is written to STDERR
I20211116 19:38:41.956179 94197 bf_sde_wrapper.cc:1530] bf_sysfs_fname: /sys/class/bf/bf0/device/dev_add
Install dir: /usr (0x1994410)
bf_switchd: system services initialized
bf_switchd: loading conf_file /usr/share/stratum/target_skip_p4_no_bsp.conf...
bf_switchd: processing device configuration...
Configuration for dev_id 0
  Family        : dpdk
bf_switchd: processing P4 configuration...
P4 profile for dev_id 0
P4 EAL args dummy -n 4 -c 3
num P4 programs 1
  p4_name: dummy
  bfrt_config: 
  port_config: 
  p4_pipeline_name: pipe
    context: 
    config: 
  Pipes in scope [0 1 2 3 ]
  diag: 
  accton diag: 
  non_default_port_ppgs: 0
  SAI default initialize: 1 
Operational mode set to DPDK MODEL
Initialized the device types using PAL handler registration
bf_switchd: drivers initialized
Skipping P4 program load for dev_id 0
EAL: Detected CPU lcores: 12
EAL: Detected NUMA nodes: 1
EAL: Detected shared linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available 1048576 kB hugepages reported
EAL: VFIO support initialized
TELEMETRY: No legacy callbacks, legacy socket not created
2021-11-16 19:38:42.213563 BF_BFRT FATAL - Unable to find any BfRt Json File
2021-11-16 19:38:42.213715 BF_BFRT ERROR - makeBfRtInfo:383 Failed to create BfRtInfo for dev_id  0

bf_switchd: dev_id 0 initialized

bf_switchd: initialized 1 devices
Skip p4 lib init
Skip mav diag lib init
bf_switchd: spawning cli server thread
bf_switchd: running in background; driver shell is disabled
bf_switchd: server started - listening on port 9999
I20211116 19:38:42.218636 94197 bf_sde_wrapper.cc:1548] switchd started successfully
I20211116 19:38:42.218663 94197 bf_interface.cc:98] Detected is_sw_model: 1
I20211116 19:38:42.218680 94197 bf_interface.cc:99] SDE version: 9.5.0

how to run only ubuntu2004?

  1. In Readme I do not see instructions on how to run ubuntu2004 only?

This is from the ipdk_default.env, shall I simply comment out the unrequired RT_ENVs? OR shall I choose ubuntu2004 in IFS="," read -r -a ENV_ATTR <<< "${RT_ENVS[fedora33]}" ? Please instruct

# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

# SCRIPT_DIR contains the directory of the 'source'ing ipdk script
# Define the pre configured (docker container) runtime environments
# Add new definitions at the end of the array.
# BASE_IMAGE,IMAGE_NAME,DOCKERFILE
declare -gA RT_ENVS
RT_ENVS["fedora33"]="fedora:33,ipdk/p4-ovs-fc33,${SCRIPT_DIR}/../Dockerfile.fedora"
RT_ENVS["ubuntu2004"]="ubuntu:20.04,ipdk/p4-ovs-ubuntu20.04,${SCRIPT_DIR}/../Dockerfile.ubuntu"
RT_ENVS["ubuntu1804"]="ubuntu:18.04,ipdk/p4-ovs-ubuntu18.04,${SCRIPT_DIR}/../Dockerfile.ubuntu"

# Build parameters
NO_CACHE=false                          # build with cache (true/false)
PROXY=                                  # http/s proxy to use <Your Proxy>
KEEP_SOURCE_CODE=false                  # Keep source code in image after build
                                        # (true/false(default))
# Default base image reference setup (Fedora Core 33)
IFS="," read -r -a ENV_ATTR <<< "${RT_ENVS[fedora33]}"
  1. Please add instructions about this in th readme

Thanks

Error when trying to build

When running source /root/start_p4ovs.sh /root, I'm seeing the below error. Did something change in one of the dependent P4 packages recently? This is on a Linux VM, not WSL2.

make[2]: Leaving directory '/root/p4-sde/p4-driver/src'
make[1]: Leaving directory '/root/p4-sde/p4-driver/src'
Making clean in doc
make[1]: Entering directory '/root/p4-sde/p4-driver/doc'
rm -rf .libs _libs
rm -f *.lo
make[1]: Leaving directory '/root/p4-sde/p4-driver/doc'
Making clean in bf_switchd
make[1]: Entering directory '/root/p4-sde/p4-driver/bf_switchd'
find: ‘/root/p4-sde/install’: No such file or directory
dirname: missing operand
Try 'dirname --help' for more information.
 rm -f bf_switchd
test -z "libbf_switchd_lib.la" || rm -f libbf_switchd_lib.la
rm -f ./so_locations
rm -rf .libs _libs
rm -rf lib/.libs lib/_libs
rm -f *.o
rm -f lib/*.o
rm -f lib/*.lo
rm -f *.lo
make[1]: Leaving directory '/root/p4-sde/p4-driver/bf_switchd'
make[1]: Entering directory '/root/p4-sde/p4-driver'
rm -rf .libs _libs
rm -f *.lo
make[1]: Leaving directory '/root/p4-sde/p4-driver'
make: *** empty string invalid as file name.  Stop.
make: *** [Makefile:56: volume] Error 2

VM crash when following instructions

When following the README instructions as written, I can't get two VMS to run. Note that I'm not running OVS inside a container, but instead natively in a Vagrant VM with nested virtualization enabled (inside of Virtualbox). This line indicates to pass /dev/hugepages to the first VM. However, this line then says to pass the same file to the second VM. When I do this, the first VM takes a kernel fault and crashes. If I give each VM a separate file (say, for example /hugetlbfs1 and /hugetlbfs2, then the VMs work ok.

Note that even with them running, I don't see traffic passing and it's not clear to me how to debug this. This is how I stumbled onto #45 in fact.

Error in step 5/13

Hi, Any Idea what does the below error mean? What is the problem?

FROM ubuntu:20.04 AS base
LABEL maintainer="[email protected]"
ARG PROXY

# Installing dependent packages required for DPDK Build
RUN dnf -y update && \
  dnf -y groupinstall "Development Tools" "Development Libraries" && \
  dnf -y install meson && \
  dnf -y install cmake && \
  dnf -y install gdb && \
  dnf -y install libtool && \
  dnf -y install autoconf && \
  dnf -y install autoconf-archive && \
  dnf -y install automake && \
  dnf -y install scapy && \
  dnf -y install iproute && \
"Dockerfile" 58L, 1653C written
IPDK_Container# docker build .
Sending build context to Docker daemon  68.61kB
Step 1/13 : ARG OS_VERSION=${OS_VERSION}
Step 2/13 : FROM ubuntu:20.04 AS base
 ---> d5ca7a445605
Step 3/13 : LABEL maintainer="[email protected]"
 ---> Running in df39996c81be
Removing intermediate container df39996c81be
 ---> 672d15d5a296
Step 4/13 : ARG PROXY
 ---> Running in 2186a0353b5d
Removing intermediate container 2186a0353b5d
 ---> a9b67b01739a
Step 5/13 : RUN dnf -y update &&   dnf -y groupinstall "Development Tools" "Development Libraries" &&   dnf -y install meson &&   dnf -y install cmake &&   dnf -y install gdb &&   dnf -y install libtool &&   dnf -y install autoconf &&   dnf -y install autoconf-archive &&   dnf -y install automake &&   dnf -y install scapy &&   dnf -y install iproute &&   dnf -y install net-tools &&   dnf -y install gflags-devel &&   dnf -y install iputils &&   dnf -y install cctz &&   dnf -y install json-devel &&   dnf -y install python &&   dnf -y install grpc-plugins &&   dnf -y install python3-cffi &&   dnf -y install libedit-devel &&   dnf -y install expat-devel &&   dnf -y install pip &&   dnf -y install flex &&   dnf -y install bison &&   dnf -y install libgc-devel &&   dnf -y install vim &&   dnf -y clean all
 ---> Running in 1426a7a22ad9
[ 6045.211906] docker0: port 1(veth361576e) entered blocking state
[ 6045.217884] docker0: port 1(veth361576e) entered disabled state
[ 6045.224110] device veth361576e entered promiscuous mode
[ 6047.824401] cgroup: runc (1259) created nested cgroup for controller "memory" which has incomplete hierarchy support.     Nested cgroups may change behavior in the future.
[ 6047.839391] cgroup: "memory" requires setting use_hierarchy to 1 on the root
[ 6047.851878] cgroup: cgroup: disabling cgroup2 socket matching due to net_prio or net_cls activation
[ 6048.130233] eth0: renamed from veth0f08cf9
[ 6048.160712] IPv6: ADDRCONF(NETDEV_CHANGE): veth361576e: link becomes ready
[ 6048.167738] docker0: port 1(veth361576e) entered blocking state
[ 6048.173666] docker0: port 1(veth361576e) entered forwarding state
[ 6048.180255] IPv6: ADDRCONF(NETDEV_CHANGE): docker0: link becomes ready
/bin/sh: 1: dnf: not found
[ 6048.914725] docker0: port 1(veth361576e) entered disabled state
[ 6048.920943] veth0f08cf9: renamed from eth0
[ 6049.237960] docker0: port 1(veth361576e) entered disabled state
[ 6049.244857] device veth361576e left promiscuous mode
[ 6049.249933] docker0: port 1(veth361576e) entered disabled state
The command '/bin/sh -c dnf -y update &&   dnf -y groupinstall "Development Tools" "Development Libraries" &&   dnf -y install meson &&   dnf -y install cmake &&   dnf -y install gdb &&   dnf -y install libtool &&   dnf -y install autoconf &&   dnf -y install autoconf-archive &&   dnf -y install automake &&   dnf -y install scapy &&   dnf -y install iproute &&   dnf -y install net-tools &&   dnf -y install gflags-devel &&   dnf -y install iputils &&   dnf -y install cctz &&   dnf -y install json-devel &&   dnf -y install python &&   dnf -y install grpc-plugins &&   dnf -y install python3-cffi &&   dnf -y install libedit-devel &&   dnf -y install expat-devel &&   dnf -y install pip &&   dnf -y install flex &&   dnf -y install bison &&   dnf -y install libgc-devel &&   dnf -y install vim &&   dnf -y clean all' returned a non-zero code: 127
IPDK_Container#
IPDK_Container#
IPDK_Container#

Dockerfile.ubuntu missing apt-get install libprotobuf-dev protobuf-compiler

Without those, the following errors are received (and ovs build fails further down the flow):

-- Found BISON: /usr/bin/bison (found suitable version "3.5.1", minimum required is "3.0")
CMake Error at /usr/local/lib/python3.8/dist-packages/cmake/data/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR)
  (Required is at least version "3.0.0")
Call Stack (most recent call first):
  /usr/local/lib/python3.8/dist-packages/cmake/data/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 
(_FPHSA_FAILURE_MESSAGE)
  /usr/local/lib/python3.8/dist-packages/cmake/data/share/cmake-3.22/Modules/FindProtobuf.cmake:650 
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:110 (find_package)

set_hugepages.sh doesn't work on WSL2

Likely because something isn't built into the WSL2 kernel by default. I have a quick fix to the script which does make it work, and will push it as a part of #16.

Benign error: tee: /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages: No such file or directory

Got an apparently benign error after executing /root/scripts/set_hugepages.sh per the instructions on https://github.com/ipdk-io/ipdk/blob/main/build/IPDK_Container/README (step 6.a.):

[root@aea8dd7ac07e P4-OVS]# source /root/P4-OVS/p4ovs_env_setup.sh /root/p4-sde/install 
OS and Version details...
Fedora : 33


Updated Environment Variables ...
SDE_INSTALL: /root/p4-sde/install
PKG_CONFIG_PATH: /root/p4-sde/install/lib64/pkgconfig
LIBRARY_PATH: 
LD_LIBRARY_PATH: :/root/p4-sde/install/lib:/root/p4-sde/install/lib64:/usr/local/lib:/usr/local/lib64
PATH: /root/P4-OVS/:/root/scripts/:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
C_INCLUDE_PATH: 
CPLUS_INCLUDE_PATH: 

[root@aea8dd7ac07e P4-OVS]# /root/scripts/set_hugepages.sh
1024
tee: /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages: No such file or directory
1024

"ipdk build --no-cache" completed successfully yet cannot start/attach

Seems successful completion of build, yet the docker start fails.

What am I (or is) missing?

make[3]: Leaving directory '/root/P4-OVS'
make[2]: Leaving directory '/root/P4-OVS'
make[1]: Leaving directory '/root/P4-OVS'
Copy p4ovs_env_setup.sh script from P4-OVS
Copy build-p4ovs.sh script from P4-OVS
Copy install_dep_packages.sh script from P4-OVS
Removing P4-OVS source code
Removing p4-driver source code
Removing P4C source code
Removing intermediate container 72a75ce8c730
 ---> 5e845a1db81b
Successfully built 5e845a1db81b
Successfully tagged ipdk/p4-ovs-ubuntu20.04:92532fd
~/ipdk/build
~/ipdk/build# ./ipdk start -d
Loaded /root/ipdk/build/scripts/ipdk_default.env
Loaded /root/.ipdk/ipdk.env
Unable to find image 'ipdk/p4-ovs-ubuntu20.04:92532fd' locally
docker: Error response from daemon: pull access denied for ipdk/p4-ovs-ubuntu20.04, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
~/ipdk/build# docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
root@kub-node1-smadarf:~/ipdk/build# docker volume ls
DRIVER    VOLUME NAME
~/ipdk/build#

Error Running IPDK demo using Vagrant [Virtualbox +kvm]

I am doing an exercise to use IPDK container as a Program enabled vSwitch, switching traffic between 2 vms on host using this README https://github.com/ipdk-io/ipdk/blob/main/build/README_DOCKER.md

In procedure below order should be maintained,
1. Make vagrant up
2. Make IPDK container up
3. Create and start the vms

Issue here is once I start the Vagrant using virtualbox (default provider), While starting the vms using kvm I am getting below error :

ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy
qemu-system-x86_64: failed to initialize KVM: Device or resource busy

Kern.log
Feb 3 14:20:24 silpixa00400831 kernel: [1408724.643268] kvm: enabling virtualization on CPU61 failed
Feb 3 14:20:24 silpixa00400831 kernel: [1408724.643270] kvm: enabling virtualization on CPU5 failed

Later I have remove the virtualbox and vagrant was down, then tried to start the vms, I was able to start the vm successfully but then while making vagrant up I was getting error and unable to make vagrant up.

ERROR :
The name of your virtual machine couldn't be set because VirtualBox
is reporting another VM with that name already exists. Most of the
time, this is because of an error with VirtualBox not cleaning up
properly. To fix this, verify that no VMs with that name do exist
(by opening the VirtualBox GUI). If they don't, then look at the
folder in the error message from VirtualBox below and remove it
if there isn't any information you need in there.

VirtualBox error:

VBoxManage: error: Could not rename the directory '/root/VirtualBox VMs/temp_clone_1644322777955_65127' to '/root/VirtualBox VMs/ipdk-container' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "SaveSettings()" at line 3265 of file VBoxManageModifyVM.cpp

According to https://www.dedoimedo.com/computers/kvm-virtualbox.html & https://askubuntu.com/questions/413511/can-virtualbox-and-kvm-run-alongside-each-other/413545#413545
Both need access to the CPU's virtualization features, but that's not designed to be used by more than one hypervisor at once.

So in this latest IPDK exercise how do we resolved the conflicts between two hyperviser (VirtualBox used by Vagrant & qemu-kvm)?

ipdk container tutorial on ubuntu 20.04: error with gnmi-cli

When trying the ipdk container tutorial on a baremetal server with ubuntu 20.04, I succeed in installing and starting ovs without any matter.
But an error occures with gnmi-cli for interface creation
gnmi-cli: error while loading shared libraries: libglog.so.1: cannot open shared object file: No such file or directory

However, the file is in /usr/local/lib64 (as a target of a symlink) which is itsef in the path list:

# ll /usr/local/lib64/libglog.so.1
lrwxrwxrwx 1 root root 16 Oct 27 11:26 /usr/local/lib64/libglog.so.1 -> libglog.so.0.6.0
# ll /usr/local/lib64/libglog.so.0.6.0
-rwxr-xr-x 1 root root 258376 Oct 27 11:26 /usr/local/lib64/libglog.so.0.6.0
# echo $LD_LIBRARY_PATH
:/root/p4-sde/install/lib:/root/p4-sde/install/lib64:/usr/local/lib:/usr/local/lib64:/root/p4-sde/install/lib:/root/p4-sde/install/lib64:/usr/local/lib:/usr/local/lib64

Any idea to solve it ?

Cannot set pipeline with ovs-p4ctl command

I'm trying to set a pipeline per the instructions and running into some issues:

root@ubuntu2004:~/examples/simple_l3# ovs-p4ctl set-pipe ovs-br1 /root/examples/simple_l3/simple_l3.pb.bin /root/examples/simple_l3/p4Info.txt
Error: P4Runtime RPC error (INVALID_ARGUMENT): Unknown format for p4_device_config.
root@ubuntu2004:~/examples/simple_l3#

I've created the pipeline file with the following commands:

root@ubuntu2004:~/examples/simple_l3# p4c --arch psa --target dpdk --output $OUTPUT_DIR/pipe --p4runtime-files $OUTPUT_DIR/p4Info.txt --bf-rt-schema $OUTPUT_DIR/bf-rt.json --context $OUTPUT_DIR/pipe/context.json $OUTPUT_DIR/simple_l3.p4
root@ubuntu2004:~/examples/simple_l3# ovs_pipeline_builder --p4c_conf_file=simple_l3.conf --bf_pipeline_config_binary_file=simple_l3.pb.bin

Note that I had to modify the simple_l3.pb.bin file because it had a bunch of unprintable characters in it. Perhaps this is part of the problem?

Error building stratum code

Seeing this now. Note that I've applied the fix for #13, and also my PR to add shellcheck support.

 . -I ./stratum -I ./stratum/stratum/public/proto -I ./external -I ./p4proto -I ./p4proto/p4rt -I ./p4proto/p4rt/proto -I ./p4proto/bfIntf -I /usr/local/lib -I ./p4proto/p4rt/proto/p4 -g -O2 -MT stratum/stratum/glue/status/p4proto_p4rt_libp4rt_la-posix_error_space.lo -MD -MP -MF stratum/stratum/glue/status/.deps/p4proto_p4rt_libp4rt_la-posix_error_space.Tpo -c stratum/stratum/glue/status/posix_error_space.cc -o stratum/stratum/glue/status/p4proto_p4rt_libp4rt_la-posix_error_space.o
stratum/stratum/glue/logging.cc:32:8: error: ‘void stratum::{anonymous}::SyslogSink::send(google::LogSeverity, const char*, const char*, int, const tm*, const char*, size_t)’ marked ‘override’, but does not override
32 |   void send(LogSeverity severity, const char* full_filename,
   |        ^~~~
stratum/stratum/glue/logging.cc: In function ‘void stratum::InitStratumLogging()’:                                       stratum/stratum/glue/logging.cc:54:31: error: invalid new-expression of abstract class type ‘stratum::{anonymous}::SyslogSink’
54 |     log_sink = new SyslogSink();
   |                              ^
stratum/stratum/glue/logging.cc:30:7: note:   because the following virtual functions are pure within ‘stratum::{anonymous}::SyslogSink’:
30 | class SyslogSink : public LogSink {
   |       ^~~~~~~~~~
In file included from ./stratum/stratum/glue/logging.h:18,
                         from stratum/stratum/glue/logging.cc:5:
/usr/local/include/glog/logging.h:1737:16: note:     ‘virtual void google::LogSink::send(google::LogSeverity, const char*, const char*, int, const LogMessageTime&, const char*, size_t)’
1737 |   virtual void send(LogSeverity severity, const char* full_filename,
    |                 ^~~~
make[2]: *** [Makefile:7448: stratum/stratum/glue/p4proto_p4rt_libp4rt_la-logging.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f stratum/stratum/glue/status/.deps/p4proto_p4rt_libp4rt_la-posix_error_space.Tpo stratum/stratum/glue/status/.deps/p4proto_p4rt_libp4rt_la-posix_error_space.Plo
make[2]: Leaving directory '/root/P4-OVS'  

program not found or is not executable (-grpc_out: protoc-gen-grpc: Plugin failed with status code 1)

I'm running latest ipdk head on CentOS 8, Dockerfile.ubuntu

The following errors during ipdk build --no-cache prevnt ovs build:

protoc -I./external/googleapis -I/usr/local/include -I./p4runtime/proto --grpc_out=./p4proto/p4rt/proto --plugin=protoc-gen- grpc=`which grpc_cpp_plugin` ./p4runtime/proto/p4/v1/p4runtime.proto
: program not found or is not executable
: program not found or is not executable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
make: *** [Makefile:9755: p4proto/p4rt/proto/p4/v1/p4runtime.grpc.pb.h] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:9755: p4proto/p4rt/proto/p4/v1/p4runtime.grpc.pb.cc] Error 1
protoc -I./external/googleapis -I/usr/local/include -I./p4runtime/proto --grpc_out=./p4proto/p4rt/proto --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ./p4runtime/proto/p4/v1/p4runtime.proto
protoc -I./external/googleapis -I/usr/local/include -I./p4runtime/proto --grpc_out=./p4proto/p4rt/proto --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ./p4runtime/proto/p4/v1/p4runtime.proto
: program not found or is not executable
: program not found or is not executable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
make: *** [Makefile:9755: p4proto/p4rt/proto/p4/v1/p4runtime.grpc.pb.h] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:9755: p4proto/p4rt/proto/p4/v1/p4runtime.grpc.pb.cc] Error 1

Suggestions?

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.