Giter Club home page Giter Club logo

p4factory's People

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

p4factory's Issues

Empty action_function_decls

Spec's grammar for action_function_declaration states one or more action_statements, but some of these p4 targets have empty action function decls. Can you clarify the expected grammar moving forward?

basic routing module fails during build

I am getting the following error when I want to build the module for basic routing:


[root@localhost basic_routing]# make bm                                                                               
/root/workspace/p4factory/submodules/p4c-behavioral/p4c_bm/shell.py p4src/basic_routing.p4 --gen-dir=/root/workspace/p4
factory/targets/basic_routing/build//bm/ --thrift --public-inc-path=/root/workspace/p4factory/targets/basic_routing/build//inc/p4_sim --p4-prefix=basic_routing                                                                               
WARNING: No error rule is defined for exclusive state 'pragma'                                                         
WARNING: Token 'DIVIDE' defined, but not used
WARNING: Token 'PPHASH' defined, but not used                                                                          
WARNING: Token 'MOD' defined, but not used                                                                             
WARNING: There are 3 unused tokens
parsing successful                                                                                                     
semantic checking successful                                                                                           
Header type standard_metadata_t not byte-aligned, adding padding
Header type ingress_metadata_t not byte-aligned, adding padding                                                        
validating:  True                                                                                                      
validating:  True
validating:  True                                                                                                      
validating:  True                                                                                                      
Generating files in directory /root/workspace/p4factory/targets/basic_routing/build/bm
total phv length (in bytes): 112                                                                                       
    Compiling : bm::tcam_cache.c                                                                                       
    Compiling : bm::actions.c
    Compiling : bm::lf.c                                                                                               
    Compiling : bm::ingress_pipeline.c                                                                                 
    Compiling : bm::egress_pipeline.c
    Compiling : bm::parser.c                                                                                           
    Compiling : bm::tables.c                                                                                           
    Compiling : bm::stateful.c
    Compiling : bm::phv.c                                                                                              
    Compiling : bm::pre.c                                                                                              
    Compiling : bm::deparser.c
    Compiling : bm::pd_ms.c                                                                                            
    Compiling : bm::mirroring.c                                                                                        
    Compiling : bm::queuing.c
    Compiling : bm::calculations.c                                                                                     
    Compiling : bm::pkt_manager.c                                                                                      
    Compiling : bm::field_list.c
    Compiling : bm::pd.c                                                                                               
    Compiling : bm::conditional_tables.c                                                                               
    Compiling : bm::pd_static.c
    Compiling : bm::checksums.c                                                                                        
    Compiling : bm::metadata_recirc.c                                                                                  
    Compiling : bm::action_profiles.c
    Compiling : bm::metadata_utils.c                                                                                   
    Compiling : bm::value_set.c                                                                                        
    Compiling : bm::rmt.c
    Compiling : bm::fields.c                                                                                           
    Compiling : bm::pipeline.c                                                                                         
thrift -r --gen cpp --out /root/workspace/p4factory/targets/basic_routing/build//bm/src /root/workspace/p4factory/targets/basic_routing/build//bm/thrift/p4_pd_rpc.thrift &&  thrift -r --gen cpp --out /root/workspace/p4factory/targets/basic_routing/build//bm/src /root/workspace/p4factory/targets/basic_routing/build//bm/thrift/conn_mgr_pd_rpc.thrift &&  thrift -r --gen cpp --out /root/workspace/p4factory/targets/basic_routing/build//bm/src /root/workspace/p4factory/targets/basic_routing/build//bm/thrift/mc_pd_rpc.thrift && true
    Compiling : bm::pd_rpc_server.cpp                                                                                  
/root/workspace/p4factory/targets/basic_routing/build//bm/src/pd_rpc_server.cpp:5:45: fatal error: thrift/protocol/TBinaryProtocol.h: No such file or directory
 #include <thrift/protocol/TBinaryProtocol.h>
                                             ^
compilation terminated.
/root/workspace/p4factory/submodules/p4c-behavioral/p4c-bm.mk:127: recipe for target '/root/workspace/p4factory/targets
/basic_routing/build//bm/obj/pd_rpc_server.o' failed
make: *** [/root/workspace/p4factory/targets/basic_routing/build//bm/obj/pd_rpc_server.o] Error 1

Thrift build was successfull by the way.

Error in installing dependency

Hello, I am getting the following error when installing dependencies. I wonder how I can fix it?

Installed /usr/local/lib/python2.7/dist-packages/p4_hlir-0.9.35-py2.7.egg
Processing dependencies for p4-hlir==0.9.35
Searching for ply==3.8
Best match: ply 3.8
Processing ply-3.8-py2.7.egg
ply 3.8 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/ply-3.8-py2.7.egg
Finished processing dependencies for p4-hlir==0.9.35
Cloning into 'p4c-graphs'...
Username for 'https://github.com': imehrdad2012
Password for 'https://[email protected]':
remote: Repository not found.
fatal: repository 'https://github.com/p4lang/p4c-graphs.git/' not found

Setting up a kind of multicast

I struggle with implementing a kind of multicast behaviour.
Is it possible to send a packet to a fixed destination such as 10.10.10.10, to look up this address in a table and get a match, resulting in sending the packet to, say, 10.0.0.1 on egress port 1 and 10.0.1.1 on port 2?

In the p4 spec 1.0.2 in section 13 is stated to use the egress_spec and specify a multicast group.
But mapping this to the triple (packet, egress_port, egress_instance) should be done by the buffering mechanism, and i don't know how to do this?

Is there an easy way to do this or any more detailed description of doing this?

Error while running l2_switch example

Hi all,
I am getting below errors while running l2_switch example

[root@localhost l2_switch]# make bm
Linking: bm
/usr/bin/ld: cannot find -ledit
collect2: error: ld returned 1 exit status
/home/prai/p4factory/targets/l2_switch/../../makefiles/bin.mk:29: recipe for target '/home/prai/p4factory/targets/l2_switch/build//bin/bm' failed
make: *** [/home/prai/p4factory/targets/l2_switch/build//bin/bm] Error 1

Thanks,
Pavan

Linker error

Even after applying my changes here: #14, I get a linker error when trying to run make on a new target.

I think main.c (which seems to be checked in for all other targets) isn't created by tools/newtarget.py?

What is the superiority of P4 over OpenCl?

Hi everybody,

I am new to P4 and I am trying to find a topic related to P4 for my internship project. In this regard, I have some questions:

  1. I know Opencl is a framework for writing programs that execute across heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), field-programmable gate arrays (FPGAs) and other processors or hardware accelerators. What is the benefit of using P4 over OpenCl in case of packet processing.
  2. Do you have any idea about a topic related to P4 for my internship project?

Regards,

ImportError: cannot import name TFrozenDict

Hi! Recently I was tring Integration with Mininet.

I followed the step in README, cd the directory p4factory/targets/simple_router/ and make successfully. Then I started the Mininet by the command:

./run_demo.bash
root@ubuntu:/home/wasdns/p4factory/targets/simple_router# ./run_demo.bash
*** Creating network
*** Adding hosts:
h1 h2 
*** Adding switches:
s1 
*** Adding links:
(h1, s1) (h2, s1) 
*** Configuring hosts
h1 h2 
*** Starting controller

*** Starting 1 switches
s1 Starting P4 switch s1
/home/wasdns/p4factory/targets/simple_router/behavioral-model --name s1 --dpid 0000000000000001 -i s1-eth1 -i s1-eth2 --listener 127.0.0.1:11111 --pd-server 127.0.0.1:22222 
switch has been started

**********
h1
default interface: eth0	10.0.0.10	00:04:00:00:00:00
**********
**********
h2
default interface: eth0	10.0.1.10	00:04:00:00:00:01
**********
Ready !
*** Starting CLI:
mininet>

OK, and when I opened another Terminal, cd the directory and tried the command below:

./run_add_demo_entries.bash

to install table entries, I got into trouble:

root@ubuntu:/home/wasdns/p4factory/targets/simple_router# ./run_add_demo_entries.bash 
ImportError: cannot import name TFrozenDict
ImportError: cannot import name TFrozenDict
ImportError: cannot import name TFrozenDict
ImportError: cannot import name TFrozenDict
ImportError: cannot import name TFrozenDict
ImportError: cannot import name TFrozenDict

I'm not familier with Python, but I think it may be something wrong with thrift.

My thrift version:

Thrift version 1.0.0-dev

However..I have no idea about how to deal with it. Should I install the packet named "TFrozenDict"? But I didn't find anything by asking Google.

Can you help me? Thank you. :)

