cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
6,788 Views
Registered: ‎03-09-2017

how to get iperf3 into petalinux 2017.1

Jump to solution

How can i get iperf3 into my petalinux boot image? I cannot see iperf tools in petalinux-config -c rootfs. I want to perform iperf test on the ethernet port and i found following posts

 

http://www.wiki.xilinx.com/Adding+New+RPM+Packages+in+meta-petalinux

 

http://www.wiki.xilinx.com/Getting+Started+With+Yocto+using+Repo+to+build+RPM+Packages

 

to get the package into petalinux and I understood that i have to download state-cache file from this following link https://www.xilinx.com/support/answers/69074.html  for my petalinux 2017.1. Am I on the right way? what is this state cache? Are zynq extras already available in petalinux?

 

 

1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
9,985 Views
Registered: ‎10-14-2015

you don't need to compile externally iperf3, as you already have it in petalinux. you can find the recipe in <your_petalinux_source_dir>/components/yocto/source/arm/layers/meta-oe/recipes-benchmark/iperf3

 

1) in your <project_dir>/project-spec/meta-user/recipes-core/images/petalinux-image.bbappend add the following line:

 IMAGE_INSTALL_append = " iperf3"  (be aware of the extra space)

2) in petalinux-config -c rootfs -> user packages, enable iperf3

 

and then build your image as usual

 

View solution in original post

15 Replies
Highlighted
Voyager
Voyager
6,779 Views
Registered: ‎06-24-2013

Hey @jenny_august13,

 

That's probably a little trickier, as iperf3 comes with a library to install.

If all you want to do is a quick test, it's probably way simpler to build iperf3 from the sources (on the target).

 

And in case you are lazy (and trusting), I just built iperf3 as (almost) static binary so that should work for you.

No need to compile anything, just download it (on/to the target) and you should be fine.

 

Hope this helps,

Herbert

-------------- Yes, I do this for fun!
Highlighted
Explorer
Explorer
6,774 Views
Registered: ‎03-09-2017
Ohh that would be great if you can share the source,thanks in advance
0 Kudos
Highlighted
Voyager
Voyager
6,759 Views
Registered: ‎06-24-2013

Hey @jenny_august13,

 

Sources are available on the IPerf site, here is what I did to compile it:

 

wget https://iperf.fr/download/source/iperf-3.1.3-source.tar.gz
tar xzf iperf-3.1.3-source.tar.gz
cd iperf-3.1.3
./configure
make

You'll get the binary in src/.libs/iperf3 and there is a wrapper you can immediately start under src/iperf3.

 

To build the static binary, I did the following:

cd src
gcc -O2 -static -o .libs/iperf3.static iperf3-main.o ./.libs/libiperf.a -lm

Hope this helps,

Herbert

-------------- Yes, I do this for fun!
Highlighted
Explorer
Explorer
6,755 Views
Registered: ‎03-09-2017
Yupp thankyou
0 Kudos
Highlighted
Voyager
Voyager
6,752 Views
Registered: ‎06-24-2013

