[P4-dev] P4-dev Digest, Vol 13, Issue 1

Jon Castro castro.jon at gmail.com
Thu Sep 1 20:08:20 EDT 2016


Hi Sarath,

I'm glad to hear that you got a working setup.  You basically need to
recompile the new p4 source code with p4 compiler. The compiler creates a
new json file and you will need to restart the switch with the new json
content.

I'm pushing my experimental work on P4 in following github repo
https://github.com/p4kide . You may find useful MiniP4 project which
creates P4 networks based on configuration yaml file using Mininet. The
good news for you is that it takes care of compiling the p4 src and many
other stuff. So, you can just update your p4 code and restart mnp4.

The other project is an experimental implementation on Amazon VPC using P4.


Kind regards,
Jon

On Fri, Sep 2, 2016 at 9:57 AM, Sarath Kamisetty <sarath.kamisetty at gmail.com
> wrote:

> Another follow up question on this .. If I make any modifications to the
> p4src/*.p4 files, what are the steps to re-compile so I can run the unit
> tests and make sure nothing is broken ? Sorry if this was asked earlier, I
> couldn't find it in the archives.
>
> Thanks,
> Sarat
>
>
> On Thu, Sep 1, 2016 at 4:53 PM, Sarath Kamisetty <
> sarath.kamisetty at gmail.com> wrote:
>
>> Hi,
>>
>> #1. for bmv2, I had to do "make install" at the end (instead of just
>> "make") to install it in the standard location (this was pointed by Antonin
>> as well).
>>
>> #2. I wasn't aware of "git submodule update --init --recursive" as you
>> pointed out. I ended up doing the hard way ... did git clone manually under
>> the subdirs based on the errors I was seeing for p4-build/ (otherwise it
>> was empty) and also under switchsai/submodules/ to get SAI header files).
>>
>> Thanks for these consolidated steps, I now have a working setup.
>>
>> Thanks,
>> Sarat
>>
>> On Thu, Sep 1, 2016 at 1:39 PM, Jon Castro <castro.jon at gmail.com> wrote:
>>
>>> Did you execute git submodule update --init --recursive scripts?
>>>
>>> I use following commands to install all modules Ubuntu Trusty:
>>>
>>> sudo apt-get update
>>> sudo apt-get install python-dev python-pip git make -y
>>> sudo pip install scapy thrift networkx ctypesgen
>>>
>>> git clone https://github.com/p4lang/ptf
>>> cd ptf
>>> sudo python setup.py install
>>> cd ..
>>>
>>> git clone https://github.com/p4lang/p4c-bm.git p4c-bmv2
>>> cd p4c-bmv2
>>> sudo pip install -r requirements.txt
>>> sudo python setup.py install
>>> cd ..
>>>
>>>
>>> git clone https://github.com/p4lang/behavioral-model.git bmv2
>>> cd bmv2
>>> ./install_deps.sh
>>> ./autogen.sh
>>> ./configure --with-pdfixed
>>> make
>>> cd ..
>>>
>>> git clone https://github.com/p4lang/switch
>>> cd switch
>>> git submodule update --init --recursive
>>> ./autogen.sh
>>> ./configure --with-bmv2 --with-switchsai
>>>  make
>>>
>>> Kind regards,
>>> Jon
>>>
>>> On Fri, Sep 2, 2016 at 2:00 AM, <p4-dev-request at lists.p4.org> wrote:
>>>
>>>> Send P4-dev mailing list submissions to
>>>>         p4-dev at lists.p4.org
>>>>
>>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>>         http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>>>> or, via email, send a message with subject or body 'help' to
>>>>         p4-dev-request at lists.p4.org
>>>>
>>>> You can reach the person managing the list at
>>>>         p4-dev-owner at lists.p4.org
>>>>
>>>> When replying, please edit your Subject line so it is more specific
>>>> than "Re: Contents of P4-dev digest..."
>>>>
>>>>
>>>> Today's Topics:
>>>>
>>>>    1. Installing P4 sample switch (Sarath Kamisetty)
>>>>
>>>>
>>>> ----------------------------------------------------------------------
>>>>
>>>> Message: 1
>>>> Date: Wed, 31 Aug 2016 19:44:56 -0700
>>>> From: Sarath Kamisetty <sarath.kamisetty at gmail.com>
>>>> To: p4-dev at lists.p4.org
>>>> Subject: [P4-dev] Installing P4 sample switch
>>>> Message-ID:
>>>>         <CANxZJknKss5yNhTV-ybAKmUkh4bdNKKRQ4qnz4x62Vx8-8X=hQ at mail.gm
>>>> ail.com>
>>>> Content-Type: text/plain; charset="utf-8"
>>>>
>>>> Hi,
>>>>
>>>> I am trying to follow the instructions posted in
>>>> https://github.com/p4lang/switch to compile and run the switch
>>>> (switch.p4).
>>>> Is there one single script that performs all the steps ? I couldn't find
>>>> one. Any other documentation to get this up and running will be helpful.
>>>>
>>>> I did the following:
>>>>
>>>> #1) Installed PTF
>>>> #2) Installed p4c-bmv2
>>>> #3) Compiled bmv2 with --with-pdfixed option. Where do I install this ?
>>>> Instructions at https://github.com/p4lang/behavioral-model only
>>>> mention how
>>>> to compile, not about installing it in any location. It is unclear how
>>>> this
>>>> switch.p4 will use this path I compiled bmv2 in.
>>>>
>>>> At this point, I did the following under the switch/ directory
>>>>
>>>> ./autogen.sh
>>>>  ./configure --with-bmv2 --with-switchsai
>>>>  make
>>>>
>>>> And "make" failed promptly with the following error:
>>>>
>>>> [saratk at ubuntu:~/Projects/ws1/Closet/p4/matrix/apps/switch]make
>>>> make  all-recursive
>>>> make[1]: Entering directory
>>>> `/home/saratk/Projects/ws1/Closet/p4/matrix/apps/switch'
>>>> Making all in p4-build
>>>> make[2]: Entering directory
>>>> `/home/saratk/Projects/ws1/Closet/p4/matrix/apps/switch/p4-build'
>>>> make[2]: *** No rule to make target `all'.  Stop.
>>>> make[2]: Leaving directory
>>>> `/home/saratk/Projects/ws1/Closet/p4/matrix/apps/switch/p4-build'
>>>> make[1]: *** [all-recursive] Error 1
>>>> make[1]: Leaving directory
>>>> `/home/saratk/Projects/ws1/Closet/p4/matrix/apps/switch'
>>>> make: *** [all] Error 2
>>>> [saratk at ubuntu:~/Projects/ws1/Closet/p4/matrix/apps/switch]
>>>>
>>>> Suspecting something wrong with p4-build/, I followed instructions at
>>>> https://github.com/p4lang/p4-build/ under switch/p4-build/ and
>>>> "configure"
>>>> step failed:
>>>>
>>>> ./configure --with-bmv2 P4_NAME=switch
>>>> P4_PATH=/home/<user>/p4-apps/switch/p4src/switch.p4
>>>>
>>>> ...
>>>> ...
>>>> checking for vector... yes
>>>> checking for p4c-bmv2... /usr/local/bin/p4c-bmv2
>>>> *checking bm/pdfixed/pd_common.h usability... no*
>>>> *checking bm/pdfixed/pd_common.h presence... no*
>>>> *checking for bm/pdfixed/pd_common.h... no*
>>>> *configure: error: bmv2 pdfixed headers not found*
>>>> *configure: error: ./co**nfigure failed for p4-build*
>>>>
>>>> However, I do see these files from step 3 in different path. Is there
>>>> some
>>>> environment variable that I need to set so this step succeeds ? Pls.
>>>> help.
>>>>
>>>> Thanks,
>>>> Sarat
>>>> -------------- next part --------------
>>>> An HTML attachment was scrubbed...
>>>> URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachmen
>>>> ts/20160831/90309706/attachment-0001.html>
>>>>
>>>> ------------------------------
>>>>
>>>> Subject: Digest Footer
>>>>
>>>> _______________________________________________
>>>> P4-dev mailing list
>>>> P4-dev at p4.org
>>>> Listinfo - http://mail.p4.org/mailman/listinfo/p4-dev_p4.org
>>>> Archives - http://mail.p4.org/pipermail/p4-dev_p4.org/
>>>>
>>>>
>>>> ------------------------------
>>>>
>>>> End of P4-dev Digest, Vol 13, Issue 1
>>>> *************************************
>>>>
>>>
>>>
>>> _______________________________________________
>>> P4-dev mailing list
>>> P4-dev at lists.p4.org
>>> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160902/9638cd9f/attachment-0002.html>


More information about the P4-dev mailing list