apps/int/vxlan-gpe not support linux kernel version 4.x

compile log:

sunnogo@R04220:/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe$ make
make -C /lib/modules/4.4.0-22-generic/build M=/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-22-generic'
  CC [M]  /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.o
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:94:7: error: redefinition of ‘union vxlan_addr’
 union vxlan_addr {
       ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:44:0:
include/net/vxlan.h:119:7: note: originally defined here
 union vxlan_addr {
       ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:100:8: error: redefinition of ‘struct vxlan_rdst’
 struct vxlan_rdst {
        ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:44:0:
include/net/vxlan.h:125:8: note: originally defined here
 struct vxlan_rdst {
        ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:122:8: error: redefinition of ‘struct vxlan_dev’
 struct vxlan_dev {
        ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:44:0:
include/net/vxlan.h:152:8: note: originally defined here
 struct vxlan_dev {
        ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: In function ‘vxlan_fdb_info’:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:423:9: error: void value not ignored as it ought to be
  return nlmsg_end(skb, nlh);
         ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: In function ‘vxlan_udp_encap_recv’:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1255:4: error: ‘struct vxlan_sock’ has no member named ‘rcv’
  vs->rcv(vs, skb, vxh->vx_vni);
    ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: In function ‘vxlan6_xmit_skb’:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1681:7: error: implicit declaration of function ‘vlan_tx_tag_present’ [-Werror=implicit-function-declaration]
    + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);
       ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1708:23: warning: passing argument 1 of ‘udp_tunnel6_xmit_skb’ from incompatible pointer type [-Wincompatible-pointer-types]
  udp_tunnel6_xmit_skb(vs->sock, dst, skb, dev, saddr, daddr, prio,
                       ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:37:0:
include/net/udp_tunnel.h:87:5: note: expected ‘struct dst_entry *’ but argument is of type ‘struct socket *’
 int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
     ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1708:33: warning: passing argument 2 of ‘udp_tunnel6_xmit_skb’ from incompatible pointer type [-Wincompatible-pointer-types]
  udp_tunnel6_xmit_skb(vs->sock, dst, skb, dev, saddr, daddr, prio,
                                 ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:37:0:
include/net/udp_tunnel.h:87:5: note: expected ‘struct sock *’ but argument is of type ‘struct dst_entry *’
 int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
     ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1708:2: error: too few arguments to function ‘udp_tunnel6_xmit_skb’
  udp_tunnel6_xmit_skb(vs->sock, dst, skb, dev, saddr, daddr, prio,
  ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:37:0:
include/net/udp_tunnel.h:87:5: note: declared here
 int udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
     ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: In function ‘vxlan_xmit_skb’:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1787:29: warning: passing argument 1 of ‘udp_tunnel_xmit_skb’ from incompatible pointer type [-Wincompatible-pointer-types]
  return udp_tunnel_xmit_skb(vs->sock, rt, skb, src, dst, tos,
                             ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:37:0:
include/net/udp_tunnel.h:81:5: note: expected ‘struct rtable *’ but argument is of type ‘struct socket *’
 int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb,
     ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1787:39: warning: passing argument 2 of ‘udp_tunnel_xmit_skb’ from incompatible pointer type [-Wincompatible-pointer-types]
  return udp_tunnel_xmit_skb(vs->sock, rt, skb, src, dst, tos,
                                       ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:37:0:
include/net/udp_tunnel.h:81:5: note: expected ‘struct sock *’ but argument is of type ‘struct rtable *’
 int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb,
     ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1787:9: error: too few arguments to function ‘udp_tunnel_xmit_skb’
  return udp_tunnel_xmit_skb(vs->sock, rt, skb, src, dst, tos,
         ^
In file included from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:37:0:
include/net/udp_tunnel.h:81:5: note: declared here
 int udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb,
     ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: In function ‘vxlan_xmit_one’:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1941:34: warning: passing argument 1 of ‘ipv6_stub->ipv6_dst_lookup’ from incompatible pointer type [-Wincompatible-pointer-types]
   if (ipv6_stub->ipv6_dst_lookup(sk, &ndst, &fl6)) {
                                  ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1941:34: note: expected ‘struct net *’ but argument is of type ‘struct sock *’
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1941:38: warning: passing argument 2 of ‘ipv6_stub->ipv6_dst_lookup’ from incompatible pointer type [-Wincompatible-pointer-types]
   if (ipv6_stub->ipv6_dst_lookup(sk, &ndst, &fl6)) {
                                      ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1941:38: note: expected ‘struct sock *’ but argument is of type ‘struct dst_entry **’
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1941:45: warning: passing argument 3 of ‘ipv6_stub->ipv6_dst_lookup’ from incompatible pointer type [-Wincompatible-pointer-types]
   if (ipv6_stub->ipv6_dst_lookup(sk, &ndst, &fl6)) {
                                             ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1941:45: note: expected ‘struct dst_entry **’ but argument is of type ‘struct flowi6 *’
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1941:7: error: too few arguments to function ‘ipv6_stub->ipv6_dst_lookup’
   if (ipv6_stub->ipv6_dst_lookup(sk, &ndst, &fl6)) {
       ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: At top level:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2468:12: error: unknown type name ‘vxlan_rcv_t’
            vxlan_rcv_t *rcv, void *data,
            ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2520:7: error: unknown type name ‘vxlan_rcv_t’
       vxlan_rcv_t *rcv, void *data,
       ^
In file included from include/linux/linkage.h:6:0,
                 from include/linux/kernel.h:6,
                 from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:14:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2546:19: error: ‘vxlan_sock_add’ undeclared here (not in a function)
 EXPORT_SYMBOL_GPL(vxlan_sock_add);
                   ^
include/linux/export.h:57:16: note: in definition of macro ‘__EXPORT_SYMBOL’
  extern typeof(sym) sym;     \
                ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2546:1: note: in expansion of macro ‘EXPORT_SYMBOL_GPL’
 EXPORT_SYMBOL_GPL(vxlan_sock_add);
 ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: In function ‘vxlan_sock_work’:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2557:8: error: called object ‘vxlan_sock_add’ is not a function or function pointer
  nvs = vxlan_sock_add(net, port, vxlan_rcv, NULL, false, vxlan->flags);
        ^
In file included from include/linux/linkage.h:6:0,
                 from include/linux/kernel.h:6,
                 from /home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:14:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2546:19: note: declared here
 EXPORT_SYMBOL_GPL(vxlan_sock_add);
                   ^
include/linux/export.h:57:21: note: in definition of macro ‘__EXPORT_SYMBOL’
  extern typeof(sym) sym;     \
                     ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2546:1: note: in expansion of macro ‘EXPORT_SYMBOL_GPL’
 EXPORT_SYMBOL_GPL(vxlan_sock_add);
 ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: At top level:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:604:25: warning: ‘vxlan_gro_receive’ defined but not used [-Wunused-function]
 static struct sk_buff **vxlan_gro_receive(struct sk_buff **head, struct sk_buff *skb)
                         ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:669:12: warning: ‘vxlan_gro_complete’ defined but not used [-Wunused-function]
 static int vxlan_gro_complete(struct sk_buff *skb, int nhoff)
            ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:692:13: warning: ‘vxlan_notify_add_rx_port’ defined but not used [-Wunused-function]
 static void vxlan_notify_add_rx_port(struct vxlan_sock *vs)
             ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1219:12: warning: ‘vxlan_udp_encap_recv’ defined but not used [-Wunused-function]
 static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
            ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2427:13: warning: ‘vxlan_del_work’ defined but not used [-Wunused-function]
 static void vxlan_del_work(struct work_struct *work)
             ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:2434:23: warning: ‘vxlan_create_sock’ defined but not used [-Wunused-function]
 static struct socket *vxlan_create_sock(struct net *net, bool ipv6,
                       ^
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c: In function ‘vxlan_xmit_skb’:
/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.c:1789:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target '/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.o' failed
make[2]: *** [/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe/vxlan.o] Error 1
Makefile:1396: recipe for target '_module_/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe' failed
make[1]: *** [_module_/home/sunyongfeng/workshop/p4/p4factory/apps/int/vxlan-gpe] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-22-generic'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2

To make docker-image is failed

Hi,

I ran the command 'make docker-image' in the directory p4factory/targets/switch

I got the following error message,

Building docker image for target bm-switchlink
....
......
Copying python thrift files
WARNING: No libraries specified
INFO: Status: Preprocessing /tmp/tmpnRxo80.h
INFO: Status: gcc -E -U GNUC -dD -I/usr/include -I/p4factory/submodules/switch/switchsai/submodules/SAI/inc "-Dinline=" "-D__inline__=" "-D__extension__=" "-D__const=const" "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" "/tmp/tmpnRxo80.h"
INFO: Status: Parsing /tmp/tmpnRxo80.h
INFO: Status: Processing description list.
WARNING: Macro "SAI_MAX_FIRMWARE_PATH_NAME_LEN" depends on an unknown identifier "PATH_MAX". Macro "SAI_MAX_FIRMWARE_PATH_NAME_LEN" will not be output
INFO: Status: Writing to /p4factory/targets/switch/tests/pd_thrift/switch_sai_thrift/sai_headers.py.
INFO: Status: Wrapping complete.
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions.
make: *** [/p4factory/targets/switch/build//bm/obj/dc.o] Error 4
make: *** Waiting for unfinished jobs....
The command '/bin/sh -c cd /p4factory ; ./autogen.sh ; ./configure ; cd /p4factory/targets/switch ; make clean ; make -j4 bm-switchlink' returned a non-zero code: 2
make: *** [docker-image] Error 1

My VM:

parallels@ubuntu:~/TestLogs$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 485M 4.0K 485M 1% /dev
tmpfs 99M 1.2M 98M 2% /run
/dev/sda1 62G 20G 40G 33% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 495M 148K 495M 1% /run/shm
none 100M 64K 100M 1% /run/user
Home 233G 92G 142G 40% /media/psf/Home
Photo Library 233G 92G 142G 40% /media/psf/Photo Library
/dev/sr0 86M 86M 0 100% /media/parallels/CDROM

Please, find the logs in the following link,

https://onedrive.live.com/redir?resid=83528C00681158AF!716&authkey=!ALdN4bh1GDUAh6c&ithint=file%2clog

Cannot open Xterm for switch at the mininet CLI

I'm trying to run the test for INT Reference Application described on routing-fail-over-test

The mininet topology has the following nodes:

mininet> nodes
available nodes are:
h1 h2 h3 h4 leaf1 leaf2 spine1 spine2

I can open an Xterm terminal for h1 by typing

mininet> xterm h1

However, by typing

mininet> xterm leaf1

The mininet prompt returned without any error message, but I cannot see any Xterm popup window.

What might be the problem in this case?

Modified Topology of Reference Application Failed to Connect

I intended to modify the Test Network Topology into a linear one.

My idea is to break the line between Spine1 and Leaf2, and the line between Spine2 and Leaf1, and setup a new connection between Spine1 and Spine2.

part of the original code in p4factory/mininet/int_ref_topology.py:

link_cfgs = [
    LinkConfig( 'leaf1', 'h1', 0 ),
    LinkConfig( 'leaf1', 'h2', 1 ),
    LinkConfig( 'leaf1', 'spine1', 2, 0 ),
    LinkConfig( 'leaf1', 'spine2', 3, 0 ),

    LinkConfig( 'leaf2', 'h3', 0 ),
    LinkConfig( 'leaf2', 'h4', 1 ),
    LinkConfig( 'leaf2', 'spine1', 2, 1 ),
    LinkConfig( 'leaf2', 'spine2', 3, 1 ),
  ]

I modified it as follows:

link_cfgs = [
    LinkConfig( 'leaf1', 'h1', 0 ),
    LinkConfig( 'leaf1', 'h2', 1 ),
    LinkConfig( 'leaf1', 'spine1', 2, 0 ),
   # LinkConfig( 'leaf1', 'spine2', 3, 0 ),

    LinkConfig( 'leaf2', 'h3', 0 ),
    LinkConfig( 'leaf2', 'h4', 1 ),
   # LinkConfig( 'leaf2', 'spine1', 2, 1 ),
    LinkConfig( 'leaf2', 'spine2', 3, 1 ),

   # New connection
    LinkConfig( 'spine1', 'spine2', 1, 0),
  ]

The topology setup seemed fine, but when I tested pingall under mininet:

mininet> pingall
*** Ping: testing ping reachability
h2 -> X h1 X
h3 -> X X h4
h1 -> h2 X X
h4 -> X h3 X
*** Results: 66% dropped (4/12 received)
mininet> pingall
*** Ping: testing ping reachability
h2 -> X h1 X
h3 -> X X h4
h1 -> h2 X X
h4 -> X h3 X
*** Results: 66% dropped (4/12 received)

Spine1 and Spine2 seemed failed to connect, or failed to exchange routes with each other.

What did I miss?

Git submodule update throws error

When i run the "git submodule update --init --recursive " under p4factory directory, it gives error for three submodules as:

  • submodules/bigcode
  • submodules/p4ofagent/submodules/indigo
  • submodules/p4ofagent

Output:

➜ p4factory git:(master) git submodule update --init --recursive
Submodule 'submodules/bm' (https://github.com/p4lang/behavioral-model.git) registered for path 'submodules/bm'
Submodule 'submodules/oft-infra' (https://github.com/p4lang/oftest.git) registered for path 'submodules/oft-infra'
Submodule 'submodules/p4c-behavioral' (https://github.com/p4lang/p4c-behavioral.git) registered for path 'submodules/p4c-behavioral'
Submodule 'submodules/p4c-bm' (https://github.com/p4lang/p4c-bm.git) registered for path 'submodules/p4c-bm'
Submodule 'submodules/p4c-graphs' (https://github.com/p4lang/p4c-graphs.git) registered for path 'submodules/p4c-graphs'
Submodule 'submodules/p4ofagent' (https://github.com/p4lang/p4ofagent) registered for path 'submodules/p4ofagent'
Submodule 'submodules/switchapi' (https://github.com/p4lang/switchapi.git) registered for path 'submodules/switchapi'
Submodule 'submodules/switchlink' (https://github.com/p4lang/switchlink.git) registered for path 'submodules/switchlink'
Submodule 'submodules/switchsai' (https://github.com/p4lang/switchsai.git) registered for path 'submodules/switchsai'
Cloning into 'submodules/bm'...
remote: Counting objects: 4815, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 4815 (delta 1), reused 0 (delta 0), pack-reused 4807
Receiving objects: 100% (4815/4815), 28.98 MiB | 1.10 MiB/s, done.
Resolving deltas: 100% (3212/3212), done.
Checking connectivity... done.
Submodule path 'submodules/bm': checked out 'c3cab3cfb125ba0e3a9ef9bae76df1275e31c5b9'
Cloning into 'submodules/oft-infra'...
remote: Counting objects: 7961, done.
remote: Total 7961 (delta 0), reused 0 (delta 0), pack-reused 7961
Receiving objects: 100% (7961/7961), 4.45 MiB | 936.00 KiB/s, done.
Resolving deltas: 100% (4076/4076), done.
Checking connectivity... done.
Submodule path 'submodules/oft-infra': checked out 'fdbac3bbb62365e02bc2a7b94bd59fb25f5c5dd9'
Cloning into 'submodules/p4c-behavioral'...
remote: Counting objects: 549, done.
remote: Total 549 (delta 0), reused 0 (delta 0), pack-reused 549
Receiving objects: 100% (549/549), 272.49 KiB | 302.00 KiB/s, done.
Resolving deltas: 100% (303/303), done.
Checking connectivity... done.
Submodule path 'submodules/p4c-behavioral': checked out '629da2a4fca68f16dcc95633157e1c4475c360de'
Cloning into 'submodules/p4c-bm'...
remote: Counting objects: 392, done.
remote: Total 392 (delta 0), reused 0 (delta 0), pack-reused 392
Receiving objects: 100% (392/392), 111.65 KiB | 0 bytes/s, done.
Resolving deltas: 100% (191/191), done.
Checking connectivity... done.
Submodule path 'submodules/p4c-bm': checked out '2a4542f8532dc32ee6e6428677d5e1ef93ed5c5c'
Submodule 'submodules/bm' (https://github.com/p4lang/behavioral-model.git) registered for path 'submodules/bm'
Cloning into 'submodules/bm'...
remote: Counting objects: 4815, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 4815 (delta 1), reused 0 (delta 0), pack-reused 4807
Receiving objects: 100% (4815/4815), 28.98 MiB | 1.06 MiB/s, done.
Resolving deltas: 100% (3212/3212), done.
Checking connectivity... done.
Submodule path 'submodules/p4c-bm/submodules/bm': checked out 'b1fd0e6c3be1f61022ba33b54cfb87b8dbac7396'
Cloning into 'submodules/p4c-graphs'...
remote: Counting objects: 15, done.
remote: Total 15 (delta 0), reused 0 (delta 0), pack-reused 15
Unpacking objects: 100% (15/15), done.
Checking connectivity... done.
Submodule path 'submodules/p4c-graphs': checked out 'aec09d2781a48fedada3c2d7f82b1adbb20438a1'
Cloning into 'submodules/p4ofagent'...
remote: Counting objects: 110, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 110 (delta 8), reused 0 (delta 0), pack-reused 89
Receiving objects: 100% (110/110), 58.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (42/42), done.
Checking connectivity... done.
Submodule path 'submodules/p4ofagent': checked out '06c034e7cc8f5f105fd99771a48803f8d4fc42c1'
Submodule 'submodules/indigo' (https://github.com/floodlight/indigo) registered for path 'submodules/indigo'
Cloning into 'submodules/indigo'...
remote: Counting objects: 7719, done.
remote: Total 7719 (delta 0), reused 0 (delta 0), pack-reused 7719
Receiving objects: 100% (7719/7719), 5.26 MiB | 1.11 MiB/s, done.
Resolving deltas: 100% (5223/5223), done.
Checking connectivity... done.
Submodule path 'submodules/p4ofagent/submodules/indigo': checked out '47f935b3d90c2d45b91e3814c842969faf4c6726'
Submodule 'submodules/bigcode' ([email protected]:floodlight/bigcode) registered for path 'submodules/bigcode'
Submodule 'submodules/infra' ([email protected]:floodlight/infra) registered for path 'submodules/infra'
Submodule 'submodules/loxigen-artifacts' ([email protected]:floodlight/loxigen-artifacts.git) registered for path 'submodules/loxigen-artifacts'
Cloning into 'submodules/bigcode'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of '[email protected]:floodlight/bigcode' into submodule path 'submodules/bigcode' failed
Failed to recurse into submodule path 'submodules/p4ofagent/submodules/indigo'
Cloning into 'submodules/switchapi'...
remote: Counting objects: 1930, done.
remote: Total 1930 (delta 0), reused 0 (delta 0), pack-reused 1930
Receiving objects: 100% (1930/1930), 1.30 MiB | 756.00 KiB/s, done.
Resolving deltas: 100% (1684/1684), done.
Checking connectivity... done.
Submodule path 'submodules/switchapi': checked out '9693578fcfae287c1a79c49dd1ef5bb9efcf3b4a'
Cloning into 'submodules/switchlink'...
remote: Counting objects: 50, done.
remote: Total 50 (delta 0), reused 0 (delta 0), pack-reused 50
Unpacking objects: 100% (50/50), done.
Checking connectivity... done.
Submodule path 'submodules/switchlink': checked out '020e5aeadf1b6cb325042b6ac4a91680050314df'
Cloning into 'submodules/switchsai'...
remote: Counting objects: 157, done.
remote: Total 157 (delta 0), reused 0 (delta 0), pack-reused 157
Receiving objects: 100% (157/157), 155.49 KiB | 0 bytes/s, done.
Resolving deltas: 100% (95/95), done.
Checking connectivity... done.
Submodule path 'submodules/switchsai': checked out '1a505d97d9a8ba96d2ead3ad77f34129981ee378'
Submodule 'submodules/ocpsai' (https://github.com/p4lang/ocpsai.git) registered for path 'submodules/ocpsai'
Cloning into 'submodules/ocpsai'...
remote: Counting objects: 707, done.
remote: Total 707 (delta 0), reused 0 (delta 0), pack-reused 707
Receiving objects: 100% (707/707), 5.87 MiB | 1.11 MiB/s, done.
Resolving deltas: 100% (292/292), done.
Checking connectivity... done.
Submodule path 'submodules/switchsai/submodules/ocpsai': checked out '6a45573e1b4272e0e365e5018657fbb14f7854a7'
Failed to recurse into submodule path 'submodules/p4ofagent'
➜ p4factory git:(master)

error while running ./behavioral-model

y@y-Lenovo:~/p4factory/targets/basic_routing$ sudo ./behavioral-model
[sudo] y 的密码:
No PD RPC server address specified, using 127.0.0.1:9090
No listener specified, switch will run in standalone mode

P4 Program: basic_routing

Starting RPC server on port 9090
bmi_port_interface_add(port_mgr, veth_name, n_veth, pcap_filename): ERROR -1 at main.c:434y@y-Lenovo:~/p4factory/targets/basic_routing$

target switch for bmv2 make bm error

p4factory/targets/switch/bmv2/README.md shows we can build bmv2 switch through make bm. However submodule bmv2 uses autoconf tool, and error occurs as no makefile found.

sunnogo@sunyongfeng:~/research/p4/p4factory/targets/switch/bmv2$ make bm
make -C /home/sunnogo/research/p4/p4factory/submodules/bm
make[1]: Entering directory `/home/sunnogo/research/p4/p4factory/submodules/bm'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/home/sunnogo/research/p4/p4factory/submodules/bm'
make: *** [/home/sunnogo/research/p4/p4factory/targets/switch/bmv2/switch_bmv2] Error 2

After run ./autogen and ./configure in p4factory/submodules/bm, it works fine when make bm in p4factory/targets/switch/bmv2/.

Install script for Ubuntu 14.04 fails because of thrift

The install script install_deps.sh fails on Ubuntu 14.04 when either Java or Haskell is installed.

The reason is that when compiling thrift 0.6.2, it will try to build bindings for all languages that are currently installed on the system. The problem is, haskell and java bindings fail to build.

Since I think most language bindings are not needed for P4, is it possible to deactivate all unneeded languages? By default, thrift tries to build them all:

./configure --help
  --with-qt4              build the Qt library [default=yes]
  --with-c_glib           build the C (GLib) library [default=yes]
  --with-csharp           build the C# library [default=yes]
  --with-java             build the Java library [default=yes]
  --with-erlang           build the Erlang library [default=yes]
  --with-nodejs           build the Nodejs library [default=yes]
  --with-lua              build the Lua library [default=yes]
  --with-python           build the Python library [default=yes]
  --with-perl             build the Perl library [default=yes]
  --with-php              build the PHP library [default=yes]
  --with-php_extension    build the PHP_EXTENSION library [default=yes]
  --with-ruby             build the Ruby library [default=yes]
  --with-haskell          build the Haskell library [default=yes]
  --with-go               build the Go library [default=yes]
  --with-d                build the D library [default=yes]

newtarget.py script does not generate bmv2-related code

The newtarget.py script is very useful, however, it only generates code to build with the old bm, not the new bmv2.

I managed to get a working environment for a new target by copying bmv2/Makefile, bmv2/main.c, bmv2/run_bm.sh and adapting all references to the target name, but it would be nice if the newtarget.py script did all that automatically!

selector vs. dynamic_action_selection

Spec states "dynamic_action_selection" keyword whereas dc_example and sai_p4 targets use "selector". Is this a keyword change expected in next version of spec?

Priority bug in PD-CLI?

I was trying to add a ternary match rule in PD-CLI , which requires a priority, and I worked out the syntax is add_entry TABLE_NAME MATCH_FIELDS... ACTION_NAME ACTION_PARAMETERS... PRIORITY. However actually trying to do this causes an unhandled exception in Python to be raised. Some digging reveals that add_entry in pd_thrift_client.py puts the action specification before the priority:

if action_spec_tuple != ():
    add_entry_parameters.append(self.get_action_spec(action_name, action_spec_tuple))

if priority != None:
    add_entry_parameters.append(priority)

whereas the function at the other end of the RPC is expecting the action specification after the priority. Swapping the order of the above two blocks seems to fix the problem.

Error when trying to execute ./run_add_demo_entries.bash

Running the command ./run_add_demo_entries.bash gives me the following error:
ImportError: No module named p4_pd_rpc.simple_router
ImportError: No module named p4_pd_rpc.simple_router
ImportError: No module named p4_pd_rpc.simple_router
ImportError: No module named p4_pd_rpc.simple_router
ImportError: No module named p4_pd_rpc.simple_router
ImportError: No module named p4_pd_rpc.simple_router

Can someone please help me with this.

problems on make vxlan driver for INT

My OS is Ubuntu 16.04LTS
I wanna Build the VXLAN-GPE driver in 'apps/int/vxlan-gpe'
When I enter
sudo make
There's some errors below:
make -C /lib/modules/4.4.0-47-generic/build M= modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-47-generic'
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/bin2c
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
make[2]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h'。 停止。
arch/x86/Makefile:199: recipe for target 'archheaders' failed
make[1]: *** [archheaders] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-47-generic'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2

Then , find the missing headers in Linux responsity, I ran it again, but it shows below,

make -C /lib/modules/4.4.0-47-generic/build M= modules
make[1]: Entering directory /usr/src/linux-headers-4.4.0-47-generic'
scripts/kconfig/conf --silentoldconfig Kconfig

Configuration file ".config" not found!

Please run some configurator (e.g. "make oldconfig" or
"make menuconfig" or "make xconfig").

make[3]: *** [silentoldconfig] Error 1
make[2]: *** [silentoldconfig] Error 2

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

make[1]: *** [modules] Error 1
make[1]: Leaving directory `/usr/src/linux-headers-4.4.0-47-generic'
make: *** [all] Error 2

When I fellow the step in ReadMe: ./autogen.sh, I found a problem


The command failed...

I tried the command chmod -777 /home/wasdns/p4factory-master/submodules and sudo dos2unix p4factory-master/autogen.sh but it didn't work...

Can someone help me? Thanks!

The content of autogen.sh:

cd submodules/switch/ && ./autogen.sh && cd -
cd submodules/bm/ && ./autogen.sh && cd -
cd submodules/p4-build/ && ./autogen.sh && cd -
cd submodules/p4ofagent && ./autogen.sh && cd -

problems on building docker image

My operation OS is Ubuntu 14.04.
I followed by the README.md step by step, and wanna to build a docker image.
But when I ran
make docker-image
in p4factory/targets/switch directory, the program seem work well, but when it processed step 14, there are something wrong.
First, it shows that
fatal: Not a git repository: ../../.git/modules/submodules/bm
but when I go to that directory, I tried
git status
the git showes that bm is a git repo.
Then after checking ,it shows
configure: error: The P4_PATH you provided does not exist or is not absolute
mmake: *** [clean] Error 2
Then, after compiling something, it shows many messages like
Semantic warning: header instance 'outer_udp' is not reachable and will be removed
And finally,
make: *** [bm_tenjin_output_oldest] Error 1
and quit with error 2

Error on running the python script int_ref_topology.py

Hi,

We got the following error while running the test python script int_ref_topology.py

Traceback (most recent call last):
File "./int_ref_topology.py", line 107, in
run_cfg()
File "./int_ref_topology.py", line 83, in run_cfg
net = mgr.setupAndStartNetwork()
File "/home/dannyxx001/git_repositories/p4lang/p4factory/mininet/int_cfg.py", line 114, in setupAndStartNetwork
self.addLinks()
File "/home/dannyxx001/git_repositories/p4lang/p4factory/mininet/int_cfg.py", line 169, in addLinks
self.net.addLink( n1, n2, port1 = l.port1 + 1, fast=False, bw=5)
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 366, in addLink
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 534, in init
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 424, in init
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 468, in makeIntfPair
File "build/bdist.linux-x86_64/egg/mininet/util.py", line 194, in makeIntfPair
Exception: Error creating interface pair (leaf1-eth1,h1-eth0): RTNETLINK answers: No such process

Could you please check this issue.

Thanks,
Danny Ye

targets/basic_routing

When the first installation,I follow the README.
cd p4factory/targets/basic_routing/
make bm
p4c_bm/shell.py", line 20, in
from p4_hlir.main import HLIR
ImportError:No module named p4_hlir.main
make:***[bm_tenjin_output_oldest]
I am sure "p4_hlir" have been cloned in submodules successfully .
could you give me some instructions? Thank you!

feeding bmv2 switch with own JSON

When I try to launch the target switch https://github.com/p4lang/p4factory/tree/master/targets/switch/bmv2 with my own JSON file (my_program.json instead by given switch_bmv2.json) I get the following error message:

lt-simple_switch: ../../include/bm/bm_sim/bytecontainer.h:95: bm::ByteContainer::ByteContainer(const string&): Assertion `(size - idx) > 0' failed.

The JSON file is generated by command: p4c-bmv2 my_program.p4 --json my_program.json

The switch is started by command: sudo ./switch_bmv2 --log-console -i 0@veth0 -i 1@veth2 -i 2@veth4 -i 3@veth6 -i 4@veth8 -i 5@veth10 -i 6@veth12 -i 7@veth14 -i 8@veth16 -i 64@veth250 --thrift-port 10001 --pcap my_program.json. This command produces the error message.

Is it not possible to feed this bmv2 switch with my own p4 program?

simple router make.

When I try to make https://github.com/p4lang/p4factory/tree/master/targets/simple_router
I get these errors? How do I fix them?

/home/p4/p4factory/submodules/p4c-behavioral/p4c_bm/shell.py p4src/simple_router.p4 --gen-dir=/home/p4/p4factory/targets/simple_router/build//bm/ --thrift --public-inc-path=/home/p4/p4factory/targets/simple_router/build//inc/p4_sim --p4-prefix=simple_router
WARNING: Couldn't open 'parser.out'. [Errno 13] Permission denied: '/home/p4/switch/p4c-bm/src/p4-hlir-v1.1/p4_hlir/frontend/parser.out'
WARNING: Token 'PPHASH' defined, but not used
WARNING: There is 1 unused token
Generating LALR tables
WARNING: 2 shift/reduce conflicts
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 19 : Syntax error while parsing at token dstAddr (ID)
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 19 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 20 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 21 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 27 : Syntax error while parsing at token version (ID)
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 27 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 28 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 29 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 30 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 31 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 32 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 33 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 34 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 35 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 36 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 37 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/includes/headers.p4 at line 38 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 26 : Syntax error while parsing at token nhop_ipv4 (ID)
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 26 : invalid field declaration
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 32 : Syntax error while parsing at token nhop_ipv4 (ID)
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 32 : Invalid param list for action function (
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 49 : Syntax error while parsing at token dmac (ID)
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 49 : Invalid param list for action function (
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 64 : Syntax error while parsing at token smac (ID)
parse error in file /home/p4/p4factory/targets/simple_router/p4src/simple_router.p4 at line 64 : Invalid param list for action function (
25 errors during parsing
Interrupting compilation
Error while building HLIR
/home/p4/p4factory/submodules/p4c-behavioral/p4c-bm.mk:96: recipe for target '/home/p4/p4factory/targets/simple_router/build//bm/thrift/mc_pd_rpc.thrift' failed
make: *** [/home/p4/p4factory/targets/simple_router/build//bm/thrift/mc_pd_rpc.thrift] Error 1

travis build broken

The travis CI build for p4factory is broken. This is because travis recently added --recursive to their git submodule update --init command, which means we do not have an opportunity to replace ssh access by https access in the floodlight submodules before cloning them. I don't see an easy solution for this.

Issue with MAC and IP Address of Multiple P4 switches in Mininet

I got a problem when trying to use multiple P4 switches in Mininet. It seems that the interface MAC Address and IP Address of P4 switch isn't the same as shown using ifconfig command. In the 1sw_demo.py example, the MAC Addr seem to be 00:aa:bb:00:00:00 and 00:aa:bb:00:00:01. I wander how could I find the correct MAC and IP Address if I want to set the host arp when using multiple P4 switches. Thank you!

thrift not found when making a docker image for switch

I was trying to setup the environment instructed by reference implementation of the Inband Network Telemetry.

However, when I build a docker image for the switch:

make docker-image

After a few minutes' running, I got these errors:

thrift -r --gen cpp --out /p4factory/targets/switch/build//bm/src /p4factory/targets/switch/build//bm/thrift/p4_pd_rpc.thrift && thrift -r --gen cpp --out /p4factory/targets/switch/build//bm/src /p4factory/targets/switch/build//bm/thrift/conn_mgr_pd_rpc.thrift && thrift -r --gen cpp --out /p4factory/targets/switch/build//bm/src /p4factory/targets/switch/build//bm/thrift/mc_pd_rpc.thrift && true
/bin/sh: 1: thrift: not found
make: *** [/p4factory/targets/switch/build//bm/src/p4_pd_rpc_types.h] Error 127
make: *** Waiting for unfinished jobs....
The command '/bin/sh -c cd /p4factory ; ./autogen.sh ; ./configure ; cd /p4factory/targets/switch ; make clean ; make -j4 bm-switchlink' returned a non-zero code: 2
make: *** [docker-image] Error 1

I had installed the dependencies, and cloned p4lang/thrift, installed and checked.

Error in installing dependency

Hi,

I am getting the following error when installing dependencies. I wonder how I can fix it?

Thanks!

Installed /usr/local/lib/python2.7/dist-packages/p4_hlir-0.9.35-py2.7.egg
Processing dependencies for p4-hlir==0.9.35
Searching for ply==3.8
Best match: ply 3.8
Processing ply-3.8-py2.7.egg
ply 3.8 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/ply-3.8-py2.7.egg
Finished processing dependencies for p4-hlir==0.9.35
Cloning into 'p4c-graphs'...
Username for 'https://github.com': imehrdad2012
Password for 'https://[email protected]':
remote: Repository not found.
fatal: repository 'https://github.com/p4lang/p4c-graphs.git/' not found
moradi@dahlia:~/p4factory$ sudo bash install.sh

Issue with mininet/swl_ospf.py

I have finished installing up to Integration with Mininet and Docker, and tried to run OSPF (Quagga), but I was not able to ping from h1 to h2. I got the following error. (I was able to ping using the statically configured setup mininet/swl_l3_static.py)

sudo ./swl_ospf.py
*** Configuring hosts
h1 h2
*** Starting controller

*** Starting 2 switches
sw1 Starting P4 docker switch sw1
sw2 Starting P4 docker switch sw2

*** Starting CLI:
mininet> h1 ping h2
PING 172.16.102.5 (172.16.102.5) 56(84) bytes of data.
From 172.16.101.5 icmp_seq=1 Destination Host Unreachable
From 172.16.101.5 icmp_seq=2 Destination Host Unreachable
From 172.16.101.5 icmp_seq=3 Destination Host Unreachable

mininet> h1 arp
Address HWtype HWaddress Flags Mask Iface
172.16.101.1 (incomplete) h1-eth0

Any idea on what the problem is and how I can fix this issue?

Thanks.

no autogen.sh in submodules sub-directories !!!!!

Hi,

I'm new to P4. I'm trying to install p4factory. however, when I try to run ''./autogen.sh " I encounter the following errors:
./autogen.sh: 1: ./autogen.sh: ./autogen.sh: not found
./autogen.sh: 2: cd: can't cd to submodules/bm/
./autogen.sh: 3: cd: can't cd to submodules/p4c-bm/pd_mk/
./autogen.sh: 4: cd: can't cd to submodules/p4ofagent

If fact, there is no autogen.sh file in submodules sub-directories.
I have already ran ./install_deps.sh and sudo p4factory/tools/veth_setup.sh commands.

Any idea?

INT: Anomaly on stopping the reference application

I studied and followed the instruction on p4factory/tree/master/apps/int

The environment was setup successfully. And running the reference application was OK on the terminal, but seemed no interaction with the Web client.

When I try to restarting-the-reference-application by running:

cd p4factory/mininet
sudo ./int_cleanup.sh

I received such output:

docker: "stop" requires a minimum of 1 argument.
See 'docker stop --help'.

Usage:  docker stop [OPTIONS] CONTAINER [CONTAINER...]

Stop a running container.
Sending SIGTERM and then SIGKILL after a grace period
Cannot find device "vm-eth21"
Cannot find device "vm-eth22"
Cannot find device "vm-eth23"
Cannot find device "vm-eth24"
Cannot find device "veth-t1"
testbr1: ERROR while getting interface flags: No such device
bridge testbr1 doesn't exist; can't delete it

targets/basic_routing

When the first installation,I follow the README.
cd p4factory/targets/basic_routing/ make bm sudo ./behavioral-model
It is successful.
But today,I want to do the same thing,use these code
sudo ./behavioral-mode
error
`wpq@wpq-VirtualBox:~/p4factory/targets/basic_routing$ sudo ./behavioral-model
No PD RPC server address specified, using 127.0.0.1:9090
No listener specified, switch will run in standalone mode

P4 Program: basic_routing

Starting RPC server on port 9090
bmi_port_interface_add(port_mgr, veth_name, n_veth, pcap_filename): ERROR -1 at main.c:434wpq@wpq-VirtualBox:~/p4factory/targets/basic_routing$
`

thx

adding entries to Action profile

I have a table with an action profile to implement ecmp. The code complies, how ever i am unable to add any entries to the table. A error is thrown saying the table does not exists. How do you add entries to a table that has an action profile?

Problem on building the docker image

My testing OS is ubuntu-14.04.3-desktop-amd64.

I followed every steps to setup the environment, and repeat several times, but always stuck on building the docker image.

After I run:

make docker-image

it executed for a while, and stuck after these output:

    Compiling : bm::p4_pd_rpc_constants.cpp
    Compiling : bm::conn_mgr_pd_rpc_constants.cpp
    Compiling : bm::mc_pd_rpc_constants.cpp
    Compiling : bm::res_constants.cpp
    Compiling : bm::p4_pd_rpc_types.cpp
    Compiling : bm::conn_mgr_pd_rpc_types.cpp
    Compiling : bm::mc_pd_rpc_types.cpp
    Compiling : bm::res_types.cpp
    Compiling : bm::dc.cpp
    Compiling : bm::conn_mgr.cpp
    Compiling : bm::mc.cpp
Copying python thrift files
WARNING: No libraries specified
INFO: Status: Preprocessing /tmp/tmp4uucfo.h
INFO: Status: gcc -E -U __GNUC__ -dD -I/usr/include -I/p4factory/submodules/switchsai/submodules/ocpsai/sai/inc "-Dinline=" "-D__inline__=" "-D__extension__=" "-D__const=const" "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" "/tmp/tmp4uucfo.h"
INFO: Status: Parsing /tmp/tmp4uucfo.h
INFO: Status: Processing description list.
WARNING: Macro "SAI_MAX_FIRMWARE_PATH_NAME_LEN" depends on an unknown identifier "PATH_MAX". Macro "SAI_MAX_FIRMWARE_PATH_NAME_LEN" will not be output
INFO: Status: Writing to /p4factory/targets/switch/tests/pd_thrift/switch_sai_thrift/sai_headers.py.
INFO: Status: Wrapping complete.

I waited for hours, no any further progress

p4factory/mininet/openflow_l2.py execution problem

I have already run "make bm-p4ofagent PLUGIN_OPENFLOW=1" command in p4factory/targets/switch to build the switch target with the Openflow Agent, but when I execute the openflow_l2.py there is the error message:
Traceback (most recent call last):
File "./openflow_l2.py", line 190, in
main()
File "./openflow_l2.py", line 179, in main
configure_switch()
File "./openflow_l2.py", line 122, in configure_switch
setup_bd(client, conn_mgr)
File "./openflow_l2.py", line 75, in setup_bd
action_spec = dc_set_bd_action_spec_t(
NameError: global name 'dc_set_bd_action_spec_t' is not defined

How could I fix it ? Thank you!

INT feature fails to build

I used the instructions in the README.md file for the INT code at the URL below.

https://github.com/p4lang/p4factory/tree/master/apps/int

The code fails to build with a Thrift error. I am using the correct version of Linux kernel (4.2.0-42-generic) and Ubuntu 15.10.

My P4 factory install worked fine and tested OK. The Docker install tested OK as well.

However, I just can't get "sudo make docker-image" to work and it complains that Thrift.h is not installed but I have installed Thrift. The error is below.

"configure: error: Thrift headers not found. Install Thrift from http://thrift.apache.org/docs/install/"

It would also be good to add notes to the INT README.md file as to why Docker is needed. Is it to replace a VM for Mininet use? Also, many instructions need sudo privilege to execute but the README.md file does not include the sudo in the notes.

Question in the <Towards a better behavioral model: bmv2> part

Hi, Thank you for looking my questions! Sorry to have troubled you, I hope you don't mind.

When I followed the part Towards a better behavioral model: bmv2:

cd targets/l2_switch/bmv2/
  make bm
  ./run_bm.sh       # to start the data plane 
  sudo ./drivers    # in a second terminal, to start the PD APIs (RPC server)

I tried ./run_bm.sh, it happened that:

/home/wasdns/p4factory/submodules/bm/targets/simple_switch/.libs/lt-simple_switch: error while loading shared libraries: libnanomsg.so.5.0.0: cannot open shared object file: No such file or directory

But I had installed the nanomsg. Did I install the dependencies the wrong way? If not, how can I solved this problem?
I installed the p4factory again, but it still happened.

Thank you very much !

Integration with Mininet

When I first runned the scripts named run_demo.sh and run_add_demo_entries.bash, they could work without errors and h1 could ping h2 successfully. However, some days later, the script of the run_add_demo_entries.bash could not connet to the port of 22222. I found that the the script of the run_demo.bash could not enable correspoing port (22222) successfully!
How could I solve this problem?


Integration with Mininet

Integration with Mininet provides a way to instantiate a network of nodes each running a data plane described in P4.

We provide a Mininet integration for one of our existing targets: simple_router

To run it, do the following:

cd p4factory/targets/simple_router/
make bm
./run_demo.bash
To install some table entries, run the following (in a different terminal):

./run_add_demo_entries.bash
You can then type commands in the Mininet CLI:

mininet> h1 ping h2


Thrift RPC Exception

I tried the "Integration with Mininet" example of P4. When I enter "./run_add_demo_entries.bash", I get a thrift exception

thrift.transport.TTransport.TTransportException: Could not connect to localhost:22222
Traceback (most recent call last):
File "../../cli/pd_cli.py", line 691, in
main(sys.argv[1:])
File "../../cli/pd_cli.py", line 679, in main
pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)
File "../../cli/pd_cli.py", line 35, in init
self._thrift_client = pd_thrift_client.ThriftClient(self._module, thrift_server, port, self._p4_name)
File "/home/mininet/p4/p4factory/cli/pd_thrift_client.py", line 55, in init
self.setup(hostname, port)
File "/home/mininet/p4/p4factory/cli/pd_thrift_client.py", line 77, in setup
self._transport.open()
File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 149, in open
return self.__trans.open()
File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 101, in open
message=message)
thrift.transport.TTransport.TTransportException: Could not connect to localhost:22222

When I entered the following command

home/mininet/p4/p4factory/targets/simple_router/behavioral-model --name s1 --dpid 0000000000000001 -i s1-eth1 -i s1-eth2 --listener 127.0.0.1:11111 --pd-server 127.0.0.1:22222

I get the following message

PD server address is 127.0.0.1:22222
P4 Program: simple_router
Starting RPC server on port 22222
No p4nsdb address specified, using 127.0.0.1:6379
Connected to P4NS DB
P4NSDB: could not create datapath, s1 already exists

Do you know what I am doing wrong?

Dump data in logfile

Is there a way to dump data/the whole packet into the logfile or elsewhere?

The pcap dumps that are generated by mininet seem to not include all the packets going in on the device.

If there is a better place to ask questions like this, please just tell me, thanks!

WARNING: No route found for IPv6 destination :: (no default route?)

When i use the following steps am getting the below mentioned Error message....

To run a simple test, run this in a different terminal:
cd p4factory/targets/basic_routing/
sudo python run_tests.py --test-dir tests/ptf-tests/

Can anyone give a solution. Thank you in advance.

~/p4factory/targets/basic_routing$ sudo python run_tests.py --test-dir tests/ptf-tests/
WARNING: No route found for IPv6 destination :: (no default route?)
routing.TwoBdLpmTest ... ERROR

ERROR: routing.TwoBdLpmTest

Traceback (most recent call last):
File "/home/maha/p4factory/targets/basic_routing/../../testutils/pd_base_tests.py", line 65, in setUp
ThriftInterface.setUp(self)
File "/home/maha/p4factory/targets/basic_routing/../../testutils/pd_base_tests.py", line 49, in setUp
self.transport.open()
File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TTransport.py", line 149, in open
return self.__trans.open()
File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 101, in open
message=message)
TTransportException: Could not connect to localhost:9090


Ran 1 test in 0.002s

FAILED (errors=1)


ATTENTION: SOME TESTS DID NOT PASS!!!

The following tests errored:
TwoBdLpmTest


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.