diff options
author | Vincent Hsu <vincent.hsu@linaro.org> | 2014-07-21 11:52:01 +0530 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-07-23 15:15:25 +0400 |
commit | 7cc718acd1fefaf3375fd7bbfad3dade0ca9e2dc (patch) | |
tree | 083dae11a6828a494325c0c0cce0b697ad63825b /platform/linux-dpdk/README | |
parent | f9c3c07126c2d91e671464450cceb9c389a13cc9 (diff) |
Initial ODP-DPDK port
- Pulled necessary files from platform/linux-generic into
platform/linux-dpdk
- Made necessary changes in files to get it compiled with dpdk library
for eg.,
* odp_buffer_hdr_t is mapped to struct rte_mbuf
* All odp_buffer_* maps to rte_* in dpdk
* necessary initialisations like odp_init_dpdk
* All packet related changes in odp_packet.c and odp_packet_io.c
* dpdk support in odp_packet_dpdk.c
Signed-off-by: Vincent Hsu <vincent.hsu@linaro.org>
- Add/modify files to support linux-dpdk compilation in new automake
environment.
* Modified configure.ac
* Added platform/linux-dpdk/Makefile.am
* Moved all files from platform/linux-dpdk/source to
platform/linux-dpdk/.
- Added platform/linux-dpdk/README on how to clone, compile DPDK and
commands to execute on ODP.
- Made ODP_BUFFER_<TYPES> consistent with linux-generic.
- Removed odp_buffer_is_scatter API to be inline with linux-generic.
- Added platform/linux-dpdk/odp_linux.c to supply the function
and argument to the pthread created by dpdk.
Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
Diffstat (limited to 'platform/linux-dpdk/README')
-rw-r--r-- | platform/linux-dpdk/README | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/platform/linux-dpdk/README b/platform/linux-dpdk/README new file mode 100644 index 000000000..04a49d90e --- /dev/null +++ b/platform/linux-dpdk/README @@ -0,0 +1,125 @@ +ODP-DPDK: +--------- + This effort is to port ODP on top of DPDK and use dpdk as the +accelerator for all intel NIC's. Pre-requisite is DPDK should be cloned and +compiled. DPDK and ODP was compiled and tested on Ubuntu 14.04 +3.13.0-29-generic kernel. + +# To Clone DPDK +$ git clone http://92.243.14.124/git/dpdk ./<dpdk-dir> + +# we support only 1.6.0r2 of dpdk for now +$ git tag -l -- will list all the tags available +$ git checkout -b 1.6.0 tags/v1.6.0r2 +# Please refer dpdk.org website for more details on how to build dpdk. +# Best effort is done to provide some help on dpdk cmds below for Ubuntu, +# where it was compiled and tested. +# Please refer "How to setup and compile DPDK" section in this document + +# To compile ODP with linux-dpdk +$ cd <odp-dir> +$ sudo ./bootstrap +$ sudo ./configure --with-platform=linux-dpdk LDFLAGS=-L<dpdk-build-dir>/lib CFLAGS="-include <dpdk-build-dir>/include/rte_config.h -I<dpdk-build-dir>/include -I<dpdk-build-dir>/include/arch -I<dpdk-build-dir>/include/exec-env" +# For example +$ sudo ./configure --with-platform=linux-dpdk LDFLAGS=-L/root/dpdk/build/lib CFLAGS="-include /root/dpdk/build/include/rte_config.h -I/root/dpdk/build/include -I/root/dpdk/build/include/arch -I/root/dpdk/build/include/exec-env" +$ sudo make clean +$ sudo make + +# Commands to test +l2fwding app - sudo ./test/l2fwd/odp_l2fwd -i 0,1 -m 0 -c 2 +loopback app - sudo ./test/packet/odp_pktio -i 0,1 -m 0 -c 2 + + -i 0,1 - interface number + -m 0 - burst mode + -c 2 - number of cpus + +How to setup and compile DPDK: +============================== +$ cd <dpdk-dir> + +# This has to be done only once. +# Following command will generate build dir as ./build in <dpdk-dir> +$ make config T=x86_64-default-linuxapp-gcc + +# If user wants to override and give a different name for build dir, +# then that can be done using the following command +$ make config T=x86_64-default-linuxapp-gcc O=my_sdk_build_dir + +$ vi <dpdk-build-dir>/.config and set CONFIG_RTE_BUILD_COMBINE_LIBS=y + +Note: If non-intel SFP's are used in NIC, then +$ vi <dpdk-build-dir>/.config and +set CONFIG_RTE_LIBRTE_IXGBE_ALLOW_UNSUPPORTED_SFP=y + +$ cd <dpdk-build-dir> +$ make clean; make + +# If "conflicting types for skb_set_hash" error happens during dpdk +# build, then please knock-off skb_set_hash function from kcompat.h as +# shown below. This was seen in Ubuntu 3.13.0-30-generic. +diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +index 19df483..78a794a 100644 +--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h ++++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h +@@ -3845,11 +3845,6 @@ static inline struct sk_buff *__kc__vlan_hwaccel_put_tag(struct sk_buff *skb, + #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) ) + #ifdef NETIF_F_RXHASH + #define PKT_HASH_TYPE_L3 0 +-static inline void +-skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type) +-{ +- skb->rxhash = hash; +-} + #endif /* NETIF_F_RXHASH */ + #endif /* < 3.14.0 */ +# this only ensures building dpdk, but traffic is not tested with this +# build yet. It is upto the user to test it. + +# To reserve huge pages, which is needed for dpdk, execute following command +$ sudo sh -c 'echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages' +# If you are running on a multi-node machine then, hugepages should be reserved on each node +$ ls /sys/devices/system/node +$ sudo sh -c 'echo 1024 > /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages' + +$ sudo mkdir /mnt/huge +$ sudo mount -t hugetlbfs nodev /mnt/huge +# To load uio driver +$ sudo /sbin/modprobe uio +$ ulimit -Sn 2048 + +$ cd <dpdk-dir> +$ sudo insmod ./build/build/lib/librte_eal/linuxapp/igb_uio/igb_uio.ko + +$ sudo rmmod ixgbe +$ sudo modprobe ixgbe +# If the SFP's used are non-intel, then +$ sudo modprobe ixgbe allow_unsupported_sfp=1 + +$ cd <dpdk-dir> +$ ./tools/igb_uio_bind.py --status +# this command produces output that is something similar as given below + +Network devices using IGB_UIO driver +==================================== +0000:05:00.0 'Ethernet 10G 2P X520 Adapter' drv=igb_uio unused= +0000:05:00.1 'Ethernet 10G 2P X520 Adapter' drv=igb_uio unused= + +Network devices using kernel driver +=================================== +0000:01:00.0 'NetXtreme II BCM5709 Gigabit Ethernet' if=eth0 drv=bnx2 unused=<none> *Active* +0000:01:00.1 'NetXtreme II BCM5709 Gigabit Ethernet' if=eth1 drv=bnx2 unused=<none> +0000:07:00.0 'T320 10GbE Dual Port Adapter' if=eth2,eth3 drv=cxgb3 unused=<none> + +Other network devices +===================== +<none> + +# Now you should look for pci id listed and give it in the following command +# in place of 05:00.X + +# To give the interfaces to dpdk, use following command +$ sudo ./tools/igb_uio_bind.py --bind=igb_uio 05:00.0 +$ sudo ./tools/igb_uio_bind.py --bind=igb_uio 05:00.1 +# To restore it back to kernel, use following command +$ sudo ./tools/igb_uio_bind.py --bind=ixgbe 05:00.0 +$ sudo ./tools/igb_uio_bind.py --bind=ixgbe 05:00.1 |