[ovs-discuss] [EXTERNAL] Re: Building OVS+DPDK with rpmbuild and spec files

Guru Shetty guru.ovn at gmail.com
Fri May 15 20:10:09 UTC 2020


On Fri, 15 May 2020 at 12:44, Wittling, Mark (CCI-Atlanta) <
Mark.Wittling at cox.com> wrote:

> Hmmm. Thanks Guru for sharing.
>
>
>
> What I did, was quite different procedure.
>
>    - Test things out
>       - Download DPDK to /usr/src/dpdk
>       - Untar package
>       - export DPDK_TARGET=x86_64-native-linuxapp-gcc
>       - export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
>       - sudo make install T=$DPDK_TARGET DESTDIR=install
>
> *That seemed to work. Now we have a DPDK that is built.*
>
>    - Download OVS to /usr/src/ovs
>       - Untar package
>       - Cd to releasdir and run: ./configure --with-dpdk=$DPDK_BUILD
>       - sudo make install
>
> *Now we have an OVS compiled with DPDK. Yay.*
>
>    - I loaded vfio kernel module
>    - I bound the NICs on one of my cards to vfio
>    - I created an OVS DPDK bridge, and added DPDK NIC to it.
>    - So, thinking that I was able to get that to work,
>
> Nice. Now let’s build rpms.
>
>    - I took the DPDK spec file in /usr/src/dpdk/pkg/dpdk.spec and put it
>       in /root/rpmbuild/SPECS
>       - I put the dpdk tgz in /root/rpmbuild/SOURCES
>       - Then I went to /root/rpmbuild, and ran “rpmbuild -ba dpdk.spec”
>          - This did **not** work. I got an ld link error.
>
> Hmmm. Maybe I don’t need a DPDK rpm.
>
> *What I really need, is an OVS rpm file so that yum doesn’t screw things
> up when I put openstack-openvswitch-agent on the box.*
>
>    - Put OVS spec file /usr/src/ovs/rhel/openvswitch.spec into
>       /root/rpmbuild/SPECS
>       - Put OVS tgz file in /root/rpmbuild/SOURCES
>       - Run rpmbuild -ba openvswitch.spec
>          - This didn’t even compile
>
>
>
> So if I understand the procedure you followed:
>
>    1. Build DPDK just like I did above, in /usr/src.
>       - We know that worked before.
>       - I will need to do the make directive to build dpdk-devel as well.
>       - *What directive did you use to build the rpms, if you didn’t use
>       this rpmbuild procedure I was attempting?*
>    2. Go to /usr/src/openvswitch
>       - Run the boot.sh script
>
>                                                                i.      I
> did not run this script up above – that step was not in the docs I was
> looking at. Need to see what that script does and why it is being run
>
>    - Run the configure script (again as done up above in my Test Things
>       Out phase above)
>
>                                                                i.      You
> did not mention the –with-dpdk=$DPDK_BUILD below, but I presume you
> supplied that?
>
>    - Run “make rpm-fedora RPMBUILD_OPT="--with dpdk --without check
>       --without libcapng --with autoenable"
>
>
>
> Do I have this right?
>

Let us consider OVS 2.13. It needs DPDK 19.11.  I am building on RHEL8.1

So this is what I did:

* In rpmbuild/SOURCES, download dpdk-19.11 tar file
* untar it
* DPDK upstream has removed the dpdk spec file (as they say it is not
maintained well)
* Copy over pkg/dpdk.spec from dpdk-18.11.5 to pkg directory of dpdk-19.11
* I had to apply the patch at [1] as I need some changes to my target. But
the change also includes some things that you will have to do too (around
python3 and docs)
* There are a few dependencies that you will need to install.  Some of the
ones I remember are:
yum install libvirt-devel libpcap-devel doxygen python3-sphinx
elfutils-libelf-devel

* Now run:
rpmbuild -bb --with shared  pkg/dpdk.spec

* This will create the rpms. Install them.

* Now, clone OVS repo, and change branch to 2.13
./boot.sh
./configure
make rpm-fedora RPMBUILD_OPT="--with dpdk --without check --without
libcapng --with autoenable"

* That should get OVS rpms too.


[1]:

[root at smartnic dpdk-19.11]# diff -u
/usr/src/dpdk-stable-18.11.5/pkg/dpdk.spec pkg/dpdk.spec
--- /usr/src/dpdk-stable-18.11.5/pkg/dpdk.spec 2019-11-15
07:45:43.000000000 -0800
+++ pkg/dpdk.spec 2020-05-14 18:22:55.181675203 -0700
@@ -2,11 +2,11 @@
 # Copyright 2014 6WIND S.A.

 Name: dpdk
-Version: 18.11.5
+Version: 19.11
 Release: 1
 Packager: packaging at 6wind.com
 URL: http://dpdk.org
-Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{version}.tar.gz
+Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{version}.tar.xz

 Summary: Data Plane Development Kit core
 Group: System Environment/Libraries
@@ -15,8 +15,8 @@
 ExclusiveArch: i686 x86_64 aarch64
 %ifarch aarch64
 %global machine armv8a
