Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Tonghao Zhang
On Wed, Dec 16, 2020 at 9:57 PM Richardson, Bruce
 wrote:
>
>
>
> > -Original Message-
> > From: Tonghao Zhang 
> > Sent: Wednesday, December 16, 2020 1:49 PM
> > To: Richardson, Bruce 
> > Cc: Ilya Maximets ; Pai G, Sunil
> > ; ovs dev ; David Marchand
> > ; Stokes, Ian 
> > Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> > meson build.
> >
> > On Wed, Dec 16, 2020 at 9:41 PM Richardson, Bruce
> >  wrote:
> > >
> > >
> > >
> > > > -Original Message-
> > > > From: Tonghao Zhang 
> > > > Sent: Wednesday, December 16, 2020 1:58 AM
> > > > To: Richardson, Bruce 
> > > > Cc: Ilya Maximets ; Pai G, Sunil
> > > > ; ovs dev ; David Marchand
> > > > ; Stokes, Ian 
> > > > Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for
> > DPDK
> > > > meson build.
> > > >
> > > > On Tue, Dec 15, 2020 at 9:38 PM Richardson, Bruce
> > > >  wrote:
> > > > >
> > > > > 
> > > > >
> > > > > > > > Hi Ilya
> > > > > > > > I tested the patch
> > > > > > > >
> > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> > > > > > 30877-1-
> > > > > > > > git-send-email-ian.sto...@intel.com/
> > > > > > > > As I said if we update the pkg-conf to new version. and we
> > config
> > > > the
> > > > > > > > ovs --with-dpdk=static, ovs works fine.
> > > > > > > > but if we build ovs --with-dpdk=shared, ovs doesn't work,
> > there is
> > > > > > error
> > > > > > > > log:
> > > > > > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-
> > vswitchd -a
> > > > > > > >
> > > > > >
> > > >
> > :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represen
> > > > > > > > tor=[0-6]
> > > > > > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024 --
> > socket-
> > > > limit
> > > > > > > > 1024,1024.
> > > > > > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56
> > lcore(s)
> > > > > > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> > > > nodes
> > > > > > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse
> > > > device
> > > > > > > > ":82:00.0"
> > > > > > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse
> > > > device
> > > > > > > >
> > > > > >
> > > >
> > ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represe
> > > > > > > > ntor=[0-6]'
> > > > > > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize
> > > > DPDK: No
> > > > > > > > such device
> > > > > > > >
> > > > > > > > because pci bus was not registered.
> > > > > > > >
> > > > > > > > In dpdk:
> > > > > > > > eal_plugins_init
> > > > > > > > rte_pci_scan
> > > > > > > > eal_option_device_parse -- no pci bus
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > Is DPDK installed systemwide so that the drivers - including pci
> > bus
> > > > > > > driver - can be picked up automatically on init? If not, you may
> > > > well
> > > > > > > need to pass the path to the drivers via the "-d" flag on
> > startup.
> > > > > > Hi
> > > > > > I build ovs, shown as below:
> > > > > >
> > > > > > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > > > > > meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> > > > > > -Dbuildtype=debug
> > > > > > -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> > > > > > $DPDK_TARGET
> > > > > > ninja -C $DPDK_TARGET install
> > > > > > ldconfig
> > > > > >
> > > >

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Richardson, Bruce



> -Original Message-
> From: Tonghao Zhang 
> Sent: Wednesday, December 16, 2020 1:49 PM
> To: Richardson, Bruce 
> Cc: Ilya Maximets ; Pai G, Sunil
> ; ovs dev ; David Marchand
> ; Stokes, Ian 
> Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> meson build.
> 
> On Wed, Dec 16, 2020 at 9:41 PM Richardson, Bruce
>  wrote:
> >
> >
> >
> > > -Original Message-
> > > From: Tonghao Zhang 
> > > Sent: Wednesday, December 16, 2020 1:58 AM
> > > To: Richardson, Bruce 
> > > Cc: Ilya Maximets ; Pai G, Sunil
> > > ; ovs dev ; David Marchand
> > > ; Stokes, Ian 
> > > Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for
> DPDK
> > > meson build.
> > >
> > > On Tue, Dec 15, 2020 at 9:38 PM Richardson, Bruce
> > >  wrote:
> > > >
> > > > 
> > > >
> > > > > > > Hi Ilya
> > > > > > > I tested the patch
> > > > > > >
> https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> > > > > 30877-1-
> > > > > > > git-send-email-ian.sto...@intel.com/
> > > > > > > As I said if we update the pkg-conf to new version. and we
> config
> > > the
> > > > > > > ovs --with-dpdk=static, ovs works fine.
> > > > > > > but if we build ovs --with-dpdk=shared, ovs doesn't work,
> there is
> > > > > error
> > > > > > > log:
> > > > > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-
> vswitchd -a
> > > > > > >
> > > > >
> > >
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represen
> > > > > > > tor=[0-6]
> > > > > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024 --
> socket-
> > > limit
> > > > > > > 1024,1024.
> > > > > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56
> lcore(s)
> > > > > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> > > nodes
> > > > > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse
> > > device
> > > > > > > ":82:00.0"
> > > > > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse
> > > device
> > > > > > >
> > > > >
> > >
> ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represe
> > > > > > > ntor=[0-6]'
> > > > > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize
> > > DPDK: No
> > > > > > > such device
> > > > > > >
> > > > > > > because pci bus was not registered.
> > > > > > >
> > > > > > > In dpdk:
> > > > > > > eal_plugins_init
> > > > > > > rte_pci_scan
> > > > > > > eal_option_device_parse -- no pci bus
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > Is DPDK installed systemwide so that the drivers - including pci
> bus
> > > > > > driver - can be picked up automatically on init? If not, you may
> > > well
> > > > > > need to pass the path to the drivers via the "-d" flag on
> startup.
> > > > > Hi
> > > > > I build ovs, shown as below:
> > > > >
> > > > > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > > > > meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> > > > > -Dbuildtype=debug
> > > > > -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> > > > > $DPDK_TARGET
> > > > > ninja -C $DPDK_TARGET install
> > > > > ldconfig
> > > > >
> > > > > export LD_LIBRARY_PATH=/root/local/dpdk-next-
> > > net/lib64:$LD_LIBRARY_PATH
> > > > > export PKG_CONFIG_PATH=/root/local/dpdk-next-
> > > > > net/lib64/pkgconfig/:$PKG_CONFIG_PATH
> > > > > ./configure --enable-Werror --prefix=/root/local/openvswitch-2.14
> > > > > --disable-ssl --disable-libcapng --with-dpdk=shared 'CFLAGS=-g -O0
> > > > > -Wno-deprecated-declarations'
> > > > > make && make install
> > > >

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Tonghao Zhang
On Wed, Dec 16, 2020 at 9:41 PM Richardson, Bruce
 wrote:
>
>
>
> > -Original Message-
> > From: Tonghao Zhang 
> > Sent: Wednesday, December 16, 2020 1:58 AM
> > To: Richardson, Bruce 
> > Cc: Ilya Maximets ; Pai G, Sunil
> > ; ovs dev ; David Marchand
> > ; Stokes, Ian 
> > Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> > meson build.
> >
> > On Tue, Dec 15, 2020 at 9:38 PM Richardson, Bruce
> >  wrote:
> > >
> > > 
> > >
> > > > > > Hi Ilya
> > > > > > I tested the patch
> > > > > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> > > > 30877-1-
> > > > > > git-send-email-ian.sto...@intel.com/
> > > > > > As I said if we update the pkg-conf to new version. and we config
> > the
> > > > > > ovs --with-dpdk=static, ovs works fine.
> > > > > > but if we build ovs --with-dpdk=shared, ovs doesn't work, there is
> > > > error
> > > > > > log:
> > > > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd -a
> > > > > >
> > > >
> > :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represen
> > > > > > tor=[0-6]
> > > > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024 --socket-
> > limit
> > > > > > 1024,1024.
> > > > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > > > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> > nodes
> > > > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse
> > device
> > > > > > ":82:00.0"
> > > > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse
> > device
> > > > > >
> > > >
> > ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represe
> > > > > > ntor=[0-6]'
> > > > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize
> > DPDK: No
> > > > > > such device
> > > > > >
> > > > > > because pci bus was not registered.
> > > > > >
> > > > > > In dpdk:
> > > > > > eal_plugins_init
> > > > > > rte_pci_scan
> > > > > > eal_option_device_parse -- no pci bus
> > > > > >
> > > > > >
> > > > >
> > > > > Is DPDK installed systemwide so that the drivers - including pci bus
> > > > > driver - can be picked up automatically on init? If not, you may
> > well
> > > > > need to pass the path to the drivers via the "-d" flag on startup.
> > > > Hi
> > > > I build ovs, shown as below:
> > > >
> > > > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > > > meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> > > > -Dbuildtype=debug
> > > > -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> > > > $DPDK_TARGET
> > > > ninja -C $DPDK_TARGET install
> > > > ldconfig
> > > >
> > > > export LD_LIBRARY_PATH=/root/local/dpdk-next-
> > net/lib64:$LD_LIBRARY_PATH
> > > > export PKG_CONFIG_PATH=/root/local/dpdk-next-
> > > > net/lib64/pkgconfig/:$PKG_CONFIG_PATH
> > > > ./configure --enable-Werror --prefix=/root/local/openvswitch-2.14
> > > > --disable-ssl --disable-libcapng --with-dpdk=shared 'CFLAGS=-g -O0
> > > > -Wno-deprecated-declarations'
> > > > make && make install
> > > >
> > > > One question if we export  LD_LIBRARY_PATH, we also use "-d" flag ?
> > > >
> > > > > Regards,
> > > > > /Bruce
> > >
> > > In the case above, I think the drivers should all be loaded
> > automatically
> > > from "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.0/". The
> > RTE_EAL_PMD_PATH
> > > should point to that location.
> > >
> > > To verify, can you check the "rte_build_config.h" file in your DPDK
> > build,
> > > and confirm that the path given there for RTE_EAL_PMD_PATH corresponds
> > to
> > > the path where the actual driver .so files are installed?
> > In the rte_build_config.h:
> > #define RTE_EAL_PMD_PATH "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.1"
> >
> That looks a correct path. Can you confirm that the actual pmd .so files are
> in that directory on your system?
Yes,
librte_net_mlx5.so
librte_common_mlx5.so

But note that there is not mlx5 so the ldd output
ldd /root/local/openvswitch-2.14/sbin/ovs-vswitchd | grep -i mlx5

I debugged it and found that pci was not in bus_list, so pci device
was not attached to ovs.
-- 
Best regards, Tonghao
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Tonghao Zhang
On Wed, Dec 16, 2020 at 9:34 PM Pai G, Sunil  wrote:
>
> 
> > > I tried your build commands using latest dpdk-next-net and OVS-dpdk-
> > latest branch. It worked fine for me on ubuntu18.04.
> > > Moreover, GHA and travis CI's are passing for the shared builds.
> > > So, it might be a problem with the system you are using.
> > > Best to check the paths you are setting as well.
> > >
> > > Btw, which branch in OVS and which OS are you using ?
> > > Could you also try running a sample application in dpdk like l2fwd and 
> > > check
> > if it works fine as well ?
> > Yes, I use the dpdk helloworld to test.
> > ./build/helloworld -n 4 -c 4 -a
> > :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > epresentor=[0-2]
> > EAL: Detected 56 lcore(s)
> > EAL: Detected 2 NUMA nodes
> > EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
> > EAL: Selected IOVA mode 'VA'
> > EAL: Probing VFIO support...
> > EAL: VFIO support initialized
> > EAL: Probe PCI driver: mlx5_pci (15b3:101d) device: :82:00.0 (socket 1)
> > common_mlx5: RTE_MEM is selected.
> > mlx5_pci: Size 0x is not power of 2, will be aligned to 0x1.
> > EAL: No legacy callbacks, legacy socket not created hello from core 2
> >
> > But there is error in ovs:
> > $ ovs-vsctl show
> > a360a9ac-d269-4e89-b01c-c09331b9fb00
> > Bridge br-int
> > datapath_type: netdev
> > Port tun
> > Interface tun
> > type: vxlan
> > options: {key=flow, local_ip="10.96.74.2", remote_ip=flow}
> > Port br-int
> > Interface br-int
> > type: internal
> > Port rep1
> > Interface rep1
> > type: dpdk
> > options: {dpdk-devargs=":82:00.0,representor=[1]"}
> > error: "Error attaching device 
> > ':82:00.0,representor=[1]' to DPDK"
> >
> >
> > ovs-vswitchd log:
> > 2020-12-15T21:20:41.703Z|00333|netdev|WARN|rep1: could not set
> > configuration (Invalid argument) 2020-12-
> > 15T21:20:41.703Z|00334|dpdk|ERR|Invalid port_id=256
> > 2020-12-15T21:20:41.703Z|00335|dpdk|ERR|EAL: failed to parse device
> > ":82:00.0"
> > 2020-12-15T21:20:41.703Z|00336|dpdk|ERR|EAL: failed to parse device
> > ":82:00.0"
> > 2020-12-15T21:20:41.703Z|00337|dpdk|ERR|EAL: Failed to attach device on
> > primary process 2020-12-
> > 15T21:20:41.703Z|00338|netdev_dpdk|WARN|Error attaching device
> > ':82:00.0,representor=[0]' to DPDK
> >
> > One question, did you attach a dpdk port to ovs ?
>
> Yes, I attached physical as well as virtual ports and both got added without 
> err.
>
> I suspect you might have to add a conf file pointing to the dpdk libraries , 
> something like mentioned here:
> https://www.cyberciti.biz/faq/linux-setting-changing-library-path/
still not work
I export LD_LIBRARY_PATH=/root/local/dpdk-next-net/lib64
change that to:
$ cat /etc/ld.so.conf.d/dpdk.conf
/root/local/dpdk-next-net/lib64
$ ldconfig