You're welcome!

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Highlighted
Explorer
Explorer
6,719 Views
Registered: ‎03-09-2017
`gcc -O2 -static -o .libs/iperf3.static iperf3-main.o ./.libs/libiperf.a -lm
./.libs/libiperf.a(iperf_tcp.o): In function `iperf_tcp_listen':
/home/janani/iperf-3.1.3/src/iperf_tcp.c:175: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking`

When i try to compile, Iam getting the following warning message
0 Kudos
Highlighted
Explorer
Explorer
6,711 Views
Registered: ‎03-09-2017
Ahh there is no ubuntu core running on my target board and i cannot download using wget commands. I guess i have to build the iperf3 into the boot image of petalinux. And then boot it along .
0 Kudos
Highlighted
Explorer
Explorer
9,986 Views
Registered: ‎10-14-2015

you don't need to compile externally iperf3, as you already have it in petalinux. you can find the recipe in <your_petalinux_source_dir>/components/yocto/source/arm/layers/meta-oe/recipes-benchmark/iperf3

 

1) in your <project_dir>/project-spec/meta-user/recipes-core/images/petalinux-image.bbappend add the following line:

 IMAGE_INSTALL_append = " iperf3"  (be aware of the extra space)

2) in petalinux-config -c rootfs -> user packages, enable iperf3

 

and then build your image as usual

 

View solution in original post

Highlighted
Voyager
Voyager
6,700 Views
Registered: ‎06-24-2013

hey @jenny_august13,

 

When i try to compile, Iam getting the following warning message ...

This is expected, as modern glibc cannot build static binaries with name resolution.

That's why I call them pseudo static ... nevertheless they work fine on almost any modern system.

Sorry, that I forgot to mention that ...

 

But of course, if there is an available package/module for petalinux, that's the way to go.

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
Highlighted
Explorer
Explorer
5,017 Views
Registered: ‎03-09-2017
I have added the iperf3 from the recipies and now can i run the iperf3 server on my target board when linux boots on this? I have my iperf3 client running on my pc. Can i run iperf3 server for testing multi ethernet ports at a time? or should i run individually one after the other on my target board?
0 Kudos
Highlighted
Voyager
Voyager
5,007 Views
Registered: ‎06-24-2013

Hey @jenny_august13,

 

I have added the iperf3 from the recipies and now ...

can i run the iperf3 server on my target board when linux boots on this?

I hope that you can now run iperf3, otherwise something went wrong :)

 

I have my iperf3 client running on my pc.

You can run iperf3 as client or server and it is suggested to use both for proper testing.

I.e. for one test the target board is the client, for the other test the server - it is simple to switch by an option to iperf3.

 

Can i run iperf3 server for testing multi ethernet ports at a time?

Depends on the setup. When you have separate connections for each of the iperf3 server-client connections, you can run them in parallel to test the aggregated performance, but when you share the same connection or switch for several client-server connections you will also share the bandwidth.

 

or should i run individually one after the other on my target board?

At least for an initial test I would suggest to always run one client and one server on an otherwise clean network.

 

Hope this clarifies,

Herbert

-------------- Yes, I do this for fun!
Highlighted
Explorer
Explorer
4,986 Views
Registered: ‎03-09-2017

I have my iperf3 in user packages in petalinux added into my image. now I have booted my board with the image.ub , now where can i find the iperf3 added? I couldnot find it in /usr/bin or bin or sbin.

0 Kudos
Highlighted
Explorer
Explorer
4,962 Views
Registered: ‎03-09-2017
Yupp, solved once i add recipie which are in petalinux-image had sstate locked. To unlock we have to add SIGGEN_UNLOCKED_RECIPIES += "my-recipe" in project-spec/meta-user/conf/petalinuxbsp.conf. Then we can find it under /usr/bin when linux is booted.
0 Kudos
Highlighted
Contributor
Contributor
1,354 Views
Registered: ‎08-30-2018

My Petalinux-project has no components/yocto. Do I need to configure something to get those?

$ tree -d -L 2                                                                                                                  .                                                                                                                                                            ├── build                                                                                                                                                    │   ├── cache                                                                                                                                                │   ├── conf                                                                                                                                                 │   ├── downloads                                                                                                                                            │   ├── misc                                                                                                                                                 │   ├── sstate-cache                                                                                                                                         │   └── tmp                                                                                                                                                  ├── components                                                                                                                                               │   └── plnx_workspace                                                                                                                                                                                                                                                                                  ├── images                                                                                                                                                   │   └── linux                                                                                                                                                └── project-spec                                                                                                                                                        ├── configs                                                                                                                                                         ├── hw-description                                                                                                                                                    ├── meta-plnx-generated                                                                                                                                        └── meta-user                                                                                                                                            
0 Kudos
Highlighted
Contributor
Contributor
1,353 Views
Registered: ‎08-30-2018

 

.
├── build
│   ├── cache
│   ├── conf
│   ├── downloads
│   ├── misc
│   ├── sstate-cache
│   └── tmp
├── components
│   └── plnx_workspace
├── images
│   └── linux
├── project-spec
│   ├── configs
│   ├── hw-description
│   ├── meta-plnx-generated
│   └── meta-user
...

 

 

0 Kudos