GithubHelp home page GithubHelp logo

sai-p4-bm's Introduction

SAI BEHAVIORAL MODEL

This repository clearly defines widely accepted network switch behaviour. The switch behavioral model provides a commom framework for all network vendors and users. It meant to describe the standard ethernet switch features and flows. The model enables for both users and vendors to experiance the SAI switch model using SAI API over P4 soft switch.

Repository Structure

The repository consist of:

P4 soft-switch

P4_14 source files to be complied by the p4c complier Can be independently configured via the CLI interface.

SAI adapter

C source files implementation for the SAI API build for P4 soft switch model. SAI lib Tests frameworks: PTF, unittests.

Example

Example applications built on top of SAI api. Currently only teamd based lacp app exists.

Insatllation Instructions

Clone this repository recuresively with its submodules:
git clone --recursive https://github.com/Mellanox/SAI-P4-BM

The installation should be in the following order:

  1. Enter p4-switch/ dir, and follow the readme instructions.
  2. Enter sai_adapter/ dir, and follow the readme instructions.

Architecture

The following image describes the architecture of the SAI bm:

sai-p4-bm's People

Contributors

anirudhsk avatar antoninbas avatar davidesanvito avatar dtalayco avatar grodtron avatar mattyk avatar mbudiu-bfn avatar notmem avatar sachinbahadur avatar snifbh avatar yi-tseng avatar yuri91 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

Watchers

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

sai-p4-bm's Issues

Miscellaneous Issues

I am using Ubuntu 18.04. I already have behavioral-model working on my machine since its used by p4c. Thus, the machine has all dependencies that the behavioral-model needs. But, still, using the behavioral-model in sai-p4-bm, I run into build problems.

  1. First the README.md file in the top-level directory should say, "use --recursive" to git clone the software or the behavioral-model is not downloaded.
  2. The submodule of behavioral-model does not seem to be a correct version because it fails to compile spdlog.h. I removed the behavioral-model from SAI-P4-BM/p4-switch/ and downloaded the latest one from github and then behavioral-model build successfully.
  3. However, the make in SAI-P4-BM/p4-switch/ fails. The failure is due to these four files:

p4-switch/sai-p4-target/main.cpp
p4-switch/sai-p4-target/primitives.cpp
p4-switch/sai-p4-target/simple_switch.cpp
/p4-switch/sai-p4-target/simple_switch.h

I had to change simple_switch.h to fix the compilation 'override' error.

diff --git a/p4-switch/sai-p4-target/simple_switch.h b/p4-switch/sai-p4-target/simple_switch.h
index fbdaf77..80495d6 100644
--- a/p4-switch/sai-p4-target/simple_switch.h
+++ b/p4-switch/sai-p4-target/simple_switch.h
@@ -75,11 +75,11 @@ class SimpleSwitch : public Switch {
   // by default, swapping is off
   explicit SimpleSwitch(int max_port = 256, bool enable_swap = false);
 
-  int receive(int port_num, const char *buffer, int len) override;
+  int receive(int port_num, const char *buffer, int len) /*override*/;
 
-  void start_and_return() override;
+  void start_and_return() /*override*/;
 
-  void reset_target_state() override;
+  void reset_target_state() /*override*/;
 
   int mirroring_mapping_add(mirror_id_t mirror_id, int egress_port) {
     mirroring_map[mirror_id] = egress_port;

I also had to comment out code in simple_switch.cpp to fix its compilation.

diff --git a/p4-switch/sai-p4-target/simple_switch.cpp b/p4-switch/sai-p4-target/simple_switch.cpp
index 36d9650..5e4f0b4 100644
--- a/p4-switch/sai-p4-target/simple_switch.cpp
+++ b/p4-switch/sai-p4-target/simple_switch.cpp
@@ -276,10 +276,12 @@ SimpleSwitch::copy_ingress_pkt(
   phv_copy->reset_metadata();
   FieldList *field_list = this->get_field_list(field_list_id);
   const PHV *phv = packet->get_phv();
-  for (const auto &p : *field_list) {
+#if 0  
+  for (const auto &p : field_list) {
     phv_copy->get_field(p.header, p.offset)
         .set(phv->get_field(p.header, p.offset));
   }
+#endif  
   phv_copy->get_field("standard_metadata.instance_type").set(copy_type);
   return packet_copy;
 }
@@ -483,10 +485,12 @@ SimpleSwitch::egress_thread(size_t worker_id) {
             packet->clone_with_phv_reset_metadata_ptr();
         PHV *phv_copy = packet_copy->get_phv();
         FieldList *field_list = this->get_field_list(field_list_id);
+#if 0		
         for (const auto &p : *field_list) {
           phv_copy->get_field(p.header, p.offset)
             .set(phv->get_field(p.header, p.offset));
         }
+#endif		
         phv_copy->get_field("standard_metadata.instance_type")
             .set(PKT_INSTANCE_TYPE_EGRESS_CLONE);
         enqueue(egress_port, std::move(packet_copy));
@@ -522,10 +526,12 @@ SimpleSwitch::egress_thread(size_t worker_id) {
         std::unique_ptr<Packet> packet_copy = packet->clone_no_phv_ptr();
         PHV *phv_copy = packet_copy->get_phv();
         phv_copy->reset_metadata();
+#if 0		
         for (const auto &p : *field_list) {
           phv_copy->get_field(p.header, p.offset)
               .set(phv->get_field(p.header, p.offset));
         }
+#endif		
         phv_copy->get_field("standard_metadata.instance_type")
             .set(PKT_INSTANCE_TYPE_RECIRC);

See log below.

/SimpleSwitch_server.o
primitives.cpp: In member function ‘virtual void exit_::operator()()’:
primitives.cpp:148:15: error: invalid use of incomplete type ‘class bm::Packet’
     get_packet().mark_for_exit();
     ~~~~~~~~~~^~
In file included from ../behavioral-model/include/bm/bm_sim/actions.h:83:0,
                 from primitives.cpp:21:
../behavioral-model/include/bm/bm_sim/phv.h:74:16: note: forward declaration of ‘class bm::Packet’
   friend class Packet;
                ^~~~~~
primitives.cpp: In member function ‘virtual void add_header::operator()(bm::Header&)’:
primitives.cpp:172:7: error: invalid use of incomplete type ‘class bm::Packet’
       packet.set_register(0, packet.get_register(0) + hdr.get_nbytes_packet());
       ^~~~~~
In file included from ../behavioral-model/include/bm/bm_sim/actions.h:83:0,
                 from primitives.cpp:21:
../behavioral-model/include/bm/bm_sim/phv.h:74:16: note: forward declaration of ‘class bm::Packet’
   friend class Packet;
                ^~~~~~
primitives.cpp:172:30: error: invalid use of incomplete type ‘class bm::Packet’
       packet.set_register(0, packet.get_register(0) + hdr.get_nbytes_packet());
                              ^~~~~~
In file included from ../behavioral-model/include/bm/bm_sim/actions.h:83:0,
                 from primitives.cpp:21:
../behavioral-model/include/bm/bm_sim/phv.h:74:16: note: forward declaration of ‘class bm::Packet’
   friend class Packet;
                ^~~~~~
primitives.cpp: In member function ‘virtual void remove_header::operator()(bm::Header&)’:
primitives.cpp:192:7: error: invalid use of incomplete type ‘class bm::Packet’
       packet.set_register(0, packet.get_register(0) - hdr.get_nbytes_packet());
       ^~~~~~
In file included from ../behavioral-model/include/bm/bm_sim/actions.h:83:0,
                 from primitives.cpp:21:
../behavioral-model/include/bm/bm_sim/phv.h:74:16: note: forward declaration of ‘class bm::Packet’
   friend class Packet;
                ^~~~~~
primitives.cpp:192:30: error: invalid use of incomplete type ‘class bm::Packet’
       packet.set_register(0, packet.get_register(0) - hdr.get_nbytes_packet());
                              ^~~~~~
In file included from ../behavioral-model/include/bm/bm_sim/actions.h:83:0,
                 from primitives.cpp:21:
../behavioral-model/include/bm/bm_sim/phv.h:74:16: note: forward declaration of ‘class bm::Packet’
   friend class Packet;
                ^~~~~~
primitives.cpp: In member function ‘virtual void modify_field_with_hash_based_offset::operator()(bm::Data&, const bm::Data&, const bm::NamedCalculation&, const bm::Data&)’:
primitives.cpp:268:8: error: invalid use of incomplete type ‘const class bm::NamedCalculation’
       (hash.output(get_packet()) % size.get<uint64_t>()) + base.get<uint64_t>();
        ^~~~
In file included from primitives.cpp:21:0:
../behavioral-model/include/bm/bm_sim/actions.h:95:7: note: forward declaration of ‘class bm::NamedCalculation’
 class NamedCalculation;
       ^~~~~~~~~~~~~~~~
primitives.cpp: In member function ‘virtual void execute_meter::operator()(bm::MeterArray&, const bm::Data&, bm::Field&)’:
primitives.cpp:286:13: error: invalid use of incomplete type ‘class bm::MeterArray’
     dst.set(meter_array.execute_meter(get_packet(), idx.get_uint()));
             ^~~~~~~~~~~
In file included from primitives.cpp:21:0:
../behavioral-model/include/bm/bm_sim/actions.h:96:7: note: forward declaration of ‘class bm::MeterArray’
 class MeterArray;
       ^~~~~~~~~~
primitives.cpp: In member function ‘virtual void count::operator()(bm::CounterArray&, const bm::Data&)’:
primitives.cpp:294:5: error: invalid use of incomplete type ‘class bm::CounterArray’
     counter_array.get_counter(idx.get_uint()).increment_counter(get_packet());
     ^~~~~~~~~~~~~
In file included from primitives.cpp:21:0:
../behavioral-model/include/bm/bm_sim/actions.h:97:7: note: forward declaration of ‘class bm::CounterArray’
 class CounterArray;
       ^~~~~~~~~~~~
primitives.cpp: In member function ‘virtual void truncate_::operator()(const bm::Data&)’:
primitives.cpp:352:15: error: invalid use of incomplete type ‘class bm::Packet’
     get_packet().truncate(truncated_length.get<size_t>());
     ~~~~~~~~~~^~
In file included from ../behavioral-model/include/bm/bm_sim/actions.h:83:0,
                 from primitives.cpp:21:
../behavioral-model/include/bm/bm_sim/phv.h:74:16: note: forward declaration of ‘class bm::Packet’
   friend class Packet;
                ^~~~~~
Makefile:701: recipe for target 'primitives.lo' failed
make[2]: *** [primitives.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from simple_switch.cpp:31:0:
simple_switch.h:78:7: error: ‘int SimpleSwitch::receive(int, const char*, int)’ marked ‘override’, but does not override
   int receive(int port_num, const char *buffer, int len) override;
       ^~~~~~~
simple_switch.h:80:8: error: ‘void SimpleSwitch::start_and_return()’ marked ‘override’, but does not override
   void start_and_return() override;
        ^~~~~~~~~~~~~~~~
simple_switch.h:82:8: error: ‘void SimpleSwitch::reset_target_state()’ marked ‘override’, but does not override
   void reset_target_state() override;
        ^~~~~~~~~~~~~~~~~~
simple_switch.cpp: In member function ‘std::unique_ptr<bm::Packet> SimpleSwitch::copy_ingress_pkt(const std::unique_ptr<bm::Packet>&, SimpleSwitch::PktInstanceType, bm::p4object_id_t)’:
simple_switch.cpp:279:25: error: ‘begin’ was not declared in this scope
   for (const auto &p : *field_list) {
                         ^~~~~~~~~~
simple_switch.cpp:279:25: note: suggested alternatives:
In file included from /usr/include/c++/7/string:51:0,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:27,
                 from simple_switch.cpp:21:
/usr/include/c++/7/bits/range_access.h:87:5: note:   ‘std::begin’
     begin(_Tp (&__arr)[_Nm])
     ^~~~~
In file included from /usr/include/boost/range/functions.hpp:18:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^~~~~
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/iter_fold_if.hpp:18,
                 from /usr/include/boost/mpl/find_if.hpp:19,
                 from /usr/include/boost/multiprecision/number.hpp:13,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/mpl/begin_end_fwd.hpp:22:38: note:   ‘boost::mpl::begin’
 template< typename Sequence > struct begin;
                                      ^~~~~
In file included from /usr/include/boost/range/functions.hpp:18:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^~~~~
simple_switch.cpp:279:25: error: ‘end’ was not declared in this scope
   for (const auto &p : *field_list) {
                         ^~~~~~~~~~
simple_switch.cpp:279:25: note: suggested alternatives:
In file included from /usr/include/c++/7/string:51:0,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:27,
                 from simple_switch.cpp:21:
/usr/include/c++/7/bits/range_access.h:97:5: note:   ‘std::end’
     end(_Tp (&__arr)[_Nm])
     ^~~
In file included from /usr/include/boost/range/functions.hpp:19:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^~~
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/iter_fold_if.hpp:18,
                 from /usr/include/boost/mpl/find_if.hpp:19,
                 from /usr/include/boost/multiprecision/number.hpp:13,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/mpl/begin_end_fwd.hpp:23:38: note:   ‘boost::mpl::end’
 template< typename Sequence > struct end;
                                      ^~~
In file included from /usr/include/boost/range/functions.hpp:19:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^~~
simple_switch.cpp: In member function ‘void SimpleSwitch::egress_thread(size_t)’:
simple_switch.cpp:486:31: error: ‘begin’ was not declared in this scope
         for (const auto &p : *field_list) {
                               ^~~~~~~~~~
simple_switch.cpp:486:31: note: suggested alternatives:
In file included from /usr/include/c++/7/string:51:0,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:27,
                 from simple_switch.cpp:21:
/usr/include/c++/7/bits/range_access.h:87:5: note:   ‘std::begin’
     begin(_Tp (&__arr)[_Nm])
     ^~~~~
In file included from /usr/include/boost/range/functions.hpp:18:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^~~~~
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/iter_fold_if.hpp:18,
                 from /usr/include/boost/mpl/find_if.hpp:19,
                 from /usr/include/boost/multiprecision/number.hpp:13,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/mpl/begin_end_fwd.hpp:22:38: note:   ‘boost::mpl::begin’
 template< typename Sequence > struct begin;
                                      ^~~~~
In file included from /usr/include/boost/range/functions.hpp:18:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^~~~~
simple_switch.cpp:486:31: error: ‘end’ was not declared in this scope
         for (const auto &p : *field_list) {
                               ^~~~~~~~~~
simple_switch.cpp:486:31: note: suggested alternatives:
In file included from /usr/include/c++/7/string:51:0,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:27,
                 from simple_switch.cpp:21:
/usr/include/c++/7/bits/range_access.h:97:5: note:   ‘std::end’
     end(_Tp (&__arr)[_Nm])
     ^~~
In file included from /usr/include/boost/range/functions.hpp:19:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^~~
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/iter_fold_if.hpp:18,
                 from /usr/include/boost/mpl/find_if.hpp:19,
                 from /usr/include/boost/multiprecision/number.hpp:13,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/mpl/begin_end_fwd.hpp:23:38: note:   ‘boost::mpl::end’
 template< typename Sequence > struct end;
                                      ^~~
In file included from /usr/include/boost/range/functions.hpp:19:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^~~
simple_switch.cpp:525:31: error: ‘begin’ was not declared in this scope
         for (const auto &p : *field_list) {
                               ^~~~~~~~~~
simple_switch.cpp:525:31: note: suggested alternatives:
In file included from /usr/include/c++/7/string:51:0,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:27,
                 from simple_switch.cpp:21:
/usr/include/c++/7/bits/range_access.h:87:5: note:   ‘std::begin’
     begin(_Tp (&__arr)[_Nm])
     ^~~~~
In file included from /usr/include/boost/range/functions.hpp:18:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^~~~~
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/iter_fold_if.hpp:18,
                 from /usr/include/boost/mpl/find_if.hpp:19,
                 from /usr/include/boost/multiprecision/number.hpp:13,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/mpl/begin_end_fwd.hpp:22:38: note:   ‘boost::mpl::begin’
 template< typename Sequence > struct begin;
                                      ^~~~~
In file included from /usr/include/boost/range/functions.hpp:18:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/begin.hpp:106:61: note:   ‘boost::range_adl_barrier::begin’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
                                                             ^~~~~
simple_switch.cpp:525:31: error: ‘end’ was not declared in this scope
         for (const auto &p : *field_list) {
                               ^~~~~~~~~~
simple_switch.cpp:525:31: note: suggested alternatives:
In file included from /usr/include/c++/7/string:51:0,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:27,
                 from simple_switch.cpp:21:
/usr/include/c++/7/bits/range_access.h:97:5: note:   ‘std::end’
     end(_Tp (&__arr)[_Nm])
     ^~~
In file included from /usr/include/boost/range/functions.hpp:19:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^~~
In file included from /usr/include/boost/mpl/begin_end.hpp:17:0,
                 from /usr/include/boost/mpl/iter_fold_if.hpp:18,
                 from /usr/include/boost/mpl/find_if.hpp:19,
                 from /usr/include/boost/multiprecision/number.hpp:13,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/mpl/begin_end_fwd.hpp:23:38: note:   ‘boost::mpl::end’
 template< typename Sequence > struct end;
                                      ^~~
In file included from /usr/include/boost/range/functions.hpp:19:0,
                 from /usr/include/boost/range/iterator_range_core.hpp:38,
                 from /usr/include/boost/lexical_cast.hpp:30,
                 from /usr/include/boost/multiprecision/detail/number_base.hpp:18,
                 from /usr/include/boost/multiprecision/detail/default_ops.hpp:10,
                 from /usr/include/boost/multiprecision/detail/generic_interconvert.hpp:9,
                 from /usr/include/boost/multiprecision/number.hpp:22,
                 from /usr/include/boost/multiprecision/gmp.hpp:9,
                 from ../behavioral-model/include/bm/bm_sim/bignum.h:25,
                 from ../behavioral-model/include/bm/bm_sim/data.h:34,
                 from ../behavioral-model/include/bm/bm_sim/stateful.h:46,
                 from ../behavioral-model/include/bm/bm_sim/parser.h:36,
                 from simple_switch.cpp:21:
/usr/include/boost/range/end.hpp:100:61: note:   ‘boost::range_adl_barrier::end’
 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
                                                             ^~~
In file included from thrift/src/SimpleSwitch_server.cpp:42:0:
./simple_switch.h:78:7: error: ‘int SimpleSwitch::receive(int, const char*, int)’ marked ‘override’, but does not override
   int receive(int port_num, const char *buffer, int len) override;
       ^~~~~~~
./simple_switch.h:80:8: error: ‘void SimpleSwitch::start_and_return()’ marked ‘override’, but does not override
   void start_and_return() override;
        ^~~~~~~~~~~~~~~~
./simple_switch.h:82:8: error: ‘void SimpleSwitch::reset_target_state()’ marked ‘override’, but does not override
   void reset_target_state() override;
        ^~~~~~~~~~~~~~~~~~
Makefile:701: recipe for target 'simple_switch.lo' failed
make[2]: *** [simple_switch.lo] Error 1
Makefile:701: recipe for target 'thrift/src/SimpleSwitch_server.lo' failed
make[2]: *** [thrift/src/SimpleSwitch_server.lo] Error 1
make[2]: Leaving directory '/home/hemant/SAI-P4-BM/p4-switch/sai-p4-target'
Makefile:472: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/hemant/SAI-P4-BM/p4-switch/sai-p4-target'
Makefile:396: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

  1. When can one expect the p4src to be ported to P4-16? If I can get past my failures above, I can test porting to P4-16.

Errors launching switch, running PTF

Hi, I get errors when switch is luanched. See the CLI runtime errors near the top. Code was cloned today.

chris@T1700-vbox-u14:~/sai/SAI-P4-BM/p4-softswitch/targets/P4-SAI$ sudo ./run_server.sh
Thrift port was not specified, will use 9090
Calling target program-options parser
Calling target program-options parser
Adding interface router_port1 as port 0
Thrift server was started
Adding interface sw_port0 as port 0
Adding interface sw_port1 as port 1
Adding interface sw_port2 as port 2
Adding interface sw_port3 as port 3
Adding interface sw_port4 as port 4
Adding interface sw_port5 as port 5
Adding interface sw_port6 as port 6
Adding interface sw_port7 as port 7
Adding interface cpu_port as port 8
Adding interface router_port0 as port 9
Thrift server was started
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/chris/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Obtaining JSON from switch...
Done
Control utility for runtime P4 table manipulation
RuntimeCmd: Setting default action of table_ingress_lag
action: action_set_l2if
runtime data:
RuntimeCmd: *** Unknown syntax: // table_set_default table_port_PVID action_set_pvid 1
RuntimeCmd: *** Unknown syntax: // table_set_default table_port_mode table action_set_port_mode 0
RuntimeCmd: Setting default action of table_port_configurations
action: action_set_port_configurations
runtime data: 00:01 00 00:00:05:ea 00 00
RuntimeCmd: Error: Invalid table name (table_port_ingress_l2_interface_type)
RuntimeCmd: Error: Invalid table name (table_subport_ingress_l2_interface_type)
RuntimeCmd: Setting default action of table_bridge_id_1q
action: action_set_bridge_id_vid
runtime data:
RuntimeCmd: Setting default action of table_ingress_vlan_filtering
action: _drop
runtime data:
RuntimeCmd: Setting default action of table_port_set_packet_vid_internal
action: action_set_packet_vid
runtime data:
RuntimeCmd: Setting default action of table_learn_fdb
action: action_learn_mac
runtime data:
RuntimeCmd: Setting default action of table_bridge_loopback_filter
action: _drop
runtime data:
RuntimeCmd: Setting default action of table_bridge_loopback_filter
action: _drop
runtime data:
RuntimeCmd: Setting default action of table_drop_tagged_internal
action: _nop
runtime data:
RuntimeCmd: Setting default action of table_drop_untagged_internal
action: _nop
runtime data:
RuntimeCmd: Adding entry to exact match table table_drop_tagged_internal
match key: EXACT-01
action: _drop
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_drop_untagged_internal
match key: EXACT-01
action: _drop
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_drop_untagged_internal
match key: EXACT-01
action: _drop
runtime data:
Invalid table operation (DUPLICATE_ENTRY)
RuntimeCmd: Setting default action of table_l2_trap
action: action_set_trap_id
runtime data: 00:ff
RuntimeCmd: Setting default action of table_trap_id
action: _nop
runtime data:
RuntimeCmd: Setting default action of table_egress_clone_internal
action: _nop
runtime data:
RuntimeCmd: Adding entry to exact match table table_egress_clone_internal
match key: EXACT-00:00:00:01
action: action_cpu_encap
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_egress_clone_internal
match key: EXACT-00:00:00:01
action: action_cpu_encap
runtime data:
Invalid table operation (DUPLICATE_ENTRY)
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-00
action: action_set_l2_if_type
runtime data: 03 00
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-01
action: action_set_l2_if_type
runtime data: 03 01
Entry has been added with handle 1
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-02
action: action_set_l2_if_type
runtime data: 03 02
Entry has been added with handle 2
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-03
action: action_set_l2_if_type
runtime data: 03 03
Entry has been added with handle 3
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-04
action: action_set_l2_if_type
runtime data: 03 04
Entry has been added with handle 4
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-05
action: action_set_l2_if_type
runtime data: 03 05
Entry has been added with handle 5
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-06
action: action_set_l2_if_type
runtime data: 03 06
Entry has been added with handle 6
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-07
action: action_set_l2_if_type
runtime data: 03 07
Entry has been added with handle 7
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-09
action: action_set_l2_if_type
runtime data: 03 09
Entry has been added with handle 8
RuntimeCmd: Adding entry to exact match table table_port_ingress_interface_type
match key: EXACT-09
action: action_set_l2_if_type
runtime data: 03 09
Invalid table operation (DUPLICATE_ENTRY)
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-00
action: action_forward_set_outIfType
runtime data: 00 00
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-01
action: action_forward_set_outIfType
runtime data: 01 00
Entry has been added with handle 1
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-02
action: action_forward_set_outIfType
runtime data: 02 00
Entry has been added with handle 2
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-03
action: action_forward_set_outIfType
runtime data: 03 00
Entry has been added with handle 3
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-04
action: action_forward_set_outIfType
runtime data: 04 00
Entry has been added with handle 4
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-05
action: action_forward_set_outIfType
runtime data: 05 00
Entry has been added with handle 5
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-06
action: action_forward_set_outIfType
runtime data: 06 00
Entry has been added with handle 6
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-07
action: action_forward_set_outIfType
runtime data: 07 00
Entry has been added with handle 7
RuntimeCmd: Adding entry to exact match table table_egress_br_port_to_if
match key: EXACT-07
action: action_forward_set_outIfType
runtime data: 07 00
Invalid table operation (DUPLICATE_ENTRY)
RuntimeCmd: Adding entry to exact match table table_port_set_packet_vid_internal
match key: EXACT-01
action: action_set_packet_vid
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-00 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-01 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 1
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-02 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 2
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-03 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 3
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-04 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 4
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-05 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 5
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-06 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 6
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-07 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 7
RuntimeCmd: Adding entry to exact match table table_ingress_vlan_filtering
match key: EXACT-07 EXACT-00:01
action: _nop
runtime data:
Invalid table operation (DUPLICATE_ENTRY)
RuntimeCmd: Setting default action of table_egress_vlan_filtering
action: _drop
runtime data:
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-00 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-01 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 1
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-02 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 2
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-03 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 3
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-04 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 4
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-05 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 5
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-06 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 6
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-07 EXACT-00:01
action: _nop
runtime data:
Entry has been added with handle 7
RuntimeCmd: Adding entry to exact match table table_egress_vlan_filtering
match key: EXACT-07 EXACT-00:01
action: _nop
runtime data:
Invalid table operation (DUPLICATE_ENTRY)
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-00 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-01 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 1
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-02 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 2
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-03 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 3
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-04 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 4
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-05 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 5
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-06 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 6
RuntimeCmd: Adding entry to exact match table table_egress_vlan_tag
match key: EXACT-07 EXACT-00:01 VALID-
action: action_forward_vlan_untag
runtime data:
Entry has been added with handle 7
RuntimeCmd: Setting default action of table_xSTP_instance
action: action_set_stp_id
runtime data: 01
RuntimeCmd: Setting default action of table_xSTP_instance
action: action_set_stp_id
runtime data: 01
RuntimeCmd: Setting default action of table_mc_lookup_mode
action: action_set_mcast_lookup_mode
runtime data: 00
RuntimeCmd: Setting default action of table_mc_fdb
action: action_set_mc_fdb_miss
runtime data:
RuntimeCmd: Setting default action of table_mc_l2_sg_g
action: action_set_mc_fdb_miss
runtime data:
RuntimeCmd: Setting default action of table_mc_l2_sg_g
action: action_set_mc_fdb_miss
runtime data:
RuntimeCmd: Setting default action of table_mc_l2_sg_g
action: action_set_mc_fdb_miss
runtime data:
RuntimeCmd: Setting default action of table_broadcast
action: action_forward_mc_set_if_list
runtime data: 00:01
RuntimeCmd: Setting default action of table_flood
action: action_forward_mc_set_if_list
runtime data: 00:01
RuntimeCmd: Adding entry to exact match table table_cpu_forward
match key: VALID-
action: action_forward_cpu
runtime data:
Entry has been added with handle 0
RuntimeCmd: Adding entry to exact match table table_cpu_forward
match key: VALID-
action: action_forward_cpu
runtime data:
Invalid table operation (DUPLICATE_ENTRY)
RuntimeCmd: Creating node with rid 1 , port map 1011111111 and lag map
node was created with handle 0
RuntimeCmd: Creating multicast group 1
RuntimeCmd: Associating node 0 to multicast group 1
RuntimeCmd:
No Thrift port specified, using CLI default
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/chris/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Obtaining JSON from switch...
Done
Control utility for runtime P4 table manipulation
RuntimeCmd: RuntimeCmd:
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/chris/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Obtaining JSON from switch...
Done
Control utility for runtime P4 table manipulation
RuntimeCmd: Setting default action of table_ingress_l3_if
action: _drop
runtime data:
RuntimeCmd:
router and bridge are running send SIGINT to close

  • Chris Sommers

Some L2 PTF tests failures

See below. Thanks.

chris@T1700-vbox-u14:~/sai/SAI-P4-BM/sai_adapter/test/ptf_tests$ sudo ./run_ptf_l2.sh
host_port1 0 1
host_port0 0 0
host_port7 0 7
host_port6 0 6
host_port5 0 5
host_port4 0 4
host_port3 0 3
host_port2 0 2
sail2.L2AccessToAccessVlanTest ...
Sending L2 packet port 1 -> port 2 [access vlan=10])
ok


Ran 1 test in 1.938s

OK
sail2.L2TrunkToTrunkVlanTest ...
Sending L2 packet - port 1 -> port 2 [trunk vlan=10])
ok


Ran 1 test in 1.048s

OK
sail2.L2AccessToTrunkVlanTest ...
Sending L2 packet - port 1 -> port 2 [trunk vlan=10])
ok


Ran 1 test in 0.948s

OK
sail2.L2TrunkToAccessVlanTest ...
Sending L2 packet - port 1 -> port 2 [trunk vlan=10])
FAIL

======================================================================
FAIL: sail2.L2TrunkToAccessVlanTest

Traceback (most recent call last):
File "tests_new/sail2.py", line 206, in runTest
verify_packets(self, exp_pkt, [1])
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2240, in verify_packets
verify_no_other_packets(test, device_number=device_number)
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2217, in verify_no_other_packets
test.assertTrue(rcv_pkt == None, "Unexpected packet on device %d, port %r" % (device_number, rcv_port))
AssertionError: Unexpected packet on device 0, port 0


Ran 1 test in 0.840s

FAILED (failures=1)
sail2.L2FloodTest ...
Flood test on ports 1, 2 and 3
FAIL

======================================================================
FAIL: sail2.L2FloodTest

Traceback (most recent call last):
File "tests_new/sail2.py", line 257, in runTest
verify_packets(self, exp_pkt, [1, 2])
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2240, in verify_packets
verify_no_other_packets(test, device_number=device_number)
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2217, in verify_no_other_packets
test.assertTrue(rcv_pkt == None, "Unexpected packet on device %d, port %r" % (device_number, rcv_port))
AssertionError: Unexpected packet on device 0, port 3


Ran 1 test in 0.727s

FAILED (failures=1)
sail2.L2LagTest ... FAIL

======================================================================
FAIL: sail2.L2LagTest

Traceback (most recent call last):
File "tests_new/sail2.py", line 333, in runTest
rcv_idx = verify_any_packet_any_port(self, [exp_pkt], [0, 1, 2])
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2337, in verify_any_packet_any_port
verify_no_other_packets(test, device_number=device_number)
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2217, in verify_no_other_packets
test.assertTrue(rcv_pkt == None, "Unexpected packet on device %d, port %r" % (device_number, rcv_port))
AssertionError: Unexpected packet on device 0, port 4


Ran 1 test in 0.339s

FAILED (failures=1)
sail2.L2VlanBcastUcastTest ... FAIL

======================================================================
FAIL: sail2.L2VlanBcastUcastTest

Traceback (most recent call last):
File "tests_new/sail2.py", line 433, in runTest
verify_packets(self, bcast_pkt, expected_ports)
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2240, in verify_packets
verify_no_other_packets(test, device_number=device_number)
File "/home/chris/sai/SAI-P4-BM/sai_adapter/test/ptf_tests/ptf/src/ptf/testutils.py", line 2217, in verify_no_other_packets
test.assertTrue(rcv_pkt == None, "Unexpected packet on device %d, port %r" % (device_number, rcv_port))
AssertionError: Unexpected packet on device 0, port 7


Ran 1 test in 0.560s

FAILED (failures=1)


ATTENTION: SOME TESTS DID NOT PASS!!!

The following tests failed:
L2TrunkToAccessVlanTest, L2FloodTest, L2LagTest, L2VlanBcastUcastTest


chris@T1700-vbox-u14:~/sai/SAI-P4-BM/sai_adapter/test/ptf_tests$ sudo ./run_ptf_l3.sh
WARNING: No route found for IPv6 destination :: (no default route?)
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: /home/chris/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
host_port1 0 1
host_port0 0 0
host_port7 0 7
host_port6 0 6
host_port5 0 5
host_port4 0 4
host_port3 0 3
host_port2 0 2
sail3.L3IPv4HostTest ...
Sending packet port 1 -> port 2 (192.168.0.1 -> 10.10.10.1 [id = 101])
ok


Ran 1 test in 0.896s

OK

make failed!!

Hi,everyone
I not change anything.But i get some error when i execute “make” in dir p4-switch.

The error is as follows:
In file included from simple_switch.cpp:31:0:
simple_switch.h:78:7: error: 鈥[01mint SimpleSwitch::receive(int, const char*, int)鈥marked 鈥[01moverride鈥 but does not override
int receive(int port_num, const char *buffer, int len) override;
^
simple_switch.h:80:8: error: 鈥[01mvoid SimpleSwitch::start_and_return()鈥marked 鈥[01moverride鈥 but does not override
void start_and_return() override;
^
simple_switch.h:82:8: error: 鈥[01mvoid SimpleSwitch::reset_target_state()鈥marked 鈥[01moverride鈥 but does not override
void reset_target_state() override;
^
simple_switch.cpp: In member function 鈥[01mstd::unique_ptrbm::Packet SimpleSwitch::copy_ingress_pkt(const std::unique_ptrbm::Packet&, SimpleSwitch::PktInstanceType, bm::p4object_id_t)鈥

                                                                      simple_switch.cpp:279:25: error: 鈥[01mbegin鈥was not declared in this scope

for (const auto &p : *field_list) {

This looks like the code is wrong in simple_switch.cpp.

p4c sai extension build error

In order to use SAI-P4-BM, I need to compile a P4 Soft Switch Model with SAI p4c extension. But when tried to build it, an error occurred (following https://github.com/opencomputeproject/SAI/blob/master/flexsai/p4/README.md):
Error copying directory from "/.../p4c/p4_14include" to "/.../p4c/build/p4_14include".
There was no p4_14include folder found.
Does anyone know how to fix this?

If I make an empty p4_14include dir and build, it fails because of:
terminate called after throwing an instance of 'Util::CompilationError'
what(): IntMod: Duplicate class name

Is there a plan to support sai1.3?

Hi,
I had trying to build sonic-buildimage for p4, but failed.
It looked like the SAI-P4-BM just support sai1.0, but sonic-buildimage use the sai1.3.
Is there a plan to support sai1.3?
thx.

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.