-%global target arm64-%{machine}-linuxapp-gcc
-%global config arm64-%{machine}-linuxapp-gcc
+%global target arm64-stingray-linux-gcc
+%global config arm64-stingray-linux-gcc
 %else
 %global machine default
 %global target %{_arch}-%{machine}-linuxapp-gcc
@@ -24,8 +24,7 @@
 %endif

 BuildRequires: kernel-devel, kernel-headers, libpcap-devel
-BuildRequires: doxygen, python-sphinx, inkscape
-BuildRequires: texlive-collection-latexextra
+BuildRequires: doxygen, python3-sphinx

 %description
 DPDK core includes kernel modules, core libraries and tools.
@@ -41,13 +40,6 @@
 DPDK devel is a set of makefiles, headers and examples
 for fast packet processing on x86 platforms.

-%package doc
-Summary: Data Plane Development Kit API documentation
-BuildArch: noarch
-%description doc
-DPDK doc is divided in two parts: API details in doxygen HTML format
-and guides in sphinx HTML/PDF formats.
-
 %prep
 %setup -q

@@ -60,7 +52,6 @@
 sed -ri 's,(LIBRTE_VHOST=).*,\1y,'         %{target}/.config
 sed -ri 's,(LIBRTE_PMD_PCAP=).*,\1y,'      %{target}/.config
 make O=%{target} %{?_smp_mflags}
-make O=%{target} doc

 %install
 rm -rf %{buildroot}
@@ -69,6 +60,9 @@
  includedir=%{_includedir}/dpdk libdir=%{_libdir} \
  datadir=%{_datadir}/dpdk docdir=%{_docdir}/dpdk

+find %{buildroot}%{_datadir}/ -name "*.py" -exec \
+  sed -i -e 's|#!\s*/usr/bin/env python$|#!/usr/bin/python3|' {} +
+
 %files
 %dir %{_datadir}/dpdk
 %{_datadir}/dpdk/usertools
@@ -81,11 +75,9 @@
 %{_includedir}/dpdk
 %{_datadir}/dpdk/mk
 %{_datadir}/dpdk/buildtools
-%{_datadir}/dpdk/%{target}
+%{_datadir}/dpdk/arm64-%{machine}-linux-gcc
 %{_datadir}/dpdk/examples

-%files doc
-%doc %{_docdir}/dpdk

 %post
 /sbin/ldconfig




>
>
> Mark
>
>
>
> Regards,
>
> *Mark Wittling*
>
> NFV Cloud Operations
>
> Cox Communications Inc
>
> CTECH A08-150D
>
> 6305-A Peachtree Dunwoody Road, Atlanta GA 30328
>
> 1-770-849-9696
>
>
>
> *From:* Guru Shetty <guru.ovn at gmail.com>
> *Sent:* Friday, May 15, 2020 2:12 PM
> *To:* Wittling, Mark (CCI-Atlanta) <Mark.Wittling at cox.com>
> *Cc:* ovs-discuss at openvswitch.org
> *Subject:* [EXTERNAL] Re: [ovs-discuss] Building OVS+DPDK with rpmbuild
> and spec files
>
>
>
> I have recently built OVS DPDK rpms. For e.g., yesterday, I built OVS 2.13
> with DPDK 19.11
>
>
>
> The rhel/openvswitch-fedora.spec.in
> <https://urldefense.com/v3/__http:/openvswitch-fedora.spec.in/__;!!Hit2Ag!j0U9zeO00sNxzsI9ksV88Ly9SspmBzZb1mZk2c1W-2TTP9SRFcVG3O9y0h1MIFbhDA$> should
> have everything you need.
>
>
>
> You need to first build dpdk devel and dpdk rpms from DPDK. And then
> install those rpms. And then:
>
>
>
> ./boot.sh
>
> ./configure
>
> make rpm-fedora RPMBUILD_OPT="--with dpdk --without check --without
> libcapng --with autoenable"
>
>
>
> On Wed, 13 May 2020 at 06:28, Wittling, Mark (CCI-Atlanta) <
> Mark.Wittling at cox.com> wrote:
>
> Does anyone have any experience with this?
>
>
>
> I was able to “build by hand” and get these working, but the problem is
> that if you don’t have an rpm, OpenStack will install OVS packages on top
> of what you’ve built.
>
>
>
> So I need to build rpms, so that once I get this working, I can proceed to
> install OpenStack.
>
>
>
> I got a link error on the final stage of the rpmbuild using the spec file
> on OpenStack.
>
>
>
> Versions I am using are DPDK 17.11.10 and OVS 2.10.2
>
>
>
> Mark
>
>
>
> Regards,
>
> *Mark Wittling*
>
> NFV Cloud Operations
>
> Cox Communications Inc
>
> CTECH A08-150D
>
> 6305-A Peachtree Dunwoody Road, Atlanta GA 30328
>
> 1-770-849-9696
>
>
>
> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
> <https://urldefense.com/v3/__https:/mail.openvswitch.org/mailman/listinfo/ovs-discuss__;!!Hit2Ag!j0U9zeO00sNxzsI9ksV88Ly9SspmBzZb1mZk2c1W-2TTP9SRFcVG3O9y0h340WTo4w$>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20200515/7957eec2/attachment-0001.html>


More information about the discuss mailing list