>
> Also, what does the ldd report for ovs-vswitchd binary ?
linux-vdso.so.1 =>  (0x7fff52364000)
/usr/local/gundam/gundam_client/preload/$LIB/gundam_preload.so =>
/usr/local/gundam/gundam_client/preload/lib64/gundam_preload.so
(0x7fa24dda2000)
librte_vhost.so.21 =>
/root/local/dpdk-next-net/lib64/librte_vhost.so.21
(0x7fa24dab9000)
librte_ethdev.so.21 =>
/root/local/dpdk-next-net/lib64/librte_ethdev.so.21
(0x7fa24d479000)
librte_meter.so.21 =>
/root/local/dpdk-next-net/lib64/librte_meter.so.21
(0x7fa24d276000)
librte_mbuf.so.21 => /root/local/dpdk-next-net/lib64/librte_mbuf.so.21
(0x7fa24d05b000)
librte_mempool.so.21 =>
/root/local/dpdk-next-net/lib64/librte_mempool.so.21
(0x7fa24ce4f000)
librte_eal.so.21 => /root/local/dpdk-next-net/lib64/librte_eal.so.21
(0x7fa24cb5)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7fa24c934000)
librt.so.1 => /lib64/librt.so.1 (0x7fa24c72c000)
libm.so.6 => /lib64/libm.so.6 (0x7fa24c42a000)
libunbound.so.2 => /lib64/libunbound.so.2 (0x7fa24c129000)
libc.so.6 => /lib64/libc.so.6 (0x7fa24bd5b000)
libdl.so.2 => /lib64/libdl.so.2 (0x7fa24bb57000)
libnuma.so.1 => /lib64/libnuma.so.1 (0x7fa24b94b000)
librte_kvargs.so.21 =>
/root/local/dpdk-next-net/lib64/librte_kvargs.so.21
(0x7fa24b748000)
librte_telemetry.so.21 =>
/root/local/dpdk-next-net/lib64/librte_telemetry.so.21
(0x7fa24b53e000)
librte_net.so.21 => /root/local/dpdk-next-net/lib64/librte_net.so.21
(0x7fa24b32f000)
librte_ring.so.21 => /root/local/dpdk-next-net/lib64/librte_ring.so.21
(0x7fa24b12b000)
librte_cryptodev.so.21 =>
/root/local/dpdk-next-net/lib64/librte_cryptodev.so.21
(0x7fa24af13000)
librte_hash.so.21 => /root/local/dpdk-next-net/lib64/librte_hash.so.21
(0x7fa24acf7000)
librte_rcu.so.21 => /root/local/dpdk-next-net/lib64/librte_rcu.so.21
(0x7fa24aaed000)
librte_pci.so.21 => /root/local/dpdk-next-net/lib64/librte_pci.so.21
(0x7fa24a8ea000)
/lib64/ld-linux-x86-64.so.2 (0x7fa24dfab000)

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Richardson, Bruce



> -Original Message-
> From: Tonghao Zhang 
> Sent: Wednesday, December 16, 2020 1:58 AM
> To: Richardson, Bruce 
> Cc: Ilya Maximets ; Pai G, Sunil
> ; ovs dev ; David Marchand
> ; Stokes, Ian 
> Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> meson build.
> 
> On Tue, Dec 15, 2020 at 9:38 PM Richardson, Bruce
>  wrote:
> >
> > 
> >
> > > > > Hi Ilya
> > > > > I tested the patch
> > > > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> > > 30877-1-
> > > > > git-send-email-ian.sto...@intel.com/
> > > > > As I said if we update the pkg-conf to new version. and we config
> the
> > > > > ovs --with-dpdk=static, ovs works fine.
> > > > > but if we build ovs --with-dpdk=shared, ovs doesn't work, there is
> > > error
> > > > > log:
> > > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd -a
> > > > >
> > >
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represen
> > > > > tor=[0-6]
> > > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024 --socket-
> limit
> > > > > 1024,1024.
> > > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> nodes
> > > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse
> device
> > > > > ":82:00.0"
> > > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse
> device
> > > > >
> > >
> ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represe
> > > > > ntor=[0-6]'
> > > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize
> DPDK: No
> > > > > such device
> > > > >
> > > > > because pci bus was not registered.
> > > > >
> > > > > In dpdk:
> > > > > eal_plugins_init
> > > > > rte_pci_scan
> > > > > eal_option_device_parse -- no pci bus
> > > > >
> > > > >
> > > >
> > > > Is DPDK installed systemwide so that the drivers - including pci bus
> > > > driver - can be picked up automatically on init? If not, you may
> well
> > > > need to pass the path to the drivers via the "-d" flag on startup.
> > > Hi
> > > I build ovs, shown as below:
> > >
> > > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > > meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> > > -Dbuildtype=debug
> > > -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> > > $DPDK_TARGET
> > > ninja -C $DPDK_TARGET install
> > > ldconfig
> > >
> > > export LD_LIBRARY_PATH=/root/local/dpdk-next-
> net/lib64:$LD_LIBRARY_PATH
> > > export PKG_CONFIG_PATH=/root/local/dpdk-next-
> > > net/lib64/pkgconfig/:$PKG_CONFIG_PATH
> > > ./configure --enable-Werror --prefix=/root/local/openvswitch-2.14
> > > --disable-ssl --disable-libcapng --with-dpdk=shared 'CFLAGS=-g -O0
> > > -Wno-deprecated-declarations'
> > > make && make install
> > >
> > > One question if we export  LD_LIBRARY_PATH, we also use "-d" flag ?
> > >
> > > > Regards,
> > > > /Bruce
> >
> > In the case above, I think the drivers should all be loaded
> automatically
> > from "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.0/". The
> RTE_EAL_PMD_PATH
> > should point to that location.
> >
> > To verify, can you check the "rte_build_config.h" file in your DPDK
> build,
> > and confirm that the path given there for RTE_EAL_PMD_PATH corresponds
> to
> > the path where the actual driver .so files are installed?
> In the rte_build_config.h:
> #define RTE_EAL_PMD_PATH "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.1"
> 
That looks a correct path. Can you confirm that the actual pmd .so files are
in that directory on your system?
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Pai G, Sunil

> > I tried your build commands using latest dpdk-next-net and OVS-dpdk-
> latest branch. It worked fine for me on ubuntu18.04.
> > Moreover, GHA and travis CI's are passing for the shared builds.
> > So, it might be a problem with the system you are using.
> > Best to check the paths you are setting as well.
> >
> > Btw, which branch in OVS and which OS are you using ?
> > Could you also try running a sample application in dpdk like l2fwd and check
> if it works fine as well ?
> Yes, I use the dpdk helloworld to test.
> ./build/helloworld -n 4 -c 4 -a
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> epresentor=[0-2]
> EAL: Detected 56 lcore(s)
> EAL: Detected 2 NUMA nodes
> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
> EAL: Selected IOVA mode 'VA'
> EAL: Probing VFIO support...
> EAL: VFIO support initialized
> EAL: Probe PCI driver: mlx5_pci (15b3:101d) device: :82:00.0 (socket 1)
> common_mlx5: RTE_MEM is selected.
> mlx5_pci: Size 0x is not power of 2, will be aligned to 0x1.
> EAL: No legacy callbacks, legacy socket not created hello from core 2
> 
> But there is error in ovs:
> $ ovs-vsctl show
> a360a9ac-d269-4e89-b01c-c09331b9fb00
> Bridge br-int
> datapath_type: netdev
> Port tun
> Interface tun
> type: vxlan
> options: {key=flow, local_ip="10.96.74.2", remote_ip=flow}
> Port br-int
> Interface br-int
> type: internal
> Port rep1
> Interface rep1
> type: dpdk
> options: {dpdk-devargs=":82:00.0,representor=[1]"}
> error: "Error attaching device ':82:00.0,representor=[1]' 
> to DPDK"
> 
> 
> ovs-vswitchd log:
> 2020-12-15T21:20:41.703Z|00333|netdev|WARN|rep1: could not set
> configuration (Invalid argument) 2020-12-
> 15T21:20:41.703Z|00334|dpdk|ERR|Invalid port_id=256
> 2020-12-15T21:20:41.703Z|00335|dpdk|ERR|EAL: failed to parse device
> ":82:00.0"
> 2020-12-15T21:20:41.703Z|00336|dpdk|ERR|EAL: failed to parse device
> ":82:00.0"
> 2020-12-15T21:20:41.703Z|00337|dpdk|ERR|EAL: Failed to attach device on
> primary process 2020-12-
> 15T21:20:41.703Z|00338|netdev_dpdk|WARN|Error attaching device
> ':82:00.0,representor=[0]' to DPDK
> 
> One question, did you attach a dpdk port to ovs ?

Yes, I attached physical as well as virtual ports and both got added without 
err.

I suspect you might have to add a conf file pointing to the dpdk libraries , 
something like mentioned here:
https://www.cyberciti.biz/faq/linux-setting-changing-library-path/

Also, what does the ldd report for ovs-vswitchd binary ?



> 
> ovs commit-id:
> af06184705072804a4c1374f9c824c9e4c241c26
> dpdk-next-net
> d3fa7b89f0b893f051cb4cef1cbc961cb59f5721
> systeminfo
> CentOS Linux release 7.6.1810 (Core)
> kernel 3.10.0-957.1.3.el7.x86_64
> 
> >
> > >

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Tonghao Zhang
On Wed, Dec 16, 2020 at 8:43 PM Pai G, Sunil  wrote:
>
> Hi Zhang,
> Please see comments inline.
>
>
> > -Original Message-
> > From: Tonghao Zhang 
> > Sent: Wednesday, December 16, 2020 7:56 AM
> > To: Pai G, Sunil 
> > Cc: Ilya Maximets ; ovs dev ;
> > David Marchand ; Stokes, Ian
> > ; Richardson, Bruce 
> > Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> > meson build.
> >
> > On Wed, Dec 16, 2020 at 12:55 AM Pai G, Sunil 
> > wrote:
> > >
> > > Hi Zhang,
> > >
> > > Could you give this patch a try as well ?
> > >
> > http://patchwork.ozlabs.org/project/openvswitch/patch/20201215164128.1
> > > 3153-1-sunil.pa...@intel.com/ This has a check in place to throw an
> > > error if the pkg-config is buggy.
> > >
> > > Note that this is for the master branch. So, when you switch from dpdk-
> > latest to master , you would need to execute ./boot.sh before running the
> > configure command.
> > Hi Pai
> > Building the ovs --with-dpdk=static, works fine for us. so
> > Tested-by: Tonghao Zhang 
> >
> > By the way, ovs --with-dpdk=shared, still doesn't work.
>
> I tried your build commands using latest dpdk-next-net and OVS-dpdk-latest 
> branch. It worked fine for me on ubuntu18.04.
> Moreover, GHA and travis CI's are passing for the shared builds.
> So, it might be a problem with the system you are using.
> Best to check the paths you are setting as well.
>
> Btw, which branch in OVS and which OS are you using ?
> Could you also try running a sample application in dpdk like l2fwd and check 
> if it works fine as well ?
Yes, I use the dpdk helloworld to test.
./build/helloworld -n 4 -c 4 -a
:82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,representor=[0-2]
EAL: Detected 56 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: mlx5_pci (15b3:101d) device: :82:00.0 (socket 1)
common_mlx5: RTE_MEM is selected.
mlx5_pci: Size 0x is not power of 2, will be aligned to 0x1.
EAL: No legacy callbacks, legacy socket not created
hello from core 2

But there is error in ovs:
$ ovs-vsctl show
a360a9ac-d269-4e89-b01c-c09331b9fb00
Bridge br-int
datapath_type: netdev
Port tun
Interface tun
type: vxlan
options: {key=flow, local_ip="10.96.74.2", remote_ip=flow}
Port br-int
Interface br-int
type: internal
Port rep1
Interface rep1
type: dpdk
options: {dpdk-devargs=":82:00.0,representor=[1]"}
error: "Error attaching device
':82:00.0,representor=[1]' to DPDK"


ovs-vswitchd log:
2020-12-15T21:20:41.703Z|00333|netdev|WARN|rep1: could not set
configuration (Invalid argument)
2020-12-15T21:20:41.703Z|00334|dpdk|ERR|Invalid port_id=256
2020-12-15T21:20:41.703Z|00335|dpdk|ERR|EAL: failed to parse device
":82:00.0"
2020-12-15T21:20:41.703Z|00336|dpdk|ERR|EAL: failed to parse device
":82:00.0"
2020-12-15T21:20:41.703Z|00337|dpdk|ERR|EAL: Failed to attach device
on primary process
2020-12-15T21:20:41.703Z|00338|netdev_dpdk|WARN|Error attaching device
':82:00.0,representor=[0]' to DPDK

One question, did you attach a dpdk port to ovs ?

ovs commit-id:
af06184705072804a4c1374f9c824c9e4c241c26
dpdk-next-net
d3fa7b89f0b893f051cb4cef1cbc961cb59f5721
systeminfo
CentOS Linux release 7.6.1810 (Core)
kernel 3.10.0-957.1.3.el7.x86_64

>
> >
> > > > -Original Message-
> > > > From: Richardson, Bruce 
> > > > Sent: Tuesday, December 15, 2020 7:09 PM
> > > > To: Tonghao Zhang 
> > > > Cc: Ilya Maximets ; Pai G, Sunil
> > > > ; ovs dev ; David
> > > > Marchand ; Stokes, Ian
> > > > 
> > > > Subject: RE: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for
> > > > DPDK meson build.
> > > >
> > > > 
> > > >
> > > > > > > Hi Ilya
> > > > > > > I tested the patch
> > > > > > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977
> > > > > > > 825-
> > > > > 30877-1-
> > > > > > > git-send-email-ian.sto...@intel.com/
> > > > > > > As I said if we update the pkg-conf to new version. and we
> > > > > > > config the ovs --with-dpdk=static, ovs works fine.
> > > > > > > but if we build ovs --with-dpdk=sha

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-16 Thread Pai G, Sunil
Hi Zhang, 
Please see comments inline.


> -Original Message-
> From: Tonghao Zhang 
> Sent: Wednesday, December 16, 2020 7:56 AM
> To: Pai G, Sunil 
> Cc: Ilya Maximets ; ovs dev ;
> David Marchand ; Stokes, Ian
> ; Richardson, Bruce 
> Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> meson build.
> 
> On Wed, Dec 16, 2020 at 12:55 AM Pai G, Sunil 
> wrote:
> >
> > Hi Zhang,
> >
> > Could you give this patch a try as well ?
> >
> http://patchwork.ozlabs.org/project/openvswitch/patch/20201215164128.1
> > 3153-1-sunil.pa...@intel.com/ This has a check in place to throw an
> > error if the pkg-config is buggy.
> >
> > Note that this is for the master branch. So, when you switch from dpdk-
> latest to master , you would need to execute ./boot.sh before running the
> configure command.
> Hi Pai
> Building the ovs --with-dpdk=static, works fine for us. so
> Tested-by: Tonghao Zhang 
> 
> By the way, ovs --with-dpdk=shared, still doesn't work.

I tried your build commands using latest dpdk-next-net and OVS-dpdk-latest 
branch. It worked fine for me on ubuntu18.04.
Moreover, GHA and travis CI's are passing for the shared builds.
So, it might be a problem with the system you are using. 
Best to check the paths you are setting as well.

Btw, which branch in OVS and which OS are you using ?
Could you also try running a sample application in dpdk like l2fwd and check if 
it works fine as well ?


> 
> > > -Original Message-
> > > From: Richardson, Bruce 
> > > Sent: Tuesday, December 15, 2020 7:09 PM
> > > To: Tonghao Zhang 
> > > Cc: Ilya Maximets ; Pai G, Sunil
> > > ; ovs dev ; David
> > > Marchand ; Stokes, Ian
> > > 
> > > Subject: RE: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for
> > > DPDK meson build.
> > >
> > > 
> > >
> > > > > > Hi Ilya
> > > > > > I tested the patch
> > > > > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977
> > > > > > 825-
> > > > 30877-1-
> > > > > > git-send-email-ian.sto...@intel.com/
> > > > > > As I said if we update the pkg-conf to new version. and we
> > > > > > config the ovs --with-dpdk=static, ovs works fine.
> > > > > > but if we build ovs --with-dpdk=shared, ovs doesn't work,
> > > > > > there is
> > > > error
> > > > > > log:
> > > > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS:
> > > > > > ovs-vswitchd -
> > > a
> > > > > >
> > > >
> > >
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > > epr
> > > > esen
> > > > > > tor=[0-6]
> > > > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024
> > > > > > --socket-limit 1024,1024.
> > > > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56
> > > > > > lcore(s)
> > > > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2
> NUMA
> > > > > > nodes
> > > > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse
> > > > > > device ":82:00.0"
> > > > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse
> > > > > > device
> > > > > >
> > > >
> > >
> ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > > ep
> > > > rese
> > > > > > ntor=[0-6]'
> > > > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize
> > > > > > DPDK: No such device
> > > > > >
> > > > > > because pci bus was not registered.
> > > > > >
> > > > > > In dpdk:
> > > > > > eal_plugins_init
> > > > > > rte_pci_scan
> > > > > > eal_option_device_parse -- no pci bus
> > > > > >
> > > > > >
> > > > >
> > > > > Is DPDK installed systemwide so that the drivers - including pci
> > > > > bus driver - can be picked up automatically on init? If not, you
> > > > > may well need to pass the path to the drivers via the "-d" flag on
> startup.
> > > > Hi
> > > > I build ovs, shown as below:
> > > >
> > > > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > >

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Tonghao Zhang
On Wed, Dec 16, 2020 at 12:55 AM Pai G, Sunil  wrote:
>
> Hi Zhang,
>
> Could you give this patch a try as well ?
> http://patchwork.ozlabs.org/project/openvswitch/patch/20201215164128.13153-1-sunil.pa...@intel.com/
> This has a check in place to throw an error if the pkg-config is buggy.
>
> Note that this is for the master branch. So, when you switch from dpdk-latest 
> to master , you would need to execute ./boot.sh before running the configure 
> command.
Hi Pai
Building the ovs --with-dpdk=static, works fine for us. so
Tested-by: Tonghao Zhang 

By the way, ovs --with-dpdk=shared, still doesn't work.

> > -Original Message-
> > From: Richardson, Bruce 
> > Sent: Tuesday, December 15, 2020 7:09 PM
> > To: Tonghao Zhang 
> > Cc: Ilya Maximets ; Pai G, Sunil
> > ; ovs dev ; David Marchand
> > ; Stokes, Ian 
> > Subject: RE: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> > meson build.
> >
> > 
> >
> > > > > Hi Ilya
> > > > > I tested the patch
> > > > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> > > 30877-1-
> > > > > git-send-email-ian.sto...@intel.com/
> > > > > As I said if we update the pkg-conf to new version. and we config
> > > > > the ovs --with-dpdk=static, ovs works fine.
> > > > > but if we build ovs --with-dpdk=shared, ovs doesn't work, there is
> > > error
> > > > > log:
> > > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd -
> > a
> > > > >
> > >
> > :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > epr
> > > esen
> > > > > tor=[0-6]
> > > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024
> > > > > --socket-limit 1024,1024.
> > > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> > > > > nodes
> > > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse
> > > > > device ":82:00.0"
> > > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse
> > > > > device
> > > > >
> > >
> > ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > ep
> > > rese
> > > > > ntor=[0-6]'
> > > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize
> > > > > DPDK: No such device
> > > > >
> > > > > because pci bus was not registered.
> > > > >
> > > > > In dpdk:
> > > > > eal_plugins_init
> > > > > rte_pci_scan
> > > > > eal_option_device_parse -- no pci bus
> > > > >
> > > > >
> > > >
> > > > Is DPDK installed systemwide so that the drivers - including pci bus
> > > > driver - can be picked up automatically on init? If not, you may
> > > > well need to pass the path to the drivers via the "-d" flag on startup.
> > > Hi
> > > I build ovs, shown as below:
> > >
> > > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > > meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> > > -Dbuildtype=debug
> > > -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> > > $DPDK_TARGET
> > > ninja -C $DPDK_TARGET install
> > > ldconfig
> > >
> > > export
> > > LD_LIBRARY_PATH=/root/local/dpdk-next-net/lib64:$LD_LIBRARY_PATH
> > > export PKG_CONFIG_PATH=/root/local/dpdk-next-
> > > net/lib64/pkgconfig/:$PKG_CONFIG_PATH
> > > ./configure --enable-Werror --prefix=/root/local/openvswitch-2.14
> > > --disable-ssl --disable-libcapng --with-dpdk=shared 'CFLAGS=-g -O0
> > > -Wno-deprecated-declarations'
> > > make && make install
> > >
> > > One question if we export  LD_LIBRARY_PATH, we also use "-d" flag ?
> > >
> > > > Regards,
> > > > /Bruce
> >
> > In the case above, I think the drivers should all be loaded automatically 
> > from
> > "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.0/". The
> > RTE_EAL_PMD_PATH should point to that location.
> >
> > To verify, can you check the "rte_build_config.h" file in your DPDK build, 
> > and
> > confirm that the path given there for RTE_EAL_PMD_PATH corresponds to
> > the path where the actual driver .so files are installed?
> >
> > /Bruce
>
>
> Thanks and regards
> Sunil



-- 
Best regards, Tonghao
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Tonghao Zhang
On Tue, Dec 15, 2020 at 9:38 PM Richardson, Bruce
 wrote:
>
> 
>
> > > > Hi Ilya
> > > > I tested the patch
> > > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> > 30877-1-
> > > > git-send-email-ian.sto...@intel.com/
> > > > As I said if we update the pkg-conf to new version. and we config the
> > > > ovs --with-dpdk=static, ovs works fine.
> > > > but if we build ovs --with-dpdk=shared, ovs doesn't work, there is
> > error
> > > > log:
> > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd -a
> > > >
> > :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represen
> > > > tor=[0-6]
> > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024 --socket-limit
> > > > 1024,1024.
> > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA nodes
> > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse device
> > > > ":82:00.0"
> > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse device
> > > >
> > ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represe
> > > > ntor=[0-6]'
> > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize DPDK: No
> > > > such device
> > > >
> > > > because pci bus was not registered.
> > > >
> > > > In dpdk:
> > > > eal_plugins_init
> > > > rte_pci_scan
> > > > eal_option_device_parse -- no pci bus
> > > >
> > > >
> > >
> > > Is DPDK installed systemwide so that the drivers - including pci bus
> > > driver - can be picked up automatically on init? If not, you may well
> > > need to pass the path to the drivers via the "-d" flag on startup.
> > Hi
> > I build ovs, shown as below:
> >
> > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> > -Dbuildtype=debug
> > -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> > $DPDK_TARGET
> > ninja -C $DPDK_TARGET install
> > ldconfig
> >
> > export LD_LIBRARY_PATH=/root/local/dpdk-next-net/lib64:$LD_LIBRARY_PATH
> > export PKG_CONFIG_PATH=/root/local/dpdk-next-
> > net/lib64/pkgconfig/:$PKG_CONFIG_PATH
> > ./configure --enable-Werror --prefix=/root/local/openvswitch-2.14
> > --disable-ssl --disable-libcapng --with-dpdk=shared 'CFLAGS=-g -O0
> > -Wno-deprecated-declarations'
> > make && make install
> >
> > One question if we export  LD_LIBRARY_PATH, we also use "-d" flag ?
> >
> > > Regards,
> > > /Bruce
>
> In the case above, I think the drivers should all be loaded automatically
> from "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.0/". The RTE_EAL_PMD_PATH
> should point to that location.
>
> To verify, can you check the "rte_build_config.h" file in your DPDK build,
> and confirm that the path given there for RTE_EAL_PMD_PATH corresponds to
> the path where the actual driver .so files are installed?
In the rte_build_config.h:
#define RTE_EAL_PMD_PATH "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.1"

I use dpdk-next-net repo to build dpdk, the last commit is
d3fa7b89f0b893f051cb4cef1cbc961cb59f5721
> /Bruce



-- 
Best regards, Tonghao
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Pai G, Sunil
Hi Zhang,

Could you give this patch a try as well ? 
http://patchwork.ozlabs.org/project/openvswitch/patch/20201215164128.13153-1-sunil.pa...@intel.com/
 
This has a check in place to throw an error if the pkg-config is buggy.

Note that this is for the master branch. So, when you switch from dpdk-latest 
to master , you would need to execute ./boot.sh before running the configure 
command.

> -Original Message-
> From: Richardson, Bruce 
> Sent: Tuesday, December 15, 2020 7:09 PM
> To: Tonghao Zhang 
> Cc: Ilya Maximets ; Pai G, Sunil
> ; ovs dev ; David Marchand
> ; Stokes, Ian 
> Subject: RE: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> meson build.
> 
> 
> 
> > > > Hi Ilya
> > > > I tested the patch
> > > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> > 30877-1-
> > > > git-send-email-ian.sto...@intel.com/
> > > > As I said if we update the pkg-conf to new version. and we config
> > > > the ovs --with-dpdk=static, ovs works fine.
> > > > but if we build ovs --with-dpdk=shared, ovs doesn't work, there is
> > error
> > > > log:
> > > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd -
> a
> > > >
> >
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> epr
> > esen
> > > > tor=[0-6]
> > > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024
> > > > --socket-limit 1024,1024.
> > > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> > > > nodes
> > > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse
> > > > device ":82:00.0"
> > > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse
> > > > device
> > > >
> >
> ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> ep
> > rese
> > > > ntor=[0-6]'
> > > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize
> > > > DPDK: No such device
> > > >
> > > > because pci bus was not registered.
> > > >
> > > > In dpdk:
> > > > eal_plugins_init
> > > > rte_pci_scan
> > > > eal_option_device_parse -- no pci bus
> > > >
> > > >
> > >
> > > Is DPDK installed systemwide so that the drivers - including pci bus
> > > driver - can be picked up automatically on init? If not, you may
> > > well need to pass the path to the drivers via the "-d" flag on startup.
> > Hi
> > I build ovs, shown as below:
> >
> > export DPDK_TARGET=x86_64-native-linuxapp-gcc
> > meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> > -Dbuildtype=debug
> > -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> > $DPDK_TARGET
> > ninja -C $DPDK_TARGET install
> > ldconfig
> >
> > export
> > LD_LIBRARY_PATH=/root/local/dpdk-next-net/lib64:$LD_LIBRARY_PATH
> > export PKG_CONFIG_PATH=/root/local/dpdk-next-
> > net/lib64/pkgconfig/:$PKG_CONFIG_PATH
> > ./configure --enable-Werror --prefix=/root/local/openvswitch-2.14
> > --disable-ssl --disable-libcapng --with-dpdk=shared 'CFLAGS=-g -O0
> > -Wno-deprecated-declarations'
> > make && make install
> >
> > One question if we export  LD_LIBRARY_PATH, we also use "-d" flag ?
> >
> > > Regards,
> > > /Bruce
> 
> In the case above, I think the drivers should all be loaded automatically from
> "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.0/". The
> RTE_EAL_PMD_PATH should point to that location.
> 
> To verify, can you check the "rte_build_config.h" file in your DPDK build, and
> confirm that the path given there for RTE_EAL_PMD_PATH corresponds to
> the path where the actual driver .so files are installed?
> 
> /Bruce


Thanks and regards
Sunil
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Richardson, Bruce


> > > Hi Ilya
> > > I tested the patch
> > > https://patchwork.ozlabs.org/project/openvswitch/patch/1607977825-
> 30877-1-
> > > git-send-email-ian.sto...@intel.com/
> > > As I said if we update the pkg-conf to new version. and we config the
> > > ovs --with-dpdk=static, ovs works fine.
> > > but if we build ovs --with-dpdk=shared, ovs doesn't work, there is
> error
> > > log:
> > > 2020-12-14T20:15:07.940Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd -a
> > >
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represen
> > > tor=[0-6]
> > > -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024 --socket-limit
> > > 1024,1024.
> > > 2020-12-14T20:15:07.946Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > > 2020-12-14T20:15:07.946Z|00020|dpdk|INFO|EAL: Detected 2 NUMA nodes
> > > 2020-12-14T20:15:07.946Z|00021|dpdk|ERR|EAL: failed to parse device
> > > ":82:00.0"
> > > 2020-12-14T20:15:07.946Z|00022|dpdk|ERR|EAL: Unable to parse device
> > >
> ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,represe
> > > ntor=[0-6]'
> > > 2020-12-14T20:15:07.946Z|00023|dpdk|EMER|Unable to initialize DPDK: No
> > > such device
> > >
> > > because pci bus was not registered.
> > >
> > > In dpdk:
> > > eal_plugins_init
> > > rte_pci_scan
> > > eal_option_device_parse -- no pci bus
> > >
> > >
> >
> > Is DPDK installed systemwide so that the drivers - including pci bus
> > driver - can be picked up automatically on init? If not, you may well
> > need to pass the path to the drivers via the "-d" flag on startup.
> Hi
> I build ovs, shown as below:
> 
> export DPDK_TARGET=x86_64-native-linuxapp-gcc
> meson -Dprefix=/root/local/dpdk-next-net -Dmax_ethports=256
> -Dbuildtype=debug
> -Ddisable_drivers=event/*,net/tap,net/nfb,net/mlx4,crypto/*
> $DPDK_TARGET
> ninja -C $DPDK_TARGET install
> ldconfig
> 
> export LD_LIBRARY_PATH=/root/local/dpdk-next-net/lib64:$LD_LIBRARY_PATH
> export PKG_CONFIG_PATH=/root/local/dpdk-next-
> net/lib64/pkgconfig/:$PKG_CONFIG_PATH
> ./configure --enable-Werror --prefix=/root/local/openvswitch-2.14
> --disable-ssl --disable-libcapng --with-dpdk=shared 'CFLAGS=-g -O0
> -Wno-deprecated-declarations'
> make && make install
> 
> One question if we export  LD_LIBRARY_PATH, we also use "-d" flag ?
> 
> > Regards,
> > /Bruce

In the case above, I think the drivers should all be loaded automatically
from "/root/local/dpdk-next-net/lib64/dpdk/pmds-21.0/". The RTE_EAL_PMD_PATH
should point to that location.

To verify, can you check the "rte_build_config.h" file in your DPDK build,
and confirm that the path given there for RTE_EAL_PMD_PATH corresponds to
the path where the actual driver .so files are installed?

/Bruce
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Tonghao Zhang
On Tue, Dec 15, 2020 at 8:25 PM Richardson, Bruce
 wrote:
>
>
>
> > -Original Message-
> > From: Tonghao Zhang 
> > Sent: Tuesday, December 15, 2020 12:20 PM
> > To: Ilya Maximets 
> > Cc: Pai G, Sunil ; ovs dev ;
> > Richardson, Bruce ; David Marchand
> > ; Stokes, Ian 
> > Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> > meson build.
> >
> > On Tue, Dec 15, 2020 at 5:32 PM Ilya Maximets  wrote:
> > >
> > > On 12/15/20 5:02 AM, Tonghao Zhang wrote:
> > > > On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G 
> > wrote:
> > > >>
> > > >> Make based build is deprecated in DPDK. Meson based
> > > >> build to be used for future DPDK releases.
> > > >>
> > > >> This updates travis, configure script and documentation
> > > >> for using DPDK Meson with OVS.
> > > >>
> > > >> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-
> > copy/builds/723510063
> > > >> Signed-off-by: Sunil Pai G 
> > > >> ---
> > > >> v3->v4:
> > > >> - Fix checkpatch errors
> > > >>
> > > >> v2->v3:
> > > >> - Update Documentation for vhost-user
> > > >>
> > > >> v1->v2:
> > > >> - Update Documentation
> > > >> - Simplify the pkg-config parsing script
> > > >> - Rename and move the pkg-config parsing script to python dir
> > > >> - Update travis to:
> > > >>- install DPDK to cached dir
> > > >>- disable DPDK tests
> > > >>- removed fPIC flag for DPDK
> > > >>- removed cross compilation for aarch64
> > > >> ---
> > > >>  .travis.yml  |  3 ++
> > > >>  .travis/linux-build.sh   | 39 ++-
> > > >>  .travis/linux-prepare.sh |  1 +
> > > >>  Documentation/intro/install/afxdp.rst|  2 +-
> > > >>  Documentation/intro/install/dpdk.rst | 63 --
> > --
> > > >>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
> > > >>  acinclude.m4 | 44 +++--
> > > >>  python/automake.mk   |  3 +-
> > > >>  python/build/pkgcfg.py   | 30 +++
> > > >>  9 files changed, 149 insertions(+), 54 deletions(-)
> > > >>  create mode 100644 python/build/pkgcfg.py
> > > >>
> > > >> diff --git a/.travis.yml b/.travis.yml
> > > >> index 3dd5d1d23..a8f9a4d79 100644
> > > >> --- a/.travis.yml
> > > >> +++ b/.travis.yml
> > > >> @@ -27,6 +27,9 @@ addons:
> > > >>- selinux-policy-dev
> > > >>- libunbound-dev
> > > >>- libunwind-dev
> > > >> +  - python3-setuptools
> > > >> +  - python3-wheel
> > > >> +  - ninja-build
> > > >>
> > > >>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
> > > >>
> > > >> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> > > >> index 817bf24aa..14ef833c9 100755
> > > >> --- a/.travis/linux-build.sh
> > > >> +++ b/.travis/linux-build.sh
> > > >> @@ -85,17 +85,29 @@ function install_dpdk()
> > > >>  {
> > > >>  local DPDK_VER=$1
> > > >>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> > > >> +local DPDK_OPTS=""
> > > >> +local DPDK_LIB=""
> > > >>
> > > >>  if [ -z "$TRAVIS_ARCH" ] ||
> > > >> [ "$TRAVIS_ARCH" == "amd64" ]; then
> > > >> -TARGET="x86_64-native-linuxapp-gcc"
> > > >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
> > > >>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> > > >> -TARGET="arm64-armv8a-linuxapp-gcc"
> > > >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
> > > >>  else
> > > >>  echo "Target is unknown"
> > > >>  exit 1
> > > >>  fi
> > > >>
> > > >> +

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Richardson, Bruce



> -Original Message-
> From: Tonghao Zhang 
> Sent: Tuesday, December 15, 2020 12:20 PM
> To: Ilya Maximets 
> Cc: Pai G, Sunil ; ovs dev ;
> Richardson, Bruce ; David Marchand
> ; Stokes, Ian 
> Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> meson build.
> 
> On Tue, Dec 15, 2020 at 5:32 PM Ilya Maximets  wrote:
> >
> > On 12/15/20 5:02 AM, Tonghao Zhang wrote:
> > > On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G 
> wrote:
> > >>
> > >> Make based build is deprecated in DPDK. Meson based
> > >> build to be used for future DPDK releases.
> > >>
> > >> This updates travis, configure script and documentation
> > >> for using DPDK Meson with OVS.
> > >>
> > >> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-
> copy/builds/723510063
> > >> Signed-off-by: Sunil Pai G 
> > >> ---
> > >> v3->v4:
> > >> - Fix checkpatch errors
> > >>
> > >> v2->v3:
> > >> - Update Documentation for vhost-user
> > >>
> > >> v1->v2:
> > >> - Update Documentation
> > >> - Simplify the pkg-config parsing script
> > >> - Rename and move the pkg-config parsing script to python dir
> > >> - Update travis to:
> > >>- install DPDK to cached dir
> > >>- disable DPDK tests
> > >>- removed fPIC flag for DPDK
> > >>- removed cross compilation for aarch64
> > >> ---
> > >>  .travis.yml  |  3 ++
> > >>  .travis/linux-build.sh   | 39 ++-
> > >>  .travis/linux-prepare.sh |  1 +
> > >>  Documentation/intro/install/afxdp.rst|  2 +-
> > >>  Documentation/intro/install/dpdk.rst | 63 --
> --
> > >>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
> > >>  acinclude.m4 | 44 +++--
> > >>  python/automake.mk   |  3 +-
> > >>  python/build/pkgcfg.py   | 30 +++
> > >>  9 files changed, 149 insertions(+), 54 deletions(-)
> > >>  create mode 100644 python/build/pkgcfg.py
> > >>
> > >> diff --git a/.travis.yml b/.travis.yml
> > >> index 3dd5d1d23..a8f9a4d79 100644
> > >> --- a/.travis.yml
> > >> +++ b/.travis.yml
> > >> @@ -27,6 +27,9 @@ addons:
> > >>- selinux-policy-dev
> > >>- libunbound-dev
> > >>- libunwind-dev
> > >> +  - python3-setuptools
> > >> +  - python3-wheel
> > >> +  - ninja-build
> > >>
> > >>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
> > >>
> > >> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> > >> index 817bf24aa..14ef833c9 100755
> > >> --- a/.travis/linux-build.sh
> > >> +++ b/.travis/linux-build.sh
> > >> @@ -85,17 +85,29 @@ function install_dpdk()
> > >>  {
> > >>  local DPDK_VER=$1
> > >>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> > >> +local DPDK_OPTS=""
> > >> +local DPDK_LIB=""
> > >>
> > >>  if [ -z "$TRAVIS_ARCH" ] ||
> > >> [ "$TRAVIS_ARCH" == "amd64" ]; then
> > >> -TARGET="x86_64-native-linuxapp-gcc"
> > >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
> > >>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> > >> -TARGET="arm64-armv8a-linuxapp-gcc"
> > >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
> > >>  else
> > >>  echo "Target is unknown"
> > >>  exit 1
> > >>  fi
> > >>
> > >> +if [ "$DPDK_SHARED" ]; then
> > >> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
> > >> +export LD_LIBRARY_PATH=$DPDK_LIB/:$LD_LIBRARY_PATH
> > >> +else
> > >> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
> > >> +fi
> > >> +
> > >> +# Export the following path for pkg-config to find the .pc file.
> > >> +export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
&g

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Tonghao Zhang
On Tue, Dec 15, 2020 at 5:32 PM Ilya Maximets  wrote:
>
> On 12/15/20 5:02 AM, Tonghao Zhang wrote:
> > On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G  wrote:
> >>
> >> Make based build is deprecated in DPDK. Meson based
> >> build to be used for future DPDK releases.
> >>
> >> This updates travis, configure script and documentation
> >> for using DPDK Meson with OVS.
> >>
> >> Tested-at: 
> >> https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/723510063
> >> Signed-off-by: Sunil Pai G 
> >> ---
> >> v3->v4:
> >> - Fix checkpatch errors
> >>
> >> v2->v3:
> >> - Update Documentation for vhost-user
> >>
> >> v1->v2:
> >> - Update Documentation
> >> - Simplify the pkg-config parsing script
> >> - Rename and move the pkg-config parsing script to python dir
> >> - Update travis to:
> >>- install DPDK to cached dir
> >>- disable DPDK tests
> >>- removed fPIC flag for DPDK
> >>- removed cross compilation for aarch64
> >> ---
> >>  .travis.yml  |  3 ++
> >>  .travis/linux-build.sh   | 39 ++-
> >>  .travis/linux-prepare.sh |  1 +
> >>  Documentation/intro/install/afxdp.rst|  2 +-
> >>  Documentation/intro/install/dpdk.rst | 63 
> >>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
> >>  acinclude.m4 | 44 +++--
> >>  python/automake.mk   |  3 +-
> >>  python/build/pkgcfg.py   | 30 +++
> >>  9 files changed, 149 insertions(+), 54 deletions(-)
> >>  create mode 100644 python/build/pkgcfg.py
> >>
> >> diff --git a/.travis.yml b/.travis.yml
> >> index 3dd5d1d23..a8f9a4d79 100644
> >> --- a/.travis.yml
> >> +++ b/.travis.yml
> >> @@ -27,6 +27,9 @@ addons:
> >>- selinux-policy-dev
> >>- libunbound-dev
> >>- libunwind-dev
> >> +  - python3-setuptools
> >> +  - python3-wheel
> >> +  - ninja-build
> >>
> >>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
> >>
> >> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> >> index 817bf24aa..14ef833c9 100755
> >> --- a/.travis/linux-build.sh
> >> +++ b/.travis/linux-build.sh
> >> @@ -85,17 +85,29 @@ function install_dpdk()
> >>  {
> >>  local DPDK_VER=$1
> >>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> >> +local DPDK_OPTS=""
> >> +local DPDK_LIB=""
> >>
> >>  if [ -z "$TRAVIS_ARCH" ] ||
> >> [ "$TRAVIS_ARCH" == "amd64" ]; then
> >> -TARGET="x86_64-native-linuxapp-gcc"
> >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
> >>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> >> -TARGET="arm64-armv8a-linuxapp-gcc"
> >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
> >>  else
> >>  echo "Target is unknown"
> >>  exit 1
> >>  fi
> >>
> >> +if [ "$DPDK_SHARED" ]; then
> >> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
> >> +export LD_LIBRARY_PATH=$DPDK_LIB/:$LD_LIBRARY_PATH
> >> +else
> >> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
> >> +fi
> >> +
> >> +# Export the following path for pkg-config to find the .pc file.
> >> +export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
> >> +
> >>  if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
> >>  # Avoid using cache for git tree build.
> >>  rm -rf dpdk-dir
> >> @@ -108,7 +120,8 @@ function install_dpdk()
> >>  if [ -f "${VERSION_FILE}" ]; then
> >>  VER=$(cat ${VERSION_FILE})
> >>  if [ "${VER}" = "${DPDK_VER}" ]; then
> >> -EXTRA_OPTS="${EXTRA_OPTS} 
> >> --with-dpdk=$(pwd)/dpdk-dir/build"
> >> +# Update the library paths.
> >> +sudo ldconfig
> >>  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
> >>  return
> >>  fi
> >> @@ -122,16 +135,20 @@ function install_dpdk()
> >>  pushd dpdk-dir
> >>  fi
> >>
> >> -make config CC=gcc T=$TARGET
> >> +# Disable building DPDK unit tests. Not needed for OVS build or tests.
> >> +DPDK_OPTS="$DPDK_OPTS -Dtests=false"
> >>
> >> -if [ "$DPDK_SHARED" ]; then
> >> -sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' build/.config
> >> -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
> >> -fi
> >> +# Install DPDK using prefix.
> >> +DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
> >> +
> >> +CC=gcc meson $DPDK_OPTS build
> >> +ninja -C build
> >> +sudo ninja -C build install
> >> +
> >> +# Update the library paths.
> >> +sudo ldconfig
> >>
> >> -make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
> >> -EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
> >> -echo "Installed DPDK source in $(pwd)"
> >> +echo "Installed DPDK source"
> >>  popd
> >>  echo "${DPDK_VER}" > ${VERSION_FILE}
> >>  }
> >> diff --git a/.travis/linux-prepare.sh 

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Pai G, Sunil


> > > > >> Hmm.  Thanks for the report.
> > > > >>
> > > > >> It'll be great if you can test this with new version of this patch:
> > > > >> https://patchwork.ozlabs.org/project/openvswitch/patch/16079778
> > > > >> 25-
> > > > 30877-1-
> > > > >> git-send-email-ian.sto...@intel.com/
> > > > >>
> > > > >> Bruce, David, it looks like not all versions of pkg-config
> > > > >> could be
> > used.
> > > > >> Do you know what is the minimal required version or how to
> > > > >> protect us from this kind of issues?
> > > > >>
> > > > >> Best regards, Ilya Maximets.
> > > > >
> > > > > This was just recently flagged to us and discussed on this email
> > > > > thread on the dpdk dev list.
> > > > >
> > > > > http://inbox.dpdk.org/dev/20201029091638.26646-1-
> > > getel...@nvidia.com
> > > > > /
> > > > >
> > > > > At the end of the discussion the follow was noted in our docs as
> > > > > a known issue for DPDK.
> > > > >
> > > > > "pkg-config v0.27 supplied with RHEL-7 does not process
> > > > > correctly libdpdk.pc
> > > > Libs.private section."
> > > > >
> > > > > If you have any suggestions as to how we could work around this
> > > > > issue, I'd be very keen to hear them, though unfortunately it
> > > > > does seem to be a bug in pkg-config that is outside of our control.
> > > >
> > > > Thanks for the information.  Ugh.
> > > >
> > > > It looks like we need to implement the check in our configure
> > > > script and abort if pkg-config is bad to avoid weired runtime
> > > > issues due to
> > not
> > > linked libs.
> > > >
> > > > Probably, a grep, similar to what is in above dpdk patch, over the
> > > > DPDK_vswitchd_LDFLAGS with some meaningfull error message should
> > > > do the trick.
> > > >
> > > > Ian, what do you think?
> > >
> > > Sounds good, Let myself and Sunil take a look at this and send a new
> > > v4
> > with
> > > the check.
> >
> > Sure , I think this could be added.
> > But , if there is a check already in place in DPDK, would we need one
> > in OVS as well ?
> >
> 
> There is not a check in place in DPDK, because while we can check the pkg-
> config version on the build machine, it's the version on the end-user machine
> (the OVS build machine in this case) that matters, and we can't check that as
> part of a DPDK build.
> 

Agreed, Will add a check like DPDK in the configure script.

> /Bruce

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Richardson, Bruce



> -Original Message-
> From: Pai G, Sunil 
> Sent: Tuesday, December 15, 2020 12:01 PM
> To: Stokes, Ian ; Ilya Maximets
> ; Richardson, Bruce ;
> Tonghao Zhang 
> Cc: ovs dev ; David Marchand
> 
> Subject: RE: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> meson build.
> 
> Hi,
> 
> 
> 
> > > >>>> +   When DPDK is built using Meson, and OVS must consume DPDK
> > > >>>> + shared
> > > >> libraries
> > > >>>> +   (also equivalent to leaving --with-dpdk option empty)::
> > > >>>> +
> > > >>>> +   $ ./configure --with-dpdk=shared
> > > >>> Hi all
> > > >>> when I build ovs with --with-dpdk=shared, Compilation is fine, but
> > > >>> we I launch the ovs:
> > > >>>
> > > >>> 41 2020-12-14T10:42:22.964Z|00018|dpdk|INFO|EAL ARGS: ovs-
> > vswitchd
> > > >>> -
> > > a
> > > >>>
> > > >>
> > >
> > :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > epr
> > > e
> > > sen
> > > >> tor=[0-6]
> > > >>> -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024
> > > >>> --socket-limit 1024,1024.
> > > >>> 42 2020-12-14T10:42:22.969Z|00019|dpdk|INFO|EAL: Detected 56
> > > >>> lcore(s)
> > > >>> 43 2020-12-14T10:42:22.969Z|00020|dpdk|INFO|EAL: Detected 2
> > NUMA
> > > nodes
> > > >>> 44 2020-12-14T10:42:22.969Z|00021|dpdk|ERR|EAL: failed to parse
> > > >>> device ":82:00.0"
> > > >>> 45 2020-12-14T10:42:22.969Z|00022|dpdk|ERR|EAL: Unable to parse
> > > device
> > > >>>
> > > >>
> > >
> > ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > ep
> > > r
> > > ese
> > > >> ntor=[0-6]'
> > > >>> 46 2020-12-14T10:42:22.969Z|00023|dpdk|EMER|Unable to initialize
> > > DPDK:
> > > >>> No such device
> > > >>>
> > > >>> In dpdk:
> > > >>> eal_plugins_init
> > > >>> rte_pci_scan
> > > >>> rte_bus_register
> > > >>> eal_option_device_parse -- no pci bus
> > > >>>
> > > >>> pkg-config is pkgconf-1.4.2
> > > >>>> +   When DPDK is built using Meson, and OVS must consume DPDK
> > > >>>> + static
> > > >> libraries::
> > > >>>> +
> > > >>>> +   $ ./configure --with-dpdk=static
> > > >>> Only one issue, if we use the pkgconfig-0.27 The ovs log:
> > > >>> 2020-12-14T11:58:22.622Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd
> > -a
> > > >>>
> > > >>
> > >
> > :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > epr
> > > e
> > > sen
> > > >> tor=[0-6]
> > > >>> -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024
> > > >>> --socket-limit 1024,1024.
> > > >>> 2020-12-14T11:58:22.627Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > > >>> 2020-12-14T11:58:22.627Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> > > nodes
> > > >>> 2020-12-14T11:58:22.627Z|00021|dpdk|ERR|EAL: failed to parse
> > > >>> device ":82:00.0"
> > > >>> 2020-12-14T11:58:22.627Z|00022|dpdk|ERR|EAL: Unable to parse
> > > >>> device
> > > >>>
> > > >>
> > >
> > ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> > ep
> > > r
> > > ese
> > > >> ntor=[0-6]'
> > > >>> 2020-12-14T11:58:22.627Z|00023|dpdk|EMER|Unable to initialize
> > DPDK:
> > > No
> > > >>> such device
> > > >>>
> > > >>> Because  /bin/pkg-config --static --libs libdpdk
> > > >>> pkg_cv_DPDK_LIBS='-Wl,--whole-archive -Wl,--no-whole-archive
> > > >>> -Wl,--as-needed -pthread -L/root/local/dpdk-next-net/lib64
> > > >>> -l:librte_common_cpt.a -l:librte_common_dpaax.a
> > > >>> -l:librte_common_iavf.a -l:librte_common_octeontx.a
> > > >>> -l:librte_common_octeontx2.a -l:librte_common_sfc_efx.a
> > > >>> -l:librte_bus_dpaa.a -l:librt

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Pai G, Sunil
Hi,



> >  +   When DPDK is built using Meson, and OVS must consume DPDK
> >  + shared
> > >> libraries
> >  +   (also equivalent to leaving --with-dpdk option empty)::
> >  +
> >  +   $ ./configure --with-dpdk=shared
> > >>> Hi all
> > >>> when I build ovs with --with-dpdk=shared, Compilation is fine, but
> > >>> we I launch the ovs:
> > >>>
> > >>> 41 2020-12-14T10:42:22.964Z|00018|dpdk|INFO|EAL ARGS: ovs-
> vswitchd
> > >>> -
> > a
> > >>>
> > >>
> >
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> epr
> > e
> > sen
> > >> tor=[0-6]
> > >>> -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024
> > >>> --socket-limit 1024,1024.
> > >>> 42 2020-12-14T10:42:22.969Z|00019|dpdk|INFO|EAL: Detected 56
> > >>> lcore(s)
> > >>> 43 2020-12-14T10:42:22.969Z|00020|dpdk|INFO|EAL: Detected 2
> NUMA
> > nodes
> > >>> 44 2020-12-14T10:42:22.969Z|00021|dpdk|ERR|EAL: failed to parse
> > >>> device ":82:00.0"
> > >>> 45 2020-12-14T10:42:22.969Z|00022|dpdk|ERR|EAL: Unable to parse
> > device
> > >>>
> > >>
> >
> ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> ep
> > r
> > ese
> > >> ntor=[0-6]'
> > >>> 46 2020-12-14T10:42:22.969Z|00023|dpdk|EMER|Unable to initialize
> > DPDK:
> > >>> No such device
> > >>>
> > >>> In dpdk:
> > >>> eal_plugins_init
> > >>> rte_pci_scan
> > >>> rte_bus_register
> > >>> eal_option_device_parse -- no pci bus
> > >>>
> > >>> pkg-config is pkgconf-1.4.2
> >  +   When DPDK is built using Meson, and OVS must consume DPDK
> >  + static
> > >> libraries::
> >  +
> >  +   $ ./configure --with-dpdk=static
> > >>> Only one issue, if we use the pkgconfig-0.27 The ovs log:
> > >>> 2020-12-14T11:58:22.622Z|00018|dpdk|INFO|EAL ARGS: ovs-vswitchd
> -a
> > >>>
> > >>
> >
> :82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> epr
> > e
> > sen
> > >> tor=[0-6]
> > >>> -c 0xe --huge-dir /dev/hugepages --socket-mem 1024,1024
> > >>> --socket-limit 1024,1024.
> > >>> 2020-12-14T11:58:22.627Z|00019|dpdk|INFO|EAL: Detected 56 lcore(s)
> > >>> 2020-12-14T11:58:22.627Z|00020|dpdk|INFO|EAL: Detected 2 NUMA
> > nodes
> > >>> 2020-12-14T11:58:22.627Z|00021|dpdk|ERR|EAL: failed to parse
> > >>> device ":82:00.0"
> > >>> 2020-12-14T11:58:22.627Z|00022|dpdk|ERR|EAL: Unable to parse
> > >>> device
> > >>>
> > >>
> >
> ':82:00.0,dv_flow_en=1,dv_esw_en=1,l3_vxlan_en=1,dv_xmeta_en=2,r
> ep
> > r
> > ese
> > >> ntor=[0-6]'
> > >>> 2020-12-14T11:58:22.627Z|00023|dpdk|EMER|Unable to initialize
> DPDK:
> > No
> > >>> such device
> > >>>
> > >>> Because  /bin/pkg-config --static --libs libdpdk
> > >>> pkg_cv_DPDK_LIBS='-Wl,--whole-archive -Wl,--no-whole-archive
> > >>> -Wl,--as-needed -pthread -L/root/local/dpdk-next-net/lib64
> > >>> -l:librte_common_cpt.a -l:librte_common_dpaax.a
> > >>> -l:librte_common_iavf.a -l:librte_common_octeontx.a
> > >>> -l:librte_common_octeontx2.a -l:librte_common_sfc_efx.a
> > >>> -l:librte_bus_dpaa.a -l:librte_bus_fslmc.a -l:librte_bus_ifpga.a
> > >>> -l:librte_bus_pci.a -l:librte_bus_vdev.a -l:librte_bus_vmbus.a
> > >>> -l:librte_common_mlx5.a -l:librte_common_qat.a
> > >>> -l:librte_mempool_bucket.a -l:librte_mempool_dpaa.a
> > >>> -l:librte_mempool_dpaa2.a -l:librte_mempool_octeontx.a
> > >>> -l:librte_mempool_octeontx2.a -l:librte_mempool_ring.a
> > >>> -l:librte_mempool_stack.a -l:librte_net_af_packet.a
> > >>> -l:librte_net_ark.a -l:librte_net_atlantic.a -l:librte_net_avp.a
> > >>> -l:librte_net_axgbe.a -l:librte_net_bond.a -l:librte_net_bnxt.a
> > >>> -l:librte_net_cxgbe.a -l:librte_net_dpaa.a -l:librte_net_dpaa2.a
> > >>> -l:librte_net_e1000.a -l:librte_net_ena.a -l:librte_net_enetc.a
> > >>> -l:librte_net_enic.a -l:librte_net_failsafe.a
> > >>> -l:librte_net_fm10k.a -l:librte_net_i40e.a -l:librte_net_hinic.a
> > >>> -l:librte_net_hns3.a -l:librte_net_iavf.a -l:librte_net_ice.a
> > >>> -l:librte_net_igc.a -l:librte_net_ixgbe.a -l:librte_net_kni.a
> > >>> -l:librte_net_liquidio.a -l:librte_net_memif.a
> > >>> -l:librte_net_mlx5.a -l:librte_net_netvsc.a -l:librte_net_nfp.a
> > >>> -l:librte_net_null.a -l:librte_net_octeontx.a
> > >>> -l:librte_net_octeontx2.a -l:librte_net_pcap.a -l:librte_net_pfe.a
> > >>> -l:librte_net_qede.a -l:librte_net_ring.a -l:librte_net_sfc.a
> > >>> -l:librte_net_softnic.a -l:librte_net_thunderx.a
> > >>> -l:librte_net_txgbe.a -l:librte_net_vdev_netvsc.a
> > >>> -l:librte_net_vhost.a -l:librte_net_virtio.a
> > >>> -l:librte_net_vmxnet3.a -l:librte_raw_dpaa2_cmdif.a
> > >>> -l:librte_raw_dpaa2_qdma.a -l:librte_raw_ioat.a
> > >>> -l:librte_raw_ntb.a -l:librte_raw_octeontx2_dma.a
> > >>> -l:librte_raw_octeontx2_ep.a -l:librte_raw_skeleton.a
> > >>> -l:librte_compress_octeontx.a -l:librte_regex_mlx5.a
> > >>> -l:librte_regex_octeontx2.a -l:librte_vdpa_ifc.a
> > >>> -l:librte_vdpa_mlx5.a -l:librte_baseband_null.a
> > >>> -l:librte_baseband_turbo_sw.a -l:librte_baseband_fpga_lte_fec.a
> > >>> -l:librte_baseband_fpga_5gnr_fec.a
> > >>> 

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Stokes, Ian
> On 12/15/20 10:43 AM, Richardson, Bruce wrote:
> >
> >
> >> -Original Message-
> >> From: Ilya Maximets 
> >> Sent: Tuesday, December 15, 2020 9:33 AM
> >> To: Tonghao Zhang ; Pai G, Sunil
> >> 
> >> Cc: ovs dev ; Richardson, Bruce
> >> ; Ilya Maximets ; David
> >> Marchand ; Stokes, Ian
> 
> >> Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> >> meson build.
> >>
> >> On 12/15/20 5:02 AM, Tonghao Zhang wrote:
> >>> On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G 
> >> wrote:
> >>>>
> >>>> Make based build is deprecated in DPDK. Meson based
> >>>> build to be used for future DPDK releases.
> >>>>
> >>>> This updates travis, configure script and documentation
> >>>> for using DPDK Meson with OVS.
> >>>>
> >>>> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-
> >> copy/builds/723510063
> >>>> Signed-off-by: Sunil Pai G 
> >>>> ---
> >>>> v3->v4:
> >>>> - Fix checkpatch errors
> >>>>
> >>>> v2->v3:
> >>>> - Update Documentation for vhost-user
> >>>>
> >>>> v1->v2:
> >>>> - Update Documentation
> >>>> - Simplify the pkg-config parsing script
> >>>> - Rename and move the pkg-config parsing script to python dir
> >>>> - Update travis to:
> >>>>- install DPDK to cached dir
> >>>>- disable DPDK tests
> >>>>- removed fPIC flag for DPDK
> >>>>- removed cross compilation for aarch64
> >>>> ---
> >>>>  .travis.yml  |  3 ++
> >>>>  .travis/linux-build.sh   | 39 ++-
> >>>>  .travis/linux-prepare.sh |  1 +
> >>>>  Documentation/intro/install/afxdp.rst|  2 +-
> >>>>  Documentation/intro/install/dpdk.rst | 63 
> >>>>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
> >>>>  acinclude.m4 | 44 +++--
> >>>>  python/automake.mk   |  3 +-
> >>>>  python/build/pkgcfg.py   | 30 +++
> >>>>  9 files changed, 149 insertions(+), 54 deletions(-)
> >>>>  create mode 100644 python/build/pkgcfg.py
> >>>>
> >>>> diff --git a/.travis.yml b/.travis.yml
> >>>> index 3dd5d1d23..a8f9a4d79 100644
> >>>> --- a/.travis.yml
> >>>> +++ b/.travis.yml
> >>>> @@ -27,6 +27,9 @@ addons:
> >>>>- selinux-policy-dev
> >>>>- libunbound-dev
> >>>>- libunwind-dev
> >>>> +  - python3-setuptools
> >>>> +  - python3-wheel
> >>>> +  - ninja-build
> >>>>
> >>>>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
> >>>>
> >>>> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> >>>> index 817bf24aa..14ef833c9 100755
> >>>> --- a/.travis/linux-build.sh
> >>>> +++ b/.travis/linux-build.sh
> >>>> @@ -85,17 +85,29 @@ function install_dpdk()
> >>>>  {
> >>>>  local DPDK_VER=$1
> >>>>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> >>>> +local DPDK_OPTS=""
> >>>> +local DPDK_LIB=""
> >>>>
> >>>>  if [ -z "$TRAVIS_ARCH" ] ||
> >>>> [ "$TRAVIS_ARCH" == "amd64" ]; then
> >>>> -TARGET="x86_64-native-linuxapp-gcc"
> >>>> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
> >>>>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> >>>> -TARGET="arm64-armv8a-linuxapp-gcc"
> >>>> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
> >>>>  else
> >>>>  echo "Target is unknown"
> >>>>  exit 1
> >>>>  fi
> >>>>
> >>>> +if [ "$DPDK_SHARED" ]; then
> >>>> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
> >>>> +export LD_LIBRARY_PATH=$DPDK

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Ilya Maximets
On 12/15/20 10:43 AM, Richardson, Bruce wrote:
> 
> 
>> -Original Message-
>> From: Ilya Maximets 
>> Sent: Tuesday, December 15, 2020 9:33 AM
>> To: Tonghao Zhang ; Pai G, Sunil
>> 
>> Cc: ovs dev ; Richardson, Bruce
>> ; Ilya Maximets ; David
>> Marchand ; Stokes, Ian 
>> Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
>> meson build.
>>
>> On 12/15/20 5:02 AM, Tonghao Zhang wrote:
>>> On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G 
>> wrote:
>>>>
>>>> Make based build is deprecated in DPDK. Meson based
>>>> build to be used for future DPDK releases.
>>>>
>>>> This updates travis, configure script and documentation
>>>> for using DPDK Meson with OVS.
>>>>
>>>> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-
>> copy/builds/723510063
>>>> Signed-off-by: Sunil Pai G 
>>>> ---
>>>> v3->v4:
>>>> - Fix checkpatch errors
>>>>
>>>> v2->v3:
>>>> - Update Documentation for vhost-user
>>>>
>>>> v1->v2:
>>>> - Update Documentation
>>>> - Simplify the pkg-config parsing script
>>>> - Rename and move the pkg-config parsing script to python dir
>>>> - Update travis to:
>>>>- install DPDK to cached dir
>>>>- disable DPDK tests
>>>>- removed fPIC flag for DPDK
>>>>- removed cross compilation for aarch64
>>>> ---
>>>>  .travis.yml  |  3 ++
>>>>  .travis/linux-build.sh   | 39 ++-
>>>>  .travis/linux-prepare.sh |  1 +
>>>>  Documentation/intro/install/afxdp.rst|  2 +-
>>>>  Documentation/intro/install/dpdk.rst | 63 
>>>>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
>>>>  acinclude.m4 | 44 +++--
>>>>  python/automake.mk   |  3 +-
>>>>  python/build/pkgcfg.py   | 30 +++
>>>>  9 files changed, 149 insertions(+), 54 deletions(-)
>>>>  create mode 100644 python/build/pkgcfg.py
>>>>
>>>> diff --git a/.travis.yml b/.travis.yml
>>>> index 3dd5d1d23..a8f9a4d79 100644
>>>> --- a/.travis.yml
>>>> +++ b/.travis.yml
>>>> @@ -27,6 +27,9 @@ addons:
>>>>- selinux-policy-dev
>>>>- libunbound-dev
>>>>- libunwind-dev
>>>> +  - python3-setuptools
>>>> +  - python3-wheel
>>>> +  - ninja-build
>>>>
>>>>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
>>>>
>>>> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
>>>> index 817bf24aa..14ef833c9 100755
>>>> --- a/.travis/linux-build.sh
>>>> +++ b/.travis/linux-build.sh
>>>> @@ -85,17 +85,29 @@ function install_dpdk()
>>>>  {
>>>>  local DPDK_VER=$1
>>>>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
>>>> +local DPDK_OPTS=""
>>>> +local DPDK_LIB=""
>>>>
>>>>  if [ -z "$TRAVIS_ARCH" ] ||
>>>> [ "$TRAVIS_ARCH" == "amd64" ]; then
>>>> -TARGET="x86_64-native-linuxapp-gcc"
>>>> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
>>>>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
>>>> -TARGET="arm64-armv8a-linuxapp-gcc"
>>>> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
>>>>  else
>>>>  echo "Target is unknown"
>>>>  exit 1
>>>>  fi
>>>>
>>>> +if [ "$DPDK_SHARED" ]; then
>>>> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
>>>> +export LD_LIBRARY_PATH=$DPDK_LIB/:$LD_LIBRARY_PATH
>>>> +else
>>>> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
>>>> +fi
>>>> +
>>>> +# Export the following path for pkg-config to find the .pc file.
>>>> +export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
>>>> +
>>>>  if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
>>>> 

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Richardson, Bruce



> -Original Message-
> From: Ilya Maximets 
> Sent: Tuesday, December 15, 2020 9:33 AM
> To: Tonghao Zhang ; Pai G, Sunil
> 
> Cc: ovs dev ; Richardson, Bruce
> ; Ilya Maximets ; David
> Marchand ; Stokes, Ian 
> Subject: Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK
> meson build.
> 
> On 12/15/20 5:02 AM, Tonghao Zhang wrote:
> > On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G 
> wrote:
> >>
> >> Make based build is deprecated in DPDK. Meson based
> >> build to be used for future DPDK releases.
> >>
> >> This updates travis, configure script and documentation
> >> for using DPDK Meson with OVS.
> >>
> >> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-
> copy/builds/723510063
> >> Signed-off-by: Sunil Pai G 
> >> ---
> >> v3->v4:
> >> - Fix checkpatch errors
> >>
> >> v2->v3:
> >> - Update Documentation for vhost-user
> >>
> >> v1->v2:
> >> - Update Documentation
> >> - Simplify the pkg-config parsing script
> >> - Rename and move the pkg-config parsing script to python dir
> >> - Update travis to:
> >>- install DPDK to cached dir
> >>- disable DPDK tests
> >>- removed fPIC flag for DPDK
> >>- removed cross compilation for aarch64
> >> ---
> >>  .travis.yml  |  3 ++
> >>  .travis/linux-build.sh   | 39 ++-
> >>  .travis/linux-prepare.sh |  1 +
> >>  Documentation/intro/install/afxdp.rst|  2 +-
> >>  Documentation/intro/install/dpdk.rst | 63 
> >>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
> >>  acinclude.m4 | 44 +++--
> >>  python/automake.mk   |  3 +-
> >>  python/build/pkgcfg.py   | 30 +++
> >>  9 files changed, 149 insertions(+), 54 deletions(-)
> >>  create mode 100644 python/build/pkgcfg.py
> >>
> >> diff --git a/.travis.yml b/.travis.yml
> >> index 3dd5d1d23..a8f9a4d79 100644
> >> --- a/.travis.yml
> >> +++ b/.travis.yml
> >> @@ -27,6 +27,9 @@ addons:
> >>- selinux-policy-dev
> >>- libunbound-dev
> >>- libunwind-dev
> >> +  - python3-setuptools
> >> +  - python3-wheel
> >> +  - ninja-build
> >>
> >>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
> >>
> >> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> >> index 817bf24aa..14ef833c9 100755
> >> --- a/.travis/linux-build.sh
> >> +++ b/.travis/linux-build.sh
> >> @@ -85,17 +85,29 @@ function install_dpdk()
> >>  {
> >>  local DPDK_VER=$1
> >>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> >> +local DPDK_OPTS=""
> >> +local DPDK_LIB=""
> >>
> >>  if [ -z "$TRAVIS_ARCH" ] ||
> >> [ "$TRAVIS_ARCH" == "amd64" ]; then
> >> -TARGET="x86_64-native-linuxapp-gcc"
> >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
> >>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> >> -TARGET="arm64-armv8a-linuxapp-gcc"
> >> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
> >>  else
> >>  echo "Target is unknown"
> >>  exit 1
> >>  fi
> >>
> >> +if [ "$DPDK_SHARED" ]; then
> >> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
> >> +export LD_LIBRARY_PATH=$DPDK_LIB/:$LD_LIBRARY_PATH
> >> +else
> >> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
> >> +fi
> >> +
> >> +# Export the following path for pkg-config to find the .pc file.
> >> +export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
> >> +
> >>  if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
> >>  # Avoid using cache for git tree build.
> >>  rm -rf dpdk-dir
> >> @@ -108,7 +120,8 @@ function install_dpdk()
> >>  if [ -f "${VERSION_FILE}" ]; then
> >>  VER=$(cat ${VERSION_FILE})
> >>  if [ "${VER}" = "${DPDK_VER}" ]; then
> >> -  

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-15 Thread Ilya Maximets
On 12/15/20 5:02 AM, Tonghao Zhang wrote:
> On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G  wrote:
>>
>> Make based build is deprecated in DPDK. Meson based
>> build to be used for future DPDK releases.
>>
>> This updates travis, configure script and documentation
>> for using DPDK Meson with OVS.
>>
>> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/723510063
>> Signed-off-by: Sunil Pai G 
>> ---
>> v3->v4:
>> - Fix checkpatch errors
>>
>> v2->v3:
>> - Update Documentation for vhost-user
>>
>> v1->v2:
>> - Update Documentation
>> - Simplify the pkg-config parsing script
>> - Rename and move the pkg-config parsing script to python dir
>> - Update travis to:
>>- install DPDK to cached dir
>>- disable DPDK tests
>>- removed fPIC flag for DPDK
>>- removed cross compilation for aarch64
>> ---
>>  .travis.yml  |  3 ++
>>  .travis/linux-build.sh   | 39 ++-
>>  .travis/linux-prepare.sh |  1 +
>>  Documentation/intro/install/afxdp.rst|  2 +-
>>  Documentation/intro/install/dpdk.rst | 63 
>>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
>>  acinclude.m4 | 44 +++--
>>  python/automake.mk   |  3 +-
>>  python/build/pkgcfg.py   | 30 +++
>>  9 files changed, 149 insertions(+), 54 deletions(-)
>>  create mode 100644 python/build/pkgcfg.py
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index 3dd5d1d23..a8f9a4d79 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -27,6 +27,9 @@ addons:
>>- selinux-policy-dev
>>- libunbound-dev
>>- libunwind-dev
>> +  - python3-setuptools
>> +  - python3-wheel
>> +  - ninja-build
>>
>>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
>>
>> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
>> index 817bf24aa..14ef833c9 100755
>> --- a/.travis/linux-build.sh
>> +++ b/.travis/linux-build.sh
>> @@ -85,17 +85,29 @@ function install_dpdk()
>>  {
>>  local DPDK_VER=$1
>>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
>> +local DPDK_OPTS=""
>> +local DPDK_LIB=""
>>
>>  if [ -z "$TRAVIS_ARCH" ] ||
>> [ "$TRAVIS_ARCH" == "amd64" ]; then
>> -TARGET="x86_64-native-linuxapp-gcc"
>> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
>>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
>> -TARGET="arm64-armv8a-linuxapp-gcc"
>> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
>>  else
>>  echo "Target is unknown"
>>  exit 1
>>  fi
>>
>> +if [ "$DPDK_SHARED" ]; then
>> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
>> +export LD_LIBRARY_PATH=$DPDK_LIB/:$LD_LIBRARY_PATH
>> +else
>> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
>> +fi
>> +
>> +# Export the following path for pkg-config to find the .pc file.
>> +export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
>> +
>>  if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
>>  # Avoid using cache for git tree build.
>>  rm -rf dpdk-dir
>> @@ -108,7 +120,8 @@ function install_dpdk()
>>  if [ -f "${VERSION_FILE}" ]; then
>>  VER=$(cat ${VERSION_FILE})
>>  if [ "${VER}" = "${DPDK_VER}" ]; then
>> -EXTRA_OPTS="${EXTRA_OPTS} --with-dpdk=$(pwd)/dpdk-dir/build"
>> +# Update the library paths.
>> +sudo ldconfig
>>  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
>>  return
>>  fi
>> @@ -122,16 +135,20 @@ function install_dpdk()
>>  pushd dpdk-dir
>>  fi
>>
>> -make config CC=gcc T=$TARGET
>> +# Disable building DPDK unit tests. Not needed for OVS build or tests.
>> +DPDK_OPTS="$DPDK_OPTS -Dtests=false"
>>
>> -if [ "$DPDK_SHARED" ]; then
>> -sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' build/.config
>> -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
>> -fi
>> +# Install DPDK using prefix.
>> +DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
>> +
>> +CC=gcc meson $DPDK_OPTS build
>> +ninja -C build
>> +sudo ninja -C build install
>> +
>> +# Update the library paths.
>> +sudo ldconfig
>>
>> -make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
>> -EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
>> -echo "Installed DPDK source in $(pwd)"
>> +echo "Installed DPDK source"
>>  popd
>>  echo "${DPDK_VER}" > ${VERSION_FILE}
>>  }
>> diff --git a/.travis/linux-prepare.sh b/.travis/linux-prepare.sh
>> index 71eb347e8..1baa11641 100755
>> --- a/.travis/linux-prepare.sh
>> +++ b/.travis/linux-prepare.sh
>> @@ -22,6 +22,7 @@ cd ..
>>
>>  pip3 install --disable-pip-version-check --user flake8 hacking
>>  pip3 install --user --upgrade docutils
>> +pip3 install --user  'meson==0.47.1'
>>
>>  if [ "$M32" ]; 

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-12-14 Thread Tonghao Zhang
On Thu, Sep 3, 2020 at 2:06 AM Sunil Pai G  wrote:
>
> Make based build is deprecated in DPDK. Meson based
> build to be used for future DPDK releases.
>
> This updates travis, configure script and documentation
> for using DPDK Meson with OVS.
>
> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/723510063
> Signed-off-by: Sunil Pai G 
> ---
> v3->v4:
> - Fix checkpatch errors
>
> v2->v3:
> - Update Documentation for vhost-user
>
> v1->v2:
> - Update Documentation
> - Simplify the pkg-config parsing script
> - Rename and move the pkg-config parsing script to python dir
> - Update travis to:
>- install DPDK to cached dir
>- disable DPDK tests
>- removed fPIC flag for DPDK
>- removed cross compilation for aarch64
> ---
>  .travis.yml  |  3 ++
>  .travis/linux-build.sh   | 39 ++-
>  .travis/linux-prepare.sh |  1 +
>  Documentation/intro/install/afxdp.rst|  2 +-
>  Documentation/intro/install/dpdk.rst | 63 
>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
>  acinclude.m4 | 44 +++--
>  python/automake.mk   |  3 +-
>  python/build/pkgcfg.py   | 30 +++
>  9 files changed, 149 insertions(+), 54 deletions(-)
>  create mode 100644 python/build/pkgcfg.py
>
> diff --git a/.travis.yml b/.travis.yml
> index 3dd5d1d23..a8f9a4d79 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -27,6 +27,9 @@ addons:
>- selinux-policy-dev
>- libunbound-dev
>- libunwind-dev
> +  - python3-setuptools
> +  - python3-wheel
> +  - ninja-build
>
>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
>
> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> index 817bf24aa..14ef833c9 100755
> --- a/.travis/linux-build.sh
> +++ b/.travis/linux-build.sh
> @@ -85,17 +85,29 @@ function install_dpdk()
>  {
>  local DPDK_VER=$1
>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> +local DPDK_OPTS=""
> +local DPDK_LIB=""
>
>  if [ -z "$TRAVIS_ARCH" ] ||
> [ "$TRAVIS_ARCH" == "amd64" ]; then
> -TARGET="x86_64-native-linuxapp-gcc"
> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> -TARGET="arm64-armv8a-linuxapp-gcc"
> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
>  else
>  echo "Target is unknown"
>  exit 1
>  fi
>
> +if [ "$DPDK_SHARED" ]; then
> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
> +export LD_LIBRARY_PATH=$DPDK_LIB/:$LD_LIBRARY_PATH
> +else
> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
> +fi
> +
> +# Export the following path for pkg-config to find the .pc file.
> +export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
> +
>  if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
>  # Avoid using cache for git tree build.
>  rm -rf dpdk-dir
> @@ -108,7 +120,8 @@ function install_dpdk()
>  if [ -f "${VERSION_FILE}" ]; then
>  VER=$(cat ${VERSION_FILE})
>  if [ "${VER}" = "${DPDK_VER}" ]; then
> -EXTRA_OPTS="${EXTRA_OPTS} --with-dpdk=$(pwd)/dpdk-dir/build"
> +# Update the library paths.
> +sudo ldconfig
>  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
>  return
>  fi
> @@ -122,16 +135,20 @@ function install_dpdk()
>  pushd dpdk-dir
>  fi
>
> -make config CC=gcc T=$TARGET
> +# Disable building DPDK unit tests. Not needed for OVS build or tests.
> +DPDK_OPTS="$DPDK_OPTS -Dtests=false"
>
> -if [ "$DPDK_SHARED" ]; then
> -sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' build/.config
> -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
> -fi
> +# Install DPDK using prefix.
> +DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
> +
> +CC=gcc meson $DPDK_OPTS build
> +ninja -C build
> +sudo ninja -C build install
> +
> +# Update the library paths.
> +sudo ldconfig
>
> -make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
> -EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
> -echo "Installed DPDK source in $(pwd)"
> +echo "Installed DPDK source"
>  popd
>  echo "${DPDK_VER}" > ${VERSION_FILE}
>  }
> diff --git a/.travis/linux-prepare.sh b/.travis/linux-prepare.sh
> index 71eb347e8..1baa11641 100755
> --- a/.travis/linux-prepare.sh
> +++ b/.travis/linux-prepare.sh
> @@ -22,6 +22,7 @@ cd ..
>
>  pip3 install --disable-pip-version-check --user flake8 hacking
>  pip3 install --user --upgrade docutils
> +pip3 install --user  'meson==0.47.1'
>
>  if [ "$M32" ]; then
>  # Installing 32-bit libraries.
> diff --git a/Documentation/intro/install/afxdp.rst 
> b/Documentation/intro/install/afxdp.rst
> index 3c8f78825..327f2b3df 100644
> --- 

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-11-09 Thread Pai G, Sunil
Hi Ilya , 

Thank you for the comments , please see response inline.

> -Original Message-
> From: Ilya Maximets 
> Sent: Tuesday, November 10, 2020 2:27 AM
> To: Pai G, Sunil ; d...@openvswitch.org
> Cc: Stokes, Ian ; i.maxim...@ovn.org;
> david.march...@redhat.com; Richardson, Bruce
> ; christian.ehrha...@canonical.com;
> i.maxim...@ovn.org; Kevin Traynor 
> Subject: Re: [PATCH dpdk-latest v4] build: Add support for DPDK meson
> build.
> 
> On 9/2/20 8:06 PM, Sunil Pai G wrote:
> > Make based build is deprecated in DPDK. Meson based build to be used
> > for future DPDK releases.
> >
> > This updates travis, configure script and documentation for using DPDK
> > Meson with OVS.
> >
> > Tested-at:
> > https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/723510063
> > Signed-off-by: Sunil Pai G 
> > ---
> 
> Sorry for delay.  Following up with things that I think should be fixed before
> this patch merged to master.

Not a problem :)

> 
> > v3->v4:
> > - Fix checkpatch errors
> >
> > v2->v3:
> > - Update Documentation for vhost-user
> >
> > v1->v2:
> > - Update Documentation
> > - Simplify the pkg-config parsing script
> > - Rename and move the pkg-config parsing script to python dir
> > - Update travis to:
> >- install DPDK to cached dir
> >- disable DPDK tests
> >- removed fPIC flag for DPDK
> >- removed cross compilation for aarch64
> > ---
> >  .travis.yml  |  3 ++
> >  .travis/linux-build.sh   | 39 ++-
> >  .travis/linux-prepare.sh |  1 +
> >  Documentation/intro/install/afxdp.rst|  2 +-
> >  Documentation/intro/install/dpdk.rst | 63 
> >  Documentation/topics/dpdk/vhost-user.rst | 18 +--
> >  acinclude.m4 | 44 +++--
> >  python/automake.mk   |  3 +-
> >  python/build/pkgcfg.py   | 30 +++
> >  9 files changed, 149 insertions(+), 54 deletions(-)  create mode
> > 100644 python/build/pkgcfg.py
> >
> > diff --git a/.travis.yml b/.travis.yml index 3dd5d1d23..a8f9a4d79
> > 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -27,6 +27,9 @@ addons:
> >- selinux-policy-dev
> >- libunbound-dev
> >- libunwind-dev
> > +  - python3-setuptools
> > +  - python3-wheel
> > +  - ninja-build
> >
> >


> > +CC=gcc meson $DPDK_OPTS build
> > +ninja -C build
> > +sudo ninja -C build install
> 
> Why we need 'sudo' here?  We're installing to a local folder, should work
> without 'sudo', IIUC.

Sure , Will try removing the sudo.

> 
> > +
> > +# Update the library paths.
> > +sudo ldconfig
> >
> > -make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
> > -EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
> > -echo "Installed DPDK source in $(pwd)"
> > +echo "Installed DPDK source"
> 
> It's probably better to keep this line as is.

Sure.

> 
> >  popd
> >  echo "${DPDK_VER}" > ${VERSION_FILE}  } diff --git
> > a/.travis/linux-prepare.sh b/.travis/linux-prepare.sh index
> > 71eb347e8..1baa11641 100755
> > --- a/.travis/linux-prepare.sh
> > +++ b/.travis/linux-prepare.sh
> > @@ -22,6 +22,7 @@ cd ..
> >
> >  pip3 install --disable-pip-version-check --user flake8 hacking
> >  pip3 install --user --upgrade docutils
> > +pip3 install --user  'meson==0.47.1'
> >
> >  if [ "$M32" ]; then
> >  # Installing 32-bit libraries.
> > diff --git a/Documentation/intro/install/afxdp.rst
> > b/Documentation/intro/install/afxdp.rst
> > index 3c8f78825..327f2b3df 100644
> > --- a/Documentation/intro/install/afxdp.rst
> > +++ b/Documentation/intro/install/afxdp.rst
> > @@ -396,7 +396,7 @@ PVP using vhostuser device
> >  --
> >  First, build OVS with DPDK and AFXDP::
> >
> > -  ./configure  --enable-afxdp --with-dpdk=
> > +  ./configure  --enable-afxdp --with-dpdk=shared|static|
> 
> There should be no '' option.  See below.
Sure .

> 
> >make -j4 && make install
> >
> >  Create a vhost-user port from OVS::
> > diff --git a/Documentation/intro/install/dpdk.rst
> > b/Documentation/intro/install/dpdk.rst
> > index 39544f835..cd7e51c75 100644
> > --- a/Documentation/intro/install/dpdk.rst
> > +++ b/Documentation/intro/install/dpdk.rst
> > @@ -62,6 +62,8 @@ Detailed system requirements can be found at `DPDK
> requirements`_.
> >  .. _DPDK supported NIC: http://dpdk.org/doc/nics  .. _DPDK
> > requirements: http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html
> >
> > +.. _dpdk-install:
> > +
> >  Installing
> >  --
> >
> > @@ -76,10 +78,31 @@ Install DPDK
> > $ export DPDK_DIR=/usr/src/dpdk-stable-19.11.2
> > $ cd $DPDK_DIR
> >
> > +#. Configure and install DPDK using Meson
> > +
> > +   Meson is the preferred tool to build recent DPDK releases
> > +   as Make support is deprecated and will be removed from DPDK 20.11.
> > +   OVS supports DPDK Meson builds from DPDK 19.11 onwards.
> 
> Do we support meson builds 

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-11-09 Thread Ilya Maximets
On 9/2/20 8:06 PM, Sunil Pai G wrote:
> Make based build is deprecated in DPDK. Meson based
> build to be used for future DPDK releases.
> 
> This updates travis, configure script and documentation
> for using DPDK Meson with OVS.
> 
> Tested-at: https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/723510063
> Signed-off-by: Sunil Pai G 
> ---

Sorry for delay.  Following up with things that I think should be fixed
before this patch merged to master.

> v3->v4:
> - Fix checkpatch errors
> 
> v2->v3:
> - Update Documentation for vhost-user
> 
> v1->v2:
> - Update Documentation
> - Simplify the pkg-config parsing script
> - Rename and move the pkg-config parsing script to python dir
> - Update travis to:
>- install DPDK to cached dir
>- disable DPDK tests
>- removed fPIC flag for DPDK
>- removed cross compilation for aarch64
> ---
>  .travis.yml  |  3 ++
>  .travis/linux-build.sh   | 39 ++-
>  .travis/linux-prepare.sh |  1 +
>  Documentation/intro/install/afxdp.rst|  2 +-
>  Documentation/intro/install/dpdk.rst | 63 
>  Documentation/topics/dpdk/vhost-user.rst | 18 +--
>  acinclude.m4 | 44 +++--
>  python/automake.mk   |  3 +-
>  python/build/pkgcfg.py   | 30 +++
>  9 files changed, 149 insertions(+), 54 deletions(-)
>  create mode 100644 python/build/pkgcfg.py
> 
> diff --git a/.travis.yml b/.travis.yml
> index 3dd5d1d23..a8f9a4d79 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -27,6 +27,9 @@ addons:
>- selinux-policy-dev
>- libunbound-dev
>- libunwind-dev
> +  - python3-setuptools
> +  - python3-wheel
> +  - ninja-build
>  
>  before_install: ./.travis/${TRAVIS_OS_NAME}-prepare.sh
>  
> diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
> index 817bf24aa..14ef833c9 100755
> --- a/.travis/linux-build.sh
> +++ b/.travis/linux-build.sh
> @@ -85,17 +85,29 @@ function install_dpdk()
>  {
>  local DPDK_VER=$1
>  local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
> +local DPDK_OPTS=""
> +local DPDK_LIB=""
>  
>  if [ -z "$TRAVIS_ARCH" ] ||
> [ "$TRAVIS_ARCH" == "amd64" ]; then
> -TARGET="x86_64-native-linuxapp-gcc"
> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
>  elif [ "$TRAVIS_ARCH" == "aarch64" ]; then
> -TARGET="arm64-armv8a-linuxapp-gcc"
> +DPDK_LIB=$(pwd)/dpdk-dir/build/lib/aarch64-linux-gnu
>  else
>  echo "Target is unknown"
>  exit 1
>  fi
>  
> +if [ "$DPDK_SHARED" ]; then
> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=shared"
> +export LD_LIBRARY_PATH=$DPDK_LIB/:$LD_LIBRARY_PATH
> +else
> +EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=static"
> +fi
> +
> +# Export the following path for pkg-config to find the .pc file.
> +export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
> +
>  if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
>  # Avoid using cache for git tree build.
>  rm -rf dpdk-dir
> @@ -108,7 +120,8 @@ function install_dpdk()
>  if [ -f "${VERSION_FILE}" ]; then
>  VER=$(cat ${VERSION_FILE})
>  if [ "${VER}" = "${DPDK_VER}" ]; then
> -EXTRA_OPTS="${EXTRA_OPTS} --with-dpdk=$(pwd)/dpdk-dir/build"
> +# Update the library paths.
> +sudo ldconfig
>  echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
>  return
>  fi
> @@ -122,16 +135,20 @@ function install_dpdk()
>  pushd dpdk-dir
>  fi
>  
> -make config CC=gcc T=$TARGET
> +# Disable building DPDK unit tests. Not needed for OVS build or tests.
> +DPDK_OPTS="$DPDK_OPTS -Dtests=false"
>  
> -if [ "$DPDK_SHARED" ]; then
> -sed -i '/CONFIG_RTE_BUILD_SHARED_LIB=n/s/=n/=y/' build/.config
> -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$TARGET/lib
> -fi
> +# Install DPDK using prefix.
> +DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
> +
> +CC=gcc meson $DPDK_OPTS build
> +ninja -C build
> +sudo ninja -C build install

Why we need 'sudo' here?  We're installing to a local folder, should work
without 'sudo', IIUC.

> +
> +# Update the library paths.
> +sudo ldconfig
>  
> -make -j4 CC=gcc EXTRA_CFLAGS='-fPIC'
> -EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build"
> -echo "Installed DPDK source in $(pwd)"
> +echo "Installed DPDK source"

It's probably better to keep this line as is.

>  popd
>  echo "${DPDK_VER}" > ${VERSION_FILE}
>  }
> diff --git a/.travis/linux-prepare.sh b/.travis/linux-prepare.sh
> index 71eb347e8..1baa11641 100755
> --- a/.travis/linux-prepare.sh
> +++ b/.travis/linux-prepare.sh
> @@ -22,6 +22,7 @@ cd ..
>  
>  pip3 install --disable-pip-version-check --user flake8 hacking
>  pip3 install --user 

Re: [ovs-dev] [PATCH dpdk-latest v4] build: Add support for DPDK meson build.

2020-09-11 Thread Pai G, Sunil
> -Original Message-
> From: Ilya Maximets 
> Sent: Friday, September 11, 2020 8:14 PM
> To: Stokes, Ian ; Pai G, Sunil ;
> d...@openvswitch.org
> Cc: i.maxim...@ovn.org; david.march...@redhat.com; Richardson, Bruce
> ; christian.ehrha...@canonical.com;
> i.maxim...@ovn.org
> Subject: Re: [PATCH dpdk-latest v4] build: Add support for DPDK meson
> build.
> 
> On 9/11/20 4:33 PM, Stokes, Ian wrote:
> >> Make based build is deprecated in DPDK. Meson based build to be used
> >> for future DPDK releases.
> >>
> >> This updates travis, configure script and documentation for using
> >> DPDK Meson with OVS.
> >>
> >> Tested-at:
> >> https://travis-ci.org/github/Sunil-Pai-G/ovs-copy/builds/723510063
> >> Signed-off-by: Sunil Pai G 
> >
> > Thanks Sunil, I've applied this to dpdk-latest. With the deadlines for v1 
> > for
> DPDK 20.11 being today I think it's prudent to get the dpdk-latest build
> running again.
> 
> Thanks, Ian.
> 
> I think it's good to have dpdk-latest wokring again.
> 
> However, this patch will need some changes that will need to be done
> before moving this to master branch.  Could be done as follow up change
> with squashing before pushing to master.
> 
> Main point is that, IIUC, this patch changes default build configuration from
> static linking to dynamic which it should not.
> 

Hi Ilya , 
Before this change , when using DPDK meson build with OVS , I saw that DPDK 
shared libraries are used by default
even when asked for static because of the --whole-archive and 
--no-whole-archive flags getting jumbled by the libtool.
I wasn’t sure if I had to change this behavior, hence retained it. :)

I will send out another patch addressing this along with the other comments on 
this patch when they are available.

> And the documentation for --with-dpdk configuration knob is confusing, i.e.
> it's not aligned with the actual code, If I'm not mistaken.
> 

I would be happy to make it as simple as possible. Suggestions are welcome :)

> There are few other minor comments too.  I'll write them down once I'll find
> some time.  Just wanted to highlight big behavioral change for now.

Sure , will wait on your feedback.



Thanks and regards
Sunil